aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann2001-01-02 14:15:22 +0000
committerGerd Moellmann2001-01-02 14:15:22 +0000
commit0fddb84c10812e3864f1978fd023362f744e666c (patch)
tree6ab6ba4c2b966b9ea5593a11aa4dbe1bca77a0b6
parent9b207e8ed2426e4972794e82e9a61aa77401846d (diff)
downloademacs-0fddb84c10812e3864f1978fd023362f744e666c.tar.gz
emacs-0fddb84c10812e3864f1978fd023362f744e666c.zip
(comint-input-history-ignore): New variable.
(comint-read-input-ring): Ignore entries matching comint-input-history-ignore.
-rw-r--r--lisp/comint.el16
1 files changed, 11 insertions, 5 deletions
diff --git a/lisp/comint.el b/lisp/comint.el
index 4e6d852fe94..dbe75edbf63 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -1,6 +1,6 @@
1;;; comint.el --- general command interpreter in a window stuff 1;;; comint.el --- general command interpreter in a window stuff
2 2
3;; Copyright (C) 1988, 90, 92, 93, 94, 95, 96, 97, 98, 99, 2000 3;; Copyright (C) 1988, 90, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
5 5
6;; Author: Olin Shivers <shivers@cs.cmu.edu> then 6;; Author: Olin Shivers <shivers@cs.cmu.edu> then
@@ -297,6 +297,9 @@ the function `comint-truncate-buffer' is on `comint-output-filter-functions'."
297(defvar comint-input-ring-separator "\n" 297(defvar comint-input-ring-separator "\n"
298 "Separator between commands in the history file.") 298 "Separator between commands in the history file.")
299 299
300(defvar comint-input-history-ignore "^#"
301 "Regexp for history entries that should be ignored when comint initializes.")
302
300(defcustom comint-process-echoes nil 303(defcustom comint-process-echoes nil
301 "*If non-nil, assume that the subprocess echoes any input. 304 "*If non-nil, assume that the subprocess echoes any input.
302If so, delete one copy of the input so that only one copy eventually 305If so, delete one copy of the input so that only one copy eventually
@@ -832,7 +835,9 @@ failure to read the history file.
832This function is useful for major mode commands and mode hooks. 835This function is useful for major mode commands and mode hooks.
833 836
834The commands stored in the history file are separated by the 837The commands stored in the history file are separated by the
835`comint-input-ring-separator'. The most recent command comes last. 838`comint-input-ring-separator', and entries that match
839`comint-input-history-ignore' are ignored. The most recent command
840comes last.
836 841
837See also `comint-input-ignoredups' and `comint-write-input-ring'." 842See also `comint-input-ignoredups' and `comint-write-input-ring'."
838 (cond ((or (null comint-input-ring-file-name) 843 (cond ((or (null comint-input-ring-file-name)
@@ -866,9 +871,10 @@ See also `comint-input-ignoredups' and `comint-write-input-ring'."
866 (setq start (point-min))) 871 (setq start (point-min)))
867 (setq history (buffer-substring start end)) 872 (setq history (buffer-substring start end))
868 (goto-char start) 873 (goto-char start)
869 (if (or (null comint-input-ignoredups) 874 (if (and (not (string-match comint-input-history-ignore history))
870 (ring-empty-p ring) 875 (or (null comint-input-ignoredups)
871 (not (string-equal (ring-ref ring 0) history))) 876 (ring-empty-p ring)
877 (not (string-equal (ring-ref ring 0) history))))
872 (progn 878 (progn
873 (ring-insert-at-beginning ring history) 879 (ring-insert-at-beginning ring history)
874 (setq count (1+ count))))))) 880 (setq count (1+ count)))))))