Mercurial > emacs
comparison lisp/dabbrev.el @ 28486:7b327ea7706b
(dabbrev-ignored-regexps): New user-option.
(dabbrev--find-expansion): Ignore buffers matching a regexp
from dabbrev-ignored-regexps.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Mon, 03 Apr 2000 19:23:35 +0000 |
parents | 1ef9d70dfb0f |
children | 07f205e3af83 |
comparison
equal
deleted
inserted
replaced
28485:cfc5860e2942 | 28486:7b327ea7706b |
---|---|
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> |
7 ;; Created: 16 Mars 1992 | 8 ;; Created: 16 Mars 1992 |
8 ;; Lindberg's last update version: 5.7 | 9 ;; Lindberg's last update version: 5.7 |
191 Dabbrev always searches the current buffer first. Then, if | 192 Dabbrev always searches the current buffer first. Then, if |
192 `dabbrev-check-other-buffers' says so, it searches the buffers | 193 `dabbrev-check-other-buffers' says so, it searches the buffers |
193 designated by `dabbrev-select-buffers-function'. | 194 designated by `dabbrev-select-buffers-function'. |
194 | 195 |
195 Then, if `dabbrev-check-all-buffers' is non-nil, dabbrev searches | 196 Then, if `dabbrev-check-all-buffers' is non-nil, dabbrev searches |
196 all the other buffers, except those named in `dabbrev-ignored-buffer-names'." | 197 all the other buffers, except those named in `dabbrev-ignored-buffer-names', |
198 or 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. |
204 See 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") |
208 | |
209 (defcustom dabbrev-ignored-regexps nil | |
210 "*List of regexps matching names of buffers that dabbrev should not check. | |
211 See also `dabbrev-ignored-buffer-names'." | |
212 :type '(repeat regexp) | |
213 :group 'dabbrev | |
214 :version "21.1") | |
205 | 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 |
209 nil: Don't look in other buffers. | 219 nil: Don't look in other buffers. |
759 (if dabbrev-check-all-buffers | 769 (if dabbrev-check-all-buffers |
760 (setq non-friend-buffer-list | 770 (setq non-friend-buffer-list |
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))))) |
770 ;; Move buffers that are visible on the screen | 787 ;; Move buffers that are visible on the screen |
771 ;; to the front of the list. Remove the current buffer. | 788 ;; to the front of the list. Remove the current buffer. |