GNU bug report logs -
#13420
24.2.92; [PATCH] calendar-redraw moves window-point
Previous Next
Reported by: Leo Liu <sdl.web <at> gmail.com>
Date: Sat, 12 Jan 2013 08:12:02 UTC
Severity: normal
Tags: patch
Found in version 24.2.92
Fixed in version 24.4
Done: Glenn Morris <rgm <at> gnu.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 13420 in the body.
You can then email your comments to 13420 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#13420
; Package
emacs
.
(Sat, 12 Jan 2013 08:12:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Leo Liu <sdl.web <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sat, 12 Jan 2013 08:12:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Due to a bug/trap as reported in http://debbugs.gnu.org/13361, here is
one bug in calendar that moves window-point to (point-min).
1. Emacs -q
2. M-x calendar
3. C-x o so that the *calendar* window is not selected
4. M-x calendar-redraw
When you C-x o back to the calendar window, your window-point is no
longer at today's date but (point-min).
Note also calendar-redraw is called when saving in the diary file where
it has a save-hook: diary-redraw-calendar; so it is not uncommon for
this annoyance to happen.
[emacs-cal-bug.png (image/png, inline)]
[Message part 3 (text/plain, inline)]
For example, I often move to a future date and `i d' to insert a
reminder in the diary file and then C-x C-s. When I switch back to
calendar for further work, point is at the inconvenient point-min.
The proposed fix is in the patch attached.
I'd bet there are more occurrences in emacs source that fall into this
trap.
Leo
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el
index 9b0eb3e9..74d3ce80 100644
--- a/lisp/calendar/calendar.el
+++ b/lisp/calendar/calendar.el
@@ -1562,11 +1562,13 @@ (defun calendar-generate-month (month year indent)
(defun calendar-redraw ()
"Redraw the calendar display, if `calendar-buffer' is live."
(interactive)
- (if (get-buffer calendar-buffer)
- (with-current-buffer calendar-buffer
- (let ((cursor-date (calendar-cursor-to-nearest-date)))
- (calendar-generate-window displayed-month displayed-year)
- (calendar-cursor-to-visible-date cursor-date)))))
+ (when (get-buffer calendar-buffer)
+ (with-current-buffer calendar-buffer
+ (let ((cursor-date (calendar-cursor-to-nearest-date)))
+ (calendar-generate-window displayed-month displayed-year)
+ (calendar-cursor-to-visible-date cursor-date))
+ (when (window-live-p (get-buffer-window))
+ (set-window-point (get-buffer-window) (point))))))
(defvar calendar-mode-map
(let ((map (make-keymap)))
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#13420
; Package
emacs
.
(Mon, 14 Jan 2013 00:58:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 13420 <at> debbugs.gnu.org (full text, mbox):
Please apply to trunk, thanks.
bug marked as fixed in version 24.4, send any further explanations to
13420 <at> debbugs.gnu.org and Leo Liu <sdl.web <at> gmail.com>
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Mon, 14 Jan 2013 19:43:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Tue, 12 Feb 2013 12:24:02 GMT)
Full text and
rfc822 format available.
This bug report was last modified 12 years and 125 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.