1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-08 12:40:49 -08:00

* lisp/keymap.el (define-keymap): Demote "duplicate def" to a warning

* test/src/keymap-tests.el (keymap-test-duplicate-definitions):
Adjust accordingly.
This commit is contained in:
Stefan Monnier 2024-01-12 18:05:14 -05:00
parent a764b503e1
commit eb779ae646
2 changed files with 22 additions and 7 deletions

View file

@ -23,6 +23,7 @@
;;; Code:
(require 'ert)
(require 'cl-lib)
(defun keymap-tests--make-keymap-test (fun)
(should (eq (car (funcall fun)) 'keymap))
@ -470,10 +471,18 @@ g .. h foo
ert-keymap-duplicate
"a" #'next-line
"a" #'previous-line))
(should-error
(define-keymap
"a" #'next-line
"a" #'previous-line)))
(let ((msg ""))
;; FIXME: It would be nicer to use `current-message' rather than override
;; `message', but `current-message' returns always nil in batch mode :-(
(cl-letf (((symbol-function 'message)
(lambda (fmt &rest args) (setq msg (apply #'format fmt args)))))
(should
(string-match "duplicate"
(progn
(define-keymap
"a" #'next-line
"a" #'previous-line)
msg))))))
(ert-deftest keymap-unset-test-remove-and-inheritance ()
"Check various behaviors of keymap-unset. (Bug#62207)"