GNU bug report logs - #22457
24.5; [PATCH] `dired-mark-if' should not count non-changes

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Sun, 24 Jan 2016 18:06:02 UTC

Severity: minor

Tags: fixed

Found in version 24.5

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


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

From: Drew Adams <drew.adams <at> oracle.com>
To: Michael Heerdegen <michael_heerdegen <at> web.de>, Lars Ingebrigtsen
 <larsi <at> gnus.org>
Cc: 22457 <at> debbugs.gnu.org
Subject: RE: bug#22457: 24.5; [PATCH] `dired-mark-if' should not count
 non-changes
Date: Tue, 25 Jun 2019 16:26:58 -0700 (PDT)
> Oh, btw, this patch line
> 
>   (looking-at-p (char-to-string dired-marker-char))
> 
> is not good if dired-marker-char is a regexp special like . or ?, I
> guess (regexp-quote missing)?

It's a good point; it would be clearer to wrap the
arg to `looking-at-p' with `regexp-quote'.

It works as coded, however, because Emacs regexp
matching treats a special char such as `*' as
non-special in such a context.

I'm not saying it's good to rely on that (documented)
behavior - it's better to use `regexp-quote'.

See (elisp)`Syntax of Regexps':

  *Please note:* For historical compatibility, special characters are
  treated as ordinary ones if they are in contexts where their special
  meanings make no sense.  For example, '*foo' treats '*' as ordinary
  since there is no preceding expression on which the '*' can act.  It is
  poor practice to depend on this behavior; quote the special character
  anyway, regardless of where it appears.




This bug report was last modified 6 years and 3 days ago.

Previous Next


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