Re: [Orgmode] Patch for windowing problem
Bastien wrote: > Hi Nick, > > Nick Dokos writes: > >> AFAICT this has *not* been fixed: > > Yes, you're right - the issue I fixed was just a small step forward. > > Robert, I applied your patch, thanks a lot for it. > > I renamed it to `org-save-frame-excursion' and I slightly modified the > docstring, hope you don't mind. I will send this to the Emacs devs, I > guess some will be interested. That's a much better idea. I am more a common lisp programmer than an emacs lisp programmer, and need to remember that prepending "org-" is the equivalent of IN-PACKAGE ;-) Best, R ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Patch for windowing problem
Hi Nick, Nick Dokos writes: > AFAICT this has *not* been fixed: Yes, you're right - the issue I fixed was just a small step forward. Robert, I applied your patch, thanks a lot for it. I renamed it to `org-save-frame-excursion' and I slightly modified the docstring, hope you don't mind. I will send this to the Emacs devs, I guess some will be interested. Thanks all for insisting on this bug! -- Bastien ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Patch for windowing problem
Bastien wrote: > Hi Robert, > > Robert Goldman writes: > > > The closest I can do is to set calendar-setup to 'two-frame, which > > does pop up a frame and leave my cursor trapped in it, but it actually > > behaves even /worse/ than Aquamacs, because I can't assign a date at > > all. > > Yes, this is a bug - fixed. Let me know if it also fixes the other > issue you have - if not, I will investigate further. > Hi Bastien, AFAICT this has *not* been fixed: I might have made a mistake of course, so if anybody else decides to test it, I for one would be grateful. I'm pretty sure that I got the update (commit 3c031462f5b3a30b1fdd77e0c111586b8287a154) and I rebuilt org-mode and restarted emacs (I did an org-reload, tested without success and restarted emacs just to make sure I was getting the new bits). I eval the following form in the *scratch* buffer: (setq calendar-setup 'calendar-only) to enable frames for the calendar, and then I do (org-remember), and do C-c C-s to schedule it. The calendar frame pops up, but clicking on it does nothing: I don't get the overlay in the minibuffer that I get when I don't use calendar frames. The only way to change the date is using the keyboard (+3, S-, etc). Thanks, Nick ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Patch for windowing problem
Hi Robert, Robert Goldman writes: > The closest I can do is to set calendar-setup to 'two-frame, which > does pop up a frame and leave my cursor trapped in it, but it actually > behaves even /worse/ than Aquamacs, because I can't assign a date at > all. Yes, this is a bug - fixed. Let me know if it also fixes the other issue you have - if not, I will investigate further. Thanks for your patience! -- Bastien ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Patch for windowing problem
Bastien wrote: > Robert Goldman writes: > >> I will see if I can set up a test case, involving creating some frames, >> that might display this problem on vanilla Emacs. I'm afraid it's not a >> very high priority for me, since it will involve getting Org working on >> a different machine. > > Thanks for this. I will also try to reproduce the problem on vanilla > Emacs -- btw, can you suggest a simple recipe on how to reproduce it > with emacs -Q (and relevant frame config, of course)? > >> However, I'm inclined to suggest that, if this is NOT a problem on >> vanilla emacs, and my patch does not /damage/ operations on vanilla >> emacs while making life easier on aquamacs, we can safely push it. > > If this is a bug in Aquamacs, we shouldn't fix it in Emacs, even if > the workaround doesn't break anything -- by using such a workaround > we just remove incentives for Aquamacs people to fix the bug. > > Anyway, perhaps it's an Emacs + Org problem, so let's test and see! For the record, I don't believe that this is an Aquamacs bug per se. The Aquamacs aspect of the problem is that Aquamacs is frame-happy, and tends to pop up a lot more frames than a vanilla emacs. That means that behaviors occur that you wouldn't see with a vanilla emacs. I'm not suggesting that Aquamacs is doing anything wrong by putting the Calendar buffer in another frame, so by handling that case, I'm not fixing an Aquamacs bug. I'm just guarding against a condition that we don't see in vanilla emacs. Unfortunately, I don't know how to replicate this on a vanilla emacs. When I try to force *Calendar* into a different frame while inside a call to org-schedule, I cannot. The closest I can do is to set calendar-setup to 'two-frame, which does pop up a frame and leave my cursor trapped in it, but it actually behaves even /worse/ than Aquamacs, because I can't assign a date at all. On Aquamacs I get a date, but my cursor is left in the wrong window, making me (ugh) use the mouse to get back where I was. Hope that helps, r ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Patch for windowing problem
Robert Goldman writes: > I will see if I can set up a test case, involving creating some frames, > that might display this problem on vanilla Emacs. I'm afraid it's not a > very high priority for me, since it will involve getting Org working on > a different machine. Thanks for this. I will also try to reproduce the problem on vanilla Emacs -- btw, can you suggest a simple recipe on how to reproduce it with emacs -Q (and relevant frame config, of course)? > However, I'm inclined to suggest that, if this is NOT a problem on > vanilla emacs, and my patch does not /damage/ operations on vanilla > emacs while making life easier on aquamacs, we can safely push it. If this is a bug in Aquamacs, we shouldn't fix it in Emacs, even if the workaround doesn't break anything -- by using such a workaround we just remove incentives for Aquamacs people to fix the bug. Anyway, perhaps it's an Emacs + Org problem, so let's test and see! PS: Remember I'm just a temporary maintainer, so I'm just double-careful about not introducing unnecessary changes... -- Bastien ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Patch for windowing problem
Bastien wrote: > Hi Robert, > > Robert Goldman writes: > >> If you are inclined, you should be able to run with this patch, and it >> should do /absolutely nothing/. That would be a good test, too. If you >> plug it in, and you use only a single frame, org-mode should not change >> at all for you. If it does, you have performed the valuable service of >> finding that I have made a big bug! > > I've been trying to use frames with Org and Org-remember. I can't > reproduce the bug you are reporting, so maybe it's an Aquamacs bug? > > Does anyone using frames in GNU Emacs can reproduce Robert's bug? > I will see if I can set up a test case, involving creating some frames, that might display this problem on vanilla Emacs. I'm afraid it's not a very high priority for me, since it will involve getting Org working on a different machine. However, I'm inclined to suggest that, if this is NOT a problem on vanilla emacs, and my patch does not /damage/ operations on vanilla emacs while making life easier on aquamacs, we can safely push it. best, r ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Patch for windowing problem
Hi Robert, Robert Goldman writes: > If you are inclined, you should be able to run with this patch, and it > should do /absolutely nothing/. That would be a good test, too. If you > plug it in, and you use only a single frame, org-mode should not change > at all for you. If it does, you have performed the valuable service of > finding that I have made a big bug! I've been trying to use frames with Org and Org-remember. I can't reproduce the bug you are reporting, so maybe it's an Aquamacs bug? Does anyone using frames in GNU Emacs can reproduce Robert's bug? -- Bastien ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Patch for windowing problem
Bastien wrote: > Robert Goldman writes: > >> Bastien wrote: >>> Yes, would be nice if the Aquamacs crowd could test this! >>> >>> Thanks Robert for the patch. >> Actually, let me clarify -- it's even more important for the >> NON-Aquamacs crowd to test this. I am pretty confident it does The >> Right Thing on Aquamacs, but aquamacs uses frames much more heavily than >> normal emacs. And I don't use org-mode on normal emacs right now. So >> it's there that we could look for me getting the frame management more >> wrong. >> >> I should also say, though, that if you're a big frame user on normal >> emacs, this should also be a help to you, not just to aquamacs users. > > I'm using a single frame so I can't really test it. Well you can, at least a little. I can't see any way in which my save-and-restore frame focus tweak would affect you --- but it's always possible to be wrong about this. If you are inclined, you should be able to run with this patch, and it should do /absolutely nothing/. That would be a good test, too. If you plug it in, and you use only a single frame, org-mode should not change at all for you. If it does, you have performed the valuable service of finding that I have made a big bug! Best, Robert ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Patch for windowing problem
Robert Goldman writes: > Bastien wrote: >> Yes, would be nice if the Aquamacs crowd could test this! >> >> Thanks Robert for the patch. > > Actually, let me clarify -- it's even more important for the > NON-Aquamacs crowd to test this. I am pretty confident it does The > Right Thing on Aquamacs, but aquamacs uses frames much more heavily than > normal emacs. And I don't use org-mode on normal emacs right now. So > it's there that we could look for me getting the frame management more > wrong. > > I should also say, though, that if you're a big frame user on normal > emacs, this should also be a help to you, not just to aquamacs users. I'm using a single frame so I can't really test it. Please frame-people have a look at this patch. In any case, not a critical issue, I let Carsten take care of it when he's back. Thanks, -- Bastien ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Patch for windowing problem
Bastien wrote: > Yes, would be nice if the Aquamacs crowd could test this! > > Thanks Robert for the patch. Actually, let me clarify -- it's even more important for the NON-Aquamacs crowd to test this. I am pretty confident it does The Right Thing on Aquamacs, but aquamacs uses frames much more heavily than normal emacs. And I don't use org-mode on normal emacs right now. So it's there that we could look for me getting the frame management more wrong. I should also say, though, that if you're a big frame user on normal emacs, this should also be a help to you, not just to aquamacs users. best, Robert ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Patch for windowing problem
Yes, would be nice if the Aquamacs crowd could test this! Thanks Robert for the patch. Robert Goldman writes: > In an earlier posting, I mentioned that I had a problem with org-mode on > aquamacs; the cursor (really input focus) was getting "trapped" in a > different frame when the *Calendar* buffer was not in the same frame as > the source of the org-schedule command (either an org-mode buffer or a > remember buffer). The attached patch to org.el fixes this problem for > me. Would some of you all mind testing it out? It just wraps current > frame save and pop around the use of the calendar (frames aren't managed > by the save-excursion and save-window-excursion that already wrap this > interaction). > > Thanks, > Robert > index feaa115..be07d58 100644 > --- a/lisp/org.el > +++ b/lisp/org.el > @@ -12010,6 +12010,15 @@ So these are more for recording a certain time/date." > (defvar org-read-date-history nil) > (defvar org-read-date-final-answer nil) > > +(defmacro save-frame-excursion (&rest body) > + "Carry out some operations and then 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) > + > (defun org-read-date (&optional with-time to-time from-string prompt > default-time default-input) >"Read a date, possibly a time, and make things smooth for the user. > @@ -12088,77 +12097,78 @@ user." > (org-read-date-popup-calendar >(save-excursion > (save-window-excursion > - (calendar) > - (calendar-forward-day (- (time-to-days def) > -(calendar-absolute-from-gregorian > - (calendar-current-date > - (org-eval-in-calendar nil t) > - (let* ((old-map (current-local-map)) > - (map (copy-keymap calendar-mode-map)) > - (minibuffer-local-map (copy-keymap minibuffer-local-map))) > - (org-defkey map (kbd "RET") 'org-calendar-select) > - (org-defkey map (if (featurep 'xemacs) [button1] [mouse-1]) > - 'org-calendar-select-mouse) > - (org-defkey map (if (featurep 'xemacs) [button2] [mouse-2]) > - 'org-calendar-select-mouse) > - (org-defkey minibuffer-local-map [(meta shift left)] > - (lambda () (interactive) > - (org-eval-in-calendar '(calendar-backward-month 1 > - (org-defkey minibuffer-local-map [(meta shift right)] > - (lambda () (interactive) > - (org-eval-in-calendar '(calendar-forward-month 1 > - (org-defkey minibuffer-local-map [(meta shift up)] > - (lambda () (interactive) > - (org-eval-in-calendar '(calendar-backward-year 1 > - (org-defkey minibuffer-local-map [(meta shift down)] > - (lambda () (interactive) > - (org-eval-in-calendar '(calendar-forward-year 1 > - (org-defkey minibuffer-local-map [?\e (shift left)] > - (lambda () (interactive) > - (org-eval-in-calendar '(calendar-backward-month 1 > - (org-defkey minibuffer-local-map [?\e (shift right)] > - (lambda () (interactive) > - (org-eval-in-calendar '(calendar-forward-month 1 > - (org-defkey minibuffer-local-map [?\e (shift up)] > - (lambda () (interactive) > - (org-eval-in-calendar '(calendar-backward-year 1 > - (org-defkey minibuffer-local-map [?\e (shift down)] > - (lambda () (interactive) > - (org-eval-in-calendar '(calendar-forward-year 1 > - (org-defkey minibuffer-local-map [(shift up)] > - (lambda () (interactive) > - (org-eval-in-calendar '(calendar-backward-week 1 > - (org-defkey minibuffer-local-map [(shift down)] > - (lambda () (interactive) > - (org-eval-in-calendar '(calendar-forward-week 1 > - (org-defkey minibuffer-local-map [(shift left)] > - (lambda () (interactive) > - (org-eval-in-calendar '(calendar-backward-day 1 > - (org-defkey minibuffer-local-map [(shift right)] > - (lambda () (interactive) > - (org-eval-in-calendar '(calendar-forward-day 1 > - (org-defkey minibuffer-local-map ">" > - (lambda () (interactive) > - (org-eval-in-calendar '(scroll-calendar-left 1 > - (org-defkey minibuffer-local-map "<" > - (lambda () (interactive) > - (org-eval-in-calendar '(scroll-calendar-right 1 > - (run-hooks 'org-read-date-minibuffer-setup-hook) > - (unwind-protect > - (progn > - (use-local-map map) > - (add-hook 'post-command-hook 'org-read-date-display) > - (setq org-ans0 (read-string prompt default-i
[Orgmode] Patch for windowing problem
In an earlier posting, I mentioned that I had a problem with org-mode on aquamacs; the cursor (really input focus) was getting "trapped" in a different frame when the *Calendar* buffer was not in the same frame as the source of the org-schedule command (either an org-mode buffer or a remember buffer). The attached patch to org.el fixes this problem for me. Would some of you all mind testing it out? It just wraps current frame save and pop around the use of the calendar (frames aren't managed by the save-excursion and save-window-excursion that already wrap this interaction). Thanks, Robert index feaa115..be07d58 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -12010,6 +12010,15 @@ So these are more for recording a certain time/date." (defvar org-read-date-history nil) (defvar org-read-date-final-answer nil) +(defmacro save-frame-excursion (&rest body) + "Carry out some operations and then 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) + (defun org-read-date (&optional with-time to-time from-string prompt default-time default-input) "Read a date, possibly a time, and make things smooth for the user. @@ -12088,77 +12097,78 @@ user." (org-read-date-popup-calendar (save-excursion (save-window-excursion - (calendar) - (calendar-forward-day (- (time-to-days def) - (calendar-absolute-from-gregorian - (calendar-current-date - (org-eval-in-calendar nil t) - (let* ((old-map (current-local-map)) -(map (copy-keymap calendar-mode-map)) -(minibuffer-local-map (copy-keymap minibuffer-local-map))) - (org-defkey map (kbd "RET") 'org-calendar-select) - (org-defkey map (if (featurep 'xemacs) [button1] [mouse-1]) - 'org-calendar-select-mouse) - (org-defkey map (if (featurep 'xemacs) [button2] [mouse-2]) - 'org-calendar-select-mouse) - (org-defkey minibuffer-local-map [(meta shift left)] - (lambda () (interactive) - (org-eval-in-calendar '(calendar-backward-month 1 - (org-defkey minibuffer-local-map [(meta shift right)] - (lambda () (interactive) - (org-eval-in-calendar '(calendar-forward-month 1 - (org-defkey minibuffer-local-map [(meta shift up)] - (lambda () (interactive) - (org-eval-in-calendar '(calendar-backward-year 1 - (org-defkey minibuffer-local-map [(meta shift down)] - (lambda () (interactive) - (org-eval-in-calendar '(calendar-forward-year 1 - (org-defkey minibuffer-local-map [?\e (shift left)] - (lambda () (interactive) - (org-eval-in-calendar '(calendar-backward-month 1 - (org-defkey minibuffer-local-map [?\e (shift right)] - (lambda () (interactive) - (org-eval-in-calendar '(calendar-forward-month 1 - (org-defkey minibuffer-local-map [?\e (shift up)] - (lambda () (interactive) - (org-eval-in-calendar '(calendar-backward-year 1 - (org-defkey minibuffer-local-map [?\e (shift down)] - (lambda () (interactive) - (org-eval-in-calendar '(calendar-forward-year 1 - (org-defkey minibuffer-local-map [(shift up)] - (lambda () (interactive) - (org-eval-in-calendar '(calendar-backward-week 1 - (org-defkey minibuffer-local-map [(shift down)] - (lambda () (interactive) - (org-eval-in-calendar '(calendar-forward-week 1 - (org-defkey minibuffer-local-map [(shift left)] - (lambda () (interactive) - (org-eval-in-calendar '(calendar-backward-day 1 - (org-defkey minibuffer-local-map [(shift right)] - (lambda () (interactive) - (org-eval-in-calendar '(calendar-forward-day 1 - (org-defkey minibuffer-local-map ">" - (lambda () (interactive) - (org-eval-in-calendar '(scroll-calendar-left 1 - (org-defkey minibuffer-local-map "<" - (lambda () (interactive) - (org-eval-in-calendar '(scroll-calendar-right 1 - (run-hooks 'org-read-date-minibuffer-setup-hook) - (unwind-protect - (progn - (use-local-map map) - (add-hook 'post-command-hook 'org-read-date-display) - (setq org-ans0 (read-string prompt default-input - 'org-read-date-history nil)) - ;; org-ans0: from prompt - ;; org-ans1: from mouse click -