unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: [Emacs-diffs] emacs-26 35e0305: Avoid turning on the global-minor-mode recursively
       [not found] ` <20180710121716.D4670204EE@vcs0.savannah.gnu.org>
@ 2018-07-10 13:42   ` Stefan Monnier
  2018-07-10 20:07     ` John Shahid
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2018-07-10 13:42 UTC (permalink / raw)
  To: emacs-devel; +Cc: John Shahid

> +         (let ((buffers ,MODE-buffers))
> +           ;; Clear MODE-buffers to avoid scanning the same list of
> +           ;; buffers in recursive calls to MODE-enable-in-buffers.
> +           ;; Otherwise it could lead to infinite recursion.
> +           (setq ,MODE-buffers nil)
> +           (dolist (buf buffers)

Thanks.

BTW, in most other places where we need to "extract the content" of
a worklist like above, we do it with something like:

    (... (prog1 FOO (setq FOO nil)) ...)


-- Stefan



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Emacs-diffs] emacs-26 35e0305: Avoid turning on the global-minor-mode recursively
  2018-07-10 13:42   ` [Emacs-diffs] emacs-26 35e0305: Avoid turning on the global-minor-mode recursively Stefan Monnier
@ 2018-07-10 20:07     ` John Shahid
  2018-07-10 20:35       ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: John Shahid @ 2018-07-10 20:07 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel


Stefan Monnier <monnier@IRO.UMontreal.CA> writes:

>> +         (let ((buffers ,MODE-buffers))
>> +           ;; Clear MODE-buffers to avoid scanning the same list of
>> +           ;; buffers in recursive calls to MODE-enable-in-buffers.
>> +           ;; Otherwise it could lead to infinite recursion.
>> +           (setq ,MODE-buffers nil)
>> +           (dolist (buf buffers)
>
> Thanks.
>
> BTW, in most other places where we need to "extract the content" of
> a worklist like above, we do it with something like:
>
>     (... (prog1 FOO (setq FOO nil)) ...)
>
>
> -- Stefan

Should I submit a patch ?



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Emacs-diffs] emacs-26 35e0305: Avoid turning on the global-minor-mode recursively
  2018-07-10 20:07     ` John Shahid
@ 2018-07-10 20:35       ` Stefan Monnier
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2018-07-10 20:35 UTC (permalink / raw)
  To: John Shahid; +Cc: emacs-devel

>> BTW, in most other places where we need to "extract the content" of
>> a worklist like above, we do it with something like:
>>     (... (prog1 FOO (setq FOO nil)) ...)
> Should I submit a patch ?

Your call.  Maybe we could even introduce a `destructive-read` macro for
that ;-)


        Stefan



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-07-10 20:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20180710121715.23096.25536@vcs0.savannah.gnu.org>
     [not found] ` <20180710121716.D4670204EE@vcs0.savannah.gnu.org>
2018-07-10 13:42   ` [Emacs-diffs] emacs-26 35e0305: Avoid turning on the global-minor-mode recursively Stefan Monnier
2018-07-10 20:07     ` John Shahid
2018-07-10 20:35       ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).