changeset 94247:57c8f6a6456a

(internal-complete-buffer-except): New function.
author Juri Linkov <juri@jurta.org>
date Tue, 22 Apr 2008 19:47:13 +0000
parents 233d0248f6d2
children 63d5fa94ea09
files lisp/minibuffer.el
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/minibuffer.el	Tue Apr 22 15:49:43 2008 +0000
+++ b/lisp/minibuffer.el	Tue Apr 22 19:47:13 2008 +0000
@@ -764,6 +764,16 @@
                             'completion--file-name-table)
   "Internal subroutine for `read-file-name'.  Do not call this.")
 
+(defun internal-complete-buffer-except (&optional buffer)
+  "Perform completion on all buffers excluding BUFFER.
+Like `internal-complete-buffer', but removes BUFFER from the completion list."
+  (lexical-let ((except (if (stringp buffer) buffer (buffer-name buffer))))
+    (apply-partially 'completion-table-with-predicate
+		     'internal-complete-buffer
+		     (lambda (name)
+		       (not (equal (if (consp name) (car name) name) except)))
+		     nil)))
+
 (provide 'minibuffer)
 
 ;; arch-tag: ef8a0a15-1080-4790-a754-04017c02f08f