changeset 52891:a6806242012a

(bibtex-move-outside-of-entry): Move backward only if point was not inside an entry.
author Richard M. Stallman <rms@gnu.org>
date Mon, 20 Oct 2003 23:31:01 +0000
parents 51328ad3b6be
children 8a19599151b0
files lisp/textmodes/bibtex.el
diffstat 1 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/textmodes/bibtex.el	Mon Oct 20 23:30:05 2003 +0000
+++ b/lisp/textmodes/bibtex.el	Mon Oct 20 23:31:01 2003 +0000
@@ -1656,16 +1656,15 @@
   "Make sure point is outside of a BibTeX entry."
   (let ((orig-point (point)))
     (bibtex-end-of-entry)
-    (when (<= (point) orig-point)
+    (when (< (point) orig-point)
       ;; We moved backward, so we weren't inside an entry to begin with.
       ;; Leave point at the beginning of a line, and preferably
       ;; at the beginning of a paragraph.
       (goto-char orig-point)
       (beginning-of-line 1)
-      (let ((cb (char-before (1- (point)))))
-        (unless (and cb (= ?\n cb))
-          (re-search-forward "^[ \t]*[@\n]" nil 'move)
-          (backward-char 1))))
+      (unless (= ?\n (char-before (1- (point))))
+        (re-search-forward "^[ \t]*[@\n]" nil 'move)
+        (backward-char 1)))
     (skip-chars-forward " \t\n")))
 
 (defun bibtex-beginning-of-first-entry ()