This is by far best feature in Emacs that you can use interactive search inside Minibuffer. If you want to find a function that you don’t know exact name, I do this a lot – who will remember function names in Emacs, you can use:
C-h f C-s
And search for functions. How cool is that? Almost all functions that have completion inside minibuffer work with search like
- C-x b C-s – search for buffer to switch
- C-h <KEY> C-s – search for help
When I switch to Emacs 24, I found that M-x C-s don’t work. So you can’t search for interactive function to execute. But you can get it back. As describe by this Emacs Bug Ticket by putting this to you .emacs file.
(defun read-extended-command () "Read command name to invoke in `execute-extended-command'." (minibuffer-with-setup-hook (lambda () (set (make-local-variable 'minibuffer-default-add-function) (lambda () ;; Get a command name at point in the original buffer ;; to propose it after M-n. (let ((def (with-current-buffer (window-buffer (minibuffer-selected-window)) (and (commandp (function-called-at-point)) (format "%S" (function-called-at-point))))) (all (sort (minibuffer-default-add-completions) (lambda (a b) (string< a b))))) (if def (cons def (delete def all)) all))))) ;; Read a string, completing from and restricting to the set of ;; all defined commands. Don't provide any initial input. ;; Save the command read on the extended-command history list. (completing-read (concat (cond ((eq current-prefix-arg '-) "- ") ((and (consp current-prefix-arg) (eq (car current-prefix-arg) 4)) "C-u ") ((and (consp current-prefix-arg) (integerp (car current-prefix-arg))) (format "%d " (car current-prefix-arg))) ((integerp current-prefix-arg) (format "%d " current-prefix-arg))) ;; This isn't strictly correct if `execute-extended-command' ;; is bound to anything else (e.g. [menu]). ;; It could use (key-description (this-single-command-keys)), ;; but actually a prompt other than "M-x" would be confusing, ;; because "M-x" is a well-known prompt to read a command ;; and it serves as a shorthand for "Extended command: ". "M-x ") obarray 'commandp t nil 'extended-command-history)))
And tell me, why you will ever need Ido-mode
One note about that, when you use one interactive function inside another one you will need to call C-g twice to exit minibuffer
Great information. Lucky me I came across your blog by accident (stumbleupon).
I’ve saved it for later!