GNU bug report logs - #36167
[PATCH] Replace manually crafted hex regexes with [[:xdigit:]]

Previous Next

Package: emacs;

Reported by: Konstantin Kharlamov <hi-angel <at> yandex.ru>

Date: Tue, 11 Jun 2019 12:00:02 UTC

Severity: wishlist

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Konstantin Kharlamov <hi-angel <at> yandex.ru>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: Mattias Engdegård <mattiase <at> acm.org>, 36167 <at> debbugs.gnu.org
Subject: bug#36167: [PATCH] Replace manually crafted hex regexes with [[:xdigit:]]
Date: Tue, 11 Jun 2019 17:37:54 +0300

On Вт, июн 11, 2019 at 07:26, Paul Eggert <eggert <at> cs.ucla.edu> 
wrote:
> If we're going to make such a change we should be systematic about 
> it. Unfortunately the currently-proposed patches don't handle 
> examples like these:
> 
> [A-Fa-f0-9] (in dnd.el)
> 
> [0-9a-fA-F.] (in org/org-table.el)
> 
> [0-9a-fA-FxXzZ_] (in progmodes/vera-mode.el)

This one doesn't look like hex. At least :xdigit: sure doesn't match X 
and Z. Although this probably could be replaced with [[[:digit:]]xXzZ] 
(didn't test this one). But I imagine such change may better be a 
separate patch, as it's somewhat different from all the other changes.


> (skip-chars-backward "0-9a-fA-F'") (in progmodes/cc-mode.el)

Same here.

> I will cc this message to Mattias Engdegård, as he has a good 
> scanner for regular expressions and patterns. Mattias, the bug-report 
> thread is here:
> 
> https://debbugs.gnu.org/36167

Either way, thanks, I already figured too that there are some regexes 
in a different order. I'm using ack to find them, this should work:

	ack "\[[-09afAF]{9}\]"

I'll post an updated patch later.






This bug report was last modified 5 years and 322 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.