From: Oleh Krehel Date: Sat, 26 Mar 2016 13:26:57 +0000 (+0100) Subject: counsel.el (counsel-ace-link): New command X-Git-Url: https://code.delx.au/gnu-emacs-elpa/commitdiff_plain/189c093b232c7a20d0700e07f735918d8ca31cda counsel.el (counsel-ace-link): New command --- diff --git a/counsel.el b/counsel.el index 5a73bf2c6..e9b706b5a 100644 --- a/counsel.el +++ b/counsel.el @@ -1772,6 +1772,36 @@ An extra action allows to switch to the process buffer." ("s" counsel-list-processes-action-switch "switch")) :caller 'counsel-list-processes)) +;;** `counsel-ace-link' +(defun counsel-ace-link () + "Use Ivy completion for `ace-link'." + (interactive) + (let (collection action) + (cond ((eq major-mode 'Info-mode) + (setq collection 'ace-link--info-collect) + (setq action 'ace-link--info-action)) + ((eq major-mode 'help-mode) + (setq collection 'ace-link--help-collect) + (setq action 'ace-link--help-action)) + ((eq major-mode 'woman-mode) + (setq collection 'ace-link--woman-collect) + (setq action 'ace-link--woman-action)) + ((eq major-mode 'eww-mode) + (setq collection 'ace-link--eww-collect) + (setq action 'ace-link--eww-action)) + ((eq major-mode 'compilation-mode) + (setq collection 'ace-link--eww-collect) + (setq action 'ace-link--compilation-action)) + ((eq major-mode 'org-mode) + (setq collection 'ace-link--org-collect) + (setq action 'ace-link--org-action))) + (if (null collection) + (error "%S is not supported" major-mode) + (ivy-read "Ace-Link: " (funcall collection) + :action action + :require-match t + :caller 'counsel-ace-link)))) + ;;* Misc OS ;;** `counsel-rhythmbox' (defvar helm-rhythmbox-library)