mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-09 15:50:40 -08:00
read-multiple-choice: Add face when key not in name string
* lisp/emacs-lisp/rmc.el (rmc--add-key-description): Add face property also when key is not in the name string. * test/lisp/emacs-lisp/rmc-tests.el (test-rmc--add-key-description/with-attributes) (test-rmc--add-key-description/non-graphical-display): Update tests.
This commit is contained in:
parent
68f15e815e
commit
787030b021
2 changed files with 15 additions and 8 deletions
|
|
@ -22,8 +22,6 @@
|
|||
|
||||
;;; Commentary:
|
||||
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'ert)
|
||||
|
|
@ -45,13 +43,16 @@
|
|||
`(?y . ,(concat (propertize "y" 'face 'read-multiple-choice-face) "es"))))
|
||||
(should (equal-including-properties
|
||||
(rmc--add-key-description '(?n "foo"))
|
||||
'(?n . "[n] foo")))))
|
||||
`(?n . ,(concat "[" (propertize "n" 'face 'read-multiple-choice-face) "] foo"))))))
|
||||
|
||||
(ert-deftest test-rmc--add-key-description/non-graphical-display ()
|
||||
(cl-letf (((symbol-function 'display-supports-face-attributes-p) (lambda (_ _) nil)))
|
||||
(should (equal-including-properties
|
||||
(rmc--add-key-description '(?y "yes"))
|
||||
'(?y . "[Y]es")))))
|
||||
'(?y . "[Y]es")))
|
||||
(should (equal-including-properties
|
||||
(rmc--add-key-description '(?n "foo"))
|
||||
'(?n . "[n] foo")))))
|
||||
|
||||
(ert-deftest test-read-multiple-choice ()
|
||||
(dolist (char '(?y ?n))
|
||||
|
|
@ -60,6 +61,5 @@
|
|||
(should (equal (list char str)
|
||||
(read-multiple-choice "Do it? " '((?y "yes") (?n "no"))))))))
|
||||
|
||||
|
||||
(provide 'rmc-tests)
|
||||
;;; rmc-tests.el ends here
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue