@@ -4816,6 +4816,30 @@ fn where_is_internal_remap_target_key_sequence_is_resolved() {
48164816 assert_eq ! ( result, "OK ([3 122] ([3 122]))" ) ;
48174817}
48184818
4819+ #[ test]
4820+ fn where_is_internal_remapped_current_active_maps_preserve_active_map_order ( ) {
4821+ crate :: test_utils:: init_test_tracing ( ) ;
4822+ // Doom's dashboard asks `(where-is-internal 'bookmark-jump nil t)`.
4823+ // `bookmark-jump` is remapped to `consult-bookmark`, but the visible
4824+ // binding still comes from the earlier active minor/emulation map. GNU
4825+ // preserves that active-map order when expanding remapped sequences.
4826+ let result = eval_one (
4827+ r#"(let ((global-map (make-sparse-keymap))
4828+ (minor-map (make-sparse-keymap))
4829+ (minor-mode-map-alist nil)
4830+ (demo-mode t))
4831+ (use-global-map global-map)
4832+ (define-key minor-map [32 13] 'bookmark-jump)
4833+ (define-key global-map [24 114 98] 'bookmark-jump)
4834+ (define-key global-map [remap bookmark-jump] 'consult-bookmark)
4835+ (setq minor-mode-map-alist (list (cons 'demo-mode minor-map)))
4836+ (list (key-description (where-is-internal 'bookmark-jump nil t))
4837+ (key-description (where-is-internal 'consult-bookmark nil t))
4838+ (key-description (where-is-internal 'bookmark-jump nil t nil t))))"# ,
4839+ ) ;
4840+ assert_eq ! ( result, r#"OK ("SPC RET" "SPC RET" "SPC RET")"# ) ;
4841+ }
4842+
48194843#[ test]
48204844fn where_is_internal_filters_raw_remap_pseudo_key_from_results ( ) {
48214845 crate :: test_utils:: init_test_tracing ( ) ;
0 commit comments