[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master e037fb0 101/167: counsel.el (counsel-M-x): Show current-pr
From: |
Oleh Krehel |
Subject: |
[elpa] master e037fb0 101/167: counsel.el (counsel-M-x): Show current-prefix-arg in the prompt |
Date: |
Tue, 08 Dec 2015 10:50:17 +0000 |
branch: master
commit e037fb0c5da751d5a33200c5483cfef651b0f446
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
counsel.el (counsel-M-x): Show current-prefix-arg in the prompt
* counsel.el (counsel--M-x-prompt): New defun.
(counsel-M-x): Update.
Fixes #287
---
counsel.el | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/counsel.el b/counsel.el
index dee0e59..9ed334a 100644
--- a/counsel.el
+++ b/counsel.el
@@ -830,6 +830,20 @@ CMD is a command name."
(declare-function smex-update "ext:smex")
(declare-function smex-rank "ext:smex")
+(defun counsel--M-x-prompt ()
+ "M-x plus the string representation of `current-prefix-arg'."
+ (if (not current-prefix-arg)
+ "M-x "
+ (concat
+ (if (eq current-prefix-arg '-)
+ "- "
+ (if (integerp current-prefix-arg)
+ (format "%d " current-prefix-arg)
+ (if (= (car current-prefix-arg) 4)
+ "C-u "
+ (format "%d " (car current-prefix-arg)))))
+ "M-x ")))
+
;;;###autoload
(defun counsel-M-x (&optional initial-input)
"Ivy version of `execute-extended-command'.
@@ -856,7 +870,7 @@ Optional INITIAL-INPUT is the initial input in the
minibuffer."
(setq cands smex-ido-cache)
(setq pred nil)
(setq sort nil))
- (ivy-read "M-x " cands
+ (ivy-read (counsel--M-x-prompt) cands
:predicate pred
:require-match t
:history 'extended-command-history
- [elpa] master b948987 095/167: Input "/sudo::" goes to current directory instead of root's home, (continued)
- [elpa] master b948987 095/167: Input "/sudo::" goes to current directory instead of root's home, Oleh Krehel, 2015/12/08
- [elpa] master 7317848 092/167: counsel.el (counsel-M-x): Add "definition" action, Oleh Krehel, 2015/12/08
- [elpa] master adf7fd3 097/167: swiper.el (swiper--add-overlays): Take extra WND arg, Oleh Krehel, 2015/12/08
- [elpa] master b91870e 094/167: Fix /ssh: and /sudo:: broken in 71695df, Oleh Krehel, 2015/12/08
- [elpa] master 6afce97 096/167: counsel.el (counsel-git-grep-query-replace): Should exit minibuffer, Oleh Krehel, 2015/12/08
- [elpa] master 6e9ab3d 111/167: swiper.el: Add support for evil-jumper/backward, Oleh Krehel, 2015/12/08
- [elpa] master 2a0a25d 117/167: counsel.el (counsel-locate): Add INTIAL-INPUT arg, Oleh Krehel, 2015/12/08
- [elpa] master 7cf7575 103/167: swiper.el (swiper-toggle-face-matching): Add and bind to "C-c C-f", Oleh Krehel, 2015/12/08
- [elpa] master 6b612cf 093/167: Rebind ivy-occur to "C-c C-o" and "C-o u", Oleh Krehel, 2015/12/08
- [elpa] master 4544c69 105/167: ivy.el (ivy-dispatching-done): Don't set action permanently, Oleh Krehel, 2015/12/08
- [elpa] master e037fb0 101/167: counsel.el (counsel-M-x): Show current-prefix-arg in the prompt,
Oleh Krehel <=
- [elpa] master dcc747b 107/167: ivy.el (ivy-occur-mode-map): Bind "q" to quit-window, Oleh Krehel, 2015/12/08
- [elpa] master 57800f6 110/167: swiper.el (swiper-font-lock-ensure): Add eww-mode, Oleh Krehel, 2015/12/08
- [elpa] master f246178 113/167: ivy.el (ivy-prefix-sort): New defcustom, off by default for now, Oleh Krehel, 2015/12/08
- [elpa] master 660e293 106/167: Allow counsel-git-grep -> ivy-occur -> wgrep, Oleh Krehel, 2015/12/08
- [elpa] master 044307d 116/167: ivy.el (ivy--sort-files-by-date): Fix due to destructive cl-sort, Oleh Krehel, 2015/12/08
- [elpa] master 6666cf8 099/167: Fix directory validity check, Oleh Krehel, 2015/12/08
- [elpa] master d434071 120/167: swiper.el (swiper-all): New command to swiper all file buffers, Oleh Krehel, 2015/12/08
- [elpa] master b39e20c 102/167: ivy.el (ivy-alt-done): Ensure the trailing slash for directories, Oleh Krehel, 2015/12/08
- [elpa] master d89abf2 104/167: counsel.el (counsel--find-symbol): Silence byte compiler, Oleh Krehel, 2015/12/08
- [elpa] master c4562e0 109/167: swiper.el (swiper-font-lock-ensure): Add occur-mode, Oleh Krehel, 2015/12/08