diff options
| author | Kim F. Storm | 2005-02-19 23:30:29 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2005-02-19 23:30:29 +0000 |
| commit | ed02c1db47526136acacefde75ac09e525f20337 (patch) | |
| tree | 8990f4efcde9e8ca081079b78f0852c5a1b0e622 | |
| parent | 0fba9f25f220fb815c285a78cffc0cee87a8ba79 (diff) | |
| download | emacs-ed02c1db47526136acacefde75ac09e525f20337.tar.gz emacs-ed02c1db47526136acacefde75ac09e525f20337.zip | |
(line-move): Add fourth optional arg try-vscroll which
must be set to perform auto-window-vscroll.
When moving backwards and doing auto-window-vscroll, automatically
vscroll to the last part of lines which are taller than the window.
(next-line, previous-line): Set try-vscroll arg on line-move.
| -rw-r--r-- | lisp/simple.el | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index 3f3c41422a1..3d3178888bc 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -3158,12 +3158,12 @@ and more reliable (no dependence on goal column, etc.)." | |||
| 3158 | (let ((abbrev-mode nil)) | 3158 | (let ((abbrev-mode nil)) |
| 3159 | (end-of-line) | 3159 | (end-of-line) |
| 3160 | (insert "\n")) | 3160 | (insert "\n")) |
| 3161 | (line-move arg)) | 3161 | (line-move arg nil nil t)) |
| 3162 | (if (interactive-p) | 3162 | (if (interactive-p) |
| 3163 | (condition-case nil | 3163 | (condition-case nil |
| 3164 | (line-move arg) | 3164 | (line-move arg nil nil t) |
| 3165 | ((beginning-of-buffer end-of-buffer) (ding))) | 3165 | ((beginning-of-buffer end-of-buffer) (ding))) |
| 3166 | (line-move arg))) | 3166 | (line-move arg nil nil t))) |
| 3167 | nil) | 3167 | nil) |
| 3168 | 3168 | ||
| 3169 | (defun previous-line (&optional arg) | 3169 | (defun previous-line (&optional arg) |
| @@ -3186,9 +3186,9 @@ to use and more reliable (no dependence on goal column, etc.)." | |||
| 3186 | (or arg (setq arg 1)) | 3186 | (or arg (setq arg 1)) |
| 3187 | (if (interactive-p) | 3187 | (if (interactive-p) |
| 3188 | (condition-case nil | 3188 | (condition-case nil |
| 3189 | (line-move (- arg)) | 3189 | (line-move (- arg) nil nil t) |
| 3190 | ((beginning-of-buffer end-of-buffer) (ding))) | 3190 | ((beginning-of-buffer end-of-buffer) (ding))) |
| 3191 | (line-move (- arg))) | 3191 | (line-move (- arg) nil nil t)) |
| 3192 | nil) | 3192 | nil) |
| 3193 | 3193 | ||
| 3194 | (defcustom track-eol nil | 3194 | (defcustom track-eol nil |
| @@ -3227,8 +3227,8 @@ Outline mode sets this." | |||
| 3227 | (assq prop buffer-invisibility-spec))))) | 3227 | (assq prop buffer-invisibility-spec))))) |
| 3228 | 3228 | ||
| 3229 | ;; Perform vertical scrolling of tall images if necessary. | 3229 | ;; Perform vertical scrolling of tall images if necessary. |
| 3230 | (defun line-move (arg &optional noerror to-end) | 3230 | (defun line-move (arg &optional noerror to-end try-vscroll) |
| 3231 | (if auto-window-vscroll | 3231 | (if (and auto-window-vscroll try-vscroll) |
| 3232 | (let ((forward (> arg 0)) | 3232 | (let ((forward (> arg 0)) |
| 3233 | (part (nth 2 (pos-visible-in-window-p (point) nil t)))) | 3233 | (part (nth 2 (pos-visible-in-window-p (point) nil t)))) |
| 3234 | (if (and (consp part) | 3234 | (if (and (consp part) |
| @@ -3244,7 +3244,14 @@ Outline mode sets this." | |||
| 3244 | (* (frame-char-height) (- arg)))))) | 3244 | (* (frame-char-height) (- arg)))))) |
| 3245 | t) | 3245 | t) |
| 3246 | (set-window-vscroll nil 0) | 3246 | (set-window-vscroll nil 0) |
| 3247 | (line-move-1 arg noerror to-end))) | 3247 | (when (line-move-1 arg noerror to-end) |
| 3248 | (sit-for 0) | ||
| 3249 | (if (and (not forward) | ||
| 3250 | (setq part (nth 2 (pos-visible-in-window-p | ||
| 3251 | (line-beginning-position) nil t))) | ||
| 3252 | (> (cdr part) 0)) | ||
| 3253 | (set-window-vscroll nil (cdr part) t)) | ||
| 3254 | t))) | ||
| 3248 | (line-move-1 arg noerror to-end))) | 3255 | (line-move-1 arg noerror to-end))) |
| 3249 | 3256 | ||
| 3250 | ;; This is the guts of next-line and previous-line. | 3257 | ;; This is the guts of next-line and previous-line. |