changeset 24939:db6ed843d5e8

(hscroll-minibuffer-hook): New function. (hscroll-global-mode): Add and remove that hook. Set hscroll-old-truncate-was-global's default value.
author Richard M. Stallman <rms@gnu.org>
date Fri, 09 Jul 1999 18:00:24 +0000
parents a4c871b96d4b
children ca83292ec6f2
files lisp/hscroll.el
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/hscroll.el	Fri Jul 09 13:38:11 1999 +0000
+++ b/lisp/hscroll.el	Fri Jul 09 18:00:24 1999 +0000
@@ -196,20 +196,25 @@
 	    ;; it was off
 	    (progn
 	      (setq hscroll-old-truncate-default (default-value truncate-lines))
-	      (setq hscroll-old-truncate-was-global t)
+	      (setq-default hscroll-old-truncate-was-global t)
 	      (setq-default truncate-lines t)
+	      (add-hook 'minibuffer-setup-hook 'hscroll-minibuffer-hook)
               (setq hscroll-timer
                     (run-with-idle-timer 0 t 'hscroll-window-maybe))))
       ;; turn it off
       (if hscroll-mode
 	  ;; it was on
 	  (progn
+	    (remove-hook 'minibuffer-setup-hook 'hscroll-minibuffer-hook)
 	    (setq-default truncate-lines hscroll-old-truncate-default)
             (cancel-timer hscroll-timer))))
 
     (setq-default hscroll-mode newmode)
     (force-mode-line-update t)))
 
+(defun hscroll-minibuffer-hook ()
+  (setq truncate-lines hscroll-old-truncate-default))
+
 (defun hscroll-window-maybe ()
   "Scroll horizontally if point is off or nearly off the edge of the window.
 This is called automatically when in HScroll mode, but it can be explicitly