emacs-devel
[Top][All Lists]
Advanced

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

save-frame-excursion?


From: Bastien
Subject: save-frame-excursion?
Date: Thu, 23 Jul 2009 19:30:47 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (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.  

Is this a pattern that other developers already met?

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

-- 
 Bastien




reply via email to

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