annotate lisp/auto-show.el @ 267:966663fcf606 r20-5b32

Import from CVS: tag r20-5b32
author cvs
date Mon, 13 Aug 2007 10:26:29 +0200
parents 41ff10fd062f
children 70ad99077275
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1 ;;; auto-show.el --- perform automatic horizontal scrolling as point moves
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
2
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
3 ;; Copyright (C) 1997 Free Software Foundation, Inc.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
4 ;; This file is in the public domain.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
5
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
6 ;; Author: Pete Ware <ware@cis.ohio-state.edu>
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
7 ;; Maintainer: XEmacs Development Team
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
8 ;; Keywords: extensions, internal, dumped
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
9
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
10 ;; This file is part of XEmacs.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
11
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
12 ;; XEmacs is free software; you can redistribute it and/or modify it
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
13 ;; under the terms of the GNU General Public License as published by
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
14 ;; the Free Software Foundation; either version 2, or (at your option)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
15 ;; any later version.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
16
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
17 ;; XEmacs is distributed in the hope that it will be useful, but
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
20 ;; General Public License for more details.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
21
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
22 ;; You should have received a copy of the GNU General Public License
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
23 ;; along with XEmacs; see the file COPYING. If not, write to the Free
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
24 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
25 ;; 02111-1307, USA.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
26
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
27 ;;; Synched up with: Emacs/Mule zeta.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
28
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
29 ;;; Commentary:
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
30
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
31 ;; This file is dumped with XEmacs.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
32
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
33 ;; Modified by: Ben Wing <wing@666.com>
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
34
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
35 ;; This file provides functions that
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
36 ;; automatically scroll the window horizontally when the point moves
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
37 ;; off the left or right side of the window.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
38
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
39 ;; Once this library is loaded, automatic horizontal scrolling
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
40 ;; occurs whenever long lines are being truncated.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
41 ;; To request truncation of long lines, set the variable
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
42 ;; Setting the variable `truncate-lines' to non-nil.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
43 ;; You can do this for all buffers as follows:
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
44 ;;
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
45 ;; (set-default 'truncate-lines t)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
46
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
47 ;; Here is how to do it for C mode only:
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
48 ;;
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
49 ;; (set-default 'truncate-lines nil) ; this is the original value
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
50 ;; (defun my-c-mode-hook ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
51 ;; "Run when C-mode starts up. Changes ..."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
52 ;; ... set various personal preferences ...
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
53 ;; (setq truncate-lines t))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
54 ;; (add-hook 'c-mode-hook 'my-c-mode-hook)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
55 ;;
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
56 ;;
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
57 ;; As a finer level of control, you can still have truncated lines but
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
58 ;; without the automatic horizontal scrolling by setting the buffer
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
59 ;; local variable `auto-show-mode' to nil. The default value is t.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
60 ;; The command `auto-show-mode' toggles the value of the variable
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
61 ;; `auto-show-mode'.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
62
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
63 ;;; Code:
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
64
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
65 (defgroup auto-show nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
66 "Perform automatic horizontal scrolling as point moves."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
67 :group 'display
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
68 :group 'extensions)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
69
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
70 ;; This is preloaded, so we don't need special :set, :require, etc.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
71 (defcustom auto-show-mode t
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
72 "*Non-nil enables automatic horizontal scrolling, when lines are truncated.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
73 The default value is t. To change the default, do this:
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
74 (set-default 'auto-show-mode nil)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
75 See also command `auto-show-mode'.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
76 This variable has no effect when lines are not being truncated.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
77 This variable is automatically local in each buffer where it is set."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
78 :type 'boolean
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
79 :group 'auto-show)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
80
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
81 (make-variable-buffer-local 'auto-show-mode)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
82
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
83 (defcustom auto-show-shift-amount 8
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
84 "*Extra columns to scroll. for automatic horizontal scrolling."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
85 :type 'integer
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
86 :group 'auto-show)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
87
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
88 (defcustom auto-show-show-left-margin-threshold 50
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
89 "*Threshold column for automatic horizontal scrolling to the right.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
90 If point is before this column, we try to scroll to make the left margin
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
91 visible. Setting this to 0 disables this feature."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
92 :type 'number
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
93 :group 'auto-show)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
94
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
95 (defun auto-show-truncationp ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
96 "True if line truncation is enabled for the selected window."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
97 ;; XEmacs change (use specifiers)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
98 ;; ### There should be a more straightforward way to do this from elisp.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
99 (or truncate-lines
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
100 (and truncate-partial-width-windows
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
101 (< (+ (window-width)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
102 (specifier-instance left-margin-width)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
103 (specifier-instance right-margin-width))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
104 (frame-width)))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
105
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
106 (defun auto-show-mode (arg)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
107 "Turn automatic horizontal scroll mode on or off.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
108 With arg, turn auto scrolling on if arg is positive, off otherwise.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
109 This mode is enabled or disabled for each buffer individually.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
110 It takes effect only when `truncate-lines' is non-nil."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
111 (interactive "P")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
112 (setq auto-show-mode
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
113 (if (null arg)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
114 (not auto-show-mode)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
115 (> (prefix-numeric-value arg) 0))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
116
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
117 ;; XEmacs addition:
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
118 (defvar auto-show-inhibiting-commands
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
119 '(scrollbar-char-left
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
120 scrollbar-char-right
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
121 scrollbar-page-left
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
122 scrollbar-page-right
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
123 scrollbar-to-left
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
124 scrollbar-to-right
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
125 scrollbar-horizontal-drag)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
126 "Commands that inhibit auto-show behavior.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
127 This normally includes the horizontal scrollbar commands.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
128
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
129 ;; XEmacs addition:
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
130 (defun auto-show-should-take-action-p ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
131 (and auto-show-mode (auto-show-truncationp)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
132 (equal (window-buffer) (current-buffer))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
133 (not (memq this-command auto-show-inhibiting-commands))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
134
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
135 ;; XEmacs addition:
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
136 (defun auto-show-make-region-visible (start end)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
137 "Move point in such a way that the region (START, END) is visible.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
138 This only does anything if auto-show-mode is enabled, and it doesn't
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
139 actually do any horizontal scrolling; rather, it just sets things up so
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
140 that the region will be visible when `auto-show-make-point-visible'
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
141 is next called (this happens after every command)."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
142 (if (auto-show-should-take-action-p)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
143 (let* ((col (current-column)) ;column on line point is at
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
144 (scroll (window-hscroll));how far window is scrolled
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
145 (w-width (- (window-width)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
146 (if (> scroll 0)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
147 2 1))) ;how wide window is on the screen
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
148 (right-col (+ scroll w-width))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
149 (start-col (save-excursion (goto-char start) (current-column)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
150 (end-col (save-excursion (goto-char end) (current-column))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
151 (cond ((and (>= start-col scroll)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
152 (<= end-col right-col))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
153 ;; already completely visible
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
154 nil)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
155 ((< start-col scroll)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
156 (scroll-right (- scroll start-col)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
157 (t
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
158 (scroll-left (- end-col right-col)))))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
159
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
160 (defun auto-show-make-point-visible (&optional ignore-arg)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
161 "Scroll horizontally to make point visible, if that is enabled.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
162 This function only does something if `auto-show-mode' is non-nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
163 and longlines are being truncated in the selected window.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
164 See also the command `auto-show-mode'."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
165 (interactive)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
166 ;; XEmacs change
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
167 (if (auto-show-should-take-action-p)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
168 (let* ((col (current-column)) ;column on line point is at
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
169 (scroll (window-hscroll)) ;how far window is scrolled
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
170 (w-width (- (window-width)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
171 (if (> scroll 0)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
172 2 1))) ;how wide window is on the screen
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
173 (right-col (+ scroll w-width)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
174 (if (and (< col auto-show-show-left-margin-threshold)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
175 (< col (window-width))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
176 (> scroll 0))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
177 (scroll-right scroll)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
178 (if (< col scroll) ;to the left of the screen
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
179 (scroll-right (+ (- scroll col) auto-show-shift-amount))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
180 (if (or (> col right-col) ;to the right of the screen
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
181 (and (= col right-col)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
182 (not (eolp))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
183 (scroll-left (+ auto-show-shift-amount
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
184 (- col (+ scroll w-width))))))))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
185
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
186 ;; XEmacs change:
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
187 ;; #### instead of this, we kludgily call it from the C code, to make sure
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
188 ;; that it's done after any other things on post-command-hook (which might
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
189 ;; move point).
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
190 ;; Do auto-scrolling after commands.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
191 ;;(add-hook 'post-command-hook 'auto-show-make-point-visible)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
192
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
193 ;; If being dumped, turn it on right away.
267
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 209
diff changeset
194 (when (boundp 'pureload)
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
195 (auto-show-mode 1))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
196
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
197 ;; Do auto-scrolling in comint buffers after process output also.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
198 ; XEmacs -- don't do this now, it messes up comint.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
199 ;(add-hook 'comint-output-filter-functions 'auto-show-make-point-visible t)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
200
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
201 (provide 'auto-show)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
202
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
203 ;;; auto-show.el ends here