aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann2000-04-03 19:23:35 +0000
committerGerd Moellmann2000-04-03 19:23:35 +0000
commit7e65cba265d1c25113c1e6d6dc28ca18b797ae44 (patch)
treebce1bc860a70d9fb1f431199365088596e85c67c
parent0166aed1b5ccd0343f8622fae81fb84c671bc6f4 (diff)
downloademacs-7e65cba265d1c25113c1e6d6dc28ca18b797ae44.tar.gz
emacs-7e65cba265d1c25113c1e6d6dc28ca18b797ae44.zip
(dabbrev-ignored-regexps): New user-option.
(dabbrev--find-expansion): Ignore buffers matching a regexp from dabbrev-ignored-regexps.
-rw-r--r--lisp/dabbrev.el29
1 files changed, 23 insertions, 6 deletions
diff --git a/lisp/dabbrev.el b/lisp/dabbrev.el
index 909b86dbbcf..34c9a41d709 100644
--- a/lisp/dabbrev.el
+++ b/lisp/dabbrev.el
@@ -1,6 +1,7 @@
1;;; dabbrev.el --- dynamic abbreviation package 1;;; dabbrev.el --- dynamic abbreviation package
2 2
3;; Copyright (C) 1985, 86, 92, 94, 96, 1997 Free Software Foundation, Inc. 3;; Copyright (C) 1985, 86, 92, 94, 96, 1997, 2000
4;; Free Software Foundation, Inc.
4 5
5;; Author: Don Morrison 6;; Author: Don Morrison
6;; Maintainer: Lars Lindberg <Lars.Lindberg@sypro.cap.se> 7;; Maintainer: Lars Lindberg <Lars.Lindberg@sypro.cap.se>
@@ -193,16 +194,25 @@ Dabbrev always searches the current buffer first. Then, if
193designated by `dabbrev-select-buffers-function'. 194designated by `dabbrev-select-buffers-function'.
194 195
195Then, if `dabbrev-check-all-buffers' is non-nil, dabbrev searches 196Then, if `dabbrev-check-all-buffers' is non-nil, dabbrev searches
196all the other buffers, except those named in `dabbrev-ignored-buffer-names'." 197all the other buffers, except those named in `dabbrev-ignored-buffer-names',
198or matched by `dabbrev-ignored-regexps'."
197 :type 'boolean 199 :type 'boolean
198 :group 'dabbrev) 200 :group 'dabbrev)
199 201
200(defcustom dabbrev-ignored-buffer-names '("*Messages*" "*Buffer List*") 202(defcustom dabbrev-ignored-buffer-names '("*Messages*" "*Buffer List*")
201 "*List of buffer names that dabbrev should not check." 203 "*List of buffer names that dabbrev should not check.
204See also `dabbrev-ignored-regexps'."
202 :type '(repeat (string :tag "Buffer name")) 205 :type '(repeat (string :tag "Buffer name"))
203 :group 'dabbrev 206 :group 'dabbrev
204 :version "20.3") 207 :version "20.3")
205 208
209(defcustom dabbrev-ignored-regexps nil
210 "*List of regexps matching names of buffers that dabbrev should not check.
211See also `dabbrev-ignored-buffer-names'."
212 :type '(repeat regexp)
213 :group 'dabbrev
214 :version "21.1")
215
206(defcustom dabbrev-check-other-buffers t 216(defcustom dabbrev-check-other-buffers t
207 "*Should \\[dabbrev-expand] look in other buffers?\ 217 "*Should \\[dabbrev-expand] look in other buffers?\
208 218
@@ -761,9 +771,16 @@ See also `dabbrev-abbrev-char-regexp' and \\[dabbrev-completion]."
761 (nreverse 771 (nreverse
762 (dabbrev-filter-elements 772 (dabbrev-filter-elements
763 buffer (buffer-list) 773 buffer (buffer-list)
764 (and (not (member (buffer-name buffer) 774 (let ((bn (buffer-name buffer)))
765 dabbrev-ignored-buffer-names)) 775 (and (not (member bn dabbrev-ignored-buffer-names))
766 (not (memq buffer dabbrev--friend-buffer-list))))) 776 (not (memq buffer dabbrev--friend-buffer-list))
777 (not
778 (let ((tail dabbrev-ignored-regexps)
779 (match nil))
780 (while (and tail (not match))
781 (setq match (string-match (car tail) bn)
782 tail (cdr tail)))
783 match))))))
767 dabbrev--friend-buffer-list 784 dabbrev--friend-buffer-list
768 (append dabbrev--friend-buffer-list 785 (append dabbrev--friend-buffer-list
769 non-friend-buffer-list))))) 786 non-friend-buffer-list)))))