Commit 16712304 authored by Glenn Morris's avatar Glenn Morris

When marking, visit included diary-files in temp buffers.

Ref: bug#8920, but not a bug.

* lisp/calendar/diary-lib.el (diary-mark-entries)
Visit included diary-files in temp buffers.
parent 1a5db1f4
2011-06-25 Glenn Morris <>
* calendar/diary-lib.el (diary-mark-entries)
Visit included diary-files in temp buffers.
* progmodes/f90.el (f90-keywords-re, f90-font-lock-keywords-1)
(f90-blocks-re, f90-program-block-re, f90-end-block-re)
(f90-start-block-re, f90-imenu-generic-expression)
......@@ -1405,22 +1405,36 @@ marks. This is intended to deal with deleted diary entries."
(setq calendar-mark-diary-entries-flag nil)
(let ((diary-marking-entries-flag t)
(with-current-buffer (find-file-noselect (diary-check-diary-file) t)
(when (eq major-mode (default-value 'major-mode)) (diary-mode))
(diary-buffer (find-buffer-visiting diary-file))
;; Dynamically bound in diary-mark-included-diary-files.
(d-incp (and (boundp 'diary-including) diary-including))
file-glob-attrs temp-buff)
(unless d-incp
(message "Marking diary entries..."))
(with-current-buffer (or diary-buffer
(if d-incp
(setq temp-buff (generate-new-buffer
" *diary-temp*"))
(diary-check-diary-file) t)))
(if temp-buff
;; If including, caller has already verified it is readable.
(insert-file-contents diary-file)
(if (eq major-mode (default-value 'major-mode)) (diary-mode)))
(setq calendar-mark-diary-entries-flag t)
(message "Marking diary entries...")
(setq file-glob-attrs (nth 1 (diary-pull-attrs nil '())))
(with-syntax-table diary-syntax-table
(diary-mark-entries-1 'calendar-mark-date-pattern)
;; Although it looks like mark-entries-hook runs every time,
;; diary-mark-included-diary-files binds it to nil
;; (essentially) when it runs in included files.
(run-hooks 'diary-nongregorian-marking-hook
(message "Marking diary entries...done")))))
(and temp-buff (buffer-name temp-buff) (kill-buffer temp-buff)))
(or d-incp (message "Marking diary entries...done"))))
(define-obsolete-function-alias 'mark-diary-entries 'diary-mark-entries "23.1")
......@@ -1514,15 +1528,12 @@ See also `diary-include-other-diary-files'."
(while (re-search-forward
(format "^%s \"\\([^\"]*\\)\"" (regexp-quote diary-include-string))
nil t)
(let* ((diary-file (match-string-no-properties 1))
(let ((diary-file (match-string-no-properties 1))
(diary-mark-entries-hook 'diary-mark-included-diary-files)
(dbuff (find-buffer-visiting diary-file)))
(diary-including t))
(if (file-exists-p diary-file)
(if (file-readable-p diary-file)
(unless dbuff
(kill-buffer (find-buffer-visiting diary-file))))
(message "Can't read included diary file %s" diary-file)
(sleep-for 2))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment