* bug#27465: 24.5; `dired-mark-unmarked-files' with non-nil UNFLAG-P
@ 2017-06-23 22:44 Drew Adams
2019-07-21 15:41 ` Lars Ingebrigtsen
0 siblings, 1 reply; 2+ messages in thread
From: Drew Adams @ 2017-06-23 22:44 UTC (permalink / raw)
To: 27465
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'
^ permalink raw reply [flat|nested] 2+ messages in thread
* bug#27465: 24.5; `dired-mark-unmarked-files' with non-nil UNFLAG-P
2017-06-23 22:44 bug#27465: 24.5; `dired-mark-unmarked-files' with non-nil UNFLAG-P Drew Adams
@ 2019-07-21 15:41 ` Lars Ingebrigtsen
0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2019-07-21 15:41 UTC (permalink / raw)
To: Drew Adams; +Cc: 27465
Drew Adams <drew.adams@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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-07-21 15:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-23 22:44 bug#27465: 24.5; `dired-mark-unmarked-files' with non-nil UNFLAG-P Drew Adams
2019-07-21 15:41 ` Lars Ingebrigtsen
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).