[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 1303e10 061/184: counsel.el (counsel-M-x-action): Extract
From: |
Oleh Krehel |
Subject: |
[elpa] master 1303e10 061/184: counsel.el (counsel-M-x-action): Extract |
Date: |
Wed, 16 Oct 2019 13:14:49 -0400 (EDT) |
branch: master
commit 1303e100785531c4131059e056b91b82894bd392
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
counsel.el (counsel-M-x-action): Extract
---
counsel.el | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/counsel.el b/counsel.el
index 8586c28..5242131 100644
--- a/counsel.el
+++ b/counsel.el
@@ -876,6 +876,18 @@ packages are, in order of precedence, `amx' and `smex'."
(defvar counsel-M-x-history nil
"History for `counsel-M-x'.")
+(defun counsel-M-x-action (cmd)
+ "Execute CMD."
+ (setq cmd (intern cmd))
+ (cond ((bound-and-true-p amx-initialized)
+ (amx-rank cmd))
+ ((bound-and-true-p smex-initialized-p)
+ (smex-rank cmd)))
+ (setq prefix-arg current-prefix-arg)
+ (setq this-command cmd)
+ (setq real-this-command cmd)
+ (command-execute cmd 'record))
+
;;;###autoload
(defun counsel-M-x (&optional initial-input)
"Ivy version of `execute-extended-command'.
@@ -896,16 +908,7 @@ when available, in that order of precedence."
(not (get sym 'byte-obsolete-info)))))
:require-match t
:history 'counsel-M-x-history
- :action (lambda (cmd)
- (setq cmd (intern cmd))
- (cond ((bound-and-true-p amx-initialized)
- (amx-rank cmd))
- ((bound-and-true-p smex-initialized-p)
- (smex-rank cmd)))
- (setq prefix-arg current-prefix-arg)
- (setq this-command cmd)
- (setq real-this-command cmd)
- (command-execute cmd 'record))
+ :action #'counsel-M-x-action
:sort (not externs)
:keymap counsel-describe-map
:initial-input initial-input
@@ -5835,7 +5838,7 @@ Additional actions:\\<ivy-minibuffer-map>
;; major mode starters have no
arguments
(and doc-split (null (cdr (read (car
doc-split)))))))
(null (help-function-arglist f)))))
- :action (lambda (mode) (funcall (intern mode)))
+ :action #'counsel-M-x-action
:caller 'counsel-major))
;;* `counsel-mode'
- [elpa] master 230137b 047/184: ivy.el (ivy-restrict-to-matches): Work for dynamic collection, (continued)
- [elpa] master 230137b 047/184: ivy.el (ivy-restrict-to-matches): Work for dynamic collection, Oleh Krehel, 2019/10/16
- [elpa] master c3bd60c 041/184: ivy.el (ivy--occur-press-update-window): Don't error if buffer was killed, Oleh Krehel, 2019/10/16
- [elpa] master 6bf2cba 053/184: ivy.el (ivy-read-action-ivy): Don't recur, Oleh Krehel, 2019/10/16
- [elpa] master 1a4ebda 048/184: Allow virtual-buffers customization, Oleh Krehel, 2019/10/16
- [elpa] master b4af1a6 040/184: swiper.el (swiper-recenter-top-bottom): Works for swiper-isearch, Oleh Krehel, 2019/10/16
- [elpa] master 327dbd6 058/184: counsel.el (counsel-rg-base-command): Don't include directory on non-Windows, Oleh Krehel, 2019/10/16
- [elpa] master 5140127 046/184: ivy.el: Run ispell-comments-and-strings, Oleh Krehel, 2019/10/16
- [elpa] master 2ecbd7d 054/184: ivy.el (ivy-read-action-ivy): Show the selected item in the prompt, Oleh Krehel, 2019/10/16
- [elpa] master ae70443 060/184: counsel.el (counsel-major): Add, Oleh Krehel, 2019/10/16
- [elpa] master f66eec5 059/184: Add counsel-buffer-or-recentf, Oleh Krehel, 2019/10/16
- [elpa] master 1303e10 061/184: counsel.el (counsel-M-x-action): Extract,
Oleh Krehel <=
- [elpa] master ca5040d 078/184: counsel.el (counsel-rg-base-command): Remove "-S" flag, Oleh Krehel, 2019/10/16
- [elpa] master 20d604c 069/184: ivy.el (ivy-restrict-to-matches): Fix for ivy-resume, Oleh Krehel, 2019/10/16
- [elpa] master c307ae9 055/184: swiper.el (swiper--re-builder): Fix symbol bounds with char-fold-to-regexp, Oleh Krehel, 2019/10/16
- [elpa] master 5424a564 082/184: ivy.el (ivy--handle-directory): Extract, Oleh Krehel, 2019/10/16
- [elpa] master d73376f 010/184: ivy.el (ivy--trim-trailing-re): Add, Oleh Krehel, 2019/10/16
- [elpa] master 824f8d7 072/184: counsel.el (counsel--find-return-list): Works with or without "./" prefix, Oleh Krehel, 2019/10/16
- [elpa] master 4fef498 065/184: Use file-name-at-point-functions for file commands, Oleh Krehel, 2019/10/16
- [elpa] master 3d0fcb5 064/184: ivy.el (ivy-partial): Fix trailing space issue, Oleh Krehel, 2019/10/16
- [elpa] master 7dea040 066/184: ivy.el (ivy-pre-prompt-function): Add, Oleh Krehel, 2019/10/16
- [elpa] master cd7e924 077/184: ivy.el (ivy-read): Fix docstring, Oleh Krehel, 2019/10/16