summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1999-07-09 18:00:24 +0000
committerRichard M. Stallman <rms@gnu.org>1999-07-09 18:00:24 +0000
commitf165ac6642751893b53f5c8e9ebaddb9fe3e20a9 (patch)
treee6e142c1b17db7414f5dd1265bd04b0485678cfe
parent191100f2aa7d0cffac2ab6ba91ae634e7e3f9c65 (diff)
downloademacs-f165ac6642751893b53f5c8e9ebaddb9fe3e20a9.tar.gz
(hscroll-minibuffer-hook): New function.
(hscroll-global-mode): Add and remove that hook. Set hscroll-old-truncate-was-global's default value.
-rw-r--r--lisp/hscroll.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/hscroll.el b/lisp/hscroll.el
index 04c582fbee1..1afce940556 100644
--- a/lisp/hscroll.el
+++ b/lisp/hscroll.el
@@ -196,20 +196,25 @@ will have no effect on it).
;; 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