summaryrefslogtreecommitdiff
path: root/lisp/keymap.el
Commit message (Collapse)AuthorAgeFilesLines
* Signal error on duplicate key definitionsRobert Pluim2022-08-021-1/+15
| | | | | | | | | | | * lisp/keymap.el (define-keymap, defvar-keymap): Signal error if the same key is specified twice. (Bug#56873) * doc/lispref/keymaps.texi (Creating Keymaps): Document error signaling behaviour. * test/src/keymap-tests.el (keymap-test-duplicate-definitions): Test duplicate definition detection.
* Declare `key-valid-p` and `readablep` as error-freeMattias Engdegård2022-07-311-1/+1
| | | | | | | * lisp/keymap.el (key-valid-p): * lisp/subr.el (readablep): These functions are effect-free; declare them correspondingly. Note that readablep is not pure since its return value depends on ambient state.
* Filter out NS non-key events from `where-is-internal'Lars Ingebrigtsen2022-06-181-0/+5
| | | | | | | | | | | * doc/lispref/keymaps.texi (Scanning Keymaps): Document it. * lisp/keymap.el (make-non-key-event): New function. * lisp/term/common-win.el (x-setup-function-keys): Mark ns events as not being keys (bug#55940). * src/keymap.c (Fwhere_is_internal): Filter out key sequences that are marked as being non-keys.
* Avoid "control-control-KEY" (bug#55738)Mattias Engdegård2022-06-181-7/+7
| | | | | | | | | | | | | | Constructs such as ?\C-^@ or ?\C-\C-m literally apply a Control modifier twice which doesn't make sense at all. What is really meant is a C0 base character with the Control modifier bit set. This change is only stylistic in nature. * lisp/edmacro.el (edmacro-format-keys): * lisp/keymap.el (key-parse): * lisp/subr.el (event-modifiers, event-basic-type): * test/lisp/subr-tests.el (subr-test-kbd): Use \0 and \r instead of ^@ and \C-m to represent NUL and RET when combined with other modifiers.
* Fix key-parse problem with C-x ( ... sequencesLars Ingebrigtsen2022-05-031-12/+1
| | | | | | | | * lisp/keymap.el (key-parse): Move the read-kbd-macro compat code from here... * lisp/subr.el (kbd): ... to here. (And fix the logic, too.) This allows `key-parse' to have a less puzzling result while maintaining backwards compatibility (bug#38775).
* Audit quoting the quote character in doc stringsLars Ingebrigtsen2022-04-221-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/src/regex-emacs-tests.el (regex-tests-compare): (regex-tests-compare): (regex-tests-match): * test/lisp/xml-tests.el (xml-parse-tests--qnames): * test/lisp/mh-e/mh-thread-tests.el (mh-thread-tests-before-from): * test/lisp/cedet/srecode-utest-template.el (srecode-utest-map-reset): * test/lisp/calc/calc-tests.el (calc-tests-equal): * lisp/window.el (get-lru-window): (get-mru-window): (get-largest-window): (quit-restore-window): (display-buffer): * lisp/vc/vc-rcs.el (vc-rcs-consult-headers): * lisp/url/url-auth.el (url-digest-auth-build-response): * lisp/tutorial.el (tutorial--find-changed-keys): * lisp/transient.el (transient-suffix-object): * lisp/textmodes/rst.el (rst-insert-list-new-item): * lisp/textmodes/bibtex.el (bibtex-clean-entry): * lisp/tab-bar.el (tab-bar--key-to-number): (toggle-frame-tab-bar): * lisp/ses.el (ses-recalculate-cell): (ses-define-local-printer): (ses-prin1): * lisp/progmodes/xref.el (xref--find-ignores-arguments): * lisp/progmodes/verilog-mode.el (verilog-single-declaration-end): * lisp/progmodes/tcl.el (tcl-mode-hook): * lisp/progmodes/gdb-mi.el (gdb-get-buffer-create): * lisp/progmodes/elisp-mode.el (elisp--xref-make-xref): * lisp/play/dunnet.el (dun-room-objects): * lisp/outline.el (outline--cycle-state): * lisp/org/ox-publish.el (org-publish-find-property): * lisp/org/ox-html.el (org-html--unlabel-latex-environment): * lisp/org/org-table.el (org-table-collapse-header): * lisp/org/org-plot.el (org--plot/prime-factors): * lisp/org/org-agenda.el (org-agenda--mark-blocked-entry): (org-agenda-set-restriction-lock): * lisp/org/ob-lua.el (org-babel-lua-read-string): * lisp/org/ob-julia.el (org-babel-julia-evaluate-external-process): (org-babel-julia-evaluate-session): * lisp/org/ob-core.el (org-babel-default-header-args): * lisp/obsolete/mouse-sel.el (mouse-select): (mouse-select-secondary): * lisp/net/tramp.el (tramp-methods): * lisp/net/eww.el (eww-accept-content-types): * lisp/net/dictionary-connection.el (dictionary-connection-status): * lisp/minibuffer.el (completion-flex--make-flex-pattern): * lisp/mh-e/mh-mime.el (mh-have-file-command): * lisp/mh-e/mh-limit.el (mh-subject-to-sequence): (mh-subject-to-sequence-threaded): (mh-subject-to-sequence-unthreaded): * lisp/mail/feedmail.el (feedmail-queue-buffer-file-name): (feedmail-vm-mail-mode): * lisp/ls-lisp.el (ls-lisp--sanitize-switches): * lisp/keymap.el (key-valid-p): * lisp/international/ccl.el (ccl-compile-branch-blocks): * lisp/image/image-converter.el (image-convert): * lisp/gnus/spam.el (spam-backend-check): * lisp/gnus/nnselect.el (nnselect-generate-artlist): * lisp/gnus/nnmairix.el (nnmairix-widget-other): * lisp/gnus/message.el (message-mailto): * lisp/gnus/gnus-sum.el (gnus-collect-urls-from-article): * lisp/gnus/gnus-search.el (gnus-search-prepare-query): * lisp/frame.el (frame-size-history): * lisp/eshell/esh-var.el (eshell-parse-variable-ref): * lisp/eshell/em-dirs.el (eshell-expand-multiple-dots): * lisp/erc/erc-backend.el (erc-bounds-of-word-at-point): * lisp/emulation/cua-rect.el (cua--rectangle-operation): * lisp/emacs-lisp/text-property-search.el (text-property-search-forward): * lisp/emacs-lisp/package.el (package-desc-suffix): * lisp/emacs-lisp/faceup.el (faceup-test-explain): * lisp/emacs-lisp/comp.el (comp-curr-allocation-class): (comp-alloc-class-to-container): (comp-add-cstrs): (comp-remove-type-hints-func): (batch-byte+native-compile): * lisp/emacs-lisp/cl-macs.el (cl--optimize): * lisp/elec-pair.el (electric-pair--syntax-ppss): * lisp/doc-view.el (doc-view-doc-type): * lisp/cedet/semantic/symref.el (semantic-symref-tool-alist): (semantic-symref-hit-to-tag-via-db): (semantic-symref-hit-to-tag-via-buffer): * lisp/cedet/semantic/lex-spp.el (semantic-lex-spp-get-overlay): * lisp/cedet/semantic/java.el (semantic-java-doc-keywords-map): * lisp/cedet/semantic/find.el (semantic-brute-find-tag-by-function): * lisp/cedet/semantic/db.el (semanticdb-project-predicate-functions): * lisp/cedet/semantic.el (semantic-working-type): * lisp/cedet/ede/files.el (ede-flush-directory-hash): * lisp/calc/calc.el (calc--header-line): * lisp/auth-source.el (auth-source-pick-first-password): (auth-source--decode-octal-string): * etc/themes/modus-themes.el (modus-themes--paren): (modus-themes--agenda-habit): * admin/cus-test.el (cus-test-vars-with-changed-state): Fix quoting in doc strings. In code examples, the ' character is quoted with \\=, and regularize 'foo to `foo', and quote strings like "foo" instead of 'foo'.
* Merge branch 'master' into scratch/correct-warning-posAlan Mackenzie2022-01-221-32/+32
|\
| * Make key-valid-p work in TurkeyLars Ingebrigtsen2022-01-201-32/+32
| | | | | | | | | | * lisp/keymap.el (key-valid-p): Inhibit case folding, otherwise (key-valid-p "I") would return nil in tr_TR environments.
* | Miscellaneous amendments to the scratch/correct-warning-pos branchAlan Mackenzie2022-01-221-5/+6
|/ | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/cedet/semantic/fw.el (semantic-alias-obsolete) (semantic-varalias-obsolete): Replace calls to byte-compile-warn with calls to byte-compile-warn-x (when it exists). * lisp/emacs-lisp/bytecomp.el (byte-compile-log-warning-function) (byte-compile--log-warning-for-byte-compile): Make the POSITION parameter no longer &optional (for the benefit of flymake on *.el). (byte-compile-log-warning): Replace a nil POSITION argument with an actual position. (byte-compile-file-form-require): Push the required symbol onto byte-compile-form-stack, for the benefit of `do-after-load-evaluation'. * lisp/keymap.el (define-keymap--compile): Replace four calls to byte-compile-warn with byte-compile-warn-x. * doc/lispref/elisp.texi (master menu): Add entries for Shorthands and Symbols with position. * doc/lispref/streams.texi (Input Functions): Document read-positioning-symbols. * doc/lispref/symbols.texi (Symbols): Add new menu entry. (Symbols with Position): New @section.
* Remove ambiguity from key-valid-p docstringRobert Pluim2022-01-041-1/+1
| | | | | * lisp/keymap.el (key-valid-p): Be explicit about the separator being one and only one space.
* Move define-keymap and defvar-keymap to keymap.elStefan Kangas2022-01-021-0/+133
| | | | | | | | | These functions deal with the "new" keymap binding interface, so they belong in keymap.el rather than in subr.el. * lisp/subr.el (define-keymap--compile, define-keymap) (defvar-keymap): Move from here ... * lisp/keymap.el (define-keymap--compile, define-keymap) (defvar-keymap): ... to here.
* ; Add 2022 to copyright years.Eli Zaretskii2022-01-011-1/+1
|
* ; * lisp/keymap.el (key-valid-p): Fix wording of doc string.Eli Zaretskii2021-12-281-1/+1
|
* Doc fix; fix terminology in key binding functionsStefan Kangas2021-12-271-4/+4
| | | | | * lisp/keymap.el (keymap-set, key-valid-p): * lisp/subr.el (define-keymap): Doc fix; improve terminology.
* Make keymap-lookup work for keymap results, tooLars Ingebrigtsen2021-12-101-2/+3
| | | | | * lisp/keymap.el (keymap-lookup): Make this function work for non-symbol lookups, too (bug#52374).
* Fix keymap-lookup implementationLars Ingebrigtsen2021-12-041-2/+2
| | | | | * lisp/keymap.el (keymap-lookup): Make this actually work for looking up keys.
* Fix some of the argument handling in keymap-set and keymap-substituteLars Ingebrigtsen2021-11-301-6/+5
| | | | | | | * lisp/keymap.el (keymap-set): Fix handling of binding one key to another key. (keymap-substitute): Fix confusion in implementation -- the args are definitions, not keys.
* Use compiler macros for the key syntax checksMattias Engdegård2021-11-281-1/+21
| | | | | | | | | | | | | | | | | | Compile-time key string syntax checks are better written using compiler macros than with byte-hunk-handlers inside the compiler proper. * lisp/emacs-lisp/bytecomp.el (byte-compile-define-keymap) (byte-compile-define-keymap--define): Remove. * lisp/keymap.el (keymap--compile-check): New. (keymap-set, keymap-global-set, keymap-local-set, keymap-global-unset) (keymap-local-unset, keymap-unset, keymap-substitute) (keymap-set-after, key-translate, keymap-lookup, keymap-local-lookup) (keymap-global-lookup): Use compiler-macro for argument checks. * lisp/subr.el (define-keymap--compile): New. (define-keymap--define): Fold into define-keymap. (define-keymap): Use compiler-macro. (defvar-keymap): Use define-keymap.
* Change the call signature to keymap-substituteLars Ingebrigtsen2021-11-171-1/+1
| | | | | | | * lisp/keymap.el (keymap-substitute): Make the keymap the first parameter for symmetry with the other functions. * lisp/emacs-lisp/shortdoc.el (keymaps): * lisp/emacs-lisp/bytecomp.el (lambda): Adjust.
* Make keymap-unset workLars Ingebrigtsen2021-11-161-1/+1
| | | | * lisp/keymap.el (keymap-unset): Fix key syntax (bug#51897).
* Add new 'keymap-*' functionsLars Ingebrigtsen2021-11-161-0/+437
* lisp/keymap.el: New file with all the new keymap-* functions. * lisp/loadup.el ("keymap"): Load. * lisp/subr.el (kbd): Refactor out all the code to key-parse. (define-key-after, keyboard-translate, global-set-key) (local-set-key, global-unset-key, local-unset-key) (local-key-binding, global-key-binding) (substitute-key-definition): Note in doc strings that these are legacy functions. (define-keymap--define): Use keymap-set. * lisp/emacs-lisp/byte-opt.el: Remove the optimizations for defvar-keymap and define-keymap since the macros now only understand the kbd syntax. * lisp/emacs-lisp/bytecomp.el (byte-compile-define-keymap) (byte-compile-define-keymap--define): Warn about invalid key definitions in all keymap-* functions. * lisp/emacs-lisp/shortdoc.el (keymaps): Add shortdocs form keymap* functions. * src/keymap.c (possibly_translate_key_sequence): Adjust callers to key-valid-p and key-parse. (syms_of_keymap): Adjust defs.