[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 <alex.branham@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.
- bug#32378: [PATCH] bibtex-next/previous-entry, Alex Branham, 2018/08/06
- bug#32378: [PATCH] bibtex-next/previous-entry,
Noam Postavsky <=
- bug#32378: [PATCH] bibtex-next/previous-entry, Alex Branham, 2018/08/07
- bug#32378: [PATCH] bibtex-next/previous-entry, Noam Postavsky, 2018/08/12
- bug#32378: [PATCH] bibtex-next/previous-entry, Alex Branham, 2018/08/20
- bug#32378: [PATCH] bibtex-next/previous-entry, Noam Postavsky, 2018/08/20
- bug#32378: [PATCH] bibtex-next/previous-entry, Alex Branham, 2018/08/21
- bug#32378: [PATCH] bibtex-next/previous-entry, Alex Branham, 2018/08/21
- bug#32378: [PATCH] bibtex-next/previous-entry, Noam Postavsky, 2018/08/27
- bug#32378: [PATCH] bibtex-next/previous-entry, Eli Zaretskii, 2018/08/20
- bug#32378: [PATCH] bibtex-next/previous-entry, Alex Branham, 2018/08/21
- bug#32378: [PATCH] bibtex-next/previous-entry, Eli Zaretskii, 2018/08/21