emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r107959: * simple.el (line-move): Use


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r107959: * simple.el (line-move): Use forward-line if in batch mode.
Date: Wed, 18 Apr 2012 15:00:52 +0800
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 107959
fixes bug(s): http://debbugs.gnu.org/11053
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Wed 2012-04-18 15:00:52 +0800
message:
  * simple.el (line-move): Use forward-line if in batch mode.
modified:
  lisp/ChangeLog
  lisp/simple.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-04-18 06:24:13 +0000
+++ b/lisp/ChangeLog    2012-04-18 07:00:52 +0000
@@ -1,3 +1,8 @@
+2012-04-18  Chong Yidong  <address@hidden>
+
+       * simple.el (line-move): Use forward-line if in batch mode
+       (Bug#11053).
+
 2012-04-18  Christopher Schmidt  <address@hidden>
 
        * files.el (after-find-file): Do not try to add a final newline if

=== modified file 'lisp/simple.el'
--- a/lisp/simple.el    2012-04-15 07:28:01 +0000
+++ b/lisp/simple.el    2012-04-18 07:00:52 +0000
@@ -4405,23 +4405,25 @@
 ;; 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]