From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Magne Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: trunk r113818: lisp/xml.el (xml-parse-tag-1): Use looking-at. Date: Mon, 12 Aug 2013 18:18:01 +0200 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1376324310 27359 80.91.229.3 (12 Aug 2013 16:18:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 12 Aug 2013 16:18:30 +0000 (UTC) Cc: Emacs developers To: Juanma Barranquero Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 12 18:18:32 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1V8upC-0000ah-PN for ged-emacs-devel@m.gmane.org; Mon, 12 Aug 2013 18:18:30 +0200 Original-Received: from localhost ([::1]:35045 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8upC-0007hA-7i for ged-emacs-devel@m.gmane.org; Mon, 12 Aug 2013 12:18:30 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45854) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8up3-0007gl-Th for emacs-devel@gnu.org; Mon, 12 Aug 2013 12:18:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V8uox-0005Gv-QJ for emacs-devel@gnu.org; Mon, 12 Aug 2013 12:18:21 -0400 Original-Received: from hermes.netfonds.no ([80.91.224.195]:41175) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8uox-0005GH-J2 for emacs-devel@gnu.org; Mon, 12 Aug 2013 12:18:15 -0400 Original-Received: from cm-84.215.51.58.getinternet.no ([84.215.51.58] helo=stories.gnus.org) by hermes.netfonds.no with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1V8uoj-0001xJ-Ge; Mon, 12 Aug 2013 18:18:01 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEUAAAB5bma/saOUh3uJ fXOnmYxEPzqcj4I714nFAAACSklEQVQ4jVVUPXfiMBBUCqgRnzW6KLRH1jy16GygPWQUt3ABUmOj t3//diXMxxYGz+zMjvQsCZGqO9BzKRe7vXitNy/PXIfJ+hWvxgQeJD2Pz0yXcJlqfD72HsRqfZD3 Oh/uczqXJ5yYcUtU8rVaSecSX4fDoiiGadCLoIiVmCh5297784wed8k/yzh3Z0nEzN2pSEyW53nB jb3kZFNrDkBUxgx5dea3fsuGTEUzIUZtILna2fEAAOKYvcAWr7X3ak12kBU8ZEpJczLq6yo4p4/G ANv2xJacydYqTwTW07whM2vH4hKDFn3PZSd60EBDjBSXtLRPRFTaVs6iaSiZFIxDZrWVg+0ozOot WXGySNBydVDgvKnCOyBTTOQUcVGhwnJhSpxtEDmxIJyIgGj1LixKmCFSYgDBO0QEgPtVejiYqkKu RkS8CbDRpiyzGnHGMKJg3Ji6WBWrq1e6WRDBIsERDNYDRdtVgmk+qxDNBNKkxoRSX/OCiEuNFARD JTZpxpR/SoNWkVHwfismNKlB44Ymy0u4jmbUjd5/iVOU8rYWpLCOfUjxV3xXkUAlM1PaEYclgV+K Az05RtAZyJECoLTeu73oEhGDB0XVmCSo6Gz0bxIDaUk0wLsP+uBOmjWRATZigftNxFnp5NYg0B5F geKvuttXLrnxgrjfq494DL6Vat1on6jfqXQMu7VS8RvhnNHo/XbUftSNiUUvy/Y0/3li6O/0cc55 bco5tqF6ujZ+1FMtxVOdHvjX6y1zbPHXS4Y3YEKonp/b9//zePdcS0efeQAAAABJRU5ErkJggg== X-Now-Playing: Public Image Ltd.'s _Metal Box_: "Careering" X-Hashcash: 1:23:130812:emacs-devel@gnu.org::M/1AYc1lXF/gmamr:000000000000000000000000000000000000000000RdNJ X-Hashcash: 1:23:130812:lekktu@gmail.com::r9OcdlPk0NZGLJf7:0+ojZ In-Reply-To: (Juanma Barranquero's message of "Mon, 12 Aug 2013 17:41:15 +0200") User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux) X-MailScanner-ID: 1V8uoj-0001xJ-Ge MailScanner-NULL-Check: 1376929081.7292@1/RUK8NNEWrSOMnJfEsYDw X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.224.195 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:162625 Archived-At: Juanma Barranquero writes: > On Mon, Aug 12, 2013 at 5:32 PM, Lars Magne Ingebrigtsen 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