From: Eli Zaretskii <eliz@gnu.org>
To: martin rudalics <rudalics@gmx.at>
Cc: emacs-devel@gnu.org
Subject: Re: Avoiding 'with-temp-buffer' in tight loops
Date: Fri, 09 Aug 2024 13:36:52 +0300 [thread overview]
Message-ID: <86mslmkmnv.fsf@gnu.org> (raw)
In-Reply-To: <605d068b-efa8-40c6-aaec-af1b3e1d1606@gmx.at> (message from martin rudalics on Fri, 9 Aug 2024 10:30:42 +0200)
> Date: Fri, 9 Aug 2024 10:30:42 +0200
> From: martin rudalics <rudalics@gmx.at>
>
> Ever since 'substitute-command-keys' has been transferred to help.el,
> putting initial breakpoints in Fkill_buffer has become virtually
> impossible.
It should be possible to make the breakpoint conditional on the first
character of a temporary buffer not being SPC.
> Could we pretty please replace the
>
> (let ((keymap overriding-local-map)
> (inhibit-modification-hooks t)
> (orig-buf (current-buffer)))
> (with-temp-buffer
>
> with something like
>
> (let* ((keymap overriding-local-map)
> (inhibit-modification-hooks t)
> (orig-buf (current-buffer))
> (buffer-name " *substitute-command-keys*")
> (buffer (or (get-buffer buffer-name)
> (generate-new-buffer buffer-name t))))
> (with-current-buffer buffer
> (erase-buffer)
This needs to be amended to support several threads calling
substitute-command-keys, I think.
An alternative for the above is to have substitute-command-keys bind
some variable non-nil, and have a breakpoint be conditional on that
variable's value. If this works, I think it's simpler and cleaner.
next prev parent reply other threads:[~2024-08-09 10:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-09 8:30 Avoiding 'with-temp-buffer' in tight loops martin rudalics
2024-08-09 10:36 ` Eli Zaretskii [this message]
2024-08-10 13:59 ` martin rudalics
2024-08-10 14:11 ` Eli Zaretskii
2024-08-12 7:51 ` martin rudalics
2024-08-12 10:55 ` Eli Zaretskii
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86mslmkmnv.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=rudalics@gmx.at \
/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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.