[Top][All Lists]
[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
- save-frame-excursion?,
Bastien <=
- Re: save-frame-excursion?, Stefan Monnier, 2009/07/23
- Re: save-frame-excursion?, Robert Goldman, 2009/07/24
- Re: save-frame-excursion?, Stefan Monnier, 2009/07/23
- Re: save-frame-excursion?, Robert Goldman, 2009/07/24
- Re: save-frame-excursion?, Stefan Monnier, 2009/07/24
- Re: save-frame-excursion?, Robert Goldman, 2009/07/25
- Re: save-frame-excursion?, Stefan Monnier, 2009/07/25
- Re: save-frame-excursion?, Bastien, 2009/07/25
- Re: save-frame-excursion?, Stefan Monnier, 2009/07/25
- Re: save-frame-excursion?, Bastien, 2009/07/25