1 ;;; Simple rc to configure smex.
3 (when (ignore-errors (yard-require 'smex
))
4 ;; smex version 3.0 requires a newer `execute-extended-command', but
5 ;; loads even if it is not present (newer versions signal an error,
6 ;; in which case control flow will never reach this point). On the
7 ;; other hand, older versions of smex are happy with an older
8 ;; `execute-extended-command'. Since smex does not (has not
9 ;; historically) provid(ed) a means to get the version, one
10 ;; (inelegant) way to both always clobber M-x with a working `smex'
11 ;; and avoid clobbering with a non-working `smex' is to test `smex'
13 (unless (condition-case nil
15 ;; `smex' attempts to execute whatever
16 ;; `smex-completing-read' returns.’
17 ((smex-completing-read (choices &optional initial-selection
)
18 (symbol-name 'yard-do-nothing
)))
21 (global-set-key (kbd "M-x") 'smex
)
22 (global-set-key (kbd "M-X") 'smex-major-mode-commands
)))