GNU bug report logs - #49265
28.0.50; repeat mode feature request

Previous Next

Package: emacs;

Reported by: Ergus <spacibba <at> aol.com>

Date: Mon, 28 Jun 2021 22:15:01 UTC

Severity: wishlist

Tags: fixed

Fixed in version 28.0.50

Done: Juri Linkov <juri <at> linkov.net>

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 49265 in the body.
You can then email your comments to 49265 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#49265; Package emacs. (Mon, 28 Jun 2021 22:15:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ergus <spacibba <at> aol.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 28 Jun 2021 22:15:02 GMT) Full text and rfc822 format available.

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

From: Ergus <spacibba <at> aol.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; repeat mode feature request
Date: Tue, 29 Jun 2021 00:13:41 +0200
Is it possible to add a command to get information about the commands
that have a repeat map? Basically something to know the commands with
some associated repeat like list-repeat-commands or describe-repeat or
so?


In GNU Emacs 28.0.50 (build 50, x86_64-pc-linux-gnu, GTK+ Version 3.24.29, cairo version 1.17.4)
 of 2021-06-26 built on Ergus
Repository revision: b8f9e58ef72402e69a1f0960816184d52e5d2d29
Repository branch: master
System Description: Arch Linux

Configured using:
 'configure --prefix=/home/ergo/.local/ --with-mailutils --with-json
 --with-x-toolkit=gtk3 --with-xft --with-wide-int --with-modules
 --with-cairo --with-harfbuzz --with-native-compilation'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER
PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM
GTK3 ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: C++//law

Minor modes in effect:
  global-git-commit-mode: t
  magit-auto-revert-mode: t
  diff-hl-margin-mode: t
  windmove-mode: t
  subword-mode: t
  hide-ifdef-mode: t
  preproc-font-lock-mode: t
  shell-dirtrack-mode: t
  show-paren-mode: t
  global-auto-revert-mode: t
  xclip-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  electric-pair-mode: t
  flyspell-mode: t
  company-mode: t
  flycheck-mode: t
  counsel-mode: t
  ivy-mode: t
  composable-mark-mode: t
  composable-mode: t
  repeat-mode: t
  xterm-mouse-mode: t
  winner-mode: t
  save-place-mode: t
  which-key-mode: t
  override-global-mode: t
  delete-selection-mode: t
  savehist-mode: t
  global-display-fill-column-indicator-mode: t
  display-fill-column-indicator-mode: t
  global-display-line-numbers-mode: t
  display-line-numbers-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  size-indication-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t
  abbrev-mode: t

Load-path shadows:
/usr/share/emacs/site-lisp/cmake-mode hides /home/ergo/.emacs.d/elpa/cmake-mode-20210104.1831/cmake-mode
/usr/share/emacs/site-lisp/notmuch-crypto hides /home/ergo/.emacs.d/elpa/notmuch-20210627.1741/notmuch-crypto
/usr/share/emacs/site-lisp/notmuch-compat hides /home/ergo/.emacs.d/elpa/notmuch-20210627.1741/notmuch-compat
/usr/share/emacs/site-lisp/notmuch-hello hides /home/ergo/.emacs.d/elpa/notmuch-20210627.1741/notmuch-hello
/usr/share/emacs/site-lisp/notmuch hides /home/ergo/.emacs.d/elpa/notmuch-20210627.1741/notmuch
/usr/share/emacs/site-lisp/notmuch-show hides /home/ergo/.emacs.d/elpa/notmuch-20210627.1741/notmuch-show
/usr/share/emacs/site-lisp/notmuch-maildir-fcc hides /home/ergo/.emacs.d/elpa/notmuch-20210627.1741/notmuch-maildir-fcc
/usr/share/emacs/site-lisp/coolj hides /home/ergo/.emacs.d/elpa/notmuch-20210627.1741/coolj
/usr/share/emacs/site-lisp/notmuch-draft hides /home/ergo/.emacs.d/elpa/notmuch-20210627.1741/notmuch-draft
/usr/share/emacs/site-lisp/notmuch-tree hides /home/ergo/.emacs.d/elpa/notmuch-20210627.1741/notmuch-tree
/usr/share/emacs/site-lisp/notmuch-parser hides /home/ergo/.emacs.d/elpa/notmuch-20210627.1741/notmuch-parser
/usr/share/emacs/site-lisp/notmuch-lib hides /home/ergo/.emacs.d/elpa/notmuch-20210627.1741/notmuch-lib
/usr/share/emacs/site-lisp/notmuch-mua hides /home/ergo/.emacs.d/elpa/notmuch-20210627.1741/notmuch-mua
/usr/share/emacs/site-lisp/notmuch-message hides /home/ergo/.emacs.d/elpa/notmuch-20210627.1741/notmuch-message
/usr/share/emacs/site-lisp/notmuch-address hides /home/ergo/.emacs.d/elpa/notmuch-20210627.1741/notmuch-address
/usr/share/emacs/site-lisp/notmuch-wash hides /home/ergo/.emacs.d/elpa/notmuch-20210627.1741/notmuch-wash
/usr/share/emacs/site-lisp/notmuch-tag hides /home/ergo/.emacs.d/elpa/notmuch-20210627.1741/notmuch-tag
/usr/share/emacs/site-lisp/notmuch-print hides /home/ergo/.emacs.d/elpa/notmuch-20210627.1741/notmuch-print
/usr/share/emacs/site-lisp/notmuch-query hides /home/ergo/.emacs.d/elpa/notmuch-20210627.1741/notmuch-query
/usr/share/emacs/site-lisp/notmuch-jump hides /home/ergo/.emacs.d/elpa/notmuch-20210627.1741/notmuch-jump
/usr/share/emacs/site-lisp/notmuch-company hides /home/ergo/.emacs.d/elpa/notmuch-20210627.1741/notmuch-company
/home/ergo/.emacs.d/elpa/transient-20210619.1100/transient hides /home/ergo/.local/share/emacs/28.0.50/lisp/transient

Features:
(gnutls epa-file network-stream nsm mailalias smtpmail shadow sort
notmuch-company notmuch-lib notmuch-version notmuch-compat mm-view
mml-smime smime dig mail-extr emacsbug sendmail magit-extras hi-lock
magit-bookmark magit-submodule magit-obsolete magit-blame magit-stash
magit-reflog magit-bisect magit-push magit-pull magit-fetch magit-clone
magit-remote magit-commit magit-sequence magit-notes magit-worktree
magit-tag magit-merge magit-branch magit-reset magit-files magit-refs
magit-status magit package browse-url url url-proxy url-privacy
url-expand url-methods url-history url-cookie url-domsuf url-util
mailcap url-handlers magit-repos magit-apply magit-wip magit-log
which-func imenu magit-diff smerge-mode diff git-commit log-edit message
rmc puny rfc822 mml mml-sec epa derived epg epg-config gnus-util rmail
rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047
rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils
mailheader add-log magit-core magit-autorevert magit-margin
magit-transient magit-process with-editor server magit-mode transient
magit-git magit-section magit-utils crm tramp-cmds global-tags ht
generator async counsel-gtags pulse mc-separate-operations mc-edit-lines
mc-hide-unmatched-lines-mode mc-mark-more mc-cycle-cursors
multiple-cursors-core rect move-dup diff-hl-margin eieio-opt speedbar
ezimage dframe shortdoc help-fns radix-tree vc-annotate amx s windmove
misearch multi-isearch ffap url-parse url-vars face-remap vc-hg
macrostep-c cmacexp macrostep cap-words superword subword hideif
preproc-font-lock cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles
cc-align cc-engine cc-vars cc-defs dired-aux diff-hl-dired diff-hl
log-view pcvs-util vc-dir ewoc vc tramp-cache tramp-sh tramp
tramp-loaddefs trampver tramp-integration files-x tramp-compat shell
pcomplete parse-time iso8601 time-date ls-lisp format-spec auth-source
password-cache thingatpt vc-git diff-mode vc-dispatcher bookmark pp
paren autorevert filenotify xclip yasnippet-snippets yasnippet elec-pair
flyspell-correct-ivy flyspell-correct flyspell ispell company-keywords
company-gtags company-dabbrev-code company-dabbrev company-files
company-semantic company-template company-capf company flycheck json map
find-func dash counsel xdg xref project dired-x dired dired-loaddefs
compile text-property-search comint ansi-color swiper ivy-avy avy ivy
flx ivy-faces ivy-overlay colir pcase term/tmux term/xterm xterm
jka-compr init composable composable-mark powerline comp comp-cstr
warnings subr-x powerline-separators color powerline-themes repeat
xt-mouse simple-16-theme winner ring saveplace diminish edmacro kmacro
which-key advice configmail cl-extra help-mode use-package
use-package-ensure use-package-delight use-package-diminish
use-package-bind-key bind-key use-package-core disp-table delsel
savehist easy-mmode display-fill-column-indicator display-line-numbers
info ede/auto eieio-base cl-seq seq eieio byte-opt bytecomp byte-compile
cconv eieio-core cl-macs gv eieio-loaddefs cl-loaddefs cl-lib tex-site
rx slime-autoloads early-init iso-transl tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese composite charscript charprop case-table epa-hook
jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button
loaddefs faces cus-face macroexp files window text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote threads dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting cairo
move-toolbar gtk x-toolkit x multi-tty make-network-process
native-compile emacs)

Memory information:
((conses 16 823166 101330)
 (symbols 48 30979 0)
 (strings 32 108313 15470)
 (string-bytes 1 4432716)
 (vectors 16 58052)
 (vector-slots 8 1336021 43503)
 (floats 8 348 1228)
 (intervals 56 54166 1667)
 (buffers 992 38))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49265; Package emacs. (Tue, 29 Jun 2021 09:01:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Ergus <spacibba <at> aol.com>
Cc: 49265 <at> debbugs.gnu.org
Subject: Re: bug#49265: 28.0.50; repeat mode feature request
Date: Tue, 29 Jun 2021 11:38:42 +0300
> Is it possible to add a command to get information about the commands
> that have a repeat map? Basically something to know the commands with
> some associated repeat like list-repeat-commands or describe-repeat or
> so?

I thought that such a command could have the same prefix like 'repeat-help',
but prefixes 'list-' and 'describe-' are also fine.  Maybe it should be
similar to 'describe-bindings' or better 'describe-keymap'.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49265; Package emacs. (Tue, 29 Jun 2021 15:26:01 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Juri Linkov <juri <at> linkov.net>, Ergus <spacibba <at> aol.com>
Cc: "49265 <at> debbugs.gnu.org" <49265 <at> debbugs.gnu.org>
Subject: RE: [External] : bug#49265: 28.0.50; repeat mode feature request
Date: Tue, 29 Jun 2021 15:25:42 +0000
> > Is it possible to add a command to get information about the commands
> > that have a repeat map? Basically something to know the commands with
> > some associated repeat like list-repeat-commands or describe-repeat or
> > so?
> 
> I thought that such a command could have the same prefix like 'repeat-help',
> but prefixes 'list-' and 'describe-' are also fine.  Maybe it should be
> similar to 'describe-bindings' or better 'describe-keymap'.

I thought the question was whether Emacs automatically,
or already in some way, provides some a way of
determining (e.g. using Lisp code) whether a given
command is repeatable (i.e., by just holding down a key
that it's bound to).

If that's the question then I think the answer is no.
(Is that right?)
___

If the question is instead just whether there is some
naming convention for such repeatable commands, or if
it is just a suggestion to have such a convention, then
I'll offer the naming pattern I use for such commands:

I append `+' to the command name.

For example, I use `end-of-line+' as the name of my
repeatable version of `end-of-line'.

  If called interactively with no prefix arg:
     If the previous command was also `end-of-line+',
     then move to the end of the next line.  Else, move
     to the end of the current line.
  Otherwise, move to the end of the Nth next line (Nth
     previous line if N<0).  Command `end-of-line', by
     contrast, moves to the end of the (N-1)th next line.

Similarly, repeatable command `doremi-bg+' changes a
frame's background color incrementally.

IMO, it makes much more sense to use a suffix for a
"repeatable" indication than to use a prefix.  And
there's no need for a long (pre|suf)fix, such as
`repeat-'.

Emphasis should be on the actual command name, and not
on the fact that it's repeatable.  One char (or at most
`-' followed by a single char) should suffice.
___

The other part of the request is to have a command
that shows, describes, etc. only repeatable commands.
With my naming that trivially amounts to typing a
pattern that matches `+'.

Even if your completion method doesn't let you limit
matches to `+' only at the end of the name, you'll
likely get only repeatable commands, as there aren't
many existing commands with `+' in the name.

And of course it's easy to define a command that
matches only command names with `+' at the end.
And such a command could do anything you like with
the result (describe all matching commands, return
nil or non-nil for a given command-name arg,...).






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49265; Package emacs. (Tue, 29 Jun 2021 20:39:01 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Ergus <spacibba <at> aol.com>
Cc: 49265 <at> debbugs.gnu.org
Subject: Re: bug#49265: 28.0.50; repeat mode feature request
Date: Tue, 29 Jun 2021 23:36:42 +0300
>> Is it possible to add a command to get information about the commands
>> that have a repeat map? Basically something to know the commands with
>> some associated repeat like list-repeat-commands or describe-repeat or
>> so?
>
> I thought that such a command could have the same prefix like 'repeat-help',
> but prefixes 'list-' and 'describe-' are also fine.  Maybe it should be
> similar to 'describe-bindings' or better 'describe-keymap'.

Now a new command named 'describe-repeat' was pushed to master.  Please try it.
If everything is right, this request could be closed.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49265; Package emacs. (Tue, 29 Jun 2021 20:39:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: "49265 <at> debbugs.gnu.org" <49265 <at> debbugs.gnu.org>, Ergus <spacibba <at> aol.com>
Subject: Re: [External] : bug#49265: 28.0.50; repeat mode feature request
Date: Tue, 29 Jun 2021 23:37:23 +0300
> I thought the question was whether Emacs automatically,
> or already in some way, provides some a way of
> determining (e.g. using Lisp code) whether a given
> command is repeatable (i.e., by just holding down a key
> that it's bound to).
>
> If that's the question then I think the answer is no.
> (Is that right?)

The request was to create a new command that lists all repeatable
commands and keymaps.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49265; Package emacs. (Tue, 29 Jun 2021 21:29:01 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: "49265 <at> debbugs.gnu.org" <49265 <at> debbugs.gnu.org>, Ergus <spacibba <at> aol.com>
Subject: RE: [External] : bug#49265: 28.0.50; repeat mode feature request
Date: Tue, 29 Jun 2021 21:28:44 +0000
> > I thought the question was whether Emacs automatically,
> > or already in some way, provides some a way of
> > determining (e.g. using Lisp code) whether a given
> > command is repeatable (i.e., by just holding down a key
> > that it's bound to).
> >
> > If that's the question then I think the answer is no.
> > (Is that right?)
> 
> The request was to create a new command that lists all
> repeatable commands and keymaps.

Which amounts to the same thing: determining whether
a given command is repeatable.  I don't think Emacs has
a way of determining that.  (It would even seem to be
undecidable...)

(Though I don't know what you might mean by "and keymaps".
Repeatable keymaps?)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49265; Package emacs. (Tue, 29 Jun 2021 21:34:02 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Juri Linkov <juri <at> linkov.net>, Ergus <spacibba <at> aol.com>
Cc: "49265 <at> debbugs.gnu.org" <49265 <at> debbugs.gnu.org>
Subject: RE: [External] : bug#49265: 28.0.50; repeat mode feature request
Date: Tue, 29 Jun 2021 21:33:07 +0000
> Now a new command named 'describe-repeat' was pushed to master.  Please try
> it.  If everything is right, this request could be closed.

Where was it added to master?  I downloaded the latest
help-fns.el, and I don't see it there.  Could you perhaps
post the code here?  Could you perhaps say, here, just
what it does?  Thx.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49265; Package emacs. (Wed, 30 Jun 2021 09:51:02 GMT) Full text and rfc822 format available.

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

From: Robert Pluim <rpluim <at> gmail.com>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: "49265 <at> debbugs.gnu.org" <49265 <at> debbugs.gnu.org>, Ergus <spacibba <at> aol.com>,
 Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#49265: [External] : bug#49265: 28.0.50; repeat mode feature
 request
Date: Wed, 30 Jun 2021 11:50:43 +0200
>>>>> On Tue, 29 Jun 2021 21:28:44 +0000, Drew Adams <drew.adams <at> oracle.com> said:

    >> > I thought the question was whether Emacs automatically,
    >> > or already in some way, provides some a way of
    >> > determining (e.g. using Lisp code) whether a given
    >> > command is repeatable (i.e., by just holding down a key
    >> > that it's bound to).
    >> >
    >> > If that's the question then I think the answer is no.
    >> > (Is that right?)
    >> 
    >> The request was to create a new command that lists all
    >> repeatable commands and keymaps.

    Drew> Which amounts to the same thing: determining whether
    Drew> a given command is repeatable.  I don't think Emacs has
    Drew> a way of determining that.  (It would even seem to be
    Drew> undecidable...)

(mapatoms (lambda (sym)
            (and (commandp sym)
                 (get sym 'repeat-map)
                 (message "repeatable %s" sym))))

gets you the potentially repeatable commands. Whether theyʼre actually
repeatable depends on whether 'repeat-mode' is active.

    Drew> (Though I don't know what you might mean by "and keymaps".
    Drew> Repeatable keymaps?)

Bindings to repeatable commands maybe?

Robert
-- 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49265; Package emacs. (Wed, 30 Jun 2021 10:00:02 GMT) Full text and rfc822 format available.

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

From: Robert Pluim <rpluim <at> gmail.com>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: "49265 <at> debbugs.gnu.org" <49265 <at> debbugs.gnu.org>, Ergus <spacibba <at> aol.com>,
 Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#49265: [External] : bug#49265: 28.0.50; repeat mode feature
 request
Date: Wed, 30 Jun 2021 11:59:07 +0200
>>>>> On Tue, 29 Jun 2021 21:33:07 +0000, Drew Adams <drew.adams <at> oracle.com> said:

    >> Now a new command named 'describe-repeat' was pushed to master.  Please try
    >> it.  If everything is right, this request could be closed.

    Drew> Where was it added to master?  I downloaded the latest
    Drew> help-fns.el, and I don't see it there.  Could you perhaps
    Drew> post the code here?  Could you perhaps say, here, just
    Drew> what it does?  Thx.

Itʼs in repeat.el (and it does what I described 30 seconds ago, but
better :-) )

Iʼm not sure what the use of showing the keymaps is though. Theyʼre an
internal implementation detail, showing the potential bindings would
be more useful.

(defun describe-repeat ()
  "Describe repeatable commands and keymaps."
  (interactive)
  (help-setup-xref (list #'describe-repeat)
                   (called-interactively-p 'interactive))
  (let ((keymaps nil))
    (all-completions
     "" obarray (lambda (s)
                  (and (commandp s)
                       (get s 'repeat-map)
                       (push s (alist-get (get s 'repeat-map) keymaps)))))
    (with-help-window (help-buffer)
      (with-current-buffer standard-output
        (princ "This is a list of repeatable keymaps and commands.\n\n")

        (dolist (keymap (sort keymaps (lambda (a b) (string-lessp (car a) (car b)))))
          (princ (format-message "`%s' keymap is repeatable by these commands:\n"
                                 (car keymap)))
          (dolist (command (sort (cdr keymap) 'string-lessp))
            (princ (format-message " `%s'\n" command)))
          (princ "\n"))))))


Robert
-- 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49265; Package emacs. (Wed, 30 Jun 2021 15:11:03 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: "49265 <at> debbugs.gnu.org" <49265 <at> debbugs.gnu.org>, Ergus <spacibba <at> aol.com>,
 Juri Linkov <juri <at> linkov.net>
Subject: RE: bug#49265: [External] : bug#49265: 28.0.50; repeat mode feature
 request
Date: Wed, 30 Jun 2021 15:10:24 +0000
>     >> > I thought the question was whether Emacs automatically,
>     >> > or already in some way, provides some a way of
>     >> > determining (e.g. using Lisp code) whether a given
>     >> > command is repeatable (i.e., by just holding down a key
>     >> > that it's bound to).
>     >> >
>     >> > If that's the question then I think the answer is no.
>     >> > (Is that right?)
>     >>
>     >> The request was to create a new command that lists all
>     >> repeatable commands and keymaps.
> 
>     Drew> Which amounts to the same thing: determining whether
>     Drew> a given command is repeatable.  I don't think Emacs has
>     Drew> a way of determining that.  (It would even seem to be
>     Drew> undecidable...)
> 
> (mapatoms (lambda (sym)
>             (and (commandp sym)
>                  (get sym 'repeat-map)
>                  (message "repeatable %s" sym))))
> 
> gets you the potentially repeatable commands. Whether theyʼre
> actually repeatable depends on whether 'repeat-mode' is active.

I see.  But `repeat-map' and the code supporting the code
you show are not in any Emacs release.  They're not even
in Emacs 28 code from earlier this year.  They're in the
repeat.el I just downloaded from Master - OK.

But it's possible to define repeatable commands that
don't use repeat.el at all.

I think my general statement stands, that it's impossible
for this check to be fully accurate/complete.  At the
very least, its doc should make clear that it makes sense
only (1) starting with Emacs 28 and (2) only for repeatable
commands defined using repeat.el code.

(Of course, for Emacs 28 we need not say it's only for
Emacs 28 or later.  But some communication of that fact
would help users.)

>   Drew> (Though I don't know what you might mean by "and keymaps".
>   Drew> Repeatable keymaps?)
> 
> Bindings to repeatable commands maybe?

Maybe; who knows?  A binding to a command is not a
keymap, and vice versa.  (A key can be bound to a
keymap, however.)

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49265; Package emacs. (Wed, 30 Jun 2021 15:12:02 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: "49265 <at> debbugs.gnu.org" <49265 <at> debbugs.gnu.org>, Ergus <spacibba <at> aol.com>,
 Juri Linkov <juri <at> linkov.net>
Subject: RE: bug#49265: [External] : bug#49265: 28.0.50; repeat mode feature
 request
Date: Wed, 30 Jun 2021 15:11:07 +0000
>   >> Now a new command named 'describe-repeat' was pushed to master.
>   >> Please try it.  If everything is right, this request could be
>   >> closed.
> 
>   Drew> Where was it added to master?  I downloaded the latest
>   Drew> help-fns.el, and I don't see it there.  Could you perhaps
>   Drew> post the code here?  Could you perhaps say, here, just
>   Drew> what it does?  Thx.
> 
> Itʼs in repeat.el (and it does what I described 30 seconds ago, but
> better :-) )
> 
> Iʼm not sure what the use of showing the keymaps is though. Theyʼre an
> internal implementation detail, showing the potential bindings would
> be more useful.
> 
> (defun describe-repeat ()
>   "Describe repeatable commands and keymaps."

Again, that's wrong.  "Repeatable keymaps" doesn't
mean anything (to me, anyway).  If you mean describe
the keys bound to repeatable commands then say that.

>   (interactive)
>   (help-setup-xref (list #'describe-repeat)
>                    (called-interactively-p 'interactive))
>   (let ((keymaps nil))
>     (all-completions
>      "" obarray (lambda (s)
>                   (and (commandp s)
>                        (get s 'repeat-map)
>                        (push s (alist-get
>                                  (get s 'repeat-map)
>                                  keymaps)))))
>     (with-help-window (help-buffer)
>       (with-current-buffer standard-output
>         (princ "This is a list of repeatable keymaps and commands.\n\n")

Again, "repeatable keymaps" is a misnomer.

>         (dolist (keymap (sort keymaps (lambda (a b) (string-lessp (car a)
> (car b)))))
>           (princ (format-message "`%s' keymap is repeatable by these
> commands:\n"

How is a _keymap_ "repeatable"?

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49265; Package emacs. (Wed, 30 Jun 2021 20:05:03 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: "49265 <at> debbugs.gnu.org" <49265 <at> debbugs.gnu.org>, Ergus <spacibba <at> aol.com>,
 Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#49265: [External] : bug#49265: 28.0.50; repeat mode feature
 request
Date: Wed, 30 Jun 2021 22:55:33 +0300
> Iʼm not sure what the use of showing the keymaps is though. Theyʼre an
> internal implementation detail, showing the potential bindings would
> be more useful.

I agree, keybindings could be added as well.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49265; Package emacs. (Wed, 30 Jun 2021 20:05:03 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: "49265 <at> debbugs.gnu.org" <49265 <at> debbugs.gnu.org>,
 Robert Pluim <rpluim <at> gmail.com>, Ergus <spacibba <at> aol.com>
Subject: Re: bug#49265: [External] : bug#49265: 28.0.50; repeat mode feature
 request
Date: Wed, 30 Jun 2021 22:56:12 +0300
>>   "Describe repeatable commands and keymaps."
>
> Again, that's wrong.  "Repeatable keymaps" doesn't
> mean anything (to me, anyway).  If you mean describe
> the keys bound to repeatable commands then say that.

Repeatable keymaps are keymaps with repeatable commands.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49265; Package emacs. (Wed, 30 Jun 2021 21:16:02 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: "49265 <at> debbugs.gnu.org" <49265 <at> debbugs.gnu.org>,
 Robert Pluim <rpluim <at> gmail.com>, Ergus <spacibba <at> aol.com>
Subject: RE: bug#49265: [External] : bug#49265: 28.0.50; repeat mode feature
 request
Date: Wed, 30 Jun 2021 21:15:34 +0000
> >>   "Describe repeatable commands and keymaps."
> >
> > Again, that's wrong.  "Repeatable keymaps" doesn't
> > mean anything (to me, anyway).  If you mean describe
> > the keys bound to repeatable commands then say that.
> 
> Repeatable keymaps are keymaps with repeatable commands.

Why?  Do we define that term anywhere?  A keymap is,
itself, not something that can be repeated in any way.

And what constitutes a keymap with repeatable commands?
Is a keymap with one repeatable command repeatable, even
if it also has bindings for commands that are not
repeatable?

What's the use in listing such keymaps?  And what does
it mean to describe them?  `describe-keymap' lists the
bindings of a keymap.  But your reply to Robert, saying
that "keybindings could be added as well", suggests that
you mean something different by describing a keymap than
what `describe-keymap' does, which is to list a keymap's
key bindings.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49265; Package emacs. (Sun, 04 Jul 2021 20:41:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: "49265 <at> debbugs.gnu.org" <49265 <at> debbugs.gnu.org>,
 Robert Pluim <rpluim <at> gmail.com>, Ergus <spacibba <at> aol.com>
Subject: Re: bug#49265: [External] : bug#49265: 28.0.50; repeat mode feature
 request
Date: Sun, 04 Jul 2021 23:31:33 +0300
>> >>   "Describe repeatable commands and keymaps."
>> >
>> > Again, that's wrong.  "Repeatable keymaps" doesn't
>> > mean anything (to me, anyway).  If you mean describe
>> > the keys bound to repeatable commands then say that.
>
> And what constitutes a keymap with repeatable commands?
> Is a keymap with one repeatable command repeatable, even
> if it also has bindings for commands that are not
> repeatable?

I don't see where is "Repeatable keymaps" used?
The above docstring is

  "Describe repeatable commands and keymaps."

i.e. "repeatable commands" and also their "keymaps".




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49265; Package emacs. (Sun, 04 Jul 2021 21:10:02 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: "49265 <at> debbugs.gnu.org" <49265 <at> debbugs.gnu.org>,
 Robert Pluim <rpluim <at> gmail.com>, Ergus <spacibba <at> aol.com>
Subject: RE: bug#49265: [External] : bug#49265: 28.0.50; repeat mode feature
 request
Date: Sun, 4 Jul 2021 21:09:24 +0000
> >> >>   "Describe repeatable commands and keymaps."
> >> >
> >> > Again, that's wrong.  "Repeatable keymaps" doesn't
> >> > mean anything (to me, anyway).  If you mean describe
> >> > the keys bound to repeatable commands then say that.
> >
> > And what constitutes a keymap with repeatable commands?
> > Is a keymap with one repeatable command repeatable, even
> > if it also has bindings for commands that are not
> > repeatable?
> 
> I don't see where is "Repeatable keymaps" used?
> The above docstring is
> 
>   "Describe repeatable commands and keymaps."
> 
> i.e. "repeatable commands" and also their "keymaps".

The text is ambiguous.  If that's what you mean,
please reword it.  For example, this unambiguously
applies "repeatable" only to "commands":

  Describe keymaps and repeatable commands.

But is "describe keymaps" appropriate?  Or are the
keymaps that are described here only certain ones?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49265; Package emacs. (Mon, 05 Jul 2021 09:49:02 GMT) Full text and rfc822 format available.

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

From: Robert Pluim <rpluim <at> gmail.com>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: "49265 <at> debbugs.gnu.org" <49265 <at> debbugs.gnu.org>, Ergus <spacibba <at> aol.com>,
 Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#49265: [External] : bug#49265: 28.0.50; repeat mode feature
 request
Date: Mon, 05 Jul 2021 11:48:28 +0200
>>>>> On Sun, 4 Jul 2021 21:09:24 +0000, Drew Adams <drew.adams <at> oracle.com> said:

    >> >> >>   "Describe repeatable commands and keymaps."
    >> >> >
    >> >> > Again, that's wrong.  "Repeatable keymaps" doesn't
    >> >> > mean anything (to me, anyway).  If you mean describe
    >> >> > the keys bound to repeatable commands then say that.
    >> >
    >> > And what constitutes a keymap with repeatable commands?
    >> > Is a keymap with one repeatable command repeatable, even
    >> > if it also has bindings for commands that are not
    >> > repeatable?
    >> 
    >> I don't see where is "Repeatable keymaps" used?
    >> The above docstring is
    >> 
    >> "Describe repeatable commands and keymaps."
    >> 
    >> i.e. "repeatable commands" and also their "keymaps".

    Drew> The text is ambiguous.  If that's what you mean,
    Drew> please reword it.  For example, this unambiguously
    Drew> applies "repeatable" only to "commands":

    Drew>   Describe keymaps and repeatable commands.

    Drew> But is "describe keymaps" appropriate?  Or are the
    Drew> keymaps that are described here only certain ones?

It only describes keymaps that have bindings to repeatable commands in
them. I still think we should not mention keymaps at all, only bindings.

Robert
-- 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49265; Package emacs. (Mon, 05 Jul 2021 14:54:01 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: "49265 <at> debbugs.gnu.org" <49265 <at> debbugs.gnu.org>, Ergus <spacibba <at> aol.com>,
 Juri Linkov <juri <at> linkov.net>
Subject: RE: bug#49265: [External] : bug#49265: 28.0.50; repeat mode feature
 request
Date: Mon, 5 Jul 2021 14:53:28 +0000
>     Drew> The text is ambiguous.  If that's what you mean,
>     Drew> please reword it.  For example, this unambiguously
>     Drew> applies "repeatable" only to "commands":
> 
>     Drew>   Describe keymaps and repeatable commands.
> 
>     Drew> But is "describe keymaps" appropriate?  Or are the
>     Drew> keymaps that are described here only certain ones?
> 
> It only describes keymaps that have bindings to
> repeatable commands in them.

Yes, that's what I understood.  So the proposed doc
misleads.  (And it doesn't describe all such keymaps,
because it doesn't consider all repeatable commands -
see next.)

> I still think we should not mention keymaps at all, only bindings.

I agree.

And as I mentioned earlier, it should be made clear
in the doc that "repeatable" here means only commands
defined using `repeat.el'.

There are other ways to define repeatable commands,
and those commands aren't represented by this
describe feature.

(It's not even clear to me that this feature really
helps users.  A naming convention (combined with
`commandp', of course) makes more sense to me.)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49265; Package emacs. (Mon, 05 Jul 2021 21:43:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: "49265 <at> debbugs.gnu.org" <49265 <at> debbugs.gnu.org>, Ergus <spacibba <at> aol.com>,
 Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#49265: [External] : bug#49265: 28.0.50; repeat mode feature
 request
Date: Tue, 06 Jul 2021 00:04:07 +0300
>     Drew>   Describe keymaps and repeatable commands.
>
>     Drew> But is "describe keymaps" appropriate?  Or are the
>     Drew> keymaps that are described here only certain ones?
>
> It only describes keymaps that have bindings to repeatable commands in
> them. I still think we should not mention keymaps at all, only bindings.

I checked again, and it seems everything is already correct:
currently the Help buffer groups repeatable commands
by the keymap that is activated in post-command-hook.

Then keymap names have links to the Help buffer that
shows information about the keymap: all its keybindings, etc.
using `describe-keymap'.
Also every command has a link to the Help buffer
that describes that command.

Indeed, there is text "keymap is repeatable by these commands"
in the sense that the keymap is activated for repetition
in post-command-hook.

Maybe Drew could suggest a better text?

One thing I see that could be improved is a too ambiguous name `describe-repeat'.
I propose to rename this command to `describe-repeat-mode'.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49265; Package emacs. (Tue, 06 Jul 2021 01:32:02 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Juri Linkov <juri <at> linkov.net>, Robert Pluim <rpluim <at> gmail.com>
Cc: "49265 <at> debbugs.gnu.org" <49265 <at> debbugs.gnu.org>, Ergus <spacibba <at> aol.com>
Subject: RE: bug#49265: [External] : bug#49265: 28.0.50; repeat mode feature
 request
Date: Tue, 6 Jul 2021 01:31:49 +0000
> Indeed, there is text "keymap is repeatable by these commands"
> in the sense that the keymap is activated for repetition
> in post-command-hook.

I don't think the particular meaning you claim there
is suggested by that wording, i.e., that readers will
understand such an esoteric meaning of "repeatable"
as applied to a keymap.

> Maybe Drew could suggest a better text?

My suggestion would be to not say anything about the
keymaps involved.  What's the purpose in trying to do
that?  What additional help do you mean to provide
by it?

> One thing I see that could be improved is a too ambiguous
> name `describe-repeat'.

The problem isn't ambiguity, IMO.  It's that the name
and the description are overly general.  Only some
repeatable commands are covered by this (apparently).

> I propose to rename this command to `describe-repeat-mode'.

That sounds like it's a command that describes some
mode called `repeat-mode'.

I don't have a great suggestion for the name.  IIUC,
the command lists bindings of commands that are
defined using function `repeat'.

Maybe `list-repeat-commands', as OP suggested.  Or
maybe `describe-repeat-bindings', as it is bindings
that are listed/described.  I don't think it's
about describing the commands - their bindings are
listed.

(`repeat' vs `repeatable', since it's limited to
commands defined using repeat.el.)  





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49265; Package emacs. (Tue, 06 Jul 2021 17:56:01 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: "49265 <at> debbugs.gnu.org" <49265 <at> debbugs.gnu.org>,
 Robert Pluim <rpluim <at> gmail.com>, Ergus <spacibba <at> aol.com>
Subject: Re: bug#49265: [External] : bug#49265: 28.0.50; repeat mode feature
 request
Date: Tue, 06 Jul 2021 20:54:06 +0300
tags 49265 fixed
close 49265 28.0.50
thanks

>> Maybe Drew could suggest a better text?
>
> My suggestion would be to not say anything about the
> keymaps involved.  What's the purpose in trying to do
> that?  What additional help do you mean to provide
> by it?

But the keymaps are the essential part of this feature.

>> I propose to rename this command to `describe-repeat-mode'.
>
> That sounds like it's a command that describes some
> mode called `repeat-mode'.

This is correct, the mode is called `repeat-mode'.

> I don't have a great suggestion for the name.  IIUC,
> the command lists bindings of commands that are
> defined using function `repeat'.
>
> Maybe `list-repeat-commands', as OP suggested.  Or
> maybe `describe-repeat-bindings', as it is bindings
> that are listed/described.  I don't think it's
> about describing the commands - their bindings are
> listed.

Thanks for the suggestion, this helped to rename it
to the most proper name `describe-repeat-maps',
because this feature is based on `repeat-map' props.
Also did my best to fix text strings.




Added tag(s) fixed. Request was from Juri Linkov <juri <at> linkov.net> to control <at> debbugs.gnu.org. (Tue, 06 Jul 2021 17:56:01 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.0.50, send any further explanations to 49265 <at> debbugs.gnu.org and Ergus <spacibba <at> aol.com> Request was from Juri Linkov <juri <at> linkov.net> to control <at> debbugs.gnu.org. (Tue, 06 Jul 2021 17:56:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49265; Package emacs. (Tue, 06 Jul 2021 18:26:01 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: "49265 <at> debbugs.gnu.org" <49265 <at> debbugs.gnu.org>,
 Robert Pluim <rpluim <at> gmail.com>, Ergus <spacibba <at> aol.com>
Subject: RE: bug#49265: [External] : bug#49265: 28.0.50; repeat mode feature
 request
Date: Tue, 6 Jul 2021 18:25:51 +0000
> >> Maybe Drew could suggest a better text?
> >
> > My suggestion would be to not say anything about the
> > keymaps involved.  What's the purpose in trying to do
> > that?  What additional help do you mean to provide
> > by it?
> 
> But the keymaps are the essential part of this feature.

Sorry, I haven't understood that.  How so?
What does the doc/help tell us about their
importance for "this feature"?

> >> I propose to rename this command to `describe-repeat-mode'.
> >
> > That sounds like it's a command that describes some
> > mode called `repeat-mode'.
> 
> This is correct, the mode is called `repeat-mode'.

I see.  I don't see that in Emacs releases.
Presumably it is new for Emacs 28.  So does
this command describe the mode?  Or does it
just list key bindings (as `describe-keymap'
does)?

> > I don't have a great suggestion for the name.  IIUC,
> > the command lists bindings of commands that are
> > defined using function `repeat'.
> >
> > Maybe `list-repeat-commands', as OP suggested.  Or
> > maybe `describe-repeat-bindings', as it is bindings
> > that are listed/described.  I don't think it's
> > about describing the commands - their bindings are
> > listed.
> 
> Thanks for the suggestion, this helped to rename it
> to the most proper name `describe-repeat-maps',
> because this feature is based on `repeat-map' props.
> Also did my best to fix text strings.

So are there multiple repeat maps?  And what
about what you hinted above - that this command
describes `repeat-mode'?  Is there perhaps a
`repeat-mode-map', and is this about that?

Not clear to me (not that that matters).




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

bug unarchived. Request was from Juri Linkov <juri <at> linkov.net> to control <at> debbugs.gnu.org. (Mon, 15 Nov 2021 17:30:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49265; Package emacs. (Mon, 15 Nov 2021 17:52:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: 49265 <at> debbugs.gnu.org
Subject: Re: bug#49265: [External] : bug#49265: 28.0.50; repeat mode feature
 request
Date: Mon, 15 Nov 2021 19:51:03 +0200
[Here is a link to the previous discussion:
https://lists.gnu.org/archive/html/emacs-devel/2021-10/msg01730.html ]

> >> Thanks, I tried this out, and everything looks nice.
> >> I could push this in the next few days after trying to solve
> >> remaining problems:

> Thereʼs no rush

Sorry for the delay.  Now your patch is pushed.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49265; Package emacs. (Mon, 15 Nov 2021 18:23:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: 49265 <at> debbugs.gnu.org
Subject: Re: bug#49265: [External] : bug#49265: 28.0.50; repeat mode feature
 request
Date: Mon, 15 Nov 2021 20:21:16 +0200
> [Here is a link to the previous discussion:
> https://lists.gnu.org/archive/html/emacs-devel/2021-10/msg01730.html ]
>
>> >> Thanks, I tried this out, and everything looks nice.
>> >> I could push this in the next few days after trying to solve
>> >> remaining problems:
>
>> Thereʼs no rush
>
> Sorry for the delay.  Now your patch is pushed.

I noticed one shortcoming: describe-repeat-maps prints
only one keybinding for every command.  But sometimes
the same command is bound to more than 1 key in the same keymap.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49265; Package emacs. (Wed, 17 Nov 2021 17:08:01 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: 49265 <at> debbugs.gnu.org
Subject: Re: bug#49265: [External] : bug#49265: 28.0.50; repeat mode feature
 request
Date: Wed, 17 Nov 2021 19:01:37 +0200
Hi Robert,

What do you think about using `map-keymap' in `describe-repeat-maps'
to fix the following problem?  Could it help to print all keys
bound to the same command?

> I noticed one shortcoming: describe-repeat-maps prints
> only one keybinding for every command.  But sometimes
> the same command is bound to more than 1 key in the same keymap.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49265; Package emacs. (Thu, 18 Nov 2021 10:17:02 GMT) Full text and rfc822 format available.

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

From: Robert Pluim <rpluim <at> gmail.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: 49265 <at> debbugs.gnu.org
Subject: Re: bug#49265: [External] : bug#49265: 28.0.50; repeat mode feature
 request
Date: Thu, 18 Nov 2021 11:16:24 +0100
>>>>> On Wed, 17 Nov 2021 19:01:37 +0200, Juri Linkov <juri <at> linkov.net> said:

    Juri> Hi Robert,
    Juri> What do you think about using `map-keymap' in `describe-repeat-maps'
    Juri> to fix the following problem?  Could it help to print all keys
    Juri> bound to the same command?

    >> I noticed one shortcoming: describe-repeat-maps prints
    >> only one keybinding for every command.  But sometimes
    >> the same command is bound to more than 1 key in the same keymap.

You donʼt need `map-keymap' for that:

diff --git a/lisp/repeat.el b/lisp/repeat.el
index 45201ad1aa..5458ff30e5 100644
--- a/lisp/repeat.el
+++ b/lisp/repeat.el
@@ -533,10 +533,11 @@ describe-repeat-maps
           (dolist (command (sort (cdr keymap) 'string-lessp))
             (let* ((info (help-fns--analyze-function command))
                    (map (list (symbol-value (car keymap))))
-                   (desc (key-description
-                          (or (where-is-internal command map t)
-                              (where-is-internal (nth 3 info) map t)))))
-              (princ (format-message " `%s' (bound to '%s')\n" command desc))))
+                   (desc (mapconcat (lambda (key)
+                                      (format "'%s'" (key-description key)))
+                                    (or (where-is-internal command map)
+                                        (where-is-internal (nth 3 info) map)) ", ")))
+              (princ (format-message " `%s' (bound to %s)\n" command desc))))
           (princ "\n"))))))
 
 (provide 'repeat)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49265; Package emacs. (Thu, 18 Nov 2021 17:46:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: 49265 <at> debbugs.gnu.org
Subject: Re: bug#49265: [External] : bug#49265: 28.0.50; repeat mode feature
 request
Date: Thu, 18 Nov 2021 19:44:34 +0200
>     Juri> Hi Robert,
>     Juri> What do you think about using `map-keymap' in `describe-repeat-maps'
>     Juri> to fix the following problem?  Could it help to print all keys
>     Juri> bound to the same command?
>
>     >> I noticed one shortcoming: describe-repeat-maps prints
>     >> only one keybinding for every command.  But sometimes
>     >> the same command is bound to more than 1 key in the same keymap.
>
> You donʼt need `map-keymap' for that:
>
> +                   (desc (mapconcat (lambda (key)
> +                                      (format "'%s'" (key-description key)))
> +                                    (or (where-is-internal command map)
> +                                        (where-is-internal (nth 3 info) map)) ", ")))
> +              (princ (format-message " `%s' (bound to %s)\n" command desc))))

Thanks, works nicely, so pushed it now.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 17 Dec 2021 12:24:14 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 121 days ago.

Previous Next


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