From: martin rudalics <rudalics@gmx.at>
To: Eli Zaretskii <eliz@gnu.org>
Cc: contovob@tcd.ie, 34765@debbugs.gnu.org, monnier@IRO.UMontreal.CA,
alexanderm@web.de
Subject: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook
Date: Thu, 23 May 2019 10:38:38 +0200 [thread overview]
Message-ID: <b4606a93-9277-c45c-8e85-4b76055d66cf@gmx.at> (raw)
In-Reply-To: <83woii7qh3.fsf@gnu.org>
>> Thanks, I hope I understand it now. Could you pretty please add the
>> (instructive for me) "a buffer created when the reused buffer is busy
>> and cannot be reused" somewhere to the comments maybe together with a
>> reference to reused_workbuf_in_use.
>
> Not sure where you want to add this. coding.c already says:
That's what I've read and did not understand. It's a bit too concise.
> /* Name (or base name) of work buffer for code conversion. */
> Lisp_Object Vcode_conversion_workbuf_name;
This comment insinuates that there is only one such buffer.
> /* A working buffer used by the top level conversion.
What is the "top level conversion"?
> Once it is
> created, it is never destroyed. It has the name
> Vcode_conversion_workbuf_name. The other working buffers are
> destroyed after the use is finished, and their names are modified
> versions of Vcode_conversion_workbuf_name. */
> static Lisp_Object Vcode_conversion_reused_workbuf;
>
> /* True iff Vcode_conversion_reused_workbuf is already in use. */
> static bool reused_workbuf_in_use;
>
> is that what you wanted to see?
I'd prefer something like a common comment for all these variables
going as
/* The internal work buffers for code conversion are created lazily on
demand. The name of the first buffer created that way is specified
by Vcode_conversion_workbuf_name. Once created, this buffer is no
more deleted in the current Emacs session. While this buffer is in
use, the boolean variable reused_workbuf_in_use is true. This
buffer is reused for new conversions whenever reused_workbuf_in_use
is false.
When reused_workbuf_in_use is true and more code conversion work
has to be done, a new buffer is created. The name of that new
buffer is generated by Fgenerate_new_buffer_name, using
Vcode_conversion_workbuf_name as base name. Any such buffer is
destroyed immediately as soon as it is no more used. */
>> Hopefully this also means that we can use _something like_
>> Fgenerate_new_buffer to replace both instances of Fget_buffer_create
>> in code_conversion_restore.
>
> You mean code_conversion_save, I presume.
You presume correctly.
> One of those calls to Fget_buffer_create shouldn't generate a new
> name, though. It should always use a fixed name.
Fgenerate_new_buffer_name should do that: "If there is no live buffer
named NAME, then return NAME.".
Concludingly, what we need in the present context is a function
- to create a buffer whose name is generated from a base name
argument,
- to set the new buffer's inhibit_buffer_hooks flag according to a
corresponding argument and to not run any hooks when that flag
should be set and the buffer is created,
- that is as internal as possible to avoid that applications misuse it
(it can't be entirely internal since macros like 'with-temp-buffer'
will need it).
martin
next prev parent reply other threads:[~2019-05-23 8:38 UTC|newest]
Thread overview: 72+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-05 22:57 bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook Alexander Miller
2019-03-06 9:39 ` martin rudalics
2019-03-06 11:29 ` Alexander Miller
2019-03-06 14:13 ` martin rudalics
2019-03-06 15:41 ` Eli Zaretskii
2019-03-06 17:57 ` martin rudalics
2019-04-23 9:21 ` martin rudalics
2019-04-23 10:36 ` Eli Zaretskii
2019-04-24 7:27 ` martin rudalics
2019-04-24 11:12 ` Eli Zaretskii
2019-04-24 12:55 ` Stefan Monnier
2019-04-25 8:06 ` martin rudalics
2019-04-25 8:50 ` Eli Zaretskii
2019-04-25 10:31 ` martin rudalics
2019-04-25 10:49 ` Eli Zaretskii
2019-04-26 7:40 ` martin rudalics
2019-04-26 8:09 ` Eli Zaretskii
2019-04-25 13:01 ` Stefan Monnier
2019-04-25 14:34 ` Eli Zaretskii
2019-04-26 7:41 ` martin rudalics
2019-04-26 8:10 ` Eli Zaretskii
2019-04-26 7:41 ` martin rudalics
2019-04-26 8:10 ` Eli Zaretskii
2019-04-26 11:00 ` martin rudalics
2019-04-26 11:26 ` Eli Zaretskii
2019-04-27 8:30 ` martin rudalics
2019-04-26 17:14 ` Basil L. Contovounesios
2019-04-27 8:31 ` martin rudalics
2019-05-20 13:42 ` Basil L. Contovounesios
2019-05-21 7:32 ` martin rudalics
2019-05-21 7:58 ` Basil L. Contovounesios
2019-05-21 10:04 ` martin rudalics
2019-05-22 7:29 ` Eli Zaretskii
2019-05-22 8:32 ` martin rudalics
2019-05-22 10:06 ` Eli Zaretskii
2019-05-23 8:38 ` martin rudalics [this message]
2019-05-23 14:37 ` Eli Zaretskii
2019-05-24 8:01 ` martin rudalics
2019-05-22 14:12 ` Stefan Monnier
2019-05-22 15:50 ` Eli Zaretskii
2019-05-22 7:21 ` Eli Zaretskii
2020-08-26 11:06 ` Lars Ingebrigtsen
2020-09-05 7:05 ` Eli Zaretskii
2020-10-07 3:27 ` Lars Ingebrigtsen
2020-10-07 7:58 ` martin rudalics
2020-11-29 21:03 ` Basil L. Contovounesios
2020-11-30 9:05 ` martin rudalics
2020-11-30 18:07 ` Basil L. Contovounesios
2020-11-30 19:01 ` martin rudalics
2020-11-30 20:33 ` Basil L. Contovounesios
2020-12-01 9:34 ` martin rudalics
2020-11-30 19:42 ` Eli Zaretskii
2020-11-30 20:34 ` Basil L. Contovounesios
2020-12-07 22:16 ` Basil L. Contovounesios
2020-12-07 22:37 ` Basil L. Contovounesios
2020-12-08 8:09 ` martin rudalics
2020-12-14 21:03 ` Basil L. Contovounesios
2020-12-15 16:03 ` Eli Zaretskii
2020-12-15 16:24 ` Basil L. Contovounesios
2020-12-18 14:57 ` Basil L. Contovounesios
2020-12-18 15:36 ` Stefan Monnier
2020-12-18 18:49 ` Basil L. Contovounesios
2020-12-19 10:33 ` Eli Zaretskii
2020-12-19 14:15 ` Basil L. Contovounesios
2020-12-19 16:06 ` Eli Zaretskii
2020-12-19 21:10 ` Basil L. Contovounesios
2020-12-20 15:05 ` Eli Zaretskii
2019-03-07 6:18 ` Alexander Miller
2019-03-07 8:29 ` martin rudalics
2019-03-07 9:44 ` Alexander Miller
2019-03-07 13:46 ` martin rudalics
2020-12-20 17:57 ` Basil L. Contovounesios
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=b4606a93-9277-c45c-8e85-4b76055d66cf@gmx.at \
--to=rudalics@gmx.at \
--cc=34765@debbugs.gnu.org \
--cc=alexanderm@web.de \
--cc=contovob@tcd.ie \
--cc=eliz@gnu.org \
--cc=monnier@IRO.UMontreal.CA \
/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.