From d52d95b40dd985745080571a32a0c904757cf493 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 13 Jun 2002 16:40:19 +0000 Subject: [PATCH] Some people customize mode-line-format... --- misc/ChangeLog | 6 ++++++ misc/po-mode.el | 8 ++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/misc/ChangeLog b/misc/ChangeLog index 8086fe7f0..8547dbcdb 100644 --- a/misc/ChangeLog +++ b/misc/ChangeLog @@ -1,3 +1,9 @@ +2002-06-13 Bruno Haible + + * 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 . + 2002-05-12 Bruno Haible * po-compat.el: Add ISO-8859-14, KOI8-T, GEORGIAN-PS to the list of diff --git a/misc/po-mode.el b/misc/po-mode.el index 6d957cda3..7fc9a0447 100644 --- a/misc/po-mode.el +++ b/misc/po-mode.el @@ -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." -- 2.47.2