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/diary-lib.el


From: Glenn Morris
Subject: [Emacs-diffs] Changes to emacs/lisp/calendar/diary-lib.el
Date: Tue, 01 Mar 2005 05:23:58 -0500

Index: emacs/lisp/calendar/diary-lib.el
diff -c emacs/lisp/calendar/diary-lib.el:1.88 
emacs/lisp/calendar/diary-lib.el:1.89
*** emacs/lisp/calendar/diary-lib.el:1.88       Sun Feb 27 22:46:03 2005
--- emacs/lisp/calendar/diary-lib.el    Tue Mar  1 10:23:58 2005
***************
*** 1,6 ****
  ;;; diary-lib.el --- diary functions
  
! ;; Copyright (C) 1989, 1990, 1992, 1993, 1994, 1995, 2003, 2004
  ;;           Free Software Foundation, Inc.
  
  ;; Author: Edward M. Reingold <address@hidden>
--- 1,6 ----
  ;;; diary-lib.el --- diary functions
  
! ;; Copyright (C) 1989, 1990, 1992, 1993, 1994, 1995, 2003, 2004, 2005
  ;;           Free Software Foundation, Inc.
  
  ;; Author: Edward M. Reingold <address@hidden>
***************
*** 841,846 ****
--- 841,850 ----
  After the entries are marked, the hooks `nongregorian-diary-marking-hook' and
  `mark-diary-entries-hook' are run."
    (interactive)
+   ;; To remove any deleted diary entries.
+   (when mark-diary-entries-in-calendar
+     (setq mark-diary-entries-in-calendar nil)
+     (redraw-calendar))
    (let ((marking-diary-entries t)
          file-glob-attrs marks)
      (save-excursion
***************
*** 1647,1657 ****
            (append diary-entries-list
                    (list (list date string specifier marker globcolor))))))
  
  (defun make-diary-entry (string &optional nonmarking file)
    "Insert a diary entry STRING which may be NONMARKING in FILE.
! If omitted, NONMARKING defaults to nil and FILE defaults to `diary-file'."
    (let ((pop-up-frames (window-dedicated-p (selected-window))))
      (find-file-other-window (substitute-in-file-name (or file diary-file))))
    (widen)
    (goto-char (point-max))
    (when (let ((case-fold-search t))
--- 1651,1676 ----
            (append diary-entries-list
                    (list (list date string specifier marker globcolor))))))
  
+ (defun diary-redraw-calendar ()
+   "If `calendar-buffer' is live and diary entries are marked, redraw it."
+   (and mark-diary-entries-in-calendar
+        (redraw-calendar))
+   ;; Return value suitable for `write-contents-functions'.
+   nil)
+ 
  (defun make-diary-entry (string &optional nonmarking file)
    "Insert a diary entry STRING which may be NONMARKING in FILE.
! If omitted, NONMARKING defaults to nil and FILE defaults to
! `diary-file'.  Adds `diary-redraw-calendar' to
! `write-contents-functions' for FILE, so that the calendar will be
! redrawn with the new entry marked, if necessary."
    (let ((pop-up-frames (window-dedicated-p (selected-window))))
      (find-file-other-window (substitute-in-file-name (or file diary-file))))
+   (add-hook 'write-contents-functions 'diary-redraw-calendar nil t)
+   (when selective-display
+     (subst-char-in-region (point-min) (point-max) ?\^M ?\n t)
+     (setq selective-display nil)
+     (kill-local-variable 'mode-line-format))
    (widen)
    (goto-char (point-max))
    (when (let ((case-fold-search t))




reply via email to

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