1656 |
"Make sure point is outside of a BibTeX entry." |
"Make sure point is outside of a BibTeX entry." |
1657 |
(let ((orig-point (point))) |
(let ((orig-point (point))) |
1658 |
(bibtex-end-of-entry) |
(bibtex-end-of-entry) |
1659 |
(when (<= (point) orig-point) |
(when (< (point) orig-point) |
1660 |
;; We moved backward, so we weren't inside an entry to begin with. |
;; We moved backward, so we weren't inside an entry to begin with. |
1661 |
;; Leave point at the beginning of a line, and preferably |
;; Leave point at the beginning of a line, and preferably |
1662 |
;; at the beginning of a paragraph. |
;; at the beginning of a paragraph. |
1663 |
(goto-char orig-point) |
(goto-char orig-point) |
1664 |
(beginning-of-line 1) |
(beginning-of-line 1) |
1665 |
(let ((cb (char-before (1- (point))))) |
(unless (= ?\n (char-before (1- (point)))) |
1666 |
(unless (and cb (= ?\n cb)) |
(re-search-forward "^[ \t]*[@\n]" nil 'move) |
1667 |
(re-search-forward "^[ \t]*[@\n]" nil 'move) |
(backward-char 1))) |
|
(backward-char 1)))) |
|
1668 |
(skip-chars-forward " \t\n"))) |
(skip-chars-forward " \t\n"))) |
1669 |
|
|
1670 |
(defun bibtex-beginning-of-first-entry () |
(defun bibtex-beginning-of-first-entry () |