Commit graph

110 commits

Author SHA1 Message Date
Juri Linkov
9711c8c2b4 * lisp/repeat.el (describe-repeat-maps): More outlines and page separators. 2022-11-18 09:19:23 +02:00
Juri Linkov
875a8582ec * lisp/repeat.el (describe-repeat-maps): Use fill-region-as-paragraph. 2022-11-17 19:54:33 +02:00
Juri Linkov
d6c1c76ba4 * lisp/repeat.el (describe-repeat-maps): Improve the output.
Print the table of keybindings and a list of commands that
enter and exit repeat-map.  Use default outline headings.
https://lists.gnu.org/archive/html/emacs-devel/2022-11/msg00969.html
2022-11-17 09:28:32 +02:00
Juri Linkov
95efafb726 * lisp/repeat.el (repeat-exit): Add autoload cookie. 2022-10-05 22:47:42 +03:00
Juri Linkov
b374952b51 * lisp/repeat.el (repeat-exit-key): Replace type 'key-sequence' with 'key'.
(repeat-post-hook, repeat-echo-message-string): Add backward-compatibility
code for repeat-exit-key to keep support for 'key-sequence' type (bug#55986).
2022-10-03 22:55:11 +03:00
Juri Linkov
b67dc85e22 * lisp/repeat.el (repeat-exit): New command.
(repeat-exit-function): New variable.
(repeat-post-hook): Set repeat-exit-function.
Call repeat-exit from run-with-idle-timer.
Also use repeat--exit.
(repeat--exit): New internal function.
2022-10-03 22:55:11 +03:00
Juri Linkov
70b58d3eb4 * lisp/repeat.el (repeat<defgroup>): New customization group.
(repeat-too-dangerous, repeat-on-final-keystroke)
(repeat-exit-key, repeat-exit-timeout, repeat-keep-prefix)
(repeat-check-key, repeat-echo-function, repeat-mode):
Change group to 'repeat'.
2022-10-02 21:14:42 +03:00
Juri Linkov
5866fd5fec * lisp/repeat.el (describe-repeat-maps): Handle non-symbol keymap (bug#21634). 2022-07-06 20:40:48 +03:00
Stefan Kangas
05297e40c0 Quote some literal keys to get help-key-binding face
* lisp/align.el (align):
* lisp/bindings.el (undo-repeat-map):
* lisp/calc/calc-embed.el (calc-do-embedded):
* lisp/calc/calc-prog.el (calc-user-define-invocation):
* lisp/calc/calc-yank.el (calc--edit-mode):
* lisp/comint.el (comint-history-isearch)
* lisp/dired.el (dired-mode):
* lisp/emulation/viper.el (viper-mode):
* lisp/erc/erc-button.el (erc-button-face):
* lisp/erc/erc-track.el (erc-track-enable-keybindings):
* lisp/gnus/gnus-art.el (gnus-article-button-face):
* lisp/gnus/gnus-eform.el (gnus-edit-form):
* lisp/gnus/gnus-sum.el (gnus-summary-stop-at-end-of-message)
(gnus-summary-goto-unread):
* lisp/icomplete.el (icomplete-show-matches-on-no-input):
* lisp/image-mode.el (image-scroll-up):
* lisp/international/iso-transl.el (iso-transl-set-language):
* lisp/isearch.el (isearch-forward-regexp):
* lisp/misc.el (butterfly):
* lisp/outline.el (outline-minor-mode-cycle-filter)
(outline-minor-mode-cycle):
* lisp/progmodes/grep.el (rgrep):
* lisp/progmodes/gud.el (gud-gdb-repeat-map, gud-sdb-repeat-map)
(gud-dbx-repeat-map, gud-xdb-repeat-map, gud-perldb-repeat-map)
(gud-pdb-repeat-map, gud-guiler-repeat-map, gud-jdb-repeat-map):
* lisp/progmodes/idlw-shell.el (idlwave-shell-graphics-window-size)
(idlwave-shell-mode):
* lisp/progmodes/idlwave.el (idlwave-shell-debug-modifiers)
(idlwave-list-shell-load-path-shadows):
* lisp/progmodes/python.el (python-shell-get-process-or-error):
* lisp/repeat.el (repeat-check-key):
* lisp/replace.el (query-replace, query-replace-regexp)
(read-regexp):
* lisp/simple.el (read-extended-command-predicate):
* lisp/tab-bar.el (tab-bar-switch-repeat-map)
(tab-bar-move-repeat-map):
* lisp/term.el (ansi-term):
* lisp/textmodes/reftex-index.el (reftex-index-phrases-set-macro-key):
* lisp/vc/emerge.el (emerge-scroll-left, emerge-scroll-right):
* lisp/windmove.el:
* lisp/winner.el (winner-mode): Quote literal keys to get
'help-key-binding' face.
* lisp/comint.el (comint-insert-previous-argument): Use regular
quotes.
2022-07-03 23:31:31 +02:00
Juri Linkov
ae31dd5306 Use more help-key-binding faces in repeat-mode message
* lisp/repeat.el (repeat-echo-message-string): Use
substitute-command-keys for repeat-exit-key as well.
2022-07-03 20:02:02 +03:00
Stefan Kangas
4b9b1ea6a0 Use help-key-binding face in repeat-mode message
* lisp/repeat.el (repeat-echo-message-string): Use
substitute-command-keys.
2022-07-02 17:09:22 +02:00
Tassilo Horn
5e40c5a3be Merge from origin/emacs-28
f3acc09377 ; Revert "Use file-in-directory-p instead of obsolete dire...
5082d74cfd ; * lisp/recentf.el: Fix typo.
3f66e2a903 * lisp/repeat.el (repeat-mode): Fix message format.
137539c125 Clarify autotype.texi text slightly
2022-06-21 21:53:57 +02:00
Stefan Kangas
3f66e2a903 * lisp/repeat.el (repeat-mode): Fix message format. 2022-06-21 13:57:30 +02:00
Lars Ingebrigtsen
a7ee25e903 Make describe-repeat-maps fontify key bindings
* lisp/repeat.el (describe-repeat-maps): Fontify key bindings as
key bindings.
2022-06-19 16:21:14 +02:00
Visuwesh
7547e4e60e repeat-mode: Don't echo unset keys in help message
* repeat.el (repeat-echo-message-string): Check if the key is set.
(bug#55977)
2022-06-15 10:24:33 +03:00
Lars Ingebrigtsen
d036891967 Fix the final divergent single quote usages in doc strings
* lisp/view.el (view-mode-map):
* lisp/repeat.el (repeat-is-really-this-command):
* lisp/help.el (substitute-command-keys):
* lisp/electric.el (electric-quote-mode):
* lisp/cedet/srecode/texi.el (srecode-texi-texify-docstring):
* lisp/cedet/semantic/sort.el
(semantic-orphaned-member-metaparent-type): Audit usages of single
quotes in doc strings.
2022-05-24 18:48:50 +02:00
Eli Zaretskii
dcd76bd48d Merge from origin/emacs-28
836be7a112 ; * etc/refcards/ru-refcard.tex: Update Copyright year.
86cbc6ee4a * lisp/net/tramp-sh.el: Adapt copyright year
ebe8772f65 ; Minor fixes related to copyright years
23c1ee6989 ; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye...
8d3fc7ec89 * src/xfaces.c (face_for_font): Make 'hash' be uintptr_t.
19dcb237b5 ; Add 2022 to copyright years.

# Conflicts:
#	etc/NEWS
#	etc/refcards/ru-refcard.tex
#	lib/cdefs.h
#	lisp/erc/erc-dcc.el
#	lisp/erc/erc-imenu.el
#	lisp/erc/erc-replace.el
#	lisp/image-dired.el
#	lisp/progmodes/xref.el
#	m4/alloca.m4
#	m4/byteswap.m4
#	m4/errno_h.m4
#	m4/getopt.m4
#	m4/gnulib-common.m4
#	m4/inttypes.m4
#	m4/stddef_h.m4
#	m4/stdint.m4
#	m4/sys_socket_h.m4
2022-01-01 07:03:03 -05:00
Eli Zaretskii
19dcb237b5 ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
Stefan Kangas
48d1e6e9d9 Merge from origin/emacs-28
f38dfa56a0 ; Update loaddefs files.
b3d4b18507 ; make change-history-commit
334ff0232e * lisp/repeat.el: Use same logic for repeat-check-key and ...
8230a47ecc * lisp/help.el (help--analyze-key): Prefer posn-set-point ...

# Conflicts:
#	lisp/ldefs-boot.el
2021-12-02 17:34:10 +01:00
Juri Linkov
334ff0232e * lisp/repeat.el: Use same logic for repeat-check-key and repeat-exit-timeout.
* lisp/repeat.el (repeat-check-key): Use for repeat-check-key the same logic
as is used for repeat-exit-timeout in repeat-post-hook (bug#51390).
(repeat-post-hook): Check for repeat-exit-timeout symbol property.
2021-12-01 19:41:37 +02:00
Stefan Kangas
93d9bc09f4 Merge from origin/emacs-28
e632b83a28 Update authors.el for Emacs 28
e9fdb11903 ; * ChangeLog.3: Some additional fixes.
8fa4749df1 ; * ChangeLog.3: Filename fixes.
ea5a90b4f4 * lisp/repeat.el: Fix long-standing problem when a random ...
ef4954b69c * lisp/repeat.el (repeat-keep-prefix): Change default to nil.
6d5886e780 * test/lisp/repeat-tests.el (repeat-tests-call-b): Test fo...
9e16c6a96d ; * src/comp.c (syms_of_comp) <comp-no-native-file-h>: Doc...
9aa8fd6e62 * src/callint.c (Fcall_interactively): Fix inhibit_mouse_e...
70c229b1fc Fix regression in gdb-frame-handler
cd9dd26d24 Format and index concept 'predicate' in ELisp Intro
ab291656d0 ; * ChangeLog.3: Fix typos.
354f6c5609 ; * ChangeLog.3: Formatting fixes.
6192525a96 ; make change-history-commit
2021-12-01 06:30:22 +01:00
Juri Linkov
ea5a90b4f4 * lisp/repeat.el: Fix long-standing problem when a random key activates map
* lisp/repeat.el (repeat-check-key): New defcustom (bug#51390).
(repeat--command-property): New internal function.
(repeat-check-key): New function.
(repeat-post-hook): Use repeat--command-property and repeat-check-key.

* test/lisp/repeat-tests.el (repeat-tests-check-key): New test.
2021-11-30 21:07:18 +02:00
Juri Linkov
ef4954b69c * lisp/repeat.el (repeat-keep-prefix): Change default to nil.
'repeat-keep-prefix' doesn't yet have sufficient support
that covers all cases in bug#51281, so it's disabled now.
2021-11-30 21:07:18 +02:00
Gregory Heytings
49422d2e69 Do not buttonize key bindings outside of *Help* buffers
* etc/NEWS: Mention the new variable.

* lisp/apropos.el (apropos-describe-plist): Bind the new
variable (bug#52053).
* lisp/button.el (button-describe): Bind the new variable.

* lisp/help-fns.el (describe-function, describe-variable)
(describe-face, describe-symbol, describe-syntax)
(describe-categories, describe-keymap, describe-mode)
(describe-widget): Bind the new variable.

* lisp/help-macro.el (make-help-screen): Bind the new variable.

* lisp/help.el (help-buffer-under-preparation): New variable
that is bound to t by commands that create a *Help* buffer.
(substitute-command-keys): Use the new variable:
help-link-key-to-documentation is supposed to have an effect
only "in *Help* buffers". Fixes bug#52053.
(view-lossage, describe-bindings, describe-key): Bind the new
variable.

* lisp/repeat.el (describe-repeat-maps): Bind the new variable.

* lisp/international/mule-cmds.el (describe-input-method)
(describe-language-environment): Bind the new variable.

* lisp/international/mule-diag.el (describe-character-set)
(describe-coding-system, describe-font, describe-fontset)
((list-fontsets): Bind the new variable.
2021-11-29 15:13:31 +01:00
Narendra Joshi
588caf0b27 * lisp/repeat.el (repeat-post-hook): Add check symbolp rep-map.
Copyright-paperwork-exempt: yes
2021-11-25 09:58:53 +02:00
Robert Pluim
bf824843f4 * lisp/repeat.el (describe-repeat-maps): Print all bound keys (bug#49265). 2021-11-18 19:42:44 +02:00
Juri Linkov
b418aad85a * lisp/repeat.el (repeat-echo-message): Bind message-log-max to nil.
Don't insert messages about repeatable keys in the *Messages* buffer.
2021-11-15 19:53:29 +02:00
Robert Pluim
fe2ac7cb7c * lisp/repeat.el (describe-repeat-maps): Use help-fns--analyze-function.
Print keys bound to commands in every keymap (bug#49265)
2021-11-15 19:50:30 +02:00
Juri Linkov
c840bfe7e1 * lisp/repeat.el: Detect changes in the minibuffer state (bug#47566)
(repeat--prev-mb): New internal variable.
(repeat-post-hook): Check the property 'repeat-map' on the symbol
from 'this-command' in addition to 'real-this-command'.  Don't allow
repeatable maps in the activated minibuffer or in the minibuffer
from another command.  Set 'repeat--prev-mb' at the end.
2021-11-15 19:39:37 +02:00
Robert Pluim
9c37b812da ; * lisp/repeat.el (repeat-mode): Fix docstring typo. 2021-10-22 12:15:06 +02:00
Robert Pluim
caf87d80fa * lisp/repeat.el (repeat-keep-prefix): Expand description. 2021-10-22 11:33:16 +02:00
Juri Linkov
cb8b12b56d Improve docstrings and NEWS item of 'repeat-mode'
* lisp/repeat.el (repeat-exit-timeout, repeat-echo-function)
(repeat-in-progress, repeat-map): Update docstrings.
2021-10-20 20:16:57 +03:00
Stefan Kangas
aebba085cb ; More minor stylistic fixes found by checkdoc 2021-09-22 20:26:40 +02:00
Juri Linkov
de0b5227e0 * lisp/repeat.el (repeat-echo-message): Clear only own added part of message.
(describe-repeat-maps, repeat-mode): Refer to each other in docstrings.
2021-09-17 19:00:03 +03:00
Gabriel do Nascimento Ribeiro
46ff443dc0 Handle nil messages in repeat-echo-message.
* lisp/repeat.el (repeat-echo-message): Handle cases where
'current-message' is nil (bug#50176).
2021-08-25 20:10:28 +03:00
Mattias Engdegård
8620512361 ; * lisp/repeat.el (repeat-echo-message): Use string-search. 2021-08-24 15:57:38 +02:00
Gabriel do Nascimento Ribeiro
0c640b82f0 Fix to clear echo-area after repeat-exit-timeout.
* lisp/repeat.el (repeat-echo-message): Use 'string-match-p'
to handle cases where echo-area contains other messages (bug#50176).
2021-08-24 09:44:05 +03:00
Juri Linkov
4db28a9dc8 * lisp/repeat.el (describe-repeat-maps): Rename from `describe-repeat'.
Fix text strings (bug#49265).
2021-07-06 20:53:09 +03:00
Juri Linkov
94a2ef436b * lisp/repeat.el (describe-repeat): New command (bug#49265). 2021-06-29 23:36:16 +03:00
Juri Linkov
0fa959db20 * lisp/repeat.el (repeat-exit-timeout): New defcustom (bug#48472).
(repeat-exit-timer): New variable.
(repeat-post-hook): Run idle timer with an "exit function"
returned from set-transient-map.
Suggested by Gustavo Barros <gusbrs.2016@gmail.com>.

(repeat-echo-message): Remove own previous message when input arg is nil.

* lisp/window.el (display-buffer-override-next-command): Return exitfun.
2021-05-19 00:02:42 +03:00
Juri Linkov
4ddad8f1db repeat-echo-mode-line-string doesn't need risky-local-variable to keep props
(bug#47566)
2021-04-14 23:05:43 +03:00
Juri Linkov
8205108217 * lisp/repeat.el: Add option to indicate repeat-mode in mode-line (bug#47566)
* lisp/repeat.el (repeat-echo-function): Rename from repeat-mode-echo.
Add choice repeat-echo-mode-line.
(repeat-in-progress): New variable.
(repeat-post-hook): Call repeat-echo-function with nil arg
at the end of repeating sequence.
(repeat-echo-message-string): New function with body from repeat-post-hook.
(repeat-echo-message): Rename from repeat-mode-message.
(repeat-echo-mode-line-string): New variable.
(repeat-echo-mode-line): New function.
2021-04-14 21:10:00 +03:00
Juri Linkov
ed4b51962e * lisp/repeat.el (repeat-mode-echo): New defcustom.
(repeat-post-hook): Use it.
(repeat-mode-message): New function (bug#47566).
(repeat-post-hook): Use real-this-command instead of this-command
to handle e.g. rectangle-exchange-point-and-mark remapped to
exchange-point-and-mark (bug#47688).
2021-04-12 19:14:45 +03:00
Juri Linkov
b4eb84d4af * lisp/repeat.el (repeat-post-hook): Check for prefix-arg.
This is instead of checking for a list of argument-related commands
that set prefix-arg anyway.
2021-04-08 21:54:43 +03:00
Juri Linkov
580c4c6510 * lisp/repeat.el (repeat-post-hook): Skip repeating in minibuffer (bug#47566).
(repeat-map)<defvar>: Add docstring.
2021-04-08 21:54:43 +03:00
Juri Linkov
15de559d98 * lisp/repeat.el (repeat-keep-prefix): New defcustom.
* lisp/repeat.el (repeat-map): New autoloaded global variable.
(repeat-post-hook): Use 'repeat-map' when non-nil
and reset it to nil afterwards.
(repeat-post-hook): Keep the current prefix when
'repeat-keep-prefix' is non-nil.

* lisp/window.el (other-window-repeat-map): Add "O" that sets
'repeat-map' to 'other-window-repeat-map' before calling
'(other-window -1)'.

https://lists.gnu.org/archive/html/emacs-devel/2021-03/msg01387.html
2021-04-06 00:02:43 +03:00
Juri Linkov
9c51a9d000 * lisp/repeat.el (repeat-post-hook): Fix key lookup.
* lisp/repeat.el (repeat-post-hook): Rename let-bound repeat-map to rep-map.
Define let-bound prefix-command-p.  Use lookup-key with
this-single-command-keys instead of last-command-event.
Don't show message when typing prefix keys.
https://lists.gnu.org/archive/html/emacs-devel/2021-04/msg00083.html
2021-04-05 23:46:35 +03:00
Stefan Kangas
8b07994e20 Convert many more links to use HTTPS 2021-03-24 10:20:18 +01:00
Juri Linkov
12409c9064 New transient mode 'repeat-mode' to allow shorter key sequences (bug#46515)
* doc/emacs/basic.texi (Repeating): Document repeat-mode.

* lisp/repeat.el (repeat-exit-key): New defcustom.
(repeat-mode): New global minor mode.
(repeat-post-hook): New function.

* lisp/bindings.el (undo-repeat-map): New variable.
(undo): Put 'repeat-map' property with
'undo-repeat-map'.
(next-error-repeat-map): New variable.
(next-error, previous-error): Put 'repeat-map' property with
'next-error-repeat-map'.

* lisp/window.el (other-window-repeat-map): New variable.
(other-window): Put 'repeat-map' property with
'other-window-repeat-map'.
(resize-window-repeat-map): New variable.
(enlarge-window, enlarge-window-horizontally)
(shrink-window-horizontally, shrink-window): Put 'repeat-map'
property with 'resize-window-repeat-map'.
2021-02-17 20:04:42 +02:00
Sean Whitton
7016db933c Fix repeating complex commands
* lisp/repeat.el (repeat): Fix repeating complex commands
(bug#46290).  This makes `M-: date RET C-x z' work again (like in
Emacs 21, apparently).
2021-02-05 10:06:22 +01:00