GNU bug report logs - #4362
23.1: proced -- Mode help lists 'd' as mark command (prefer 'm')

Previous Next

Package: emacs;

Reported by: Jari Aalto <jari.aalto <at> cante.net>

Date: Sun, 6 Sep 2009 17:35:06 UTC

Severity: normal

Done: Glenn Morris <rgm <at> gnu.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 4362 in the body.
You can then email your comments to 4362 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-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4362; Package emacs. (Sun, 06 Sep 2009 17:35:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jari Aalto <jari.aalto <at> cante.net>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sun, 06 Sep 2009 17:35:07 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Jari Aalto <jari.aalto <at> cante.net>
To: Emacs bug BTS <submit <at> debbugs.gnu.org>
Subject: 23.1: proced -- Mode help lists 'd' as mark command (prefer 'm')
Date: Sun, 06 Sep 2009 20:28:11 +0300
M-x proced
C-h m


    Proced: user by -PU mode:
    Mode for displaying UNIX system processes and sending signals to them.
    Type M-x proced to start a Proced session.  In a Proced buffer
>>  type d to mark a process for later commands.
    Type x to send signals to marked processes.

SUGGESITON

PLease prefer listing the 'm' as the mark command in the mode help
listing. 'd' and 'm' both seem to mark lines, but for mode help, listing
the 'm' would better follow the convention used in other buffers like buffer
list, dired etc.



Reply sent to Glenn Morris <rgm <at> gnu.org>:
You have taken responsibility. (Mon, 07 Sep 2009 02:45:04 GMT) Full text and rfc822 format available.

Notification sent to Jari Aalto <jari.aalto <at> cante.net>:
bug acknowledged by developer. (Mon, 07 Sep 2009 02:45:05 GMT) Full text and rfc822 format available.

Message #10 received at 4362-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 4362-done <at> debbugs.gnu.org
Subject: Re: bug#4362: 23.1: proced -- Mode help lists 'd' as mark command (prefer 'm')
Date: Sun, 06 Sep 2009 22:35:58 -0400
  * proced.el (proced-mode-map): Bind "d" to proced-mark-alt.
  (proced-mark-alt): New alias, to control the advertised key.  (Bug#4362)



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4362; Package emacs. (Wed, 09 Sep 2009 03:20:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juri Linkov <juri <at> jurta.org>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Wed, 09 Sep 2009 03:20:06 GMT) Full text and rfc822 format available.

Message #15 received at 4362 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: 4362 <at> debbugs.gnu.org
Cc: Glenn Morris <rgm <at> gnu.org>, Jari Aalto <jari.aalto <at> cante.net>
Subject: Re: bug#4362: 23.1: proced -- Mode help lists 'd' as mark command (prefer 'm')
Date: Wed, 09 Sep 2009 03:57:38 +0300
> M-x proced
> C-h m
>     Proced: user by -PU mode:
>     Mode for displaying UNIX system processes and sending signals to them.
>     Type M-x proced to start a Proced session.  In a Proced buffer
>>>  type d to mark a process for later commands.
>     Type x to send signals to marked processes.
>
> SUGGESITON
>
> PLease prefer listing the 'm' as the mark command in the mode help
> listing. 'd' and 'm' both seem to mark lines, but for mode help, listing
> the 'm' would better follow the convention used in other buffers like buffer
> list, dired etc.
>
> From: Glenn Morris <rgm <at> gnu.org>
> To: 4362-done <at> emacsbugs.donarmstrong.com
> Date: Sun, 06 Sep 2009 22:35:58 -0400
>
>   * proced.el (proced-mode-map): Bind "d" to proced-mark-alt.
>   (proced-mark-alt): New alias, to control the advertised key.  (Bug#4362)

But now `C-h m' displays:

m		proced-mark
d		proced-mark-alt

that causes a false impression that these commands are different.

A simpler fix would be just changing the order of `d' and `m' bindings
in `proced-mode-map' like:

@@ -459,8 +459,8 @@
     (define-key km [down] 'next-line)
     (define-key km [up] 'previous-line)
     ;; marking
-    (define-key km "d" 'proced-mark) ; Dired compatibility ("delete")
     (define-key km "m" 'proced-mark)
+    (define-key km "d" 'proced-mark) ; Dired compatibility ("delete")
     (define-key km "u" 'proced-unmark)
     (define-key km "\177" 'proced-unmark-backward)
     (define-key km "M" 'proced-mark-all)

But really I don't understand why `m' should be preferred to `d'?
In Proced like in Dired, `d' flags a process for deletion, and `x'
commits the operation.  `m' is an alias for `d' because currently there
is no more dired-like operations on processes.

The only reason to prefer `m' over `d' in the documentation now is
the fact that proced-mark marks a process with the "*" character
(like dired's `m' does) instead of "D" (like dired's "d" does)
until someone comes with an idea of different operations
for `m' and `d' in Proced like in Buffer-menu where they are bound
to different commands:

  m -- mark current line's buffer to be displayed.
  d -- mark that buffer to be deleted, and move down.
  x -- delete or save marked buffers.

-- 
Juri Linkov
http://www.jurta.org/emacs/



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4362; Package emacs. (Thu, 10 Sep 2009 02:05:09 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juri Linkov <juri <at> jurta.org>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Thu, 10 Sep 2009 02:05:09 GMT) Full text and rfc822 format available.

Message #20 received at 4362 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: 4362 <at> debbugs.gnu.org
Cc: Jari Aalto <jari.aalto <at> cante.net>
Subject: Re: bug#4362: 23.1: proced -- Mode help lists 'd' as mark command (prefer 'm')
Date: Thu, 10 Sep 2009 04:16:05 +0300
> @@ -459,8 +459,8 @@
>      (define-key km [down] 'next-line)
>      (define-key km [up] 'previous-line)
>      ;; marking
> -    (define-key km "d" 'proced-mark) ; Dired compatibility ("delete")
>      (define-key km "m" 'proced-mark)
> +    (define-key km "d" 'proced-mark) ; Dired compatibility ("delete")
>      (define-key km "u" 'proced-unmark)
>      (define-key km "\177" 'proced-unmark-backward)
>      (define-key km "M" 'proced-mark-all)

Hmm, the trick with changing the order of key bindings doesn't work
in `Buffer-menu-mode-map'.  It would be more preferable to mention "d"
instead of "k" as the key to mark that buffer to be deleted in the
*Buffer List*, but changing the order of

    (define-key map "d" 'Buffer-menu-delete)
    (define-key map "k" 'Buffer-menu-delete)

has no effect of the output of `C-h m' in the *Buffer List*.

-- 
Juri Linkov
http://www.jurta.org/emacs/



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4362; Package emacs. (Thu, 10 Sep 2009 06:35:03 GMT) Full text and rfc822 format available.

Message #23 received at 4362 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Juri Linkov <juri <at> jurta.org>
Cc: 4362 <at> debbugs.gnu.org, Jari Aalto <jari.aalto <at> cante.net>
Subject: Re: bug#4362: 23.1: proced -- Mode help lists 'd' as mark command (prefer 'm')
Date: Thu, 10 Sep 2009 02:27:49 -0400
Juri Linkov wrote:

> But now `C-h m' displays:
>
> m		proced-mark
> d		proced-mark-alt
>
> that causes a false impression that these commands are different.

Perhaps C-h m should merge aliases like where-is seems to do.

> A simpler fix would be just changing the order of `d' and `m' bindings
> in `proced-mode-map' like:

I just copied the undo/advertised-undo approach. Please feel free to
change this as you see fit.



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4362; Package emacs. (Fri, 11 Sep 2009 02:35:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juri Linkov <juri <at> jurta.org>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Fri, 11 Sep 2009 02:35:04 GMT) Full text and rfc822 format available.

Message #28 received at 4362 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 4362 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#4362: 23.1: proced -- Mode help lists 'd' as mark command (prefer 'm')
Date: Fri, 11 Sep 2009 04:17:04 +0300
>> But now `C-h m' displays:
>>
>> m		proced-mark
>> d		proced-mark-alt
>>
>> that causes a false impression that these commands are different.
>
> Perhaps C-h m should merge aliases like where-is seems to do.
>
>> A simpler fix would be just changing the order of `d' and `m' bindings
>> in `proced-mode-map' like:
>
> I just copied the undo/advertised-undo approach. Please feel free to
> change this as you see fit.

Using the `:advertised-binding' property just implemented by Stefan is
a nice solution.  But other changes in `where-is-internal' broke preferred
key bindings in docstrings.  For example, compare the old and new
output of `C-h f Info-mode RET':

- h	Invoke the Info tutorial.
+ M-x Info-help	Invoke the Info tutorial.

- u	Move "up" from this node.
+ ^	Move "up" from this node.

- t	Go to the Top node of this file.
+ <	Go to the Top node of this file.

- b	Go to beginning of node.
+ .	Go to beginning of node.

- w	Put name of current Info node in the kill ring.
+ c	Put name of current Info node in the kill ring.

Should we put `:advertised-binding' for all old preferred key bindings
explicitly?

-- 
Juri Linkov
http://www.jurta.org/emacs/



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4362; Package emacs. (Fri, 11 Sep 2009 05:20:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Fri, 11 Sep 2009 05:20:04 GMT) Full text and rfc822 format available.

Message #33 received at 4362 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Juri Linkov <juri <at> jurta.org>
Cc: Glenn Morris <rgm <at> gnu.org>, 4362 <at> debbugs.gnu.org
Subject: Re: bug#4362: 23.1: proced -- Mode help lists 'd' as mark command (prefer 'm')
Date: Fri, 11 Sep 2009 01:13:30 -0400
> Using the `:advertised-binding' property just implemented by Stefan is
> a nice solution.  But other changes in `where-is-internal' broke preferred
> key bindings in docstrings.  For example, compare the old and new
> output of `C-h f Info-mode RET':

> - h	Invoke the Info tutorial.
> + M-x Info-help	Invoke the Info tutorial.

I just fixed this one.  It was a plain bug.

> - u	Move "up" from this node.
> + ^	Move "up" from this node.

> - t	Go to the Top node of this file.
> + <	Go to the Top node of this file.

> - b	Go to beginning of node.
> + .	Go to beginning of node.

> - w	Put name of current Info node in the kill ring.
> + c	Put name of current Info node in the kill ring.

These are trickier.  I still haven't figured out why the preference
order has changed.  Admittedly, this order was arbitrary (doesn't even
depend on the order of calls to define-key since these bindings are
stored in the vector part of a dense map) and is also arbitrary in the
new code, but it would be better to preserve the old order.

> Should we put `:advertised-binding' for all old preferred key bindings
> explicitly?

Arguably, it would be good, yes.  But first, I'll try to adjust the code
to get back the original behavior.  Thanks for bringing it up.


        Stefan



Message #34 received at 4362-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Juri Linkov <juri <at> jurta.org>
Cc: Glenn Morris <rgm <at> gnu.org>
Subject: Re: bug#4362: 23.1: proced -- Mode help lists 'd' as mark command (prefer 'm')
Date: Fri, 11 Sep 2009 14:56:21 -0400
>> - u	Move "up" from this node.
>> + ^	Move "up" from this node.

>> - t	Go to the Top node of this file.
>> + <	Go to the Top node of this file.

>> - b	Go to beginning of node.
>> + .	Go to beginning of node.

>> - w	Put name of current Info node in the kill ring.
>> + c	Put name of current Info node in the kill ring.

> These are trickier.  I still haven't figured out why the preference
> order has changed.  Admittedly, this order was arbitrary (doesn't even
> depend on the order of calls to define-key since these bindings are
> stored in the vector part of a dense map) and is also arbitrary in the
> new code, but it would be better to preserve the old order.

Actually, having investigated it some more, I see that the source of the
discrepency is that the new code unifies different paths which
previously traversed the keymaps in different orders.  I.e. in Emacs-23,
the where-is-internal code traversed the keymaps slightly differently
depending on whether or not the cache was used.  So, in the above
example, C-h m (which calls where-is-internal in a way that doesn't use
the cache) returned "u" for Info-up, but the menu-bar entry for "Info =>
Up" listed "^" as the corresponding keybinding.

This explains why I didn't notice this difference: I mostly tested my
code by comparing the bindings listed in the menus.

>> Should we put `:advertised-binding' for all old preferred key bindings
>> explicitly?
> Arguably, it would be good, yes.  But first, I'll try to adjust the code
> to get back the original behavior.  Thanks for bringing it up.

So in the end I don't think the original behavior (i.e. inconsistent
between very slightly different situations) is desirable.  If people
really prefer "u" over "^", then they'll have to add
an :advertised-binding to it.  I personally do care either way.


        Stefan


PS: Note that the advantage of the :advertised-binding feature over the
use of "advertised-foo" aliases is that it doesn't suffer from as many
drawbacks, so it can be used more liberally.  The main drawback was of
course that (where-is 'undo) listed a whole bunch of bindings, but
ironically not the "advertised" one.

PPS: As for the actual proced-mark binding, I've just added
a :advertised-binding, which should fix this bug.



bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> emacsbugs.donarmstrong.com. (Sat, 10 Oct 2009 14:24:12 GMT) Full text and rfc822 format available.

This bug report was last modified 15 years and 256 days ago.

Previous Next


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