changeset 70841:2a874a2efaf4

(bibtex-format-entry, bibtex-clean-entry): Signal more user-friendly error messages.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Mon, 22 May 2006 21:50:47 +0000
parents b599bb78c1fc
children 8b271981e0c5
files lisp/ChangeLog lisp/textmodes/bibtex.el
diffstat 2 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Mon May 22 18:09:40 2006 +0000
+++ b/lisp/ChangeLog	Mon May 22 21:50:47 2006 +0000
@@ -1,5 +1,8 @@
 2006-05-22  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+	* 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
--- a/lisp/textmodes/bibtex.el	Mon May 22 18:09:40 2006 +0000
+++ b/lisp/textmodes/bibtex.el	Mon May 22 21:50:47 2006 +0000
@@ -1803,7 +1803,8 @@
 
         ;; 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 @@
   (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