Commit f165ac66 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(hscroll-minibuffer-hook): New function.

(hscroll-global-mode): Add and remove that hook.
Set hscroll-old-truncate-was-global's default value.
parent 191100f2
...@@ -196,20 +196,25 @@ will have no effect on it). ...@@ -196,20 +196,25 @@ will have no effect on it).
;; it was off ;; it was off
(progn (progn
(setq hscroll-old-truncate-default (default-value truncate-lines)) (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) (setq-default truncate-lines t)
(add-hook 'minibuffer-setup-hook 'hscroll-minibuffer-hook)
(setq hscroll-timer (setq hscroll-timer
(run-with-idle-timer 0 t 'hscroll-window-maybe)))) (run-with-idle-timer 0 t 'hscroll-window-maybe))))
;; turn it off ;; turn it off
(if hscroll-mode (if hscroll-mode
;; it was on ;; it was on
(progn (progn
(remove-hook 'minibuffer-setup-hook 'hscroll-minibuffer-hook)
(setq-default truncate-lines hscroll-old-truncate-default) (setq-default truncate-lines hscroll-old-truncate-default)
(cancel-timer hscroll-timer)))) (cancel-timer hscroll-timer))))
(setq-default hscroll-mode newmode) (setq-default hscroll-mode newmode)
(force-mode-line-update t))) (force-mode-line-update t)))
(defun hscroll-minibuffer-hook ()
(setq truncate-lines hscroll-old-truncate-default))
(defun hscroll-window-maybe () (defun hscroll-window-maybe ()
"Scroll horizontally if point is off or nearly off the edge of the window. "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 This is called automatically when in HScroll mode, but it can be explicitly
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment