diff options
| author | Glenn Morris | 2011-06-25 15:10:21 -0700 |
|---|---|---|
| committer | Glenn Morris | 2011-06-25 15:10:21 -0700 |
| commit | 1671230453d124ab684dca74c0ffb8e99304c79f (patch) | |
| tree | 5e163e6b9bbd371023e6721f5e9b9be029fb939b | |
| parent | 1a5db1f412d0c8e1ab7a50b84d3510bb0b74701b (diff) | |
| download | emacs-1671230453d124ab684dca74c0ffb8e99304c79f.tar.gz emacs-1671230453d124ab684dca74c0ffb8e99304c79f.zip | |
When marking, visit included diary-files in temp buffers.
Ref: bug#8920, but not a bug.
* lisp/calendar/diary-lib.el (diary-mark-entries)
(diary-mark-included-diary-files):
Visit included diary-files in temp buffers.
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/calendar/diary-lib.el | 57 |
2 files changed, 38 insertions, 23 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a86a20fc737..19ec366de71 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | 2011-06-25 Glenn Morris <rgm@gnu.org> | 1 | 2011-06-25 Glenn Morris <rgm@gnu.org> |
| 2 | 2 | ||
| 3 | * calendar/diary-lib.el (diary-mark-entries) | ||
| 4 | (diary-mark-included-diary-files): | ||
| 5 | Visit included diary-files in temp buffers. | ||
| 6 | |||
| 3 | * progmodes/f90.el (f90-keywords-re, f90-font-lock-keywords-1) | 7 | * progmodes/f90.el (f90-keywords-re, f90-font-lock-keywords-1) |
| 4 | (f90-blocks-re, f90-program-block-re, f90-end-block-re) | 8 | (f90-blocks-re, f90-program-block-re, f90-end-block-re) |
| 5 | (f90-start-block-re, f90-imenu-generic-expression) | 9 | (f90-start-block-re, f90-imenu-generic-expression) |
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index f21247e9c93..0b0d05a8fc0 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el | |||
| @@ -1405,22 +1405,36 @@ marks. This is intended to deal with deleted diary entries." | |||
| 1405 | (setq calendar-mark-diary-entries-flag nil) | 1405 | (setq calendar-mark-diary-entries-flag nil) |
| 1406 | (calendar-redraw)) | 1406 | (calendar-redraw)) |
| 1407 | (let ((diary-marking-entries-flag t) | 1407 | (let ((diary-marking-entries-flag t) |
| 1408 | file-glob-attrs) | 1408 | (diary-buffer (find-buffer-visiting diary-file)) |
| 1409 | (with-current-buffer (find-file-noselect (diary-check-diary-file) t) | 1409 | ;; Dynamically bound in diary-mark-included-diary-files. |
| 1410 | (save-excursion | 1410 | (d-incp (and (boundp 'diary-including) diary-including)) |
| 1411 | (when (eq major-mode (default-value 'major-mode)) (diary-mode)) | 1411 | file-glob-attrs temp-buff) |
| 1412 | (setq calendar-mark-diary-entries-flag t) | 1412 | (unless d-incp |
| 1413 | (message "Marking diary entries...") | 1413 | (message "Marking diary entries...")) |
| 1414 | (setq file-glob-attrs (nth 1 (diary-pull-attrs nil '()))) | 1414 | (unwind-protect |
| 1415 | (with-syntax-table diary-syntax-table | 1415 | (with-current-buffer (or diary-buffer |
| 1416 | (diary-mark-entries-1 'calendar-mark-date-pattern) | 1416 | (if d-incp |
| 1417 | (diary-mark-sexp-entries) | 1417 | (setq temp-buff (generate-new-buffer |
| 1418 | ;; Although it looks like mark-entries-hook runs every time, | 1418 | " *diary-temp*")) |
| 1419 | ;; diary-mark-included-diary-files binds it to nil | 1419 | (find-file-noselect |
| 1420 | ;; (essentially) when it runs in included files. | 1420 | (diary-check-diary-file) t))) |
| 1421 | (run-hooks 'diary-nongregorian-marking-hook | 1421 | (if temp-buff |
| 1422 | 'diary-mark-entries-hook)) | 1422 | ;; If including, caller has already verified it is readable. |
| 1423 | (message "Marking diary entries...done"))))) | 1423 | (insert-file-contents diary-file) |
| 1424 | (if (eq major-mode (default-value 'major-mode)) (diary-mode))) | ||
| 1425 | (setq calendar-mark-diary-entries-flag t) | ||
| 1426 | (setq file-glob-attrs (nth 1 (diary-pull-attrs nil '()))) | ||
| 1427 | (with-syntax-table diary-syntax-table | ||
| 1428 | (save-excursion | ||
| 1429 | (diary-mark-entries-1 'calendar-mark-date-pattern) | ||
| 1430 | (diary-mark-sexp-entries) | ||
| 1431 | ;; Although it looks like mark-entries-hook runs every time, | ||
| 1432 | ;; diary-mark-included-diary-files binds it to nil | ||
| 1433 | ;; (essentially) when it runs in included files. | ||
| 1434 | (run-hooks 'diary-nongregorian-marking-hook | ||
| 1435 | 'diary-mark-entries-hook)))) | ||
| 1436 | (and temp-buff (buffer-name temp-buff) (kill-buffer temp-buff))) | ||
| 1437 | (or d-incp (message "Marking diary entries...done")))) | ||
| 1424 | 1438 | ||
| 1425 | ;;;###cal-autoload | 1439 | ;;;###cal-autoload |
| 1426 | (define-obsolete-function-alias 'mark-diary-entries 'diary-mark-entries "23.1") | 1440 | (define-obsolete-function-alias 'mark-diary-entries 'diary-mark-entries "23.1") |
| @@ -1514,15 +1528,12 @@ See also `diary-include-other-diary-files'." | |||
| 1514 | (while (re-search-forward | 1528 | (while (re-search-forward |
| 1515 | (format "^%s \"\\([^\"]*\\)\"" (regexp-quote diary-include-string)) | 1529 | (format "^%s \"\\([^\"]*\\)\"" (regexp-quote diary-include-string)) |
| 1516 | nil t) | 1530 | nil t) |
| 1517 | (let* ((diary-file (match-string-no-properties 1)) | 1531 | (let ((diary-file (match-string-no-properties 1)) |
| 1518 | (diary-mark-entries-hook 'diary-mark-included-diary-files) | 1532 | (diary-mark-entries-hook 'diary-mark-included-diary-files) |
| 1519 | (dbuff (find-buffer-visiting diary-file))) | 1533 | (diary-including t)) |
| 1520 | (if (file-exists-p diary-file) | 1534 | (if (file-exists-p diary-file) |
| 1521 | (if (file-readable-p diary-file) | 1535 | (if (file-readable-p diary-file) |
| 1522 | (progn | 1536 | (diary-mark-entries) |
| 1523 | (diary-mark-entries) | ||
| 1524 | (unless dbuff | ||
| 1525 | (kill-buffer (find-buffer-visiting diary-file)))) | ||
| 1526 | (beep) | 1537 | (beep) |
| 1527 | (message "Can't read included diary file %s" diary-file) | 1538 | (message "Can't read included diary file %s" diary-file) |
| 1528 | (sleep-for 2)) | 1539 | (sleep-for 2)) |