changeset 27842:cfa579c1229f

(include-other-diary-files): Undo the selective display in any included file and don't kill it.
author Gerd Moellmann <gerd@gnu.org>
date Thu, 24 Feb 2000 13:47:36 +0000
parents d3dca8568200
children d401b5066063
files lisp/calendar/diary-lib.el
diffstat 1 files changed, 16 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/calendar/diary-lib.el	Thu Feb 24 12:59:48 2000 +0000
+++ b/lisp/calendar/diary-lib.el	Thu Feb 24 13:47:36 2000 +0000
@@ -363,20 +363,28 @@
            (regexp-quote diary-include-string)
            " \"\\([^\"]*\\)\"")
           nil t)
-    (let ((diary-file (substitute-in-file-name
-                       (buffer-substring-no-properties
-                        (match-beginning 2) (match-end 2))))
-          (diary-list-include-blanks nil)
-          (list-diary-entries-hook 'include-other-diary-files)
-          (diary-display-hook 'ignore)
-          (diary-hook nil))
+    (let* ((diary-file (substitute-in-file-name
+                        (buffer-substring-no-properties
+                         (match-beginning 2) (match-end 2))))
+           (diary-list-include-blanks nil)
+           (list-diary-entries-hook 'include-other-diary-files)
+           (diary-display-hook 'ignore)
+           (diary-hook nil)
+           (d-buffer (find-buffer-visiting diary-file))
+           (diary-modified (if d-buffer
+                               (save-excursion
+                                 (set-buffer d-buffer)
+                                 (buffer-modified-p)))))
       (if (file-exists-p diary-file)
           (if (file-readable-p diary-file)
               (unwind-protect
                   (setq diary-entries-list
                         (append diary-entries-list
                                 (list-diary-entries original-date number)))
-                (kill-buffer (find-buffer-visiting diary-file)))
+                (set-buffer (find-buffer-visiting diary-file))
+                (subst-char-in-region (point-min) (point-max) ?\^M ?\n t)
+                (setq selective-display nil)
+                (set-buffer-modified-p diary-modified))
             (beep)
             (message "Can't read included diary file %s" diary-file)
             (sleep-for 2))