GNU bug report logs - #27465
24.5; `dired-mark-unmarked-files' with non-nil UNFLAG-P

Previous Next

Package: emacs;

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

Date: Fri, 23 Jun 2017 22:45: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


View this message in rfc822 format

From: Drew Adams <drew.adams <at> oracle.com>
To: 27465 <at> debbugs.gnu.org
Subject: bug#27465: 24.5; `dired-mark-unmarked-files' with non-nil UNFLAG-P
Date: Fri, 23 Jun 2017 15:44:21 -0700 (PDT)
AFAICT this could never have worked.

1. Prior to Emacs 24, the interactive spec was just "P", which could of
   course not work interactively.  In Emacs 24 it was changed to read
   the REGEXP and use the prefix arg for UNFLAG-P.  That "P" was an
   indication that the command never worked interactively and was
   probably ill-conceived for that.  And that "P" remained from Emacs
   20 (if not before) through 23.

2. There are no occurrences in the Elisp sources that use non-nil
   UNFLAG-P.

3. Non-nil UNFLAG-P does nothing, AFAICT.  It _cannot_ do anything.
   Certainly it cannot unflag, which means change a deletion flag (`D')
   to a space char.  Why?  Because the replacement is applied only to
   lines that already have a space char (not a `D').

   Its effect in that case is indeed to post a space char.  But it does
   so only for lines that already have a space char!

   This is the call:

   (dired-mark-if
     (and
      (looking-at-p " ") ; <=== Mark (with a SPC) only if already there!
      (let ((fn (dired-get-filename localp t)))
        (and fn (string-match-p regexp fn))))
     msg)

What to do?  I suggest NOT trying to have any "unflag" behavior here.
If it were fixed, so that it actually replaced `D' with ` ' when there
is a prefix arg, I think that behavior would be confusing.  IOW, better
not to fix the implementation to fix an awful design.  Mark-if-unmarked
should not mean unflag sometimes.

But if you really want to fix this so that it does what the doc says,
that's OK by me.  Something should be done about it, anyway.

(BTW, the comment "uninteresting" is backward wrt the comment "not
already marked".  The files that are checked are those that are not
already marked and are interesting, i.e, match.)

In GNU Emacs 24.5.1 (i686-pc-mingw32)
 of 2015-04-11 on LEG570
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --prefix=/c/usr --host=i686-pc-mingw32'




This bug report was last modified 6 years and 1 day ago.

Previous Next


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