From 89d65b51d7363eb1569718bb1f94ed2135613249 Mon Sep 17 00:00:00 2001 From: "Ryan C. Thompson" Date: Sat, 18 Mar 2017 09:34:16 -0700 Subject: [PATCH 1/3] Require a match when completing commands This sets the "require-match" argument to t when calling ido-completing-read, and it also switches to using ido-completing-read+ [1], since standard ido doesn't handle "require-match" being non-nil. [1] https://github.com/DarwinAwardWinner/ido-ubiquitous#ido-completing-read --- Cask | 2 ++ smex.el | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Cask b/Cask index db6da62..44a5d97 100644 --- a/Cask +++ b/Cask @@ -2,3 +2,5 @@ (source melpa) (package-file "smex.el") + +(depends-on "ido-completing-read+") diff --git a/smex.el b/smex.el index 6d4a72b..2e42e59 100644 --- a/smex.el +++ b/smex.el @@ -7,6 +7,7 @@ ;; Package-Requires: ((emacs "24")) ;; Version: 3.0 ;; Keywords: convenience, usability +;; Package-Requires: ((ido-completing-read+ "0")) ;; This file is not part of GNU Emacs. @@ -28,6 +29,7 @@ ;;; Code: (require 'ido) +(require 'ido-completing-read+) (defgroup smex nil "M-x interface with Ido-style fuzzy matching and ranking heuristics." @@ -135,8 +137,8 @@ Set this to nil to disable fuzzy matching." (ido-enable-flex-matching smex-flex-matching) (ido-max-prospects 10) (minibuffer-completion-table choices)) - (ido-completing-read (smex-prompt-with-prefix-arg) choices nil nil - initial-input 'extended-command-history (car choices)))) + (ido-completing-read+ (smex-prompt-with-prefix-arg) choices nil t + initial-input 'extended-command-history (car choices)))) (defun smex-prompt-with-prefix-arg () (if (not current-prefix-arg) From 3b7781ac3629909755973b3d27c47f0061830a74 Mon Sep 17 00:00:00 2001 From: "Ryan C. Thompson" Date: Sat, 18 Mar 2017 09:42:54 -0700 Subject: [PATCH 2/3] Remove no-longer-necessary fix from 187a9c5 ido-ubiquitous no longer has any effect on completions that are not initiated through its own functions, so this fix is no longer necessary. --- smex.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smex.el b/smex.el index 2e42e59..9d3a182 100644 --- a/smex.el +++ b/smex.el @@ -138,7 +138,7 @@ Set this to nil to disable fuzzy matching." (ido-max-prospects 10) (minibuffer-completion-table choices)) (ido-completing-read+ (smex-prompt-with-prefix-arg) choices nil t - initial-input 'extended-command-history (car choices)))) + initial-input 'extended-command-history))) (defun smex-prompt-with-prefix-arg () (if (not current-prefix-arg) From fbdaaac3d973c34e19e4cae3a0e4e8d32c6db1cc Mon Sep 17 00:00:00 2001 From: "Ryan C. Thompson" Date: Tue, 25 Jul 2017 20:41:12 -0700 Subject: [PATCH 3/3] Add ido-cr+ dependency to the elisp file It was already declared in the Cask file, but it needs to be in both. --- smex.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smex.el b/smex.el index 9d3a182..937dd73 100644 --- a/smex.el +++ b/smex.el @@ -4,7 +4,7 @@ ;; ;; Author: Cornelius Mika and contributors ;; URL: http://github.com/nonsequitur/smex/ -;; Package-Requires: ((emacs "24")) +;; Package-Requires: ((emacs "24") (ido-completing-read+ "3.0")) ;; Version: 3.0 ;; Keywords: convenience, usability ;; Package-Requires: ((ido-completing-read+ "0"))