GNU bug report logs -
#16257
24.3.50; calendar-cursor-to-visible-date needs set-window-point
Previous Next
Reported by: Keith David Bershatsky <esq <at> lawlist.com>
Date: Thu, 26 Dec 2013 02:22:01 UTC
Severity: minor
Tags: notabug
Found in version 24.3.50
Done: Stefan Monnier <monnier <at> iro.umontreal.ca>
Bug is archived. No further changes may be made.
Full log
Message #7 received at control <at> debbugs.gnu.org (full text, mbox):
tags 16257 notabug
thanks
> Here is the thread on stackoverflow that provides a working example of
> the problem, and a working solution:
> http://stackoverflow.com/questions/20776564/how-to-use-calendar-cursor-to-visible-date-without-switching-to-calendar
The question is not clear. E.g.:
"I would like the function to work without actually switching to the
calendar window -- i.e., it should work even when the buffer is buried."
While we clearly can't select the calendar window if the calendar is
not displayed, I don't see why that would make it undesirable to
temporarily select that window when it does exist. E.g.
(with-selected-window (or (get-buffer-window (current-buffer) 0)
(selected-window))
(calendar-cursor-to-visible-date date))
Of course, if there are various windows displaying that buffer, things
are more interesting.
> Without adding `set-window-point` to the function
> `calendar-cursor-to-visible-date`, functions like
> `with-current-buffer` and `set-buffer` do not work properly.
Those work just fine (although they don't quite do what you think they do).
> From another window, it should be possible to use
> `calendar-cursor-to-visible-date` without actually switching to that
> "*Calendar*" buffer.
Here I lost you again. calendar-cursor-to-visible-date works inside the
calendar buffer, so you can't use it without switching to the
*Calendar* buffer. But that's unrelated to whether or not you select
the corresponding window (if any).
Stefan
This bug report was last modified 11 years and 138 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.