summaryrefslogtreecommitdiff
path: root/lisp/subr.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2022-01-31 17:31:09 +0100
committerLars Ingebrigtsen <larsi@gnus.org>2022-01-31 17:32:26 +0100
commitdbf08491a5a45d88048082ba6ece1b61bdbc622b (patch)
tree78de737ed5696fbaebd6e25ebf053fa3290c98f2 /lisp/subr.el
parent1d1b664fbb9232aa40d8daa54a689cfd63d38aa9 (diff)
downloademacs-dbf08491a5a45d88048082ba6ece1b61bdbc622b.tar.gz
emacs-dbf08491a5a45d88048082ba6ece1b61bdbc622b.tar.bz2
emacs-dbf08491a5a45d88048082ba6ece1b61bdbc622b.zip
Make more ranges sort properly in describe-keymap
* lisp/subr.el (keymap-canonicalize): Don't consider two-character ranges as a range (bug#11325).
Diffstat (limited to 'lisp/subr.el')
-rw-r--r--lisp/subr.el13
1 files changed, 11 insertions, 2 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index fccd75361bd..a1eb6fe3afb 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1149,8 +1149,17 @@ Subkeymaps may be modified but are not canonicalized."
(setq map (map-keymap ;; -internal
(lambda (key item)
(if (consp key)
- ;; Treat char-ranges specially.
- (push (cons key item) ranges)
+ (if (= (car key) (1- (cdr key)))
+ ;; If we have a two-character range, then
+ ;; treat it as two separate characters
+ ;; (because this makes `describe-bindings'
+ ;; look better and shouldn't affect
+ ;; anything else).
+ (progn
+ (push (cons (car key) item) bindings)
+ (push (cons (cdr key) item) bindings))
+ ;; Treat char-ranges specially.
+ (push (cons key item) ranges))
(push (cons key item) bindings)))
map)))
;; Create the new map.