emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/calendar/calendar.el


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/lisp/calendar/calendar.el
Date: Mon, 12 Sep 2005 17:31:18 -0400

Index: emacs/lisp/calendar/calendar.el
diff -c emacs/lisp/calendar/calendar.el:1.175 
emacs/lisp/calendar/calendar.el:1.176
*** emacs/lisp/calendar/calendar.el:1.175       Tue Aug  9 11:30:36 2005
--- emacs/lisp/calendar/calendar.el     Mon Sep 12 21:31:17 2005
***************
*** 164,198 ****
    :group 'diary)
  
  ;;;###autoload
- (defcustom number-of-diary-entries 1
-   "*Specifies how many days of diary entries are to be displayed initially.
- This variable affects the diary display when the command \\[diary] is used,
- or if the value of the variable `view-diary-entries-initially' is t.  For
- example, if the default value 1 is used, then only the current day's diary
- entries will be displayed.  If the value 2 is used, then both the current
- day's and the next day's entries will be displayed.
- 
- The value can also be a vector such as [0 2 2 2 2 4 1]; this value
- says to display no diary entries on Sunday, the display the entries
- for the current date and the day after on Monday through Thursday,
- display Friday through Monday's entries on Friday, and display only
- Saturday's entries on Saturday.
- 
- This variable does not affect the diary display with the `d' command
- from the calendar; in that case, the prefix argument controls the
- number of days of diary entries displayed."
-   :type '(choice (integer :tag "Entries")
-                (vector :value [0 0 0 0 0 0 0]
-                        (integer :tag "Sunday")
-                        (integer :tag "Monday")
-                        (integer :tag "Tuesday")
-                        (integer :tag "Wednesday")
-                        (integer :tag "Thursday")
-                        (integer :tag "Friday")
-                        (integer :tag "Saturday")))
-   :group 'diary)
- 
- ;;;###autoload
  (defcustom mark-diary-entries-in-calendar nil
    "*Non-nil means mark dates with diary entries, in the calendar window.
  The marking symbol is specified by the variable `diary-entry-marker'."
--- 164,169 ----
***************
*** 393,399 ****
  
  For example,
  
!   (add-hook 'calendar-move-hook (lambda () (view-diary-entries 1)))
  
  redisplays the diary for whatever date the cursor is moved to."
    :type 'hook
--- 364,370 ----
  
  For example,
  
!   (add-hook 'calendar-move-hook (lambda () (diary-view-entries 1)))
  
  redisplays the diary for whatever date the cursor is moved to."
    :type 'hook
***************
*** 1335,1340 ****
--- 1306,1312 ----
  
  (defmacro calendar-for-loop (var from init to final do &rest body)
    "Execute a for loop."
+   (declare (debug (symbolp "from" form "to" form "do" body)))
    `(let ((,var (1- ,init)))
      (while (>= ,final (setq ,var (1+ ,var)))
        ,@body)))
***************
*** 1651,1660 ****
      (increment-calendar-month month year (- calendar-offset))
      (generate-calendar-window month year)
      (if (and view-diary-entries-initially (calendar-date-is-visible-p date))
!         (view-diary-entries
!          (if (vectorp number-of-diary-entries)
!              (aref number-of-diary-entries (calendar-day-of-week date))
!            number-of-diary-entries))))
    (let* ((diary-buffer (get-file-buffer diary-file))
           (diary-window (if diary-buffer (get-buffer-window diary-buffer)))
           (split-height-threshold (if diary-window 2 1000)))
--- 1623,1629 ----
      (increment-calendar-month month year (- calendar-offset))
      (generate-calendar-window month year)
      (if (and view-diary-entries-initially (calendar-date-is-visible-p date))
!         (diary-view-entries)))
    (let* ((diary-buffer (get-file-buffer diary-file))
           (diary-window (if diary-buffer (get-buffer-window diary-buffer)))
           (split-height-threshold (if diary-window 2 1000)))
***************
*** 1662,1668 ****
          (list-calendar-holidays)))
    (run-hooks 'initial-calendar-window-hook))
  
! (autoload 'view-diary-entries "diary-lib"
    "Prepare and display a buffer with diary entries.
  Searches your diary file for entries that match ARG days starting with
  the date indicated by the cursor position in the displayed three-month
--- 1631,1637 ----
          (list-calendar-holidays)))
    (run-hooks 'initial-calendar-window-hook))
  
! (autoload 'diary-view-entries "diary-lib"
    "Prepare and display a buffer with diary entries.
  Searches your diary file for entries that match ARG days starting with
  the date indicated by the cursor position in the displayed three-month
***************
*** 2272,2278 ****
    (define-key calendar-mode-map "x"   'mark-calendar-holidays)
    (define-key calendar-mode-map "u"   'calendar-unmark)
    (define-key calendar-mode-map "m"   'mark-diary-entries)
!   (define-key calendar-mode-map "d"   'view-diary-entries)
    (define-key calendar-mode-map "D"   'view-other-diary-entries)
    (define-key calendar-mode-map "s"   'show-all-diary-entries)
    (define-key calendar-mode-map "pd"  'calendar-print-day-of-year)
--- 2241,2247 ----
    (define-key calendar-mode-map "x"   'mark-calendar-holidays)
    (define-key calendar-mode-map "u"   'calendar-unmark)
    (define-key calendar-mode-map "m"   'mark-diary-entries)
!   (define-key calendar-mode-map "d"   'diary-view-entries)
    (define-key calendar-mode-map "D"   'view-other-diary-entries)
    (define-key calendar-mode-map "s"   'show-all-diary-entries)
    (define-key calendar-mode-map "pd"  'calendar-print-day-of-year)
***************
*** 2493,2500 ****
  (defun update-calendar-mode-line ()
    "Update the calendar mode line with the current date and date style."
    (if (bufferp (get-buffer calendar-buffer))
!       (save-excursion
!         (set-buffer calendar-buffer)
          (setq mode-line-format
                (calendar-string-spread
                 (let ((date (condition-case nil
--- 2462,2468 ----
  (defun update-calendar-mode-line ()
    "Update the calendar mode line with the current date and date style."
    (if (bufferp (get-buffer calendar-buffer))
!       (with-current-buffer calendar-buffer
          (setq mode-line-format
                (calendar-string-spread
                 (let ((date (condition-case nil
***************
*** 2589,2602 ****
            (list month
                  (string-to-number (buffer-substring (1+ (point)) (+ 4 
(point))))
                  year))
!       (if (looking-at "\\*")
!           (save-excursion
!             (re-search-backward "[^*]")
!             (if (looking-at ".\\*\\*")
!                 (list month calendar-starred-day year)
!               (if error (error "Not on a date!"))))
          (if error (error "Not on a date!"))))))
  
  ;; The following version of calendar-gregorian-from-absolute is preferred for
  ;; reasons of clarity, BUT it's much slower than the version that follows it.
  
--- 2557,2571 ----
            (list month
                  (string-to-number (buffer-substring (1+ (point)) (+ 4 
(point))))
                  year))
!       (if (and (looking-at "\\*")
!                (save-excursion
!                  (re-search-backward "[^*]")
!                  (looking-at ".\\*\\*")))
!           (list month calendar-starred-day year)
          (if error (error "Not on a date!"))))))
  
+ (add-to-list 'debug-ignored-errors "Not on a date!")
+ 
  ;; The following version of calendar-gregorian-from-absolute is preferred for
  ;; reasons of clarity, BUT it's much slower than the version that follows it.
  
***************
*** 3071,3078 ****
    "Show dates on other calendars for date under the cursor."
    (interactive)
    (let* ((date (calendar-cursor-to-date t)))
!     (save-excursion
!       (set-buffer (get-buffer-create other-calendars-buffer))
        (setq buffer-read-only nil)
        (calendar-set-mode-line
         (concat (calendar-date-string date) " (Gregorian)"))
--- 3040,3046 ----
    "Show dates on other calendars for date under the cursor."
    (interactive)
    (let* ((date (calendar-cursor-to-date t)))
!     (with-current-buffer (get-buffer-create other-calendars-buffer)
        (setq buffer-read-only nil)
        (calendar-set-mode-line
         (concat (calendar-date-string date) " (Gregorian)"))
***************
*** 3138,3146 ****
  
  (provide 'calendar)
  
! ;;; Local variables:
! ;;; byte-compile-dynamic: t
! ;;; End:
  
! ;;; arch-tag: 19c61596-c8fb-4c69-bcf1-7dd739919cd8
  ;;; calendar.el ends here
--- 3106,3114 ----
  
  (provide 'calendar)
  
! ;; Local variables:
! ;; byte-compile-dynamic: t
! ;; End:
  
! ;; arch-tag: 19c61596-c8fb-4c69-bcf1-7dd739919cd8
  ;;; calendar.el ends here




reply via email to

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