comparison lisp/calendar/diary-lib.el @ 52412:58f90e8a7543

(diary-header-line-flag, diary-header-line-format): New variables. (list-diary-entries): Use them to set header line in simple diary.
author Glenn Morris <rgm@gnu.org>
date Tue, 02 Sep 2003 17:37:48 +0000
parents 695cf19ef79e
children 65fe9b0d6ac6 375f2633d815
comparison
equal deleted inserted replaced
52411:9db479d16349 52412:58f90e8a7543
256 (setq ret-attr (append ret-attr (list attrname attrvalue)))) 256 (setq ret-attr (append ret-attr (list attrname attrvalue))))
257 (setq attr-list (cdr attr-list))))) 257 (setq attr-list (cdr attr-list)))))
258 (list entry ret-attr)))) 258 (list entry ret-attr))))
259 259
260 260
261 ;; This can be removed once the kill/yank treatment of invisible text
262 ;; (see etc/TODO) is fixed. -- gm
263 (defcustom diary-header-line-flag t
264 "*If non-nil, `simple-diary-display' will show a header line.
265 The format of the header is specified by `diary-header-line-format'."
266 :group 'diary
267 :type 'boolean
268 :version "21.4")
269
270 (defcustom diary-header-line-format
271 '(:eval (calendar-string-spread
272 (list (if selective-display
273 "Selective display active - press \"s\" in calendar \
274 before edit/copy"
275 "Diary"))
276 ?\ (frame-width)))
277 "*Format of the header line displayed by `simple-diary-display'.
278 Only used if `diary-header-line-flag' is non-nil."
279 :group 'diary
280 :type 'sexp
281 :version "21.4")
261 282
262 (defun list-diary-entries (date number) 283 (defun list-diary-entries (date number)
263 "Create and display a buffer containing the relevant lines in diary-file. 284 "Create and display a buffer containing the relevant lines in diary-file.
264 The arguments are DATE and NUMBER; the entries selected are those 285 The arguments are DATE and NUMBER; the entries selected are those
265 for NUMBER days starting with date DATE. The other entries are hidden 286 for NUMBER days starting with date DATE. The other entries are hidden
309 (or (verify-visited-file-modtime diary-buffer) 330 (or (verify-visited-file-modtime diary-buffer)
310 (revert-buffer t t)))) 331 (revert-buffer t t))))
311 (setq file-glob-attrs (nth 1 (diary-pull-attrs nil ""))) 332 (setq file-glob-attrs (nth 1 (diary-pull-attrs nil "")))
312 (setq selective-display t) 333 (setq selective-display t)
313 (setq selective-display-ellipses nil) 334 (setq selective-display-ellipses nil)
335 (if diary-header-line-flag
336 (setq header-line-format diary-header-line-format))
314 (setq old-diary-syntax-table (syntax-table)) 337 (setq old-diary-syntax-table (syntax-table))
315 (set-syntax-table diary-syntax-table) 338 (set-syntax-table diary-syntax-table)
316 (unwind-protect 339 (unwind-protect
317 (let ((buffer-read-only nil) 340 (let ((buffer-read-only nil)
318 (diary-modified (buffer-modified-p)) 341 (diary-modified (buffer-modified-p))