]> git.eshelyaron.com Git - emacs.git/commitdiff
Sync window-point and point in calendar-redraw
authorLeo Liu <sdl.web@gmail.com>
Mon, 14 Jan 2013 15:39:04 +0000 (23:39 +0800)
committerLeo Liu <sdl.web@gmail.com>
Mon, 14 Jan 2013 15:39:04 +0000 (23:39 +0800)
Fixes: debbugs:13420
lisp/ChangeLog
lisp/calendar/calendar.el

index 9fc6660ce32a83c602d43f6a5dbea4c158d89d3b..d4a81bffd9c8cad8137c47f76dd761862c04af71 100644 (file)
@@ -1,3 +1,8 @@
+2013-01-14  Leo Liu  <sdl.web@gmail.com>
+
+       * calendar/calendar.el (calendar-redraw): Sync window-point and point.
+       (Bug#13420)
+
 2013-01-14  Glenn Morris  <rgm@gnu.org>
 
        * progmodes/compile.el (compilation-error-regexp-alist-alist):
index 9b0eb3e9bffb299b50a5a4a5cf0d04cce093000e..74d3ce803380e8fe7579d053ee1d122c296b9949 100644 (file)
@@ -1562,11 +1562,13 @@ line."
 (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)))