0

smex won't work without evoking the command. When I run M-x smex it will work just for that command If press M-x again I will not work, will have to press M-x smex again.

using centos 7. Here is my .emacs file(sorry don't have github), the smex configuration is in bold:

enter ;; init.el --- Emacs configuration

;; INSTALL PACKAGES
;; --------------------------------------

(require 'package)

(add-to-list 'package-archives
       '("melpa" . "http://melpa.org/packages/") t)
(package-initialize)

(defvar myPackages
  '(better-defaults
    elpy ;; add the elpy package
    flycheck ;; add the flycheck package
    material-theme))
(elpy-enable)

;; realtime python checking
(when (require 'flycheck nil t)
  (setq elpy-modules (delq 'elpy-module-flymake elpy-modules))
  (add-hook 'elpy-mode-hook 'flycheck-mode))



(mapc #'(lambda (package)
    (unless (package-installed-p package)
      (package-install package)))
      myPackages)

;; BASIC CUSTOMIZATION
;; --------------------------------------

(setq inhibit-startup-message t) ;; hide the startup message
(load-theme 'solarized-dark t) ;; load material theme
(global-linum-mode t) ;; enable line numbers globally

(require 'ido)
    (ido-mode t)

**(require 'smex)
(smex-initialize)**

;; setting up python
;; install elpy

;; init.el ends here


(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
)


(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.

 '(default ((t (:inherit nil :stipple nil :background "#002b36" :foreground "#839496" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 105 :width normal :foundry "unknown" :family "VL Gothic"))))

 '(font-lock-comment-face ((t (:foreground "#3f7f5f"))))

 '(org-level-1 ((t (:inherit variable-pitch :foreground "#cb4b16" :height 1.03))) t)

 '(org-level-2 ((t (:inherit variable-pitch :foreground "#859900" :height 1.02))) t)

 '(org-level-3 ((t (:inherit variable-pitch :foreground "#268bd2" :height 1.01))) t)

 '(org-level-4 ((t (:inherit variable-pitch :foreground "#b58900" :height 1.01))) t))

(require 'undo-tree)
(global-undo-tree-mode)
2
  • 1
    You have to add a key binding, see emacswiki.org/emacs/Smex – Andrew Swann Apr 24 '16 at 10:58
  • Welcome to Emacs.SE! Could you please edit your post to remove the parts of your init file that are not relevant to the question about smex? – Dan Apr 24 '16 at 14:33
1

M-x is a key, which runs the command execute-extended-command by default. If you want it to run the command smex, you need to bind it to smex by yourself, for example,

(global-set-key (kbd "M-x") 'smex)
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.