emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: diary-redraw-calendar clobbers point in diary-file buffer.


From: Glenn Morris
Subject: Re: diary-redraw-calendar clobbers point in diary-file buffer.
Date: Thu, 10 Mar 2005 01:10:18 +0000
User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)

While my other message percolates through the mailing list, I should
mention that I have the following changes in my local copy, to prevent
un-necessary double redrawing of the calendar. I haven't checked them
in yet, since I clearly don't know what I'm doing at the moment...


*** calendar.el 09 Mar 2005 00:17:35 +0000  1.163
--- calendar.el 10 Mar 2005 00:43:35 +0000  
***************
*** 2150,2164 ****
      (forward-line 1))))
    t)
  
  (defun redraw-calendar ()
    "Redraw the calendar display, if `calendar-buffer' is live."
    (interactive)
    (if (get-buffer calendar-buffer)
-       (save-excursion
          (with-current-buffer calendar-buffer
!           (let ((cursor-date (calendar-cursor-to-nearest-date)))
              (generate-calendar-window displayed-month displayed-year)
!             (calendar-cursor-to-visible-date cursor-date))))))
  
  ;;;###autoload
  (defcustom calendar-week-start-day 0
--- 2150,2167 ----
      (forward-line 1))))
    t)
  
+ (defvar calendar-redrawing nil
+   "Internal calendar variable, non-nil if inside redraw-calendar.")
+ 
  (defun redraw-calendar ()
    "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-redrawing t))
            (generate-calendar-window displayed-month displayed-year)
!           (calendar-cursor-to-visible-date cursor-date)))))
  
  ;;;###autoload
  (defcustom calendar-week-start-day 0


*** diary-lib.el                     09 Mar 2005 00:22:50 +0000 1.90
--- diary-lib.el                     10 Mar 2005 00:40:25 +0000 
***************
*** 846,852 ****
               ;; Avoid redrawing when called recursively, eg through
               ;; mark-diary-entries-hook for #include's, else only
               get
               ;; the last set of diary marks.
!              (not marking-diary-entries))
      (setq mark-diary-entries-in-calendar nil)
      (redraw-calendar))
    (let ((marking-diary-entries t)
--- 846,853 ----
               ;; Avoid redrawing when called recursively, eg through
               ;; mark-diary-entries-hook for #include's, else only
               get
               ;; the last set of diary marks.
!              (not marking-diary-entries)
!              (not calendar-redrawing))
      (setq mark-diary-entries-in-calendar nil)
      (redraw-calendar))
    (let ((marking-diary-entries t)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]