]> git.eshelyaron.com Git - emacs.git/commitdiff
(timeclock-modeline-display): Use assq as well as memq to find
authorJohn Wiegley <johnw@newartisans.com>
Fri, 8 Nov 2002 20:28:55 +0000 (20:28 +0000)
committerJohn Wiegley <johnw@newartisans.com>
Fri, 8 Nov 2002 20:28:55 +0000 (20:28 +0000)
`global-mode-string' within `mode-line-format'.  The structure of
that variable has changed in 21.3.

lisp/calendar/timeclock.el

index db679b8d55e5c6c4d6d207ed3f62626d4d8b9c15..ced48e6fe384ebf262f782365bcd2c4a73a93680 100644 (file)
@@ -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