all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* save-frame-excursion?
@ 2009-07-23 17:30 Bastien
  2009-07-23 20:56 ` save-frame-excursion? Stefan Monnier
  0 siblings, 1 reply; 21+ messages in thread
From: Bastien @ 2009-07-23 17:30 UTC (permalink / raw)
  To: emacs-devel; +Cc: Robert Goldman

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.  

Is this a pattern that other developers already met?

I'm copying Robert, who brought this issue up and proposed 
the code above.

-- 
 Bastien




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

end of thread, other threads:[~2009-08-03 12:50 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-23 17:30 save-frame-excursion? Bastien
2009-07-23 20:56 ` save-frame-excursion? Stefan Monnier
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
     [not found]             ` <87iqhhasm3.fsf@bzg.ath.cx>
2009-08-03  4:38               ` save-frame-excursion? Carsten Dominik
2009-08-03 12:50                 ` save-frame-excursion? Robert Goldman

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.