[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ivy-hydra aef1d4d 302/395: ivy.el (ivy-configure): Add
From: |
Basil L. Contovounesios |
Subject: |
[elpa] externals/ivy-hydra aef1d4d 302/395: ivy.el (ivy-configure): Add :parent keyword |
Date: |
Thu, 25 Feb 2021 08:32:25 -0500 (EST) |
branch: externals/ivy-hydra
commit aef1d4d1631b7e9391296743807ee1cfa6170429
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>
ivy.el (ivy-configure): Add :parent keyword
* ivy.el (ivy--parents-alist): New defvar.
---
counsel.el | 29 +++++++++++++----------------
ivy.el | 23 +++++++++++++++++------
2 files changed, 30 insertions(+), 22 deletions(-)
diff --git a/counsel.el b/counsel.el
index 159c802..b304e14 100644
--- a/counsel.el
+++ b/counsel.el
@@ -518,9 +518,8 @@ Variables declared using `defcustom' are highlighted
according to
:caller 'counsel-describe-variable)))
(ivy-configure 'counsel-describe-variable
- :initial-input "^"
- :display-transformer-fn #'counsel-describe-variable-transformer
- :sort-fn #'ivy-string<)
+ :parent 'counsel-describe-symbol
+ :display-transformer-fn #'counsel-describe-variable-transformer)
;;** `counsel-describe-function'
(ivy-set-actions
@@ -569,9 +568,8 @@ to `ivy-highlight-face'."
:caller 'counsel-describe-function)))
(ivy-configure 'counsel-describe-function
- :initial-input "^"
- :display-transformer-fn #'counsel-describe-function-transformer
- :sort-fn #'ivy-string<)
+ :parent 'counsel-describe-symbol
+ :display-transformer-fn #'counsel-describe-function-transformer)
;;** `counsel-describe-symbol'
(defcustom counsel-describe-symbol-function #'describe-symbol
@@ -599,12 +597,12 @@ to `ivy-highlight-face'."
(funcall counsel-describe-symbol-function (intern x)))
:caller 'counsel-describe-symbol)))
-(ivy-configure #'counsel-describe-symbol
+(ivy-configure 'counsel-describe-symbol
:initial-input "^"
:sort-fn #'ivy-string<)
(ivy-set-actions
- #'counsel-describe-symbol
+ 'counsel-describe-symbol
`(("I" ,#'counsel-info-lookup-symbol "info")
("d" ,#'counsel--find-symbol "definition")))
@@ -1226,7 +1224,7 @@ selected face."
:caller 'counsel-faces)))
(ivy-configure 'counsel-faces
- :sort-fn #'ivy-string<
+ :parent 'counsel-describe-face
:format-fn #'counsel--faces-format-function)
(ivy-set-actions
@@ -2014,9 +2012,8 @@ When INITIAL-INPUT is non-nil, use it in the minibuffer
during completion."
'counsel-find-file))
(ivy-configure 'counsel-find-file
- :alt-done-fn #'ivy--directory-done
- :occur #'counsel-find-file-occur
- :display-transformer-fn #'ivy-read-file-transformer)
+ :parent 'read-file-name-internal
+ :occur #'counsel-find-file-occur)
(defvar counsel-find-file-occur-cmd "ls -a | %s | xargs -d '\\n' ls -d
--group-directories-first"
"Format string for `counsel-find-file-occur'.")
@@ -2252,8 +2249,7 @@ When INITIAL-INPUT is non-nil, use it in the minibuffer
during completion."
'counsel-dired)))
(ivy-configure 'counsel-dired
- :alt-done-fn #'ivy--directory-done
- :display-transformer-fn #'ivy-read-file-transformer)
+ :parent 'read-file-name-internal)
;;** `counsel-recentf'
(defvar recentf-list)
@@ -2681,7 +2677,8 @@ INITIAL-INPUT can be given as the initial minibuffer
input."
:caller 'counsel-tracker))
(ivy-configure 'counsel-tracker
- :display-transformer-fn #'counsel-tracker-transformer)
+ :display-transformer-fn #'counsel-tracker-transformer
+ :unwind-fn #'counsel-delete-process)
;;** `counsel-fzf'
(defvar counsel-fzf-cmd "fzf -f \"%s\""
@@ -3021,7 +3018,7 @@ CALLER is passed to `ivy-read'."
:caller 'counsel-read-directory-name)))
(ivy-configure 'counsel-read-directory-name
- :display-transformer-fn #'ivy-read-file-transformer)
+ :parent 'read-file-name-internal)
(defun counsel-cd ()
"Change the directory for the currently running Ivy grep-like command.
diff --git a/ivy.el b/ivy.el
index 829c978..81c27ac 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1848,8 +1848,13 @@ An :init is a function with no arguments.
(declare-function counsel-set-async-exit-code "counsel")
+(defvar ivy--parents-alist nil
+ "Configure parent caller for child caller.
+The child caller inherits and can override the settings of the parent.")
+
(cl-defun ivy-configure (caller
&key
+ parent
initial-input
height
occur
@@ -1867,6 +1872,8 @@ An :init is a function with no arguments.
exit-codes)
"Configure `ivy-read' params for CALLER."
(declare (indent 1))
+ (when parent
+ (ivy--alist-set 'ivy--parents-alist caller parent))
(when initial-input
(ivy--alist-set 'ivy-initial-inputs-alist caller initial-input))
(when height
@@ -1942,9 +1949,13 @@ Directories come first."
"Return the value associated with KEY in ALIST, using `assq'.
KEY defaults to the last caller of `ivy-read'; if no entry is
found, it falls back to the key t."
- (cdr (or (let ((caller (or key (ivy-state-caller ivy-last))))
- (and caller (assq caller alist)))
- (assq t alist))))
+ (let ((caller (or key (ivy-state-caller ivy-last))))
+ (or
+ (and caller (cdr (assq caller alist)))
+ (let ((parent (cdr (assq caller ivy--parents-alist))))
+ (when parent
+ (ivy-alist-setting alist parent)))
+ (cdr (assq t alist)))))
(defun ivy--height (caller)
(let ((v (or (ivy-alist-setting ivy-height-alist caller)
@@ -4508,8 +4519,8 @@ CANDS are the candidates to be displayed."
:caller 'ivy-switch-buffer))
(ivy-configure 'ivy-switch-buffer
- :occur #'ivy-switch-buffer-occur
- :display-transformer-fn #'ivy-switch-buffer-transformer)
+ :parent 'internal-complete-buffer
+ :occur #'ivy-switch-buffer-occur)
;;;###autoload
(defun ivy-switch-view ()
@@ -4531,7 +4542,7 @@ CANDS are the candidates to be displayed."
:caller 'ivy-switch-buffer-other-window))
(ivy-configure 'ivy-switch-buffer-other-window
- :occur #'ivy-switch-buffer-occur)
+ :parent 'ivy-switch-buffer)
(defun ivy--yank-handle-case-fold (text)
(if (and (> (length ivy-text) 0)
- [elpa] externals/ivy-hydra bd9945b 243/395: Fix recent regression in ivy--preselect-index, (continued)
- [elpa] externals/ivy-hydra bd9945b 243/395: Fix recent regression in ivy--preselect-index, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 0ecc41c 240/395: * ivy.el (ivy-occur-next-error): Use dolist., Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra ec16352 253/395: ivy.el (ivy-resume): Check that :action is not identity, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra f3f4c8c 246/395: Fix ivy-auto-shrink-minibuffer regression, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 57c7d7c 259/395: Call actions with default-directory bound to last state dir, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 92e5a95 252/395: Add command counsel-describe-symbol, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 16d391d 263/395: ivy.el (ivy--done): Handle ivy-text being a full path when on remote, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra ce5b20a 283/395: counsel.el (counsel-grep-like-occur): Fix for a list arg, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra db5a894 327/395: ivy-test.el (ivy-with): Don't use counsel-locate-git-root, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 0b5c08a 308/395: counsel.el (counsel-grep-like-occur): Fix copy-sequence for cl-mapcan, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra aef1d4d 302/395: ivy.el (ivy-configure): Add :parent keyword,
Basil L. Contovounesios <=
- [elpa] externals/ivy-hydra cbcb7ad 034/395: swiper.el (swiper-isearch-format-function): Refactor, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 388e0d4 043/395: ivy.el (ivy--magic-tilde-directory): Fix for non-standard home path, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 5e393b0 047/395: .travis.yml (env): Bump to emacs-26.3-travis, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 2d4d6d6 076/395: Use text, not "current", in -dispatching-done when no matches, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 8c23823 073/395: ivy-test.el (ivy-swiper-wgrep): Re-enable on 24.5, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 9e7f21a 078/395: ivy.el (ivy-completing-read): Fix require-match arg being symbol, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 3c6e5da 091/395: Remove counsel--grep-mode-occur, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra e22c8df 103/395: counsel.el (counsel-git-cands): Avoid an extra call to counsel-git-root, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 044f82c 106/395: ivy.el (ivy-set-text): Add, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 0a08436 169/395: ivy.el (ivy--set-candidates): Delete duplicates only for extra sources, Basil L. Contovounesios, 2021/02/25