From: Tassilo Horn <tsdh@gnu.org>
Cc: Michael Heerdegen <michael_heerdegen@web.de>, help-gnu-emacs@gnu.org
Subject: Re: My read-buffer-function doesn't work when called by switch-to-buffer
Date: Thu, 16 Mar 2023 17:59:44 +0100 [thread overview]
Message-ID: <87h6uk8wb1.fsf@gnu.org> (raw)
In-Reply-To: <87ttylhwyd.fsf@gnu.org>
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
next prev parent reply other threads:[~2023-03-16 16:59 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-10 21:10 My read-buffer-function doesn't work when called by switch-to-buffer Tassilo Horn
2023-03-11 0:32 ` Michael Heerdegen
2023-03-11 8:58 ` Tassilo Horn
2023-03-11 20:40 ` `when-let' (was: Re: My read-buffer-function doesn't work when called by switch-to-buffer) Emanuel Berg
2023-03-12 3:32 ` My read-buffer-function doesn't work when called by switch-to-buffer Michael Heerdegen
2023-03-12 18:51 ` Tassilo Horn
2023-03-13 0:32 ` Michael Heerdegen
2023-03-15 9:06 ` Tassilo Horn
2023-03-15 18:57 ` Michael Heerdegen
2023-03-16 9:18 ` Tassilo Horn
2023-03-16 16:59 ` Tassilo Horn [this message]
2023-03-16 23:46 ` Michael Heerdegen
2023-03-17 7:04 ` Tassilo Horn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87h6uk8wb1.fsf@gnu.org \
--to=tsdh@gnu.org \
--cc=help-gnu-emacs@gnu.org \
--cc=michael_heerdegen@web.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).