From: Juanma Barranquero Date: Sat, 23 Jun 2007 10:45:01 +0000 (+0000) Subject: (ruler-mode): Prevent clobbering the original `header-line-format' X-Git-Tag: emacs-pretest-22.1.90~1325 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5a70dca3a42542951a9095b2f0d5a4f3aaba8f73;p=emacs.git (ruler-mode): Prevent clobbering the original `header-line-format' when reentering ruler mode. --- diff --git a/lisp/ruler-mode.el b/lisp/ruler-mode.el index b2c48349a05..13895aea2eb 100644 --- a/lisp/ruler-mode.el +++ b/lisp/ruler-mode.el @@ -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 @@ Call `ruler-mode-ruler-function' to compute the ruler value.") (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)