[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: trunk r113818: lisp/xml.el (xml-parse-tag-1): Use looking-at.
From: |
Lars Magne Ingebrigtsen |
Subject: |
Re: trunk r113818: lisp/xml.el (xml-parse-tag-1): Use looking-at. |
Date: |
Mon, 12 Aug 2013 18:18:01 +0200 |
User-agent: |
Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux) |
Juanma Barranquero <address@hidden> writes:
> On Mon, Aug 12, 2013 at 5:32 PM, Lars Magne Ingebrigtsen <address@hidden>
> 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
- Re: trunk r113818: lisp/xml.el (xml-parse-tag-1): Use looking-at., Lars Magne Ingebrigtsen, 2013/08/12
- Re: trunk r113818: lisp/xml.el (xml-parse-tag-1): Use looking-at., Juanma Barranquero, 2013/08/12
- Re: trunk r113818: lisp/xml.el (xml-parse-tag-1): Use looking-at.,
Lars Magne Ingebrigtsen <=
- Re: trunk r113818: lisp/xml.el (xml-parse-tag-1): Use looking-at., Juanma Barranquero, 2013/08/12
- Re: trunk r113818: lisp/xml.el (xml-parse-tag-1): Use looking-at., Glenn Morris, 2013/08/12
- Re: trunk r113818: lisp/xml.el (xml-parse-tag-1): Use looking-at., Lars Magne Ingebrigtsen, 2013/08/12
- Re: trunk r113818: lisp/xml.el (xml-parse-tag-1): Use looking-at., Stefan Monnier, 2013/08/12
- Re: trunk r113818: lisp/xml.el (xml-parse-tag-1): Use looking-at., Juanma Barranquero, 2013/08/12
- Re: trunk r113818: lisp/xml.el (xml-parse-tag-1): Use looking-at., Lars Magne Ingebrigtsen, 2013/08/13