[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C-r and C-s in minibuffer should search completion

From: Juri Linkov
Subject: Re: C-r and C-s in minibuffer should search completion
Date: Sat, 19 Apr 2008 23:11:46 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-pc-linux-gnu)

>> If there is no equivalent of Vbuffer_alist in Lisp, then
>> internal-complete-buffer-sans-current will produce wrong results.
> I don't understand what's the problem.  Your previously posted code
> should work just fine, for example.

I understood that the reason not to move `internal-complete-buffer'
to Lisp is because it uses the internal variable Vbuffer_alist.

Since these two functions are equivalent in behavior with the exception
that one of them omits the current buffer, I thought that it would be
better to have equivalent implementations by having both in Lisp with
removing possible problems of using Vbuffer_alist that you mentioned.

> Or you could define it on top of the internal-complete-buffer code,
> using the `predicate' argument.

Do you mean something like

(defun internal-complete-buffer-sans-current (string predicate flag)
  "Perform completion on buffer names excluding the current buffer.
Like `internal-complete-buffer', but removes the current buffer from
the completion list."
  (let ((current-buffer (buffer-name (other-buffer (current-buffer) t))))
     string (lambda (buffer) (not (equal current-buffer buffer))) flag)))

Juri Linkov

reply via email to

[Prev in Thread] Current Thread [Next in Thread]