[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master c009b28 080/348: ivy.el: Breaking change for alist type co
From: |
Oleh Krehel |
Subject: |
[elpa] master c009b28 080/348: ivy.el: Breaking change for alist type collection actions |
Date: |
Sat, 8 Apr 2017 11:03:32 -0400 (EDT) |
branch: master
commit c009b28337f408fe571b24be7bdb304bbc596a76
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
ivy.el: Breaking change for alist type collection actions
* ivy.el (ivy-call): The action will be called with collection's ITEM,
instead of (cdr ITEM) like before.
* ivy-test.el (ivy-read): Update test. It's easy to see the breaking
change by looking at this test update.
* counsel.el (counsel-descbinds-action-describe):
(counsel-descbinds-action-find):
(counsel-descbinds-action-info):
(counsel-imenu):
(counsel-rhythmbox-play-song):
(counsel-rhythmbox-enqueue-song):
(counsel-linux-app-action-default):
(counsel-linux-app-action-file): Update.
---
counsel.el | 20 +++++++++++---------
ivy-test.el | 2 +-
ivy.el | 18 +++++++++++-------
3 files changed, 23 insertions(+), 17 deletions(-)
diff --git a/counsel.el b/counsel.el
index 3a05c8b..9bfaa08 100644
--- a/counsel.el
+++ b/counsel.el
@@ -801,15 +801,15 @@ Usable with `ivy-resume', `ivy-next-line-and-call' and
(nreverse res)))
(defun counsel-descbinds-action-describe (x)
- (let ((cmd (cdr x)))
+ (let ((cmd (cddr x)))
(describe-function cmd)))
(defun counsel-descbinds-action-find (x)
- (let ((cmd (cdr x)))
+ (let ((cmd (cddr x)))
(counsel--find-symbol (symbol-name cmd))))
(defun counsel-descbinds-action-info (x)
- (let ((cmd (cdr x)))
+ (let ((cmd (cddr x)))
(counsel-info-lookup-symbol (symbol-name cmd))))
;;;###autoload
@@ -1976,7 +1976,7 @@ PREFIX is used to create the key."
(with-ivy-window
;; In org-mode, (imenu candidate) will expand child
node
;; after jump to the candidate position
- (imenu candidate)))
+ (imenu (cdr candidate))))
:caller 'counsel-imenu)))
;;** `counsel-list-processes'
@@ -2105,21 +2105,21 @@ And insert it into the minibuffer. Useful during
(declare-function dbus-call-method "dbus")
(declare-function dbus-get-property "dbus")
-(defun counsel-rhythmbox-play-song (uri)
- "Let Rhythmbox enqueue SONG."
+(defun counsel-rhythmbox-play-song (song)
+ "Let Rhythmbox play SONG."
(let ((service "org.gnome.Rhythmbox3")
(path "/org/mpris/MediaPlayer2")
(interface "org.mpris.MediaPlayer2.Player"))
(dbus-call-method :session service path interface
- "OpenUri" uri)))
+ "OpenUri" (cdr song))))
-(defun counsel-rhythmbox-enqueue-song (uri)
+(defun counsel-rhythmbox-enqueue-song (song)
"Let Rhythmbox enqueue SONG."
(let ((service "org.gnome.Rhythmbox3")
(path "/org/gnome/Rhythmbox3/PlayQueue")
(interface "org.gnome.Rhythmbox3.PlayQueue"))
(dbus-call-method :session service path interface
- "AddToQueue" uri)))
+ "AddToQueue" (cdr song))))
(defvar counsel-rhythmbox-history nil
"History for `counsel-rhythmbox'.")
@@ -2217,11 +2217,13 @@ And insert it into the minibuffer. Useful during
(defun counsel-linux-app-action-default (desktop-shortcut)
"Launch DESKTOP-SHORTCUT."
+ (setq desktop-shortcut (cdr desktop-shortcut))
(call-process-shell-command
(format "gtk-launch %s" (file-name-nondirectory desktop-shortcut))))
(defun counsel-linux-app-action-file (desktop-shortcut)
"Launch DESKTOP-SHORTCUT with a selected file."
+ (setq desktop-shortcut (cdr desktop-shortcut))
(let* ((entry (rassoc desktop-shortcut counsel-linux-apps-alist))
(short-name (and entry
(string-match "\\([^ ]*\\) " (car entry))
diff --git a/ivy-test.el b/ivy-test.el
index a0ccb9c..9cc9313 100644
--- a/ivy-test.el
+++ b/ivy-test.el
@@ -88,7 +88,7 @@
(ivy-read "test" '(("foo" . "bar"))
:action (lambda (x) (prin1 x))))
"f C-m")
- "\"bar\""))
+ "(\"foo\" . \"bar\")"))
(should (equal
(ivy-with
'(with-output-to-string
diff --git a/ivy.el b/ivy.el
index 97bca32..550a97b 100644
--- a/ivy.el
+++ b/ivy.el
@@ -938,13 +938,17 @@ Example use:
(let ((action (ivy--get-action ivy-last)))
(when action
(let* ((collection (ivy-state-collection ivy-last))
- (x (cond ((and (consp collection)
- (consp (car collection))
- (cdr (assoc ivy--current collection))))
- ((equal ivy--current "")
- ivy-text)
- (t
- ivy--current))))
+ (x (cond
+ ;; Alist type.
+ ((and (consp collection)
+ (consp (car collection))
+ ;; Previously, the cdr of the selected candidate
would be returned.
+ ;; Now, the whole candidate is returned.
+ (assoc ivy--current collection)))
+ ((equal ivy--current "")
+ ivy-text)
+ (t
+ ivy--current))))
(prog1 (funcall action x)
(unless (or (eq ivy-exit 'done)
(equal (selected-window)
- [elpa] master 7c73f71 293/348: Allow users to find libraries from counsel-load-library, (continued)
- [elpa] master 7c73f71 293/348: Allow users to find libraries from counsel-load-library, Oleh Krehel, 2017/04/08
- [elpa] master 07813be 094/348: Spelling fixes, Oleh Krehel, 2017/04/08
- [elpa] master 22623aa 101/348: swiper.el (swiper-avy): Require avy, Oleh Krehel, 2017/04/08
- [elpa] master 9118fa1 093/348: Separate readme into distinct ivy/counsel/swiper sections, Oleh Krehel, 2017/04/08
- [elpa] master 64b385d 107/348: Don't quit counsel-linux-app on bad data, Oleh Krehel, 2017/04/08
- [elpa] master 2be454c 104/348: Remove ivy-height from the example configuration., Oleh Krehel, 2017/04/08
- [elpa] master d83567e 073/348: counsel.el (counsel-locate-options): Remove obsolete var, Oleh Krehel, 2017/04/08
- [elpa] master e89f250 072/348: Add option for swiper line number to be searchable, Oleh Krehel, 2017/04/08
- [elpa] master 06d5cf5 078/348: counsel.el (counsel-rhythmbox): Require dbus, Oleh Krehel, 2017/04/08
- [elpa] master 469a4ab 081/348: Add ivy-push-view and ivy-pop-view, Oleh Krehel, 2017/04/08
- [elpa] master c009b28 080/348: ivy.el: Breaking change for alist type collection actions,
Oleh Krehel <=
- [elpa] master 8df5a67 089/348: counsel.el (counsel-semantic): New command, Oleh Krehel, 2017/04/08
- [elpa] master af5d2c1 097/348: Don't crash if default-directory is nil., Oleh Krehel, 2017/04/08
- [elpa] master 874632e 098/348: Name bookmarked directories using the bookmark name, Oleh Krehel, 2017/04/08
- [elpa] master 9e6bf2d 112/348: Makefile (plain): Fix target, Oleh Krehel, 2017/04/08
- [elpa] master c43de47 120/348: counsel.el (counsel-dired-jump): Fix up, Oleh Krehel, 2017/04/08
- [elpa] master 5fe3cef 122/348: counsel.el (counsel-file-jump): Allow spaces in path, Oleh Krehel, 2017/04/08
- [elpa] master f27a1f0 124/348: swiper.el (swiper-all-function): Add a ">0 cands -> 0 cands" fix, Oleh Krehel, 2017/04/08
- [elpa] master b3ca5e3 119/348: Add counsel commands for jumping to files, Oleh Krehel, 2017/04/08
- [elpa] master 46a5346 121/348: counsel.el (counsel-file-jump): Skip ".git/", Oleh Krehel, 2017/04/08
- [elpa] master 3c20b2c 126/348: counsel.el (counsel-git-grep): Fix prompt, Oleh Krehel, 2017/04/08