GNU bug report logs - #32378
[PATCH] bibtex-next/previous-entry

Previous Next

Package: emacs;

Reported by: Alex Branham <alex.branham <at> gmail.com>

Date: Mon, 6 Aug 2018 21:04:02 UTC

Severity: wishlist

Tags: fixed, patch

Fixed in version 27.1

Done: Noam Postavsky <npostavs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 32378 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: Alex Branham <alex.branham <at> gmail.com>
Cc: 32378 <at> debbugs.gnu.org
Subject: Re: bug#32378: [PATCH] bibtex-next/previous-entry
Date: Mon, 06 Aug 2018 22:15:18 -0400
Alex Branham <alex.branham <at> gmail.com> 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.




This bug report was last modified 6 years and 321 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.