help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: My read-buffer-function doesn't work when called by switch-to-buffer


From: Tassilo Horn
Subject: Re: My read-buffer-function doesn't work when called by switch-to-buffer
Date: Thu, 16 Mar 2023 17:59:44 +0100
User-agent: mu4e 1.9.22; emacs 30.0.50

Tassilo Horn <tsdh@gnu.org> writes:

>> Depends on what you want of course.  It doesn't make sense for
>> everything (not for `kill-buffer' for example).
>
> Good point (although it doesn't really hurt).  I now made my function a
> bit customizable depending on `this-command'.
>
> (defconst th/read-buffer-or-recentf-command-alist
>   "Alist with entries of the form (CMD . COMPLETES).
> COMPLETES is a list defining what's completed where entries can
> be:
>
> - `buffers':        completion for all buffers
> - `buffers-except': completion for all buffers except the current one
> - `recentf':        completion for recent files which will be found on demand"
>   '((kill-buffer buffers)
>     (switch-to-buffer buffers-except recentf)
>     (pop-to-buffer buffers-except recentf)))

Gosh, that's what you get when adding a docstring before posting!  Of
course, you put it at the wrong location.  So here it is fixed.

--8<---------------cut here---------------start------------->8---
(defconst th/read-buffer-or-recentf-command-alist
  '((kill-buffer buffers)
    (switch-to-buffer buffers-except recentf)
    (pop-to-buffer buffers-except recentf))
  "Alist with entries of the form (CMD . COMPLETES).
COMPLETES is a list defining what's completed where entries can
be:

- `buffers':        completion for all buffers
- `buffers-except': completion for all buffers except the current one
- `recentf':        completion for recent files which will be found on demand")
--8<---------------cut here---------------end--------------->8---

Bye,
Tassilo



reply via email to

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