Commit f52e8e86 authored by Stefan Monnier's avatar Stefan Monnier
Browse files

(mark-diary-entries): Don't move point. Use with-syntax-table and dolist.

parent 23006f3e
2005-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
* calendar/diary-lib.el (mark-diary-entries): Don't move point.
Use with-syntax-table and dolist.
2005-09-16 Carsten Dominik <dominik@science.uva.nl>
 
* textmodes/reftex-auc.el:
......
......@@ -865,18 +865,15 @@ diary entries."
(let ((marking-diary-entries t)
file-glob-attrs marks)
(with-current-buffer (find-file-noselect (diary-check-diary-file) t)
(save-excursion
(setq mark-diary-entries-in-calendar t)
(message "Marking diary entries...")
(setq file-glob-attrs (nth 1 (diary-pull-attrs nil '())))
(let ((d diary-date-forms)
(old-diary-syntax-table (syntax-table))
temp)
(set-syntax-table diary-syntax-table)
(while d
(let* ((date-form (if (equal (car (car d)) 'backup)
(cdr (car d))
(car d)));; ignore 'backup directive
(dayname
(with-syntax-table diary-syntax-table
(dolist (date-form diary-date-forms)
(if (eq (car date-form) 'backup)
(setq date-form (cdr date-form))) ;; ignore 'backup directive
(let* ((dayname
(diary-name-pattern calendar-day-name-array
calendar-day-abbrev-array))
(monthname
......@@ -937,12 +934,11 @@ diary entries."
(+ y 100)
y)))
(string-to-number y-str)))))
(save-excursion
(setq entry (buffer-substring-no-properties
(let ((tmp (diary-pull-attrs (buffer-substring-no-properties
(point) (line-end-position))
temp (diary-pull-attrs entry file-glob-attrs)
entry (nth 0 temp)
marks (nth 1 temp)))
file-glob-attrs)))
(setq entry (nth 0 tmp)
marks (nth 1 tmp)))
(if dd-name
(mark-calendar-days-named
(cdr (assoc-string
......@@ -958,12 +954,10 @@ diary entries."
(calendar-make-alist
calendar-month-name-array
1 nil calendar-month-abbrev-array) t)))))
(mark-calendar-date-pattern mm dd yy marks))))
(setq d (cdr d))))
(mark-calendar-date-pattern mm dd yy marks))))))
(mark-sexp-diary-entries)
(run-hooks 'nongregorian-diary-marking-hook
'mark-diary-entries-hook)
(set-syntax-table old-diary-syntax-table)
'mark-diary-entries-hook))
(message "Marking diary entries...done")))))
(defun mark-sexp-diary-entries ()
......
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