[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 5dc26fb 20/31: Improve the completion of hidden buffers
From: |
Oleh Krehel |
Subject: |
[elpa] master 5dc26fb 20/31: Improve the completion of hidden buffers |
Date: |
Fri, 01 May 2015 14:28:58 +0000 |
branch: master
commit 5dc26fbca9485db72b0739b0555e5e3ae3829304
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Improve the completion of hidden buffers
* ivy.el (ivy--collection): New defvar.
(ivy-read): Update.
(ivy--exhibit): Update.
Re #68.
---
ivy.el | 47 +++++++++++++++++++++++++++++++----------------
1 files changed, 31 insertions(+), 16 deletions(-)
diff --git a/ivy.el b/ivy.el
index 1b5c9b5..172b607 100644
--- a/ivy.el
+++ b/ivy.el
@@ -183,6 +183,9 @@ When non-nil, it should contain one %d.")
(defvar ivy--regex-function 'ivy--regex
"Current function for building a regex.")
+(defvar ivy--collection nil
+ "Store the current collection function.")
+
(defvar Info-current-file)
;;** Commands
@@ -504,6 +507,9 @@ When SORT is t, refer to `ivy-sort-functions-alist' for
sorting."
'ivy--regex))
(setq ivy--subexps 0)
(setq ivy--regexp-quote 'regexp-quote)
+ (setq ivy--collection (and (functionp collection)
+ collection))
+ (setq ivy--old-text nil)
(let (coll sort-fn)
(cond ((eq collection 'Info-read-node-name-1)
(if (equal Info-current-file "dir")
@@ -799,24 +805,33 @@ Should be run via minibuffer `post-command-hook'."
;; while-no-input would cause annoying
;; "Waiting for process to die...done" message interruptions
(let ((inhibit-message t))
- (while-no-input
- (unless (equal ivy--old-text ivy-text)
- (let ((store ivy--dynamic-function)
- (ivy--dynamic-function nil))
- (setq ivy--all-candidates (funcall store ivy-text)))
- (setq ivy--old-text ivy-text))
- (ivy--insert-minibuffer (ivy--format ivy--all-candidates))))
- (when ivy--directory
- (if (string-match "/$" ivy-text)
- (if (member ivy-text ivy--all-candidates)
- (ivy--cd (expand-file-name ivy-text ivy--directory))
- (when (string-match "//$" ivy-text)
- (ivy--cd "/")))
- (if (string-match "~$" ivy-text)
- (ivy--cd (expand-file-name "~/")))))
+ (while-no-input
+ (unless (equal ivy--old-text ivy-text)
+ (let ((store ivy--dynamic-function)
+ (ivy--dynamic-function nil))
+ (setq ivy--all-candidates (funcall store ivy-text))))
+ (ivy--insert-minibuffer (ivy--format ivy--all-candidates))))
+ (cond (ivy--directory
+ (if (string-match "/$" ivy-text)
+ (if (member ivy-text ivy--all-candidates)
+ (ivy--cd (expand-file-name ivy-text ivy--directory))
+ (when (string-match "//$" ivy-text)
+ (ivy--cd "/")))
+ (if (string-match "~$" ivy-text)
+ (ivy--cd (expand-file-name "~/")))))
+ ((and (eq ivy--collection 'internal-complete-buffer)
+ (> (length ivy-text) 0)
+ (or (= (length ivy--old-text) 0)
+ (/= (aref ivy-text 0)
+ (aref ivy--old-text 0))))
+ (setq ivy--all-candidates
+ (all-completions
+ (if (eq (aref ivy-text 0) ?\ ) " " "")
+ 'internal-complete-buffer))))
(ivy--insert-minibuffer
(ivy--format
- (ivy--filter ivy-text ivy--all-candidates)))))
+ (ivy--filter ivy-text ivy--all-candidates))))
+ (setq ivy--old-text ivy-text))
(defun ivy--insert-minibuffer (text)
"Insert TEXT into minibuffer with appropriate cleanup."
- [elpa] master 00810d6 11/31: ivy.el (ivy--filter): Fixup, (continued)
- [elpa] master 00810d6 11/31: ivy.el (ivy--filter): Fixup, Oleh Krehel, 2015/05/01
- [elpa] master 7f04019 12/31: swiper.el (swiper-font-lock-ensure): Exclude `elfeed-search-mode', Oleh Krehel, 2015/05/01
- [elpa] master 278870e 13/31: Use alpha compositing to add ivy-current-match face, Oleh Krehel, 2015/05/01
- [elpa] master 57de44c 14/31: Makefile: Update, Oleh Krehel, 2015/05/01
- [elpa] master 56d7802 15/31: Add an option for multi-tier regex matching, Oleh Krehel, 2015/05/01
- [elpa] master 7299950 16/31: ivy.el: Fixup docstrings, Oleh Krehel, 2015/05/01
- [elpa] master aa9d4a7 17/31: ivy.el (ivy-re-builders-alist): Improve doc, Oleh Krehel, 2015/05/01
- [elpa] master 0f141f5 18/31: counsel.el (counsel-git-grep): Add optional initial-input, Oleh Krehel, 2015/05/01
- [elpa] master 23ffa25 19/31: Bind "TAB" to do partial completion, Oleh Krehel, 2015/05/01
- [elpa] master ae2fd1a 21/31: Improve hidden buffer completion further, Oleh Krehel, 2015/05/01
- [elpa] master 5dc26fb 20/31: Improve the completion of hidden buffers,
Oleh Krehel <=
- [elpa] master 1332b19 22/31: ivy.el (ivy--exhibit): Fixup last commit, Oleh Krehel, 2015/05/01
- [elpa] master 6b2e95a 24/31: Add gamma-correction to alpha-blending, Oleh Krehel, 2015/05/01
- [elpa] master a868705 23/31: colir.el: Add two additional blend algorithms, Oleh Krehel, 2015/05/01
- [elpa] master 7bd6003 25/31: Update and improve faces, Oleh Krehel, 2015/05/01
- [elpa] master 94b6a83 26/31: Don't error on bad regex, Oleh Krehel, 2015/05/01
- [elpa] master 0dd6c5a 27/31: ivy.el (ivy--regex): Fixup, Oleh Krehel, 2015/05/01
- [elpa] master fc84e0d 28/31: ivy.el (ivy-read): Reset `ivy-text' earlier, Oleh Krehel, 2015/05/01
- [elpa] master 5a1bd78 29/31: Improve TRAMP completion for ivy-mode, Oleh Krehel, 2015/05/01
- [elpa] master 5a2e0fd 30/31: Allow for "/ssh:user@" as well as for "/ssh:", Oleh Krehel, 2015/05/01
- [elpa] master 4137447 31/31: Merge commit '5a2e0fd355fea83e3c172402b965a1aa826fcc0c' from swiper, Oleh Krehel, 2015/05/01