diff options
| author | Stefan Kangas | 2021-12-26 06:47:15 +0100 |
|---|---|---|
| committer | Stefan Kangas | 2021-12-26 17:05:39 +0100 |
| commit | 40dcf9c2abd62425e599f30548dc53fa58fe2202 (patch) | |
| tree | 66cf9b740b06d5c9317d35b2bbc34e23692f77be /test | |
| parent | 1e7786437d3d471bffe48d91a067556f9223e9cf (diff) | |
| download | emacs-40dcf9c2abd62425e599f30548dc53fa58fe2202.tar.gz emacs-40dcf9c2abd62425e599f30548dc53fa58fe2202.zip | |
read-multiple-choice: Display "SPC" instead of " "
* lisp/emacs-lisp/rmc.el (rmc--add-key-description): Improve display
of the keys TAB, RET, SPC, DEL, and ESC. This fixes a bug where " "
was highlighted in the description in a confusing way.
* test/lisp/emacs-lisp/rmc-tests.el
(test-rmc--add-key-description)
(test-rmc--add-key-description/with-attributes): Update tests for the
above change.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/emacs-lisp/rmc-tests.el | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/test/lisp/emacs-lisp/rmc-tests.el b/test/lisp/emacs-lisp/rmc-tests.el index a97254c46dc..5a79c505ae2 100644 --- a/test/lisp/emacs-lisp/rmc-tests.el +++ b/test/lisp/emacs-lisp/rmc-tests.el | |||
| @@ -34,7 +34,9 @@ | |||
| 34 | (should (equal (rmc--add-key-description '(?y "yes")) | 34 | (should (equal (rmc--add-key-description '(?y "yes")) |
| 35 | '(?y . "yes"))) | 35 | '(?y . "yes"))) |
| 36 | (should (equal (rmc--add-key-description '(?n "foo")) | 36 | (should (equal (rmc--add-key-description '(?n "foo")) |
| 37 | '(?n . "[n] foo"))))) | 37 | '(?n . "[n] foo"))) |
| 38 | (should (equal (rmc--add-key-description '(?\s "foo bar")) | ||
| 39 | `(?\s . "[SPC] foo bar"))))) | ||
| 38 | 40 | ||
| 39 | (ert-deftest test-rmc--add-key-description/with-attributes () | 41 | (ert-deftest test-rmc--add-key-description/with-attributes () |
| 40 | (cl-letf (((symbol-function 'display-supports-face-attributes-p) (lambda (_ _) t))) | 42 | (cl-letf (((symbol-function 'display-supports-face-attributes-p) (lambda (_ _) t))) |
| @@ -43,7 +45,10 @@ | |||
| 43 | `(?y . ,(concat (propertize "y" 'face 'read-multiple-choice-face) "es")))) | 45 | `(?y . ,(concat (propertize "y" 'face 'read-multiple-choice-face) "es")))) |
| 44 | (should (equal-including-properties | 46 | (should (equal-including-properties |
| 45 | (rmc--add-key-description '(?n "foo")) | 47 | (rmc--add-key-description '(?n "foo")) |
| 46 | `(?n . ,(concat "[" (propertize "n" 'face 'read-multiple-choice-face) "] foo")))))) | 48 | `(?n . ,(concat "[" (propertize "n" 'face 'read-multiple-choice-face) "] foo")))) |
| 49 | (should (equal-including-properties | ||
| 50 | (rmc--add-key-description '(?\s "foo bar")) | ||
| 51 | `(?\s . ,(concat "[" (propertize "SPC" 'face 'read-multiple-choice-face) "] foo bar")))))) | ||
| 47 | 52 | ||
| 48 | (ert-deftest test-rmc--add-key-description/non-graphical-display () | 53 | (ert-deftest test-rmc--add-key-description/non-graphical-display () |
| 49 | (cl-letf (((symbol-function 'display-supports-face-attributes-p) (lambda (_ _) nil))) | 54 | (cl-letf (((symbol-function 'display-supports-face-attributes-p) (lambda (_ _) nil))) |