comparison lisp/calendar/diary-lib.el @ 90261:7beb78bc1f8e

Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-97 Merge from emacs--cvs-trunk--0 Patches applied: * emacs--cvs-trunk--0 (patch 616-696) - Add lisp/mh-e/.arch-inventory - Update from CVS - Merge from gnus--rel--5.10 - Update from CVS: lisp/smerge-mode.el: Add 'tools' to file keywords. - lisp/gnus/ChangeLog: Remove duplicate entry * gnus--rel--5.10 (patch 147-181) - Update from CVS - Merge from emacs--cvs-trunk--0 - Update from CVS: lisp/mml.el (mml-preview): Doc fix. - Update from CVS: texi/message.texi: Fix default values. - Update from CVS: texi/gnus.texi (RSS): Addition.
author Miles Bader <miles@gnu.org>
date Mon, 16 Jan 2006 08:37:27 +0000
parents 5e2d3828e89f a55ee709ec8d
children 4b3d39451150
comparison
equal deleted inserted replaced
90260:0ca0d9181b5e 90261:7beb78bc1f8e
1 ;;; diary-lib.el --- diary functions 1 ;;; diary-lib.el --- diary functions
2 2
3 ;; Copyright (C) 1989, 1990, 1992, 1993, 1994, 1995, 2003, 2004, 2005 3 ;; Copyright (C) 1989, 1990, 1992, 1993, 1994, 1995, 2001, 2002, 2003,
4 ;; Free Software Foundation, Inc. 4 ;; 2004, 2005 Free Software Foundation, Inc.
5 5
6 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> 6 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
7 ;; Maintainer: Glenn Morris <rgm@gnu.org> 7 ;; Maintainer: Glenn Morris <rgm@gnu.org>
8 ;; Keywords: calendar 8 ;; Keywords: calendar
9 9
376 (set-buffer (find-file-noselect d-file t)) 376 (set-buffer (find-file-noselect d-file t))
377 (set-buffer diary-buffer) 377 (set-buffer diary-buffer)
378 (or (verify-visited-file-modtime diary-buffer) 378 (or (verify-visited-file-modtime diary-buffer)
379 (revert-buffer t t)))) 379 (revert-buffer t t))))
380 ;; Setup things like the header-line-format and invisibility-spec. 380 ;; Setup things like the header-line-format and invisibility-spec.
381 (when (eq major-mode 'fundamental-mode) (diary-mode)) 381 (when (eq major-mode default-major-mode) (diary-mode))
382 ;; d-s-p is passed to the diary display function. 382 ;; d-s-p is passed to the diary display function.
383 (let ((diary-saved-point (point))) 383 (let ((diary-saved-point (point)))
384 (save-excursion 384 (save-excursion
385 (setq file-glob-attrs (nth 1 (diary-pull-attrs nil ""))) 385 (setq file-glob-attrs (nth 1 (diary-pull-attrs nil "")))
386 (with-syntax-table diary-syntax-table 386 (with-syntax-table diary-syntax-table
437 (setq entry-found t) 437 (setq entry-found t)
438 (let ((entry-start (point)) 438 (let ((entry-start (point))
439 date-start temp) 439 date-start temp)
440 (re-search-backward "\^M\\|\n\\|\\`") 440 (re-search-backward "\^M\\|\n\\|\\`")
441 (setq date-start (point)) 441 (setq date-start (point))
442 (re-search-forward "\^M\\|\n" nil t 2) 442 ;; When selective display (rather than
443 ;; overlays) was used, diary file used to
444 ;; start in a blank line and end in a
445 ;; newline. Now that neither of these
446 ;; need be true, 'move handles the latter
447 ;; and 1/2 kludge the former.
448 (re-search-forward
449 "\^M\\|\n" nil 'move
450 (if (and (bobp) (not (looking-at "\^M\\|\n")))
451 1
452 2))
443 (while (looking-at " \\|\^I") 453 (while (looking-at " \\|\^I")
444 (re-search-forward "\^M\\|\n" nil t)) 454 (re-search-forward "\^M\\|\n" nil 'move))
445 (backward-char 1) 455 (unless (and (eobp) (not (bolp)))
456 (backward-char 1))
446 (unless list-only 457 (unless list-only
447 (remove-overlays date-start (point) 458 (remove-overlays date-start (point)
448 'invisible 'diary)) 459 'invisible 'diary))
449 (setq entry (buffer-substring entry-start (point)) 460 (setq entry (buffer-substring entry-start (point))
450 temp (diary-pull-attrs entry file-glob-attrs) 461 temp (diary-pull-attrs entry file-glob-attrs)
761 (interactive) 772 (interactive)
762 (let ((d-file (diary-check-diary-file)) 773 (let ((d-file (diary-check-diary-file))
763 (pop-up-frames (window-dedicated-p (selected-window)))) 774 (pop-up-frames (window-dedicated-p (selected-window))))
764 (with-current-buffer (or (find-buffer-visiting d-file) 775 (with-current-buffer (or (find-buffer-visiting d-file)
765 (find-file-noselect d-file t)) 776 (find-file-noselect d-file t))
766 (when (eq major-mode 'fundamental-mode) (diary-mode)) 777 (when (eq major-mode default-major-mode) (diary-mode))
767 (diary-unhide-everything) 778 (diary-unhide-everything)
768 (display-buffer (current-buffer))))) 779 (display-buffer (current-buffer)))))
769 780
770 (defcustom diary-mail-addr 781 (defcustom diary-mail-addr
771 (if (boundp 'user-mail-address) user-mail-address "") 782 (if (boundp 'user-mail-address) user-mail-address "")
864 (redraw-calendar)) 875 (redraw-calendar))
865 (let ((marking-diary-entries t) 876 (let ((marking-diary-entries t)
866 file-glob-attrs marks) 877 file-glob-attrs marks)
867 (with-current-buffer (find-file-noselect (diary-check-diary-file) t) 878 (with-current-buffer (find-file-noselect (diary-check-diary-file) t)
868 (save-excursion 879 (save-excursion
869 (when (eq major-mode 'fundamental-mode) (diary-mode)) 880 (when (eq major-mode default-major-mode) (diary-mode))
870 (setq mark-diary-entries-in-calendar t) 881 (setq mark-diary-entries-in-calendar t)
871 (message "Marking diary entries...") 882 (message "Marking diary entries...")
872 (setq file-glob-attrs (nth 1 (diary-pull-attrs nil '()))) 883 (setq file-glob-attrs (nth 1 (diary-pull-attrs nil '())))
873 (with-syntax-table diary-syntax-table 884 (with-syntax-table diary-syntax-table
874 (dolist (date-form diary-date-forms) 885 (dolist (date-form diary-date-forms)
1659 "Insert a diary entry STRING which may be NONMARKING in FILE. 1670 "Insert a diary entry STRING which may be NONMARKING in FILE.
1660 If omitted, NONMARKING defaults to nil and FILE defaults to 1671 If omitted, NONMARKING defaults to nil and FILE defaults to
1661 `diary-file'." 1672 `diary-file'."
1662 (let ((pop-up-frames (window-dedicated-p (selected-window)))) 1673 (let ((pop-up-frames (window-dedicated-p (selected-window))))
1663 (find-file-other-window (substitute-in-file-name (or file diary-file)))) 1674 (find-file-other-window (substitute-in-file-name (or file diary-file))))
1664 (when (eq major-mode 'fundamental-mode) (diary-mode)) 1675 (when (eq major-mode default-major-mode) (diary-mode))
1665 (widen) 1676 (widen)
1666 (diary-unhide-everything) 1677 (diary-unhide-everything)
1667 (goto-char (point-max)) 1678 (goto-char (point-max))
1668 (when (let ((case-fold-search t)) 1679 (when (let ((case-fold-search t))
1669 (search-backward "Local Variables:" 1680 (search-backward "Local Variables:"