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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 27465 in the body.
You can then email your comments to 27465 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#27465; Package emacs. (Fri, 23 Jun 2017 22:45:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Drew Adams <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 23 Jun 2017 22:45:02 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 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'




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#27465; Package emacs. (Sun, 21 Jul 2019 15:42:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 27465 <at> debbugs.gnu.org
Subject: Re: bug#27465: 24.5; `dired-mark-unmarked-files' with non-nil UNFLAG-P
Date: Sun, 21 Jul 2019 17:41:31 +0200
Drew Adams <drew.adams <at> oracle.com> writes:

> 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)

I've now made unflag-p work on the Emacs trunk.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 21 Jul 2019 15:42:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 27.1, send any further explanations to 27465 <at> debbugs.gnu.org and Drew Adams <drew.adams <at> oracle.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 21 Jul 2019 15:42:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 19 Aug 2019 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 245 days ago.

Previous Next


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