Mercurial > emacs
comparison lisp/calendar/timeclock.el @ 48224:0d0908b6b4cc
(timeclock-modeline-display): Use assq as well as memq to find
`global-mode-string' within `mode-line-format'. The structure of
that variable has changed in 21.3.
author | John Wiegley <johnw@newartisans.com> |
---|---|
date | Fri, 08 Nov 2002 20:28:55 +0000 |
parents | 9cead6e97a53 |
children | 0d8b17d428b5 |
comparison
equal
deleted
inserted
replaced
48223:2d1fe430cc35 | 48224:0d0908b6b4cc |
---|---|
271 (interactive "P") | 271 (interactive "P") |
272 (let ((on-p (if arg | 272 (let ((on-p (if arg |
273 (> (prefix-numeric-value arg) 0) | 273 (> (prefix-numeric-value arg) 0) |
274 (not timeclock-modeline-display)))) | 274 (not timeclock-modeline-display)))) |
275 (if on-p | 275 (if on-p |
276 (let ((list-entry (memq 'global-mode-string | 276 (let ((list-entry (or (memq 'global-mode-string mode-line-format) |
277 mode-line-format))) | 277 ;; In Emacs 21.3 we must use assq |
278 (assq 'global-mode-string mode-line-format)))) | |
278 (unless (or (null list-entry) | 279 (unless (or (null list-entry) |
279 (memq 'timeclock-mode-string mode-line-format)) | 280 (memq 'timeclock-mode-string mode-line-format)) |
280 (setcdr list-entry | 281 (setcdr list-entry (cons 'timeclock-mode-string |
281 (cons 'timeclock-mode-string | 282 (cdr list-entry)))) |
282 (cdr list-entry)))) | |
283 (unless (memq 'timeclock-update-modeline timeclock-event-hook) | 283 (unless (memq 'timeclock-update-modeline timeclock-event-hook) |
284 (add-hook 'timeclock-event-hook 'timeclock-update-modeline)) | 284 (add-hook 'timeclock-event-hook 'timeclock-update-modeline)) |
285 (when timeclock-update-timer | 285 (when timeclock-update-timer |
286 (cancel-timer timeclock-update-timer) | 286 (cancel-timer timeclock-update-timer) |
287 (setq timeclock-update-timer nil)) | 287 (setq timeclock-update-timer nil)) |