bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#32378: [PATCH] bibtex-next/previous-entry


From: Noam Postavsky
Subject: bug#32378: [PATCH] bibtex-next/previous-entry
Date: Mon, 06 Aug 2018 22:15:18 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

Alex Branham <address@hidden> writes:

> +(defun bibtex-next-entry (&optional arg)
> +  "Move point ARG entries forward."
> +  (interactive "p")
> +  (bibtex-end-of-entry)
> +  (re-search-forward bibtex-entry-maybe-empty-head nil t (or arg 1))
> +  (goto-char (match-beginning 0)))
> +
> +(defun bibtex-previous-entry (&optional arg)
> +  "Move point ARG entries backward."
> +  (interactive "p")
> +  (bibtex-beginning-of-entry)
> +  (re-search-backward bibtex-entry-maybe-empty-head nil t (or arg 1))
> +  (goto-char (match-beginning 0)))

You forgot to check the return value of re-search-forward/backward, if
there is no match then (match-beginning 0) might return something
unexpected.  Alternatively, if you don't expect the match to fail, pass
nil for NOERROR.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]