changeset 81582:68188e8fcdd8

(ruler-mode): Prevent clobbering the original `header-line-format' when reentering ruler mode.
author Juanma Barranquero <lekktu@gmail.com>
date Sat, 23 Jun 2007 10:19:39 +0000
parents 899006b22947
children b31da370880d
files lisp/ruler-mode.el
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ruler-mode.el	Sat Jun 23 10:05:57 2007 +0000
+++ b/lisp/ruler-mode.el	Sat Jun 23 10:19:39 2007 +0000
@@ -29,7 +29,7 @@
 ;;; Commentary:
 
 ;; This library provides a minor mode to display a ruler in the header
-;; line.  It works only on Emacs 21.
+;; line.  It works from Emacs 21 onwards.
 ;;
 ;; You can use the mouse to change the `fill-column' `comment-column',
 ;; `goal-column', `window-margins' and `tab-stop-list' settings:
@@ -562,7 +562,8 @@
       (progn
         ;; When `ruler-mode' is on save previous header line format
         ;; and install the ruler header line format.
-        (when (local-variable-p 'header-line-format)
+        (when (and (local-variable-p 'header-line-format)
+		   (not (local-variable-p 'ruler-mode-header-line-format-old)))
           (set (make-local-variable 'ruler-mode-header-line-format-old)
                header-line-format))
         (setq header-line-format ruler-mode-header-line-format)