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


Message #98 received at 36167 <at> debbugs.gnu.org (full text, mbox):

From: Konstantin Kharlamov <hi-angel <at> yandex.ru>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: rpluim <at> gmail.com, 36167 <at> debbugs.gnu.org
Subject: Re: bug#36167: [PATCH] Replace [0-9a-fA-F] with [[:xdigit:]]
Date: Wed, 12 Jun 2019 19:39:26 +0300

В Ср, июн 12, 2019 at 17:55, Eli Zaretskii <eliz <at> gnu.org> 
написал:
>>  Date: Wed, 12 Jun 2019 14:19:04 +0300
>>  From: Konstantin Kharlamov <hi-angel <at> yandex.ru>
>>  Cc: 36167 <at> debbugs.gnu.org
>> 
>>  > Sorry, I forgot a step: you have to visit the file you changed, 
>> and
>>  > make sure point is near where you made changes (C-x v = will show 
>> you
>>  > a *vc-diff* buffer containing the changes), and then do C-x 4 a
>>  > (possibly multiple times if you changed multiple things).
>> 
>>  Oh, that doesn't sound automated, it's a lot of work. I had 28 
>> files in
>>  the outdated patch, and there will be more, as noted Paul.
> 
> The idea is to type "C-x 4 a" right after making each change, or set
> up a keyboard macro that does this for you.

This indeed sounds somewhat easier, have I been making each xdigit 
replacement manually.

But I'm a fan of automation, this reduces a "human factor" and is 
faster. So the original xdigit patch was a matter of a single command:

	sp "\[0-9a-fA-F\]" "[[:xdigit:]]"

where "sp" is a "sed" replacement in perl¹. (okay, maybe then also to 
review and "git checkout" irrelevant files, like changelogs)

Having to do all 20 files manually would be a lot of work.

>>  And in the other patch, which I did not send as it turned out to be
>>  obsolete (which was replacing [0-9] with [[:digit:]]) I had around
>>  4xx changed files. No way one could manually go through 400 files,
>>  stop by each change, and press a hotkey.
> 
> When you change 400 files, no one will expect you to mention each
> instance, it's enough to describe the change itself and say "in all
> files" or somesuch.

Can I do that for 20 files?

1: 
https://github.com/Hi-Angel/dotfiles/blob/33eab4cc99ad06dbfa71fa0cf9c2822e5d824f24/.zshrc#L122






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

Previous Next


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