From: John Wiegley Date: Fri, 8 Nov 2002 20:28:55 +0000 (+0000) Subject: (timeclock-modeline-display): Use assq as well as memq to find X-Git-Tag: ttn-vms-21-2-B4~12537 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=dc0868e1ce1417f5e8b542144ff7db3b0ad6bf81;p=emacs.git (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. --- diff --git a/lisp/calendar/timeclock.el b/lisp/calendar/timeclock.el index db679b8d55e..ced48e6fe38 100644 --- a/lisp/calendar/timeclock.el +++ b/lisp/calendar/timeclock.el @@ -273,13 +273,13 @@ positive. Returns the new status of timeclock modeline display (> (prefix-numeric-value arg) 0) (not timeclock-modeline-display)))) (if on-p - (let ((list-entry (memq 'global-mode-string - mode-line-format))) + (let ((list-entry (or (memq 'global-mode-string mode-line-format) + ;; In Emacs 21.3 we must use assq + (assq 'global-mode-string mode-line-format)))) (unless (or (null list-entry) (memq 'timeclock-mode-string mode-line-format)) - (setcdr list-entry - (cons 'timeclock-mode-string - (cdr list-entry)))) + (setcdr list-entry (cons 'timeclock-mode-string + (cdr list-entry)))) (unless (memq 'timeclock-update-modeline timeclock-event-hook) (add-hook 'timeclock-event-hook 'timeclock-update-modeline)) (when timeclock-update-timer