You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've defined my own command using ivy-read and added ivy-rich transformers to it. When calling it interactively it works as expected, but when called directly from elisp code the transformers do not get applied.
A command to install packages using pacman,
(defuneshell/install (&optionalitem)
(interactive)
(ivy-read
"Package: "
(mapcar (lambda (strings) (s-join " | " strings))
(-partition 2 (s-lines (shell-command-to-string"pacman -Ss \"\""))))
:initial-input item
:action (lambda (choice)
(with-current-buffer;; If not in an eshell buffer, create one and switch to it.
(or (and (buffer-mode-p (buffer-name) 'eshell-mode)
(buffer-name))
(open-eshell-in-eshells-tab-here))
(insert"sudo pacman -S ")
(insert (car (s-split "" (-second-item (s-split "/" choice)))))
(funcall'eshell-send-input)))))
The transformers to display the package name, version and info,
The results when calling eshell/install interactively,
The results when calling eshell/install directly, from elisp code,
In the first instance the transformers take effect, in the second not. This bad behavior does not happen with the default enriched commands, like counsel-describe-function and the like so I assume it is my fault. I did look at the other commands, like the already mentioned counsel-describe-function, for example, to figure out how to implement my own, so maybe I've missed some details in the process?
The text was updated successfully, but these errors were encountered:
I've defined my own command using ivy-read and added ivy-rich transformers to it. When calling it interactively it works as expected, but when called directly from elisp code the transformers do not get applied.
A command to install packages using pacman,
The transformers to display the package name, version and info,
Setting up the transformers for the above command,
The results when calling
eshell/install
interactively,The results when calling
eshell/install
directly, from elisp code,In the first instance the transformers take effect, in the second not. This bad behavior does not happen with the default enriched commands, like
counsel-describe-function
and the like so I assume it is my fault. I did look at the other commands, like the already mentionedcounsel-describe-function
, for example, to figure out how to implement my own, so maybe I've missed some details in the process?The text was updated successfully, but these errors were encountered: