* Dired: Improve symmetry in mark/unmark commands bound to keys
@ 2016-09-24 17:31 Tino Calancha
2016-09-24 18:12 ` Eli Zaretskii
2016-09-24 19:31 ` Andreas Schwab
0 siblings, 2 replies; 31+ messages in thread
From: Tino Calancha @ 2016-09-24 17:31 UTC (permalink / raw)
To: Emacs developers; +Cc: tino.calancha
Dear all,
in Dired we have several commmands for mark files
bound to keys (the order is irrelevant):
1) * /
2) * @
3) % m
4) % g
5) * *
6) * s
If you load `dired-x' you get more:
7) M-(
8) * .
From that list all but 6) and 8) will _unmark_ in an
interactive call with prefix argument. That is, they mark
files or unmark them.
I have suggested in Bug#24518 that 8) should follow the same idiom
with no success :-(
Let's see my new proposal:
I) Add optional argument in 6) unflag-p to behave as the others.
II) Add a new command `dired-mark-or-unmark-extension', as
`dired-mark-extension' but, in interactive calls:
* A prefix argument _unmark_ files.
I propose to rebind '* .' to this command instead of the
`dired-mark-extension'.
After I) and II) we have an uniform behaviour for all
commands marking files which are bound to keys. Powerful and easy
to remember.
What do you think?
Regards,
Tino
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
From 33847d0f96356c6c09a78f391e27fa6a5b4f7628 Mon Sep 17 00:00:00 2001
From: Tino Calancha <tino.calancha@gmail.com>
Date: Sun, 25 Sep 2016 02:26:37 +0900
Subject: [PATCH] All Dired commands marking files, with prefix arg unmark
* lisp/dired-aux.el (dired-mark-subdir-files): Add optional
argument UNFLAG-P; if non-nil unmark files instead.
Save the point, call dired-mark-extension' but interactively with prefix arg
unmark files. Rebind '*.' to this command.
(dired-mark-sexp): Say 'Unmark' in the prompt for interactive calls
with prefix arg.
---
lisp/dired-aux.el | 11 +++++++----
lisp/dired-x.el | 28 ++++++++++++++++++++++++++--
2 files changed, 33 insertions(+), 6 deletions(-)
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 9e0943a..a817f74 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -2523,13 +2523,16 @@ dired-goto-subdir
(point)))))
;;;###autoload
-(defun dired-mark-subdir-files ()
+(defun dired-mark-subdir-files (&optional unflag-p)
"Mark all files except `.' and `..' in current subdirectory.
+With prefix argument, unmark or unflag all those files.
If the Dired buffer shows multiple directories, this command
marks the files listed in the subdirectory that point is in."
- (interactive)
- (let ((p-min (dired-subdir-min)))
- (dired-mark-files-in-region p-min (dired-subdir-max))))
+ (interactive "P")
+ (let ((dired-marker-char (or (and unflag-p ?\s) dired-marker-char))
+ (p-min (dired-subdir-min)))
+ (save-excursion
+ (dired-mark-files-in-region p-min (dired-subdir-max)))))
;;;###autoload
(defun dired-kill-subdir (&optional remember-marks)
diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index 7d73c42..0656b47 100644
--- a/lisp/dired-x.el
+++ b/lisp/dired-x.el
@@ -245,7 +245,7 @@ dired-mode-map
(define-key dired-mode-map "*O" 'dired-mark-omitted)
(define-key dired-mode-map "\M-(" 'dired-mark-sexp)
(define-key dired-mode-map "*(" 'dired-mark-sexp)
-(define-key dired-mode-map "*." 'dired-mark-extension)
+(define-key dired-mode-map "*." 'dired-mark-or-unmark-extension)
(define-key dired-mode-map "\M-!" 'dired-smart-shell-command)
(define-key dired-mode-map "\M-G" 'dired-goto-subdir)
(define-key dired-mode-map "F" 'dired-do-find-marked-files)
@@ -354,6 +354,26 @@ dired-mark-extension
"\\)$")
marker-char))
+(defun dired-mark-or-unmark-extension (extension &optional marker-char)
+ "Mark all files with a certain EXTENSION for use in later commands.
+With prefix argument, unmark or unflag all those files.
+A `.' is *not* automatically prepended to the string entered.
+EXTENSION may also be a list of extensions instead of a single one.
+Interactively, ask for EXTENSION."
+ (interactive
+ (list (read-string
+ (format "%s extension: "
+ (if current-prefix-arg "Unmarking" "Marking")))
+ (and current-prefix-arg ?\s)))
+ (or (listp extension)
+ (setq extension (list extension)))
+ (dired-mark-files-regexp
+ (concat ".";; don't match names with nothing but an extension
+ "\\("
+ (mapconcat 'regexp-quote extension "\\|")
+ "\\)$")
+ marker-char))
+
(defun dired-flag-extension (extension)
"In Dired, flag all files with a certain EXTENSION for deletion.
A `.' is *not* automatically prepended to the string entered."
@@ -1470,7 +1490,11 @@ dired-mark-sexp
;; (string-match "foo" sym) into which a user would soon fall.
;; Give `equal' instead of `=' in the example, as this works on
;; integers and strings.
- (interactive "xMark if (lisp expr): \nP")
+ (interactive
+ (list (read--expression
+ (format "%s if (lisp expr): "
+ (if current-prefix-arg "Unmark" "Mark")))
+ current-prefix-arg))
(message "%s" predicate)
(let ((dired-marker-char (if unflag-p ?\040 dired-marker-char))
inode s mode nlink uid gid size time name sym)
--
2.9.3
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
In GNU Emacs 25.2.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.0)
of 2016-09-25
Repository revision: 5ee56c4613e9380dbbe4bbaa97b29dd377e2134c
^ permalink raw reply related [flat|nested] 31+ messages in thread
* Re: Dired: Improve symmetry in mark/unmark commands bound to keys
2016-09-24 17:31 Dired: Improve symmetry in mark/unmark commands bound to keys Tino Calancha
@ 2016-09-24 18:12 ` Eli Zaretskii
2016-09-24 18:25 ` Tino Calancha
2016-09-24 19:31 ` Andreas Schwab
1 sibling, 1 reply; 31+ messages in thread
From: Eli Zaretskii @ 2016-09-24 18:12 UTC (permalink / raw)
To: Tino Calancha; +Cc: emacs-devel
> From: Tino Calancha <tino.calancha@gmail.com>
> Date: Sun, 25 Sep 2016 02:31:30 +0900 (JST)
> Cc: tino.calancha@gmail.com
>
> I) Add optional argument in 6) unflag-p to behave as the others.
> II) Add a new command `dired-mark-or-unmark-extension', as
> `dired-mark-extension' but, in interactive calls:
> * A prefix argument _unmark_ files.
> I propose to rebind '* .' to this command instead of the
> `dired-mark-extension'.
> After I) and II) we have an uniform behaviour for all
> commands marking files which are bound to keys. Powerful and easy
> to remember.
I'm okay with that proposal, but please leave the "* ." key sequence
at its present binding. For the new dired-mark-or-unmark-extension
command, I can propose "* e" or "* x", which are not yet taken, both
of them mnemonically resembling "EXtension".
Thanks.
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: Dired: Improve symmetry in mark/unmark commands bound to keys
2016-09-24 18:12 ` Eli Zaretskii
@ 2016-09-24 18:25 ` Tino Calancha
0 siblings, 0 replies; 31+ messages in thread
From: Tino Calancha @ 2016-09-24 18:25 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel, Tino Calancha
On Sat, 24 Sep 2016, Eli Zaretskii wrote:
>> From: Tino Calancha <tino.calancha@gmail.com>
>> Date: Sun, 25 Sep 2016 02:31:30 +0900 (JST)
>> Cc: tino.calancha@gmail.com
>>
>> I) Add optional argument in 6) unflag-p to behave as the others.
>> II) Add a new command `dired-mark-or-unmark-extension', as
>> `dired-mark-extension' but, in interactive calls:
>> * A prefix argument _unmark_ files.
>> I propose to rebind '* .' to this command instead of the
>> `dired-mark-extension'.
>> After I) and II) we have an uniform behaviour for all
>> commands marking files which are bound to keys. Powerful and easy
>> to remember.
>
> I'm okay with that proposal, but please leave the "* ." key sequence
> at its present binding. For the new dired-mark-or-unmark-extension
> command, I can propose "* e" or "* x", which are not yet taken, both
> of them mnemonically resembling "EXtension".
The binding "* e" looks very intuitive and easy to remember.
Thank you.
^ permalink raw reply [flat|nested] 31+ messages in thread
* RE: Dired: Improve symmetry in mark/unmark commands bound to keys
[not found] ` <<83oa3db20a.fsf@gnu.org>
@ 2016-09-24 18:53 ` Drew Adams
0 siblings, 0 replies; 31+ messages in thread
From: Drew Adams @ 2016-09-24 18:53 UTC (permalink / raw)
To: Eli Zaretskii, Tino Calancha; +Cc: emacs-devel
> > I) Add optional argument in 6) unflag-p to behave as the others.
> > II) Add a new command `dired-mark-or-unmark-extension', as
> > `dired-mark-extension' but, in interactive calls:
> > * A prefix argument _unmark_ files.
> > I propose to rebind '* .' to this command instead of the
> > `dired-mark-extension'.
> > After I) and II) we have an uniform behaviour for all
> > commands marking files which are bound to keys. Powerful and easy
> > to remember.
>
> I'm okay with that proposal, but please leave the "* ." key sequence
> at its present binding. For the new dired-mark-or-unmark-extension
> command, I can propose "* e" or "* x", which are not yet taken, both
> of them mnemonically resembling "EXtension".
FWIW, I favor Tino's proposal, including having `* .' UNmark
with a prefix arg (just like the other `*' commands).
I see no special reason why a prefix arg to `* .' would read
the character to use for marking, instead of having it unmark
as proposed.
(FWIW, In Dired+ `* .' has long been bound to a command that
does what Tino proposes. I've never heard a complaint.)
A prefix arg for `* .' currently is not useful, IMO, and
likely never used. It marks the files using a character that
you specify.
Instead, users can use `* c' to change the mark character for
the marked files, however they were marked - very useful.
The ability to have a different mark character has nothing
special to do with marking files by their extension. There
are lots of uses of different mark chars. I've never heard
of _anyone_ taking advantage of the vanilla `* .' prefix arg
behavior to use a different mark character while marking a
given extension.
In fact, my impression is that there are very few Emacs users
who even know about `* c', or know that you can have different
marks and how you can put them to use. See this bug thread,
for example: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21746#8
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: Dired: Improve symmetry in mark/unmark commands bound to keys
2016-09-24 17:31 Dired: Improve symmetry in mark/unmark commands bound to keys Tino Calancha
2016-09-24 18:12 ` Eli Zaretskii
@ 2016-09-24 19:31 ` Andreas Schwab
2016-09-24 19:39 ` Eli Zaretskii
1 sibling, 1 reply; 31+ messages in thread
From: Andreas Schwab @ 2016-09-24 19:31 UTC (permalink / raw)
To: Tino Calancha; +Cc: Emacs developers
On Sep 25 2016, Tino Calancha <tino.calancha@gmail.com> wrote:
> Let's see my new proposal:
>
> I) Add optional argument in 6) unflag-p to behave as the others.
> II) Add a new command `dired-mark-or-unmark-extension', as
> `dired-mark-extension' but, in interactive calls:
> * A prefix argument _unmark_ files.
> I propose to rebind '* .' to this command instead of the
> `dired-mark-extension'.
There is no need for dired-mark-or-unmark-extension,
dired-mark-extension should to that already. Since the prefix argument
has always been useless it is ok to change its meaning, and make it
consistent with all other dired commands.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: Dired: Improve symmetry in mark/unmark commands bound to keys
2016-09-24 19:31 ` Andreas Schwab
@ 2016-09-24 19:39 ` Eli Zaretskii
2016-09-24 19:46 ` Andreas Schwab
2016-09-24 19:49 ` Tino Calancha
0 siblings, 2 replies; 31+ messages in thread
From: Eli Zaretskii @ 2016-09-24 19:39 UTC (permalink / raw)
To: Andreas Schwab; +Cc: emacs-devel, tino.calancha
> From: Andreas Schwab <schwab@linux-m68k.org>
> Date: Sat, 24 Sep 2016 21:31:09 +0200
> Cc: Emacs developers <emacs-devel@gnu.org>
>
> There is no need for dired-mark-or-unmark-extension,
> dired-mark-extension should to that already. Since the prefix argument
> has always been useless it is ok to change its meaning, and make it
> consistent with all other dired commands.
I disagree and object to such a change.
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: Dired: Improve symmetry in mark/unmark commands bound to keys
2016-09-24 19:39 ` Eli Zaretskii
@ 2016-09-24 19:46 ` Andreas Schwab
2016-09-24 19:58 ` Eli Zaretskii
2016-09-24 19:49 ` Tino Calancha
1 sibling, 1 reply; 31+ messages in thread
From: Andreas Schwab @ 2016-09-24 19:46 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel, tino.calancha
On Sep 24 2016, Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Andreas Schwab <schwab@linux-m68k.org>
>> Date: Sat, 24 Sep 2016 21:31:09 +0200
>> Cc: Emacs developers <emacs-devel@gnu.org>
>>
>> There is no need for dired-mark-or-unmark-extension,
>> dired-mark-extension should to that already. Since the prefix argument
>> has always been useless it is ok to change its meaning, and make it
>> consistent with all other dired commands.
>
> I disagree and object to such a change.
But is the only way that makes sense. You objection has no grounds.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: Dired: Improve symmetry in mark/unmark commands bound to keys
2016-09-24 19:39 ` Eli Zaretskii
2016-09-24 19:46 ` Andreas Schwab
@ 2016-09-24 19:49 ` Tino Calancha
1 sibling, 0 replies; 31+ messages in thread
From: Tino Calancha @ 2016-09-24 19:49 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel, Andreas Schwab, tino.calancha
On Sat, 24 Sep 2016, Eli Zaretskii wrote:
>> From: Andreas Schwab <schwab@linux-m68k.org>
>> Date: Sat, 24 Sep 2016 21:31:09 +0200
>> Cc: Emacs developers <emacs-devel@gnu.org>
>>
>> There is no need for dired-mark-or-unmark-extension,
>> dired-mark-extension should to that already. Since the prefix argument
>> has always been useless it is ok to change its meaning, and make it
>> consistent with all other dired commands.
>
> I disagree and object to such a change.
I try to be objective and look at this regardless of my wish. Then, i
cannot see the rationale about what makes special marking by extension.
Why should '* .' prompt for a marker-char (the only guy doing so)
but similar ones as '* @', '* /', or even '% m' should not?
The code is talking us, let's hear what is saying. It should be obvious.
I would be proud on you if you could reconsider your opinion in case
several people here suggest you the opposite. It would be wise.
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: Dired: Improve symmetry in mark/unmark commands bound to keys
2016-09-24 19:46 ` Andreas Schwab
@ 2016-09-24 19:58 ` Eli Zaretskii
2016-09-24 20:07 ` Andreas Schwab
0 siblings, 1 reply; 31+ messages in thread
From: Eli Zaretskii @ 2016-09-24 19:58 UTC (permalink / raw)
To: Andreas Schwab; +Cc: emacs-devel, tino.calancha
> From: Andreas Schwab <schwab@linux-m68k.org>
> Cc: tino.calancha@gmail.com, emacs-devel@gnu.org
> Date: Sat, 24 Sep 2016 21:46:01 +0200
>
> >> There is no need for dired-mark-or-unmark-extension,
> >> dired-mark-extension should to that already. Since the prefix argument
> >> has always been useless it is ok to change its meaning, and make it
> >> consistent with all other dired commands.
> >
> > I disagree and object to such a change.
>
> But is the only way that makes sense. You objection has no grounds.
I stated my grounds. They might not make sense to you, but they do to
me.
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: Dired: Improve symmetry in mark/unmark commands bound to keys
2016-09-24 19:58 ` Eli Zaretskii
@ 2016-09-24 20:07 ` Andreas Schwab
2016-09-24 23:49 ` Drew Adams
` (2 more replies)
0 siblings, 3 replies; 31+ messages in thread
From: Andreas Schwab @ 2016-09-24 20:07 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel, tino.calancha
On Sep 24 2016, Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Andreas Schwab <schwab@linux-m68k.org>
>> Cc: tino.calancha@gmail.com, emacs-devel@gnu.org
>> Date: Sat, 24 Sep 2016 21:46:01 +0200
>>
>> >> There is no need for dired-mark-or-unmark-extension,
>> >> dired-mark-extension should to that already. Since the prefix argument
>> >> has always been useless it is ok to change its meaning, and make it
>> >> consistent with all other dired commands.
>> >
>> > I disagree and object to such a change.
>>
>> But is the only way that makes sense. You objection has no grounds.
>
> I stated my grounds. They might not make sense to you, but they do to
> me.
No, they make absolutely no sense. The prefix was obviously never
intented to be used with this command. The only intented use of the
second argument was the its caller, dired-flag-extension. That is easy
to prove, because before commit 736b582 it wasn't even documented in the
doc string.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 31+ messages in thread
* RE: Dired: Improve symmetry in mark/unmark commands bound to keys
2016-09-24 20:07 ` Andreas Schwab
@ 2016-09-24 23:49 ` Drew Adams
2016-09-25 9:06 ` Tino Calancha
2016-09-25 18:55 ` John Wiegley
2016-09-25 19:14 ` Eli Zaretskii
2 siblings, 1 reply; 31+ messages in thread
From: Drew Adams @ 2016-09-24 23:49 UTC (permalink / raw)
To: Andreas Schwab, Eli Zaretskii; +Cc: tino.calancha, emacs-devel
> The prefix was obviously never
> intented to be used with this command. The only intented use of the
> second argument was the its caller, dired-flag-extension. That is easy
> to prove, because before commit 736b582 it wasn't even documented in the
> doc string.
Yes. More importantly, we can do what we think is best.
What do we really need?
1. We need for `dired-flag-extension' to work. With the current
implementation that means calling `dired-mark-extension' with
a `D' mark.
2. We need a command for changing the mark character that is used
for the currently marked files. We have that: `* c'
(`dired-change-marks').
3. We need a command to mark files that have a given extension.
We have that: `* .' (`dired-mark-extension').
4. We need a command to unmark files that have a given extension.
We do NOT have this.
5. Do we need a command that marks files that have a given
extension and prompts you for which mark character to use?
This is currently provided by `* .' with a prefix arg.
I agree with Tino and Andreas that #5 is not needed. It has never
been used, AFAICT. #2 suffices for getting whatever marks you want.
I agree with them also that we do not need a new, separate command
for #4, and that we should let `* .' also unmark, with a prefix arg.
Two possibilities, if we want that behavior for `* .':
a. Redefine `dired-mark-extension' to do that. In this case,
the implementation of #1 needs to change (provide a helper).
b. Define a new command. Call it `dired-mark-or-unmark-extension'.
For (b): The other commands for which a prefix arg unmarks
rather than marks do NOT have "-or-unmark" in the name.
Should they, to distinguish them from those that only mark or
only unmark? For example, should `dired-mark-files-regexp' be
called `dired-mark-or-unmark-files-regexp'?
That brings us back to the question of thread "Ibuffer: w and B
default to buffer at current line". I think we should name the
commands after only the _default_ behavior, i.e., what happens
if you do not use a prefix arg. So I'd argue for just making
`dired-mark-extension' unmark with a prefix arg (and providing
a different helper function for `dired-flag-extension') -
unless someone can point out how using a prefix arg to specify
the mark character is actually useful for `* .'.
On the other hand, there are some commands that only mark or
unmark, and for which either (a) the opposite behavior is not
useful or (b) the prefix arg is used for something else, and
two different keys might be provided for marking and unmarking.
For example, `* m' just marks, and `* u' just unmarks. Such
exceptions also include `* ?' (`dired-unmark-all-files') and
`* !' (`dired-unmark-all-marks').
Other than such exceptions, should commands that currently only
mark or unmark, and for which both operations are useful, also
do double-duty, via a prefix arg? For example, should `* s'
unmark all with a prefix arg (one of Tino's proposals)?
Most commands that unmark also unflag - they remove all marks,
including `D' (deletion flag). The doc strings make this clear -
except the doc string of `dired-unmark'. Shouldn't that doc
string also make this clear?
There is maybe a little room for some minor cleanup and making
the command set a bit more consistent. On the other hand, all
things are not equal, and forcing consistency where it is not
appropriate is not the answer either. There is no imperative
to paint with a broad brush. In most cases there are good
reasons for the current command behavior, I think.
^ permalink raw reply [flat|nested] 31+ messages in thread
* RE: Dired: Improve symmetry in mark/unmark commands bound to keys
2016-09-24 23:49 ` Drew Adams
@ 2016-09-25 9:06 ` Tino Calancha
0 siblings, 0 replies; 31+ messages in thread
From: Tino Calancha @ 2016-09-25 9:06 UTC (permalink / raw)
To: Drew Adams; +Cc: Eli Zaretskii, tino.calancha, Andreas Schwab, Emacs developers
On Sat, 24 Sep 2016, Drew Adams wrote:
>> The prefix was obviously never
>> intented to be used with this command. The only intented use of the
>> second argument was the its caller, dired-flag-extension. That is easy
>> to prove, because before commit 736b582 it wasn't even documented in the
>> doc string.
>
> Yes. More importantly, we can do what we think is best.
>
> What do we really need?
>
> 1. We need for `dired-flag-extension' to work. With the current
> implementation that means calling `dired-mark-extension' with
> a `D' mark.
Right.
> 2. We need a command for changing the mark character that is used
> for the currently marked files. We have that: `* c'
> (`dired-change-marks').
Right.
> 3. We need a command to mark files that have a given extension.
> We have that: `* .' (`dired-mark-extension').
Right.
> 4. We need a command to unmark files that have a given extension.
> We do NOT have this.
Unfortunately not. We could if my patch in bug#24518
would being applied.
> 5. Do we need a command that marks files that have a given
> extension and prompts you for which mark character to use?
> This is currently provided by `* .' with a prefix arg.
No at all.
My patch at bug#24518 is not a fast crazy idea. It is the result
of years of using Dired and reading its souce: using its amazing marking
capabilities heavily. That patch would deserve much more attention
that just being discarded after a few hours of e-mail communication.
Why so rush to close that bug report?
*) It could be a misunderstanding:
i said that we could fix it in the way it has being done, but that
i don't wanted to be the author of the commit. That could be understood
as if i was OK with that fix. Let me clarify that words. It was a way
to say that i was against that solution. IMO, after applying that patch
Dired became less consistent, less nice ... nobody really loving Dired
would ever applied such patch. Dired is the my #1 reason to use Emacs:
commit 5ee56c46 really broke my hearth.
In bug#24518 there 3 participants, and 2 were againts the applied fix.
Now, in this thread the situation turns out to be: 3-1.
*) If it wasn't a misunderstanding, then i am very disappointed. Why not to
wait until more people give their feedback? That is not the way we handle
the bug reports, at least not what they have taught me. There are many
Dired enthusiastic people. I have no doubt if we kept open the bug
report we would get more input and find a consensus. That is why i open
the this thread. I want to let others the opportunity to give their
opinion, and make all together a better Dired, that is, a better Emacs.
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: Dired: Improve symmetry in mark/unmark commands bound to keys
2016-09-24 20:07 ` Andreas Schwab
2016-09-24 23:49 ` Drew Adams
@ 2016-09-25 18:55 ` John Wiegley
2016-09-26 9:23 ` Tino Calancha
2016-09-25 19:14 ` Eli Zaretskii
2 siblings, 1 reply; 31+ messages in thread
From: John Wiegley @ 2016-09-25 18:55 UTC (permalink / raw)
To: Andreas Schwab; +Cc: Eli Zaretskii, tino.calancha, emacs-devel
[-- Attachment #1: Type: text/plain, Size: 1331 bytes --]
>>>>> "AS" == Andreas Schwab <schwab@linux-m68k.org> writes:
>>> > I disagree and object to such a change.
>>>
>>> But is the only way that makes sense. You objection has no grounds.
>>
>> I stated my grounds. They might not make sense to you, but they do to me.
AS> No, they make absolutely no sense. The prefix was obviously never intented
AS> to be used with this command. The only intented use of the second argument
AS> was the its caller, dired-flag-extension. That is easy to prove, because
AS> before commit 736b582 it wasn't even documented in the doc string.
Hi Andreas,
I'm interested in the technical content of this exchange, but there is no
place for telling the maintainer of a project that his objection is without
ground. He _is_ our ground, and I ask everyone to respect this. If you believe
otherwise, we're always on the lookout for future maintainers to take up the
baton.
So, while I like the appeal to consistency, if Eli objects, then I object, and
you should feel obliged to resolve our concerns -- in terms of the issues at
hand -- rather than stating they are baseless. Doing so will not move the
discussion forward.
--
John Wiegley GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com 60E1 46C4 BD1A 7AC1 4BA2
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 629 bytes --]
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: Dired: Improve symmetry in mark/unmark commands bound to keys
2016-09-24 20:07 ` Andreas Schwab
2016-09-24 23:49 ` Drew Adams
2016-09-25 18:55 ` John Wiegley
@ 2016-09-25 19:14 ` Eli Zaretskii
2016-09-25 22:43 ` Andreas Schwab
` (2 more replies)
2 siblings, 3 replies; 31+ messages in thread
From: Eli Zaretskii @ 2016-09-25 19:14 UTC (permalink / raw)
To: Andreas Schwab; +Cc: tino.calancha, emacs-devel
> From: Andreas Schwab <schwab@linux-m68k.org>
> Date: Sat, 24 Sep 2016 22:07:35 +0200
> Cc: emacs-devel@gnu.org, tino.calancha@gmail.com
>
> No, they make absolutely no sense. The prefix was obviously never
> intented to be used with this command. The only intented use of the
> second argument was the its caller, dired-flag-extension. That is easy
> to prove, because before commit 736b582 it wasn't even documented in the
> doc string.
Before commit 736b582 the doc string didn't mention that EXTENSION
could be a list, either. Like the optional argument, the fact that it
could be a list was only mentioned in the comment, which was later
moved into the doc string. So by that logic the list feature also
makes no sense, which is of course absurd.
IOW, this argument proves nothing.
Look, if you want to convince me, either get the author(s) of the code
tell that they made a mistake using that 'P' in the interactive spec,
or come up with a _very_ plausible theory how it could happen without
the author really meaning it to happen. The interactive spec in its
form before my yesterday's changes was there since the day the
function was added to Emacs. We need a clear understanding how did
the spec end up being in that form when the programmer didn't mean to
allow specification of the marker. This stuff doesn't get written by
itself, so any explanation should be good and convincing.
If we cannot prove to ourselves it was an accident or a mistake, then
I object to removing this feature, even if we think it's not very
useful, and even if we don't know who uses it or whether anybody used
it in the past. I don't think we should knowingly remove existing
features without a very good reason. Emacs is stable, and "stable"
means existing features don't just disappear.
If we want to have a convenient way of unmarking by extension without
introducing a new function, let's do that without removing this
feature of specifying the marker character. There are quite a few
examples elsewhere in Emacs for how to get creative with prefix
arguments; I'm sure one of them will allow us to support both features
in this case.
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: Dired: Improve symmetry in mark/unmark commands bound to keys
2016-09-25 19:14 ` Eli Zaretskii
@ 2016-09-25 22:43 ` Andreas Schwab
2016-09-25 22:58 ` Andreas Schwab
2016-09-25 23:00 ` Andreas Schwab
2 siblings, 0 replies; 31+ messages in thread
From: Andreas Schwab @ 2016-09-25 22:43 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: tino.calancha, emacs-devel
On Sep 25 2016, Eli Zaretskii <eliz@gnu.org> wrote:
> So by that logic the list feature also makes no sense,
This is a non sequitur.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: Dired: Improve symmetry in mark/unmark commands bound to keys
2016-09-25 19:14 ` Eli Zaretskii
2016-09-25 22:43 ` Andreas Schwab
@ 2016-09-25 22:58 ` Andreas Schwab
2016-09-25 23:00 ` Andreas Schwab
2 siblings, 0 replies; 31+ messages in thread
From: Andreas Schwab @ 2016-09-25 22:58 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: tino.calancha, emacs-devel
On Sep 25 2016, Eli Zaretskii <eliz@gnu.org> wrote:
> Before commit 736b582 the doc string didn't mention that EXTENSION
> could be a list, either. Like the optional argument, the fact that it
> could be a list was only mentioned in the comment, which was later
> moved into the doc string. So by that logic the list feature also
> makes no sense, which is of course absurd.
You got it backwards: it is impossible to interactively input a list of
extensions, that's why it wasn't documented. For the same reason the
optional marker char wasn't documented for interactive use.
> IOW, this argument proves nothing.
IOW, it still proves everything.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: Dired: Improve symmetry in mark/unmark commands bound to keys
2016-09-25 19:14 ` Eli Zaretskii
2016-09-25 22:43 ` Andreas Schwab
2016-09-25 22:58 ` Andreas Schwab
@ 2016-09-25 23:00 ` Andreas Schwab
2016-09-26 2:38 ` Eli Zaretskii
2 siblings, 1 reply; 31+ messages in thread
From: Andreas Schwab @ 2016-09-25 23:00 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: tino.calancha, emacs-devel
On Sep 25 2016, Eli Zaretskii <eliz@gnu.org> wrote:
> I don't think we should knowingly remove existing features without a
> very good reason.
There is a very good reason: it does not work, and was never intented to
work.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: Dired: Improve symmetry in mark/unmark commands bound to keys
2016-09-25 23:00 ` Andreas Schwab
@ 2016-09-26 2:38 ` Eli Zaretskii
2016-09-26 8:33 ` Andreas Schwab
0 siblings, 1 reply; 31+ messages in thread
From: Eli Zaretskii @ 2016-09-26 2:38 UTC (permalink / raw)
To: Andreas Schwab; +Cc: emacs-devel, tino.calancha
> From: Andreas Schwab <schwab@linux-m68k.org>
> Date: Mon, 26 Sep 2016 01:00:41 +0200
> Cc: tino.calancha@gmail.com, emacs-devel@gnu.org
>
> On Sep 25 2016, Eli Zaretskii <eliz@gnu.org> wrote:
>
> > I don't think we should knowingly remove existing features without a
> > very good reason.
>
> There is a very good reason: it does not work
I've shown that it did work, albeit in a cumbersome and kludgey
manner.
> and was never intented to work.
You'd need to present more convincing arguments than that to change my
mind.
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: Dired: Improve symmetry in mark/unmark commands bound to keys
2016-09-26 2:38 ` Eli Zaretskii
@ 2016-09-26 8:33 ` Andreas Schwab
2016-09-26 14:59 ` Eli Zaretskii
0 siblings, 1 reply; 31+ messages in thread
From: Andreas Schwab @ 2016-09-26 8:33 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: tino.calancha, emacs-devel
On Sep 26 2016, Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Andreas Schwab <schwab@linux-m68k.org>
>> Date: Mon, 26 Sep 2016 01:00:41 +0200
>> Cc: tino.calancha@gmail.com, emacs-devel@gnu.org
>>
>> On Sep 25 2016, Eli Zaretskii <eliz@gnu.org> wrote:
>>
>> > I don't think we should knowingly remove existing features without a
>> > very good reason.
>>
>> There is a very good reason: it does not work
>
> I've shown that it did work, albeit in a cumbersome and kludgey
> manner.
That's pretty close to non-working.
>> and was never intented to work.
>
> You'd need to present more convincing arguments than that to change my
> mind.
Consider admitting that you are wrong. Doing it is a sign of strength.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: Dired: Improve symmetry in mark/unmark commands bound to keys
2016-09-25 18:55 ` John Wiegley
@ 2016-09-26 9:23 ` Tino Calancha
2016-09-26 11:05 ` Tino Calancha
` (3 more replies)
0 siblings, 4 replies; 31+ messages in thread
From: Tino Calancha @ 2016-09-26 9:23 UTC (permalink / raw)
To: jwiegley
Cc: Eli Zaretskii, Emacs developers, Andreas Schwab, drew.adams,
tino.calancha
On Sun, 25 Sep 2016, John Wiegley wrote:
>>>>>> "AS" == Andreas Schwab <schwab@linux-m68k.org> writes:
>
>>>>> I disagree and object to such a change.
>>>>
>>>> But is the only way that makes sense. You objection has no grounds.
>>>
>>> I stated my grounds. They might not make sense to you, but they do to me.
>
> AS> No, they make absolutely no sense. The prefix was obviously never intented
> AS> to be used with this command. The only intented use of the second argument
> AS> was the its caller, dired-flag-extension. That is easy to prove, because
> AS> before commit 736b582 it wasn't even documented in the doc string.
>
> Hi Andreas,
>
> I'm interested in the technical content of this exchange, but there is no
> place for telling the maintainer of a project that his objection is without
> ground. He _is_ our ground, and I ask everyone to respect this. If you believe
> otherwise, we're always on the lookout for future maintainers to take up the
> baton.
>
> So, while I like the appeal to consistency, if Eli objects, then I object, and
> you should feel obliged to resolve our concerns -- in terms of the issues at
> hand -- rather than stating they are baseless. Doing so will not move the
> discussion forward.
Hi John,
maybe the forms from Andreas where not the best, i acknowledge that, but
its not true that Andreas gave no strong arguments against the applied
solution. I miss similar strong arguments from the other side.
I still don't know why the bug report was closed such prompt considering
the issue was polemic.
1) First argument from Eli to reject my patch was that, there was no
actually bug because you can provide the marker interactively by its
code point. He was worry something using that behaviour could be
hurt if we modified it.
We inmediately told him that has absolutely no sense to ask the user to
input a code point to specify a character. I cannot imagine anyone on
this planet using such feature. I would expect better arguments than
that to defeat a position.
That should be enough to make him open his eyes and follow our suggestion
based in a deep knowledge on Dired accumulated during many yers.
2) Then, we came back with another argument similar than: well, i have
noticed there are no many ways in Dired to change the mark character, so
i would like to let this command to do such thing.
Again we answer him, that according with our large experience marking
facilities on Dired that is _not_ a good idea. There is only one sensical
thing to do in such situation: I am with Andreas and Drew on this, it
should _unmark_.
I might understand Andreas frustration after receive argumens 1) and 2),
and right after see close the bug report. I felt the same way.
We are not a pair a clowns that where walking around. We are
also Dired experts trying the fix one problem in the right way. We feel
that our arguments have being neglected/ignored and the topic has being
prematurely closed.
In addition, i don't think you should unconditionaly object just
because Eli object. The point to have 2 Emacs leaders is exactly to
have 2 brains looking the thing. They might agree sometimes, the may
disagree others.
Also, keep in a wrong decision after several people are telling you that
is wrong is a double mistake. You may think is a way to reafirm the
leadership. I think is exactly the opposite.
This topic is very sensitive and important: its more than that commit, its
about how Emacs take the decisions.
I may understand one hypotetical situation where some people say A and
others say B. In that case the leader should unblock the situation and
decide what direction to follow. But, if we have another situation where
N people say A and just the leader say B, the common sense tell us that
probably B is wrong. I would expect Emacs would chose in
such situation A. We are not python with its BDFL, i thought Emacs is
more democratic. If its not the case, then i should not belong to
this community any more.
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: Dired: Improve symmetry in mark/unmark commands bound to keys
2016-09-26 9:23 ` Tino Calancha
@ 2016-09-26 11:05 ` Tino Calancha
2016-09-26 15:02 ` Eli Zaretskii
` (2 subsequent siblings)
3 siblings, 0 replies; 31+ messages in thread
From: Tino Calancha @ 2016-09-26 11:05 UTC (permalink / raw)
To: Richard Stallman
Cc: tino.calancha, jwiegley, Emacs developers, Andreas Schwab,
Eli Zaretskii, drew.adams
Dear Richard,
could you please comment on this thread? It's about Dired.
I am very interested to read your opinion. Thank you!
PD: I am sorry, it's quite long thread. You might just want to
check Bug#24518. This thread is a continuation of that bug report.
To CC:
Added Richard to the discussion. He know Dired in detail.
If this ship should sail, i think he should be on that boat too.
Tino
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: Dired: Improve symmetry in mark/unmark commands bound to keys
2016-09-26 8:33 ` Andreas Schwab
@ 2016-09-26 14:59 ` Eli Zaretskii
0 siblings, 0 replies; 31+ messages in thread
From: Eli Zaretskii @ 2016-09-26 14:59 UTC (permalink / raw)
To: Andreas Schwab; +Cc: tino.calancha, emacs-devel
> From: Andreas Schwab <schwab@linux-m68k.org>
> Cc: emacs-devel@gnu.org, tino.calancha@gmail.com
> Date: Mon, 26 Sep 2016 10:33:51 +0200
>
> Consider admitting that you are wrong. Doing it is a sign of strength.
This goes both ways, you know.
Anyway, if we are still talking about Dired and having
dired-mark-extension unmark as well as mark, then I proposed a
solution yesterday that should let us eat the cake and have it, too.
I hope it could become a middle ground and let us move on to more
important issues.
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: Dired: Improve symmetry in mark/unmark commands bound to keys
2016-09-26 9:23 ` Tino Calancha
2016-09-26 11:05 ` Tino Calancha
@ 2016-09-26 15:02 ` Eli Zaretskii
2016-09-26 15:06 ` Eli Zaretskii
2016-09-26 15:47 ` John Wiegley
3 siblings, 0 replies; 31+ messages in thread
From: Eli Zaretskii @ 2016-09-26 15:02 UTC (permalink / raw)
To: Tino Calancha; +Cc: jwiegley, schwab, emacs-devel
> From: Tino Calancha <tino.calancha@gmail.com>
> Date: Mon, 26 Sep 2016 18:23:08 +0900 (JST)
> cc: Andreas Schwab <schwab@linux-m68k.org>, Eli Zaretskii <eliz@gnu.org>,
> tino.calancha@gmail.com, drew.adams@oracle.com,
> Emacs developers <emacs-devel@gnu.org>
>
> There is only one sensical thing to do in such situation: I am with
> Andreas and Drew on this, it should _unmark_.
As I wrote elsewhere in this thread, I'm okay with making
dired-mark-extension unmark as well, provided that doing so does not
eliminate the possibility to specify the marker character
interactively. We could use something similar to what "C-x C-s" does
with various forms of the prefix argument, to have the argument
control the command one way or the other. Or any other idea, if there
are better ones.
That sounds to me like a compromise solution that should leave
everybody at least partially happy, no?
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: Dired: Improve symmetry in mark/unmark commands bound to keys
2016-09-26 9:23 ` Tino Calancha
2016-09-26 11:05 ` Tino Calancha
2016-09-26 15:02 ` Eli Zaretskii
@ 2016-09-26 15:06 ` Eli Zaretskii
2016-09-26 15:47 ` John Wiegley
3 siblings, 0 replies; 31+ messages in thread
From: Eli Zaretskii @ 2016-09-26 15:06 UTC (permalink / raw)
To: Tino Calancha; +Cc: jwiegley, schwab, emacs-devel
> From: Tino Calancha <tino.calancha@gmail.com>
> Date: Mon, 26 Sep 2016 18:23:08 +0900 (JST)
> Cc: Eli Zaretskii <eliz@gnu.org>, Emacs developers <emacs-devel@gnu.org>,
> Andreas Schwab <schwab@linux-m68k.org>, drew.adams@oracle.com,
> tino.calancha@gmail.com
>
> I still don't know why the bug report was closed such prompt considering
> the issue was polemic.
I closed the bug report because your response indicated that you don't
want to have anything to do with fixing it while leaving the
possibility to specify the marker character. You told me if I wanted
to fix it I shall do it myself. So I fixed the cause for the error
(which was the original reason for filing the bug), and saw the bug
fixed by that. Apologies if I misunderstood what you really meant.
In any case, closing the bug doesn't mean we cannot continue
discussing it. Moreover, feel free to reopen it if you think the fix
is incorrect.
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: Dired: Improve symmetry in mark/unmark commands bound to keys
2016-09-26 9:23 ` Tino Calancha
` (2 preceding siblings ...)
2016-09-26 15:06 ` Eli Zaretskii
@ 2016-09-26 15:47 ` John Wiegley
2016-09-26 16:30 ` Tino Calancha
3 siblings, 1 reply; 31+ messages in thread
From: John Wiegley @ 2016-09-26 15:47 UTC (permalink / raw)
To: Tino Calancha; +Cc: Eli Zaretskii, Andreas Schwab, drew.adams, Emacs developers
[-- Attachment #1: Type: text/plain, Size: 908 bytes --]
>>>>> Tino Calancha <tino.calancha@gmail.com> writes:
> In addition, i don't think you should unconditionaly object just because Eli
> object.
Eli and I happen to agree on this: We don't want to change a long-standing
feature, however poorly conceived, without greater conviction. I commented in
the bug thread on the things I'd like to see happen next.
Also, you shouldn't query Richard for his opinion, you should query everyone.
Richard is not going to countermand our decision; convince us and the
community that it's wise to make this change, and we will. So for I think only
5 people total have participated in this discussion.
I believe Eli has proposed a solution that offers a middle ground. Can we move
to discussing that?
--
John Wiegley GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com 60E1 46C4 BD1A 7AC1 4BA2
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 629 bytes --]
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: Dired: Improve symmetry in mark/unmark commands bound to keys
2016-09-26 15:47 ` John Wiegley
@ 2016-09-26 16:30 ` Tino Calancha
2016-09-26 19:02 ` Eli Zaretskii
2016-09-26 21:52 ` John Wiegley
0 siblings, 2 replies; 31+ messages in thread
From: Tino Calancha @ 2016-09-26 16:30 UTC (permalink / raw)
To: Tino Calancha, Andreas Schwab, Eli Zaretskii, drew.adams,
Emacs developers
On Mon, 26 Sep 2016, John Wiegley wrote:
>>>>>> Tino Calancha <tino.calancha@gmail.com> writes:
>
>> In addition, i don't think you should unconditionaly object just because Eli
>> object.
>
> Eli and I happen to agree on this: We don't want to change a long-standing
> feature, however poorly conceived, without greater conviction. I commented in
> the bug thread on the things I'd like to see happen next.
>
> Also, you shouldn't query Richard for his opinion, you should query everyone.
> Richard is not going to countermand our decision; convince us and the
> community that it's wise to make this change, and we will. So for I think only
> 5 people total have participated in this discussion.
Sorry for that. I missunderstood your request. I asked him after you
wrote in the bug report:
-----
1. Begin a discussion on emacs-devel about the behavior of this command.
Solicit the wisdom of other old-timers on that list. Present your case
dispassionately, in terms of what we gain from such a change.
-----
I am still new here and i don't know who are the old-timers. The
first comes to my mind of course is Richard. I wish to ask S. Kremer,
that would be great, but i have never seen him in this list so i am afraid
he could pass away (?). If that is the case, someone could be hurt if i
try to contact him.
About beging a discussion on emacs-devel about this. Well, i guess we
already have this one: people can give us input here. If we open another
thread we will have 1 bug report + 2 emacs-dev thread basically talking
the same. Not too tidy.
> I believe Eli has proposed a solution that offers a middle ground. Can we move
> to discussing that?
Yes, we can talk about that.
Eli suggestion would be consistent with Dired if, for instance:
I) C-u * . el RET
;; unmark
II) C-u C-u * . el RET
;; prompt for the marker char.
IMO we should not put extra care in one hypothetical user X who
spend 22 years doing:
C-u 65 * . el RET
I mean, we should not invert the number of C-u's in I) II), because:
1) It's impossible such X user does exists (at least in this
Universe); and in case sh?e does exist i wish i will never face
this person at night in a lonely dark street; or i would have a drink
with her to explain that we are in XXI century, and now the computers
accept text when they prompt for a character. Who knows, maybe after
that she pay the drinks.
2) We private zillions of 'real' Dired users to naturally unmark files
by extension as they like to do with other Dired marking commands.
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: Dired: Improve symmetry in mark/unmark commands bound to keys
2016-09-26 16:30 ` Tino Calancha
@ 2016-09-26 19:02 ` Eli Zaretskii
2016-10-03 9:21 ` Tino Calancha
2016-09-26 21:52 ` John Wiegley
1 sibling, 1 reply; 31+ messages in thread
From: Eli Zaretskii @ 2016-09-26 19:02 UTC (permalink / raw)
To: Tino Calancha; +Cc: schwab, drew.adams, emacs-devel
> From: Tino Calancha <tino.calancha@gmail.com>
> Date: Tue, 27 Sep 2016 01:30:35 +0900 (JST)
>
> > I believe Eli has proposed a solution that offers a middle ground. Can we move
> > to discussing that?
> Yes, we can talk about that.
> Eli suggestion would be consistent with Dired if, for instance:
> I) C-u * . el RET
> ;; unmark
> II) C-u C-u * . el RET
> ;; prompt for the marker char.
FWIW, I'm okay with this.
> I mean, we should not invert the number of C-u's in I) II)
Indeed, no need.
Thanks.
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: Dired: Improve symmetry in mark/unmark commands bound to keys
2016-09-26 16:30 ` Tino Calancha
2016-09-26 19:02 ` Eli Zaretskii
@ 2016-09-26 21:52 ` John Wiegley
1 sibling, 0 replies; 31+ messages in thread
From: John Wiegley @ 2016-09-26 21:52 UTC (permalink / raw)
To: Tino Calancha; +Cc: Eli Zaretskii, Andreas Schwab, drew.adams, Emacs developers
>>>>> "TC" == Tino Calancha <tino.calancha@gmail.com> writes:
TC> About beging a discussion on emacs-devel about this. Well, i guess we
TC> already have this one: people can give us input here. If we open another
TC> thread we will have 1 bug report + 2 emacs-dev thread basically talking
TC> the same. Not too tidy.
Sure, I wrote to that bug list before I even knew this thread was here, so
indeed this is discussion we need to be having. I'd just like to hear from
more.
But it sounds like we have some proposals afoot that sound attractive. If Eli
is happy with them, we may not need a big discussion.
--
John Wiegley GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com 60E1 46C4 BD1A 7AC1 4BA2
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: Dired: Improve symmetry in mark/unmark commands bound to keys
2016-09-26 19:02 ` Eli Zaretskii
@ 2016-10-03 9:21 ` Tino Calancha
2016-10-03 9:54 ` Eli Zaretskii
0 siblings, 1 reply; 31+ messages in thread
From: Tino Calancha @ 2016-10-03 9:21 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Emacs developers, schwab, drew.adams, Tino Calancha
[-- Attachment #1: Type: text/plain, Size: 5012 bytes --]
On Mon, 26 Sep 2016, Eli Zaretskii wrote:
>> From: Tino Calancha <tino.calancha@gmail.com>
>> Date: Tue, 27 Sep 2016 01:30:35 +0900 (JST)
>>
>>> I believe Eli has proposed a solution that offers a middle ground. Can we move
>>> to discussing that?
>> Yes, we can talk about that.
>> Eli suggestion would be consistent with Dired if, for instance:
>> I) C-u * . el RET
>> ;; unmark
>> II) C-u C-u * . el RET
>> ;; prompt for the marker char.
>
> FWIW, I'm okay with this.
>
>> I mean, we should not invert the number of C-u's in I) II)
>
> Indeed, no need.
>
> Thanks.
Thank you Eli. I propose following patch:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
From 53e519484ea22e47f12ac761e2684e38cdf55d0e Mon Sep 17 00:00:00 2001
From: Tino Calancha <tino.calancha@gmail.com>
Date: Mon, 3 Oct 2016 18:15:27 +0900
Subject: [PATCH] dired-mark-extension: Unmark if called with C-u prefix
See discussion in #Bug2518 and:
https://lists.gnu.org/archive/html/emacs-devel/2016-09/msg00711.html
* lisp/dired-x.el (dired-mark-extension):
Update interactive calls: a prefix arg C-u unmark files;
a prefix C-u C-u prompt for MARKER-CHAR and mark files with it.
(dired-mark-sexp):
Show in the prompt that we are unmarking if called with a prefix argument.
* doc/misc/dired-x.texi: Update documentation for 'dired-mark-extension'.
---
doc/misc/dired-x.texi | 6 ++++--
lisp/dired-x.el | 38 +++++++++++++++++++++++++++-----------
2 files changed, 31 insertions(+), 13 deletions(-)
diff --git a/doc/misc/dired-x.texi b/doc/misc/dired-x.texi
index 2391852..0b03486 100644
--- a/doc/misc/dired-x.texi
+++ b/doc/misc/dired-x.texi
@@ -710,8 +710,10 @@ Advanced Mark Commands
@findex dired-mark-extension
Mark all files with a certain extension for use in later commands. A @samp{.}
is not automatically prepended to the string entered, you must type it
-explicitly. If invoked with a prefix argument, this command asks for
-a character to use as the marker.
+explicitly.
+If invoked with prefix argument @kbd{C-u}, this command unmark files instead.
+Calling it with the @kbd{C-u C-u} prefix, asks for a character to use
+as the marker, and mark files with it.
When called from Lisp, @var{extension} may also be a list of extensions
and an optional argument @var{marker-char} specifies the marker used.
diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index 7d73c42..7f0ab95 100644
--- a/lisp/dired-x.el
+++ b/lisp/dired-x.el
@@ -334,17 +334,27 @@ dired-mark-extension
A `.' is *not* automatically prepended to the string entered.
EXTENSION may also be a list of extensions instead of a single one.
Optional MARKER-CHAR is marker to use.
-Interactively, ask for EXTENSION, and if invoked with a prefix
-argument, for MARKER-CHAR as well."
+Interactively, ask for EXTENSION.
+Prefixed with one C-u, unmark files instead.
+Prefixed with two C-u’s, prompt for MARKER-CHAR and mark files with it."
(interactive
- (list (read-string "Marking extension: ")
- (and current-prefix-arg
- (let* ((dflt (char-to-string dired-marker-char))
- (input (read-string
- (format
- "Marker character to use (default %s): " dflt)
- nil nil dflt)))
- (aref input 0)))))
+ (let ((suffix
+ (read-string (format "%s extension: "
+ (if (equal current-prefix-arg '(4))
+ "UNmarking"
+ "Marking"))))
+ (marker
+ (pcase current-prefix-arg
+ ('(4) ?\s)
+ ('(16)
+ (let* ((dflt (char-to-string dired-marker-char))
+ (input (read-string
+ (format
+ "Marker character to use (default %s): " dflt)
+ nil nil dflt)))
+ (aref input 0)))
+ (_ dired-marker-char))))
+ (list suffix marker)))
(or (listp extension)
(setq extension (list extension)))
(dired-mark-files-regexp
@@ -1470,7 +1480,13 @@ dired-mark-sexp
;; (string-match "foo" sym) into which a user would soon fall.
;; Give `equal' instead of `=' in the example, as this works on
;; integers and strings.
- (interactive "xMark if (lisp expr): \nP")
+ (interactive
+ (list (read--expression
+ (format "%s if (lisp expr): "
+ (if current-prefix-arg
+ "UNmark"
+ "Mark")))
+ current-prefix-arg))
(message "%s" predicate)
(let ((dired-marker-char (if unflag-p ?\040 dired-marker-char))
inode s mode nlink uid gid size time name sym)
--
2.9.3
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
In GNU Emacs 26.0.50.3 (x86_64-pc-linux-gnu, GTK+ Version 3.22.0)
of 2016-10-03 built on calancha-pc
Repository revision: 8cd975cebd588d5435fa2b333dba6c526e602933
^ permalink raw reply related [flat|nested] 31+ messages in thread
* Re: Dired: Improve symmetry in mark/unmark commands bound to keys
2016-10-03 9:21 ` Tino Calancha
@ 2016-10-03 9:54 ` Eli Zaretskii
2016-10-03 11:15 ` Tino Calancha
0 siblings, 1 reply; 31+ messages in thread
From: Eli Zaretskii @ 2016-10-03 9:54 UTC (permalink / raw)
To: Tino Calancha; +Cc: emacs-devel
> From: Tino Calancha <tino.calancha@gmail.com>
> Date: Mon, 3 Oct 2016 18:21:51 +0900 (JST)
> cc: Tino Calancha <tino.calancha@gmail.com>, schwab@linux-m68k.org,
> drew.adams@oracle.com, Emacs developers <emacs-devel@gnu.org>
>
> > FWIW, I'm okay with this.
> >
> >> I mean, we should not invert the number of C-u's in I) II)
> >
> > Indeed, no need.
> >
> > Thanks.
> Thank you Eli. I propose following patch:
Thanks, I have a couple of minor comments below.
> * doc/misc/dired-x.texi: Update documentation for 'dired-mark-extension'.
This part of the log entry should state in parentheses the node in
which the change is being made, as if the node were a function.
> is not automatically prepended to the string entered, you must type it
> -explicitly. If invoked with a prefix argument, this command asks for
> -a character to use as the marker.
> +explicitly.
> +If invoked with prefix argument @kbd{C-u}, this command unmark files instead.
> +Calling it with the @kbd{C-u C-u} prefix, asks for a character to use
^^^^^^^^^^
"If called" sounds better and more correct English-wise.
> +as the marker, and mark files with it.
^^^^
"marks"
> +Prefixed with two C-u’s, prompt for MARKER-CHAR and mark files with it."
^
Please use the ASCII apostrophe character ' here, not ’, so that the
user could control the result via text-quoting-style.
With the above gotchas fixed, this is okay for the master branch.
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: Dired: Improve symmetry in mark/unmark commands bound to keys
2016-10-03 9:54 ` Eli Zaretskii
@ 2016-10-03 11:15 ` Tino Calancha
0 siblings, 0 replies; 31+ messages in thread
From: Tino Calancha @ 2016-10-03 11:15 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Emacs developers, Tino Calancha
[-- Attachment #1: Type: text/plain, Size: 1226 bytes --]
On Mon, 3 Oct 2016, Eli Zaretskii wrote:
> Thanks, I have a couple of minor comments below.
>
>> * doc/misc/dired-x.texi: Update documentation for 'dired-mark-extension'.
>
> This part of the log entry should state in parentheses the node in
> which the change is being made, as if the node were a function.
>
>> is not automatically prepended to the string entered, you must type it
>> -explicitly. If invoked with a prefix argument, this command asks for
>> -a character to use as the marker.
>> +explicitly.
>> +If invoked with prefix argument @kbd{C-u}, this command unmark files instead.
>> +Calling it with the @kbd{C-u C-u} prefix, asks for a character to use
> ^^^^^^^^^^
> "If called" sounds better and more correct English-wise.
>
>> +as the marker, and mark files with it.
> ^^^^
> "marks"
>
>> +Prefixed with two C-u’s, prompt for MARKER-CHAR and mark files with it."
> ^
> Please use the ASCII apostrophe character ' here, not ’, so that the
> user could control the result via text-quoting-style.
>
> With the above gotchas fixed, this is okay for the master branch.
Thank you.
Pushed a corrected patch with your comments to master branch
as commit 3b6eb948
^ permalink raw reply [flat|nested] 31+ messages in thread
end of thread, other threads:[~2016-10-03 11:15 UTC | newest]
Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-24 17:31 Dired: Improve symmetry in mark/unmark commands bound to keys Tino Calancha
2016-09-24 18:12 ` Eli Zaretskii
2016-09-24 18:25 ` Tino Calancha
2016-09-24 19:31 ` Andreas Schwab
2016-09-24 19:39 ` Eli Zaretskii
2016-09-24 19:46 ` Andreas Schwab
2016-09-24 19:58 ` Eli Zaretskii
2016-09-24 20:07 ` Andreas Schwab
2016-09-24 23:49 ` Drew Adams
2016-09-25 9:06 ` Tino Calancha
2016-09-25 18:55 ` John Wiegley
2016-09-26 9:23 ` Tino Calancha
2016-09-26 11:05 ` Tino Calancha
2016-09-26 15:02 ` Eli Zaretskii
2016-09-26 15:06 ` Eli Zaretskii
2016-09-26 15:47 ` John Wiegley
2016-09-26 16:30 ` Tino Calancha
2016-09-26 19:02 ` Eli Zaretskii
2016-10-03 9:21 ` Tino Calancha
2016-10-03 9:54 ` Eli Zaretskii
2016-10-03 11:15 ` Tino Calancha
2016-09-26 21:52 ` John Wiegley
2016-09-25 19:14 ` Eli Zaretskii
2016-09-25 22:43 ` Andreas Schwab
2016-09-25 22:58 ` Andreas Schwab
2016-09-25 23:00 ` Andreas Schwab
2016-09-26 2:38 ` Eli Zaretskii
2016-09-26 8:33 ` Andreas Schwab
2016-09-26 14:59 ` Eli Zaretskii
2016-09-24 19:49 ` Tino Calancha
[not found] <<alpine.DEB.2.20.1609250230400.4103@calancha-pc>
[not found] ` <<83oa3db20a.fsf@gnu.org>
2016-09-24 18:53 ` Drew Adams
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).