unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'Stefan Monnier'" <monnier@iro.umontreal.ca>
Cc: 7728@debbugs.gnu.org
Subject: bug#7728: 24.0.50; GDB backtrace from abort
Date: Sun, 16 Jan 2011 12:44:46 -0800	[thread overview]
Message-ID: <9DE79DCA301149E1AB0BCF669CD2141C@us.oracle.com> (raw)
In-Reply-To: <jwv1v4fa4hx.fsf-monnier+emacs@gnu.org>

> > I wonder how that particular plague escaped the attention of Richard
> > et al for 35 years?
> 
> Hmm... last I checked, we're only up to 25 years.

We who?  Emacs != Gnu Emacs.  Emacs dev began in the mid-70s.

No, I don't know when `save-window-excursion' was introduced.  And yes, I would
guess that it was introduced before Emacs frames were introduced.  Still, it's
been a very long time now, no matter how you count it.

> As for how... easy: they only use a single frame, and in that 
> setting it works fine and makes perfect sense.  But it doesn't
> extend well to situations with multiple frames.

I won't argue against that.  I'm not knowledgable about it.

If you are sure of what you say, then I suggest that you update the doc that
tells users how to use `save-window-excursion', including together with
`save-excursion'.  `save-window-excursion' is all through the Elisp manual, and
`with-selected-frame' is not mentioned even once!

The new doc should not just cover the case where you switch windows in the same
frame or you switch frames, but the more general case where you do not know
whether some other window and frame will be selected by the wrapped code.

IOW, if you replace or add to the doc about using `save-window-excursion', then
do so in a way that is just as general.

See also the multiple caveats in the doc about `save-window-excursion', to see
whether they too need to be updated to also mention `with-selected-frame' or
`with-selected-window'.

It would be very helpful if in the doc you compared and contrasted the proper
use of `save-selected-window', `with-selected-window', `with-selected-frame, and
`save-window-excursion', pointing out when to use which, what their differences
are, gotchas, etc.  That's not clear, IMO.


In any case, knowing how to use `with-selected-frame', perhaps together with
`with-selected-window', will not help my code, which needs to support Emacs
versions that do not have these macros.  Still, I would like the doc to be
updated to make things clear.






      reply	other threads:[~2011-01-16 20:44 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-24 16:55 bug#7728: 24.0.50; GDB backtrace from abort Drew Adams
2010-12-25  9:38 ` Eli Zaretskii
2010-12-25 10:44   ` Andreas Schwab
2010-12-25 11:12     ` Eli Zaretskii
2010-12-25 20:35   ` Stefan Monnier
2011-01-01 18:02     ` Eli Zaretskii
2011-01-09 21:18       ` Eli Zaretskii
2011-01-10 23:32         ` Drew Adams
2011-01-11 20:55       ` Stefan Monnier
2011-01-11 21:14         ` Eli Zaretskii
2011-01-11 21:44           ` Drew Adams
2011-01-12  4:11             ` Eli Zaretskii
2011-01-12  4:59               ` Drew Adams
2011-01-12 11:03                 ` Eli Zaretskii
2011-01-12 18:36                   ` Drew Adams
2011-01-12 19:52                   ` Drew Adams
2011-01-12 21:30                     ` Drew Adams
2011-01-12  7:54         ` martin rudalics
2011-01-12 15:05           ` Drew Adams
2011-01-12 15:14           ` Stefan Monnier
2011-01-12 15:59             ` martin rudalics
2011-01-12 16:22             ` Eli Zaretskii
2011-01-12 17:42               ` martin rudalics
2011-01-12 17:48                 ` Eli Zaretskii
2011-01-12 18:35                   ` martin rudalics
2011-01-12 18:36                   ` Drew Adams
2011-01-15  2:59                 ` Chong Yidong
2011-01-15 20:05                   ` martin rudalics
2011-01-13  2:53               ` Stefan Monnier
2011-01-13  7:07                 ` Drew Adams
2011-01-13 17:02                   ` Stefan Monnier
2011-01-13 17:57                     ` Drew Adams
2011-01-13 21:24                       ` Stefan Monnier
2011-01-13 22:06                         ` Drew Adams
2011-01-14  0:26                       ` Eli Zaretskii
2011-01-14  1:19                         ` Drew Adams
2011-01-14  2:40                           ` Eli Zaretskii
2011-01-14  6:46                             ` Drew Adams
2011-01-14  7:09                               ` Drew Adams
2011-01-14 20:01                         ` Sean Sieger
2011-01-14 21:06                           ` Drew Adams
2011-01-14 21:46                             ` Sean Sieger
2011-01-14 22:51                               ` Eli Zaretskii
2011-01-14 23:56                                 ` Sean Sieger
2011-01-14  2:25                       ` Stefan Monnier
2011-01-14  4:25                         ` Drew Adams
2011-01-14  8:26                     ` martin rudalics
2011-01-14  8:58                       ` Drew Adams
2011-01-14 15:30                         ` Stefan Monnier
2011-01-16 20:44                           ` Drew Adams [this message]

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=9DE79DCA301149E1AB0BCF669CD2141C@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=7728@debbugs.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 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).