unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Bastien <bastienguerry@googlemail.com>
Cc: Robert Goldman <rpgoldman@sift.info>, emacs-devel@gnu.org
Subject: Re: save-frame-excursion?
Date: Thu, 23 Jul 2009 16:56:27 -0400	[thread overview]
Message-ID: <jwvskgngly7.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87ocrb8fy0.fsf@bzg.ath.cx> (Bastien's message of "Thu, 23 Jul 2009 19:30:47 +0200")

> Currently we use this in Org-mode to save frame excursion:
> (defmacro org-save-frame-excursion (&rest body)
>   "Eval BODY and return to the currently selected frame."
>   (let ((frame-var (gensym "FRAME")))
>     `(let ((,frame-var (selected-frame)))
>        (unwind-protect
>            (progn ,@body)
>          (select-frame-set-input-focus ,frame-var)))))

> This was required when selecting a date for an Org entry.
> Org has a mechanism that lets the user browse the calendar
> while the cursor is still in the minibuffer (see org-read-date).

> When the calendar is displayed in a separate frame, this
> mechanism was broken because org-read-date was losing the
> focus.

Do you know when/why it lost the focus?

What was used before this macro (i.e. which part of this macro is the
important one)?

> Is this a pattern that other developers already met?

Well, there's save-selected-window, as well as with-selected-window,
which cover similar grounds, but without knowing more details it's hard
to tell.


        Stefan




  reply	other threads:[~2009-07-23 20:56 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-23 17:30 save-frame-excursion? Bastien
2009-07-23 20:56 ` Stefan Monnier [this message]
2009-07-24  2:24   ` save-frame-excursion? Robert Goldman
2009-07-24  3:16     ` save-frame-excursion? Stefan Monnier
2009-07-24  3:28       ` save-frame-excursion? Robert Goldman
2009-07-24 19:24         ` save-frame-excursion? Stefan Monnier
2009-07-24 21:18           ` save-frame-excursion? Robert Goldman
2009-07-25 14:39             ` save-frame-excursion? Stefan Monnier
2009-07-25 11:42           ` save-frame-excursion? Bastien
2009-07-25 14:42             ` save-frame-excursion? Stefan Monnier
2009-07-25 22:11               ` save-frame-excursion? Bastien
2009-07-26 14:26                 ` save-frame-excursion? Stefan Monnier
2009-07-26 17:00                   ` save-frame-excursion? Drew Adams
2009-07-27  3:42                   ` save-frame-excursion? Bastien
2009-07-27  4:50                     ` save-frame-excursion? Stephen J. Turnbull
2009-07-27  4:58                       ` save-frame-excursion? Bastien
2009-07-27 17:49                     ` save-frame-excursion? Stefan Monnier
2009-07-27 21:05                       ` save-frame-excursion? Bastien
2009-07-28  2:25                         ` save-frame-excursion? Stefan Monnier

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=jwvskgngly7.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=bastienguerry@googlemail.com \
    --cc=emacs-devel@gnu.org \
    --cc=rpgoldman@sift.info \
    /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).