From: "Basil L. Contovounesios" <contovob@tcd.ie>
To: "Andreas Röhler" <andreas.roehler@easy-emacs.de>
Cc: 32328@debbugs.gnu.org
Subject: bug#32328: match-beginning: return nil if search failed
Date: Wed, 01 Aug 2018 17:39:46 +0300 [thread overview]
Message-ID: <878t5qqhfx.fsf@tcd.ie> (raw)
In-Reply-To: <99197071-caa7-c187-2df7-32c8366a07ad@easy-emacs.de> ("Andreas Röhler"'s message of "Tue, 31 Jul 2018 07:59:06 +0200")
Andreas Röhler <andreas.roehler@easy-emacs.de> writes:
> match-beginning tells: Return value is undefined if the last search failed.
>
> Consider it a gain if it returns nil when failing.
I think match-string already implicitly relies on the suggested
behaviour; compare its docstring:
Value is nil if NUMth pair didn't match, or there were less than NUM pairs.
with its implementation:
(if (match-beginning num)
(if string
(substring string (match-beginning num) (match-end num))
(buffer-substring (match-beginning num) (match-end num))))
--
Basil
prev parent reply other threads:[~2018-08-01 14:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-31 5:59 bug#32328: match-beginning: return nil if search failed Andreas Röhler
2018-08-01 14:39 ` Basil L. Contovounesios [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878t5qqhfx.fsf@tcd.ie \
--to=contovob@tcd.ie \
--cc=32328@debbugs.gnu.org \
--cc=andreas.roehler@easy-emacs.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.