From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Subject: Re: Should timers run in the initial frame?
Date: Mon, 11 Jun 2018 11:42:28 -0400 [thread overview]
Message-ID: <jwvpo0xiblo.fsf-monnier+gmane.emacs.devel@gnu.org> (raw)
In-Reply-To: CAO_b3FXrEXorY9Jp0LpZ4Miefrr1ZJ9V+4HJazHZ9fZGav-esA@mail.gmail.com
> So, I wonder: would it be good if timers ran in the context of the
> initially opened Emacs frame, rather than in whichever frame was most
> recently active?
Elisp code has a lot of context, and which context needs to be saved
depends on ...hmm... context.
I don't think it can break anything to do what you suggest, but it's
a slippery slope: we could also try and preserve the current buffer,
selected window, ...
The specific problem in your case is that the change your package
imposes on buffer-list is pretty drastic (the original semantics of
buffer-list is to return *all* buffers) and inevitably introduces bugs
(e.g. some buffer-local minor modes use a global timer shared between
all buffers (and relying buffer-list for that), so you'd need to either
restore the original buffer-list for those particular uses, or advise
those minor modes such that use a "frame-purpose-local" variable instead
of a global variable for the timer).
So I think it makes more sense to add this particular workaround in your
package (e.g. by advising timer-set-function).
Stefan
next prev parent reply other threads:[~2018-06-11 15:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-11 13:40 Should timers run in the initial frame? Adam Porter
2018-06-11 15:42 ` Stefan Monnier [this message]
2018-06-16 21:07 ` Daniel Colascione
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=jwvpo0xiblo.fsf-monnier+gmane.emacs.devel@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
/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.