]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Some people customize mode-line-format...
authorBruno Haible <bruno@clisp.org>
Thu, 13 Jun 2002 16:40:19 +0000 (16:40 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:08:36 +0000 (12:08 +0200)
misc/ChangeLog
misc/po-mode.el

index 8086fe7f0009b3f9403d130f78fea6dcb9284477..8547dbcdbece215b3ef3acda5c836f51dd22e9c0 100644 (file)
@@ -1,3 +1,9 @@
+2002-06-13  Bruno Haible  <bruno@clisp.org>
+
+       * po-mode.el (po-mode-line-entry...): Try harder to find a good place
+       for adding po-mode-line-entry into mode-line-format.
+       Reported by Sam Steingold <sds@gnu.org>.
+
 2002-05-12  Bruno Haible  <bruno@clisp.org>
 
        * po-compat.el: Add ISO-8859-14, KOI8-T, GEORGIAN-PS to the list of
index 6d957cda329202db7171b9a524da3500bc0841a6..7fc9a0447cb50464fe75c14b33042d82b3b6d1ea 100644 (file)
@@ -1094,8 +1094,12 @@ all reachable through 'M-x customize', in group 'Emacs.Editing.I18n.Po'."
 
 ;; Insert MODE-LINE-ENTRY in mode line, but on first load only.
 (or (member po-mode-line-entry mode-line-format)
-    (let ((entry (member 'global-mode-string mode-line-format)))
-      (setcdr entry (cons po-mode-line-entry (cdr entry)))))
+    ; mode-line-format usually contains global-mode-string, but some
+    ; people customize this variable. As a last resort, append at the end.
+    (let ((prev-entry (or (member 'global-mode-string mode-line-format)
+                          (member "   " mode-line-format)
+                          (last mode-line-format))))
+      (setcdr prev-entry (cons po-mode-line-entry (cdr prev-entry)))))
 
 (defun po-update-mode-line-string ()
   "Compute a new statistics string to display in mode line."