aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiles Bader2001-04-27 15:28:38 +0000
committerMiles Bader2001-04-27 15:28:38 +0000
commita6a0642945fa6f859ade5e8710ce2f99654b2cdb (patch)
tree6132426e8ec65700a54184fc699d1a7a879b6635
parentf4976ebceaf62cba09ca84b43f6298e82f102b1e (diff)
downloademacs-a6a0642945fa6f859ade5e8710ce2f99654b2cdb.tar.gz
emacs-a6a0642945fa6f859ade5e8710ce2f99654b2cdb.zip
(dabbrev--ignore-buffer-p): New function.
(dabbrev--find-expansion): Use it. (dabbrev--select-buffers): Don't select ignored buffers.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/dabbrev.el24
2 files changed, 20 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f03f8c7e9a2..6905f0ec8ec 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12001-04-28 Miles Bader <miles@gnu.org>
2
3 * dabbrev.el (dabbrev--ignore-buffer-p): New function.
4 (dabbrev--find-expansion): Use it.
5 (dabbrev--select-buffers): Don't select ignored buffers.
6
12001-04-27 Gerd Moellmann <gerd@gnu.org> 72001-04-27 Gerd Moellmann <gerd@gnu.org>
2 8
3 * mail/rmail.el (rmail-message-regexp-p): Don't match before 9 * mail/rmail.el (rmail-message-regexp-p): Don't match before
diff --git a/lisp/dabbrev.el b/lisp/dabbrev.el
index 4187d361eb1..297ad595883 100644
--- a/lisp/dabbrev.el
+++ b/lisp/dabbrev.el
@@ -667,6 +667,7 @@ if it is bound, returns nil. The resulting partial list is returned."
667 (dabbrev-filter-elements 667 (dabbrev-filter-elements
668 buffer (buffer-list) 668 buffer (buffer-list)
669 (and (not (eq orig-buffer buffer)) 669 (and (not (eq orig-buffer buffer))
670 (not (dabbrev--ignore-buffer-p buffer))
670 (boundp 'dabbrev-friend-buffer-function) 671 (boundp 'dabbrev-friend-buffer-function)
671 (funcall dabbrev-friend-buffer-function buffer)))))) 672 (funcall dabbrev-friend-buffer-function buffer))))))
672 673
@@ -706,6 +707,17 @@ If IGNORE-CASE is non-nil, accept matches which differ in case."
706(defun dabbrev--scanning-message () 707(defun dabbrev--scanning-message ()
707 (message "Scanning `%s'" (buffer-name (current-buffer)))) 708 (message "Scanning `%s'" (buffer-name (current-buffer))))
708 709
710(defun dabbrev--ignore-buffer-p (buffer)
711 "Return non-nil if BUFFER should be ignored by dabbrev."
712 (let ((bn (buffer-name buffer)))
713 (or (member bn dabbrev-ignored-buffer-names)
714 (let ((tail dabbrev-ignored-buffer-regexps)
715 (match nil))
716 (while (and tail (not match))
717 (setq match (string-match (car tail) bn)
718 tail (cdr tail)))
719 match))))
720
709(defun dabbrev--find-expansion (abbrev direction ignore-case) 721(defun dabbrev--find-expansion (abbrev direction ignore-case)
710 "Find one occurrence of ABBREV, and return the expansion. 722 "Find one occurrence of ABBREV, and return the expansion.
711DIRECTION > 0 means look that many times backwards. 723DIRECTION > 0 means look that many times backwards.
@@ -776,16 +788,8 @@ of the start of the occurrence."
776 (setq non-friend-buffer-list 788 (setq non-friend-buffer-list
777 (dabbrev-filter-elements 789 (dabbrev-filter-elements
778 buffer (buffer-list) 790 buffer (buffer-list)
779 (let ((bn (buffer-name buffer))) 791 (and (not (memq buffer dabbrev--friend-buffer-list))
780 (and (not (member bn dabbrev-ignored-buffer-names)) 792 (not (dabbrev--ignore-buffer-p buffer))))
781 (not (memq buffer dabbrev--friend-buffer-list))
782 (not
783 (let ((tail dabbrev-ignored-buffer-regexps)
784 (match nil))
785 (while (and tail (not match))
786 (setq match (string-match (car tail) bn)
787 tail (cdr tail)))
788 match)))))
789 dabbrev--friend-buffer-list 793 dabbrev--friend-buffer-list
790 (append dabbrev--friend-buffer-list 794 (append dabbrev--friend-buffer-list
791 non-friend-buffer-list))))) 795 non-friend-buffer-list)))))