summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorChong Yidong <cyd@gnu.org>2012-04-18 15:00:52 +0800
committerChong Yidong <cyd@gnu.org>2012-04-18 15:00:52 +0800
commitbc6494efe328c6b6da13bafd95e035da4e36ca98 (patch)
tree5b8cc4868d041b88c42a94bc823868dd1c3358c3 /lisp
parentc09c46b263a4c47806775c57bea391612cad4404 (diff)
downloademacs-bc6494efe328c6b6da13bafd95e035da4e36ca98.tar.gz
* simple.el (line-move): Use forward-line if in batch mode.
Fixes: debbugs:11053
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/simple.el36
2 files changed, 24 insertions, 17 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index eff89ba08c0..054b3ca5f47 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2012-04-18 Chong Yidong <cyd@gnu.org>
+
+ * simple.el (line-move): Use forward-line if in batch mode
+ (Bug#11053).
+
2012-04-18 Christopher Schmidt <christopher@ch.ristopher.com>
* files.el (after-find-file): Do not try to add a final newline if
diff --git a/lisp/simple.el b/lisp/simple.el
index 09fe1807d8f..67f6e4eedf7 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -4405,23 +4405,25 @@ lines."
;; a cleaner solution to the problem of making C-n do something
;; useful given a tall image.
(defun line-move (arg &optional noerror to-end try-vscroll)
- (unless (and auto-window-vscroll try-vscroll
- ;; Only vscroll for single line moves
- (= (abs arg) 1)
- ;; But don't vscroll in a keyboard macro.
- (not defining-kbd-macro)
- (not executing-kbd-macro)
- (line-move-partial arg noerror to-end))
- (set-window-vscroll nil 0 t)
- (if (and line-move-visual
- ;; Display-based column are incompatible with goal-column.
- (not goal-column)
- ;; When the text in the window is scrolled to the left,
- ;; display-based motion doesn't make sense (because each
- ;; logical line occupies exactly one screen line).
- (not (> (window-hscroll) 0)))
- (line-move-visual arg noerror)
- (line-move-1 arg noerror to-end))))
+ (if noninteractive
+ (forward-line arg)
+ (unless (and auto-window-vscroll try-vscroll
+ ;; Only vscroll for single line moves
+ (= (abs arg) 1)
+ ;; But don't vscroll in a keyboard macro.
+ (not defining-kbd-macro)
+ (not executing-kbd-macro)
+ (line-move-partial arg noerror to-end))
+ (set-window-vscroll nil 0 t)
+ (if (and line-move-visual
+ ;; Display-based column are incompatible with goal-column.
+ (not goal-column)
+ ;; When the text in the window is scrolled to the left,
+ ;; display-based motion doesn't make sense (because each
+ ;; logical line occupies exactly one screen line).
+ (not (> (window-hscroll) 0)))
+ (line-move-visual arg noerror)
+ (line-move-1 arg noerror to-end)))))
;; Display-based alternative to line-move-1.
;; Arg says how many lines to move. The value is t if we can move the