# HG changeset patch # User Stefan Monnier # Date 1148334647 0 # Node ID 2a874a2efaf4bd86e1afb7788d670f784a02e0b5 # Parent b599bb78c1fc185e7b9e628d6664d2a77dc4ec31 (bibtex-format-entry, bibtex-clean-entry): Signal more user-friendly error messages. diff -r b599bb78c1fc -r 2a874a2efaf4 lisp/ChangeLog --- 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 + * 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 -r b599bb78c1fc -r 2a874a2efaf4 lisp/textmodes/bibtex.el --- 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