diff options
| author | Glenn Morris | 2005-05-30 11:30:47 +0000 |
|---|---|---|
| committer | Glenn Morris | 2005-05-30 11:30:47 +0000 |
| commit | bf87510ab4d8617528bb4240528fb8c23ae87eab (patch) | |
| tree | ea4e4df3e10a9d95be8d643b7171b2a2c3fc4741 | |
| parent | 85be564d99c1a093b414b564a0af48c395937cbd (diff) | |
| download | emacs-bf87510ab4d8617528bb4240528fb8c23ae87eab.tar.gz emacs-bf87510ab4d8617528bb4240528fb8c23ae87eab.zip | |
(mark-included-diary-files): Only kill included diary buffer if it was
not already being visited.
Reported by Stephen Berman <Stephen.Berman@gmx.net>.
| -rw-r--r-- | lisp/calendar/diary-lib.el | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index 312b8841cf9..c8e6843d4b2 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el | |||
| @@ -1050,15 +1050,18 @@ changing the variable `diary-include-string'." | |||
| 1050 | (regexp-quote diary-include-string) | 1050 | (regexp-quote diary-include-string) |
| 1051 | " \"\\([^\"]*\\)\"") | 1051 | " \"\\([^\"]*\\)\"") |
| 1052 | nil t) | 1052 | nil t) |
| 1053 | (let ((diary-file (substitute-in-file-name | 1053 | (let* ((diary-file (substitute-in-file-name |
| 1054 | (buffer-substring-no-properties | 1054 | (match-string-no-properties 2))) |
| 1055 | (match-beginning 2) (match-end 2)))) | 1055 | (mark-diary-entries-hook 'mark-included-diary-files) |
| 1056 | (mark-diary-entries-hook 'mark-included-diary-files)) | 1056 | (dbuff (find-buffer-visiting diary-file))) |
| 1057 | ;; TODO if dbuff is non-nil, should we check for modifications | ||
| 1058 | ;; and offer to save it first? | ||
| 1057 | (if (file-exists-p diary-file) | 1059 | (if (file-exists-p diary-file) |
| 1058 | (if (file-readable-p diary-file) | 1060 | (if (file-readable-p diary-file) |
| 1059 | (progn | 1061 | (progn |
| 1060 | (mark-diary-entries) | 1062 | (mark-diary-entries) |
| 1061 | (kill-buffer (find-buffer-visiting diary-file))) | 1063 | (unless dbuff |
| 1064 | (kill-buffer (find-buffer-visiting diary-file)))) | ||
| 1062 | (beep) | 1065 | (beep) |
| 1063 | (message "Can't read included diary file %s" diary-file) | 1066 | (message "Can't read included diary file %s" diary-file) |
| 1064 | (sleep-for 2)) | 1067 | (sleep-for 2)) |