From: Lars Magne Ingebrigtsen <larsi@gnus.org>
To: Juanma Barranquero <lekktu@gmail.com>
Cc: Emacs developers <emacs-devel@gnu.org>
Subject: Re: trunk r113818: lisp/xml.el (xml-parse-tag-1): Use looking-at.
Date: Mon, 12 Aug 2013 18:18:01 +0200 [thread overview]
Message-ID: <m3siyedgsm.fsf@stories.gnus.org> (raw)
In-Reply-To: <CAAeL0SR+XVHXp5Wrkrd_eh7w847c1BUUbt_EsfcirXW_SDdJ9Q@mail.gmail.com> (Juanma Barranquero's message of "Mon, 12 Aug 2013 17:41:15 +0200")
Juanma Barranquero <lekktu@gmail.com> writes:
> On Mon, Aug 12, 2013 at 5:32 PM, Lars Magne Ingebrigtsen <larsi@gnus.org> wrote:
>
>>> - (while (not (looking-at-p end))
>>> + (while (not (looking-at end))
>>
>> Wouldn't it be better to fix the bogus test instead of changing
>> apparently perfectly good code (for the (slightly) worse)?
>
> I'd tend to agree. In this case, an apparent predicate test (even
> using (not ...) to reinforce that idea) has a follow-up match-data use
> almost 30 lines afterwards; to make things worse,
> the code in between (inside (while ...)) also uses string matching
> (which does not affect the test, but produces some cognitive load when
> reading it). Ugly, I'd say.
Oh, the code really didn't work with `looking-at-p'? Then I guess I
misinterpreted the checkin message. :-)
(while (not (looking-at-p end))
[ snipped 27 lines, some of which do alter the match data ]
;; Move point past the end-tag.
(goto-char (match-end 0))
Yeah, that doesn't look... good...
--
(domestic pets only, the antidote for overdose, milk.)
No Gnus T-Shirt for sale: http://ingebrigtsen.no/no.php
and http://lars.ingebrigtsen.no/2013/08/twenty-years-of-september.html
next prev parent reply other threads:[~2013-08-12 16:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <E1V8tmX-0001uj-Of@vcs.savannah.gnu.org>
2013-08-12 15:32 ` trunk r113818: lisp/xml.el (xml-parse-tag-1): Use looking-at Lars Magne Ingebrigtsen
2013-08-12 15:41 ` Juanma Barranquero
2013-08-12 16:18 ` Lars Magne Ingebrigtsen [this message]
2013-08-12 16:26 ` Juanma Barranquero
2013-08-12 16:29 ` Glenn Morris
2013-08-12 16:47 ` Lars Magne Ingebrigtsen
2013-08-13 1:46 ` Stefan Monnier
2013-08-13 2:55 ` Juanma Barranquero
2013-08-13 12:10 ` Lars Magne Ingebrigtsen
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=m3siyedgsm.fsf@stories.gnus.org \
--to=larsi@gnus.org \
--cc=emacs-devel@gnu.org \
--cc=lekktu@gmail.com \
/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.