[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: save-frame-excursion?

From: Stefan Monnier
Subject: Re: save-frame-excursion?
Date: Thu, 23 Jul 2009 16:56:27 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.94 (gnu/linux)

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]