comparison lisp/auto-show.el @ 412:697ef44129c6 r21-2-14

Import from CVS: tag r21-2-14
author cvs
date Mon, 13 Aug 2007 11:20:41 +0200
parents 74fd4e045ea6
children 11054d720c21
comparison
equal deleted inserted replaced
411:12e008d41344 412:697ef44129c6
89 "*Threshold column for automatic horizontal scrolling to the right. 89 "*Threshold column for automatic horizontal scrolling to the right.
90 If point is before this column, we try to scroll to make the left margin 90 If point is before this column, we try to scroll to make the left margin
91 visible. Setting this to 0 disables this feature." 91 visible. Setting this to 0 disables this feature."
92 :type 'number 92 :type 'number
93 :group 'auto-show) 93 :group 'auto-show)
94
95 (defun auto-show-truncationp ()
96 "True if line truncation is enabled for the selected window."
97 ;; XEmacs change (use specifiers)
98 ;; ### There should be a more straightforward way to do this from elisp.
99 (or truncate-lines
100 (and truncate-partial-width-windows
101 (< (+ (window-width)
102 (specifier-instance left-margin-width)
103 (specifier-instance right-margin-width))
104 (frame-width)))))
94 105
95 (defun auto-show-mode (arg) 106 (defun auto-show-mode (arg)
96 "Turn automatic horizontal scroll mode on or off. 107 "Turn automatic horizontal scroll mode on or off.
97 With arg, turn auto scrolling on if arg is positive, off otherwise. 108 With arg, turn auto scrolling on if arg is positive, off otherwise.
98 This mode is enabled or disabled for each buffer individually. 109 This mode is enabled or disabled for each buffer individually.
115 "Commands that inhibit auto-show behavior. 126 "Commands that inhibit auto-show behavior.
116 This normally includes the horizontal scrollbar commands.") 127 This normally includes the horizontal scrollbar commands.")
117 128
118 ;; XEmacs addition: 129 ;; XEmacs addition:
119 (defun auto-show-should-take-action-p () 130 (defun auto-show-should-take-action-p ()
120 (and auto-show-mode (window-truncated-p) 131 (and auto-show-mode (auto-show-truncationp)
121 (equal (window-buffer) (current-buffer)) 132 (equal (window-buffer) (current-buffer))
122 (not (memq this-command auto-show-inhibiting-commands)))) 133 (not (memq this-command auto-show-inhibiting-commands))))
123 134
124 ;; XEmacs addition: 135 ;; XEmacs addition:
125 (defun auto-show-make-region-visible (start end) 136 (defun auto-show-make-region-visible (start end)