diff options
| author | Richard M. Stallman | 2003-10-20 23:31:01 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2003-10-20 23:31:01 +0000 |
| commit | 0640e91a85ac4e43e3df76472c841540dc441b2e (patch) | |
| tree | 357bea3143b504152824946a3392f4334e6fba96 /lisp/textmodes | |
| parent | b6c846d34180f39824bbb116ed51929cb2f13511 (diff) | |
| download | emacs-0640e91a85ac4e43e3df76472c841540dc441b2e.tar.gz emacs-0640e91a85ac4e43e3df76472c841540dc441b2e.zip | |
(bibtex-move-outside-of-entry):
Move backward only if point was not inside an entry.
Diffstat (limited to 'lisp/textmodes')
| -rw-r--r-- | lisp/textmodes/bibtex.el | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index 480f304f175..82b15cf4eb5 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el | |||
| @@ -1656,16 +1656,15 @@ are defined, but only for the head part of the entry | |||
| 1656 | "Make sure point is outside of a BibTeX entry." | 1656 | "Make sure point is outside of a BibTeX entry." |
| 1657 | (let ((orig-point (point))) | 1657 | (let ((orig-point (point))) |
| 1658 | (bibtex-end-of-entry) | 1658 | (bibtex-end-of-entry) |
| 1659 | (when (<= (point) orig-point) | 1659 | (when (< (point) orig-point) |
| 1660 | ;; We moved backward, so we weren't inside an entry to begin with. | 1660 | ;; We moved backward, so we weren't inside an entry to begin with. |
| 1661 | ;; Leave point at the beginning of a line, and preferably | 1661 | ;; Leave point at the beginning of a line, and preferably |
| 1662 | ;; at the beginning of a paragraph. | 1662 | ;; at the beginning of a paragraph. |
| 1663 | (goto-char orig-point) | 1663 | (goto-char orig-point) |
| 1664 | (beginning-of-line 1) | 1664 | (beginning-of-line 1) |
| 1665 | (let ((cb (char-before (1- (point))))) | 1665 | (unless (= ?\n (char-before (1- (point)))) |
| 1666 | (unless (and cb (= ?\n cb)) | 1666 | (re-search-forward "^[ \t]*[@\n]" nil 'move) |
| 1667 | (re-search-forward "^[ \t]*[@\n]" nil 'move) | 1667 | (backward-char 1))) |
| 1668 | (backward-char 1)))) | ||
| 1669 | (skip-chars-forward " \t\n"))) | 1668 | (skip-chars-forward " \t\n"))) |
| 1670 | 1669 | ||
| 1671 | (defun bibtex-beginning-of-first-entry () | 1670 | (defun bibtex-beginning-of-first-entry () |