Skip to content

Commit d7b0e42

Browse files
authored
Merge pull request #10 from dankessler/feat-remap-aliased-modes
2 parents d0e33d0 + 39df473 commit d7b0e42

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

bind-map.el

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,16 @@ If both are nil, just return `mode'. If
215215
`bind-map-use-remapped-modes' is non-nil, also return mode to
216216
which it has been remapped in `major-mode-remap-alist' (if
217217
applicable). If `bind-map-use-aliased-modes' is non-nil, also
218-
return any modes for which `mode' is an alias (if applicable)."
218+
return any modes for which `mode' is an alias (if applicable).
219+
Note: finding aliased modes relies on `function-alias-p', which
220+
is only available on Emacs 29.1+."
219221
(let ((r-mode
220222
(or (and bind-map-use-remapped-modes
221223
(boundp 'major-mode-remap-alist)
222224
(alist-get mode major-mode-remap-alist))))
223-
(a-modes (and bind-map-use-aliased-modes (function-alias-p mode))))
225+
(a-modes (and bind-map-use-aliased-modes
226+
(fboundp 'function-alias-p)
227+
(function-alias-p mode))))
224228
(delq nil (append (list mode r-mode) a-modes))))
225229

226230
(defun bind-map-add-to-major-mode-list (activate-var major-mode-list)

0 commit comments

Comments
 (0)