emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/view.el,v [EMACS_22_BASE]


From: Glenn Morris
Subject: [Emacs-diffs] Changes to emacs/lisp/view.el,v [EMACS_22_BASE]
Date: Tue, 25 Sep 2007 07:06:06 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Branch:         EMACS_22_BASE
Changes by:     Glenn Morris <gm>       07/09/25 07:06:06

Index: view.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/view.el,v
retrieving revision 1.84.2.4
retrieving revision 1.84.2.5
diff -u -b -r1.84.2.4 -r1.84.2.5
--- view.el     25 Sep 2007 02:27:03 -0000      1.84.2.4
+++ view.el     25 Sep 2007 07:06:06 -0000      1.84.2.5
@@ -998,21 +998,18 @@
   "Search for the TIMESth occurrence of a line with no match for REGEXP.
 If such a line is found, return non-nil and set the match-data to that line.
 If TIMES is negative, search backwards."
-  (let ((step 1)
-        (noerror 'move))
-    (when (< times 0)
-      (setq times (- times)
-            step -1
-            noerror t))
+  (let ((step (if (>= times 0) 1
+                (setq times (- times))
+                -1)))
     ;; Note that we do not check the current line.
     (while (and (> times 0)
                 (zerop (forward-line step)))
-      ;; Move only to handle eob in the forward case: on last line,
-      ;; (forward-line 1) returns 0 before the end of line.
-      (or (re-search-forward regexp (line-end-position) noerror)
-          (setq times (1- times)))))
-  (when (zerop times)
-    (forward-line 0)
+      ;; (forward-line 1) returns 0 on moving within the last line.
+      (if (eobp)
+          (setq times -1)
+        (or (re-search-forward regexp (line-end-position) t)
+            (setq times (1- times))))))
+  (and (zerop times)
     (looking-at ".*")))
 
 (provide 'view)




reply via email to

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