# HG changeset patch # User Karl Heuer # Date 928521643 0 # Node ID 4bdc30f276286424089604cecd8dbd00be441ad6 # Parent adcead6b7ce148934b5ad8521cda2617fa73a6cf Don't change hooks on loading. (auto-show-mode): Autoload. Default to nil. Add :set &c. (auto-show-mode): Add to hooks here. diff -r adcead6b7ce1 -r 4bdc30f27628 lisp/auto-show.el --- a/lisp/auto-show.el Fri Jun 04 18:39:01 1999 +0000 +++ b/lisp/auto-show.el Fri Jun 04 18:40:43 1999 +0000 @@ -1,7 +1,7 @@ ;;; auto-show.el --- perform automatic horizontal scrolling as point moves ;;; This file is in the public domain. -;;; Keywords: scroll display minor-mode +;;; Keywords: scroll display convenience ;;; Author: Pete Ware ;;; Maintainer: FSF @@ -41,13 +41,19 @@ "Perform automatic horizontal scrolling as point moves." :group 'editing) -(defcustom auto-show-mode t - "*Non-nil enables automatic horizontal scrolling, when lines are truncated. -The default value is t. To change the default, do this: - (set-default 'auto-show-mode nil) -See also command `auto-show-mode'. -This variable has no effect when lines are not being truncated. -This variable is automatically local in each buffer where it is set." +;;;###autoload +(defcustom auto-show-mode nil + "Non-nil means do automatic horizontal scrolling, when lines are truncated. + +This variable is automatically local in each buffer where it is set. + +Setting this variable directly does not take effect; +use either \\[customize] or the function `auto-show-mode'." + :set (lambda (symbol value) (auto-show mode value)) + :require 'auto-show + :initialize 'custom-initialize-default + :link '(emacs-commentary-link "auto-show.el") + :version "20.4" :type 'boolean :group 'auto-show) @@ -81,7 +87,13 @@ (setq auto-show-mode (if (null arg) (not auto-show-mode) - (> (prefix-numeric-value arg) 0)))) + (> (prefix-numeric-value arg) 0))) + (when auto-show-mode + ;; Do auto-scrolling after commands. + (add-hook 'post-command-hook 'auto-show-make-point-visible) + ;; Do auto-scrolling in comint buffers after process output also. + (add-hook 'comint-output-filter-functions + 'auto-show-make-point-visible t))) (defun auto-show-make-point-visible (&optional ignore-arg) "Scroll horizontally to make point visible, if that is enabled. @@ -107,19 +119,7 @@ (and (= col right-col) (not (eolp)))) (scroll-left (+ auto-show-shift-amount - (- col (+ scroll w-width)))) - ) - ) - ) - ) - ) - ) - -;; Do auto-scrolling after commands. -(add-hook 'post-command-hook 'auto-show-make-point-visible) - -;; Do auto-scrolling in comint buffers after process output also. -(add-hook 'comint-output-filter-functions 'auto-show-make-point-visible t) + (- col (+ scroll w-width)))))))))) (provide 'auto-show)