aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier <[email protected]>2006-05-22 21:50:47 +0000
committerStefan Monnier <[email protected]>2006-05-22 21:50:47 +0000
commit8e6ea7a32117a8948dfd0f3acd0bd2beaa806728 (patch)
tree118af6d88d91c3a7e6ee1e3d9ae3399ea047a4c9
parent35731e3bcd8268b6fa669aa35608a241dc19c26d (diff)
(bibtex-format-entry, bibtex-clean-entry):
Signal more user-friendly error messages.
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/textmodes/bibtex.el6
2 files changed, 7 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a763c61124..8249b0d777 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
2006-05-22 Stefan Monnier <[email protected]>
+ * textmodes/bibtex.el (bibtex-format-entry, bibtex-clean-entry):
+ Signal more user-friendly error messages.
+
* complete.el (PC-do-completion): Undo the addition of implicit
wildcards if they did not lead to finding any match.
(read-file-name-internal): Don't add the final > if the completion is
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el
index 044c59d0ca..74ec8beffa 100644
--- a/lisp/textmodes/bibtex.el
+++ b/lisp/textmodes/bibtex.el
@@ -1803,7 +1803,8 @@ Formats current entry according to variable `bibtex-entry-format'."
;; identify entry type
(goto-char (point-min))
- (re-search-forward bibtex-entry-type)
+ (or (re-search-forward bibtex-entry-type nil t)
+ (error "Not inside a BibTeX entry"))
(let ((beg-type (1+ (match-beginning 0)))
(end-type (match-end 0)))
(setq entry-list (assoc-string (buffer-substring-no-properties
@@ -3879,7 +3880,8 @@ At end of the cleaning process, the functions in
(interactive "P")
(let ((case-fold-search t)
(start (bibtex-beginning-of-entry))
- (_ (looking-at bibtex-any-entry-maybe-empty-head))
+ (_ (or (looking-at bibtex-any-entry-maybe-empty-head)
+ (error "Not inside a BibTeX entry")))
(entry-type (bibtex-type-in-head))
(key (bibtex-key-in-head)))
;; formatting