branch: master
commit 4a44c9e9077dfa96f9ab30fc002361e530e99f41
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
counsel.el (counsel--async-last-error-string): Add for ease of debugging
Re #2160
---
counsel.el | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/counsel.el b/counsel.el
index 272a607..9221b76 100644
--- a/counsel.el
+++ b/counsel.el
@@ -162,6 +162,9 @@ The time is measured in seconds.")
This plist maps commands to a plist mapping their exit codes to
descriptions.")
+(defvar counsel--async-last-error-string nil
+ "When the process returned non-0, store the output here.")
+
(defun counsel-set-async-exit-code (cmd number str)
"For CMD, associate NUMBER exit code with STR."
(let ((plist (plist-get counsel--async-exit-code-plist cmd)))
@@ -243,6 +246,8 @@ respectively."
(if ivy--all-candidates
(ivy--exhibit)
(ivy--insert-minibuffer "")))
+ (setq counsel--async-last-error-string
+ (with-current-buffer (process-buffer process) (buffer-string)))
(setq ivy--all-candidates
(let ((status (process-exit-status process))
(plist (plist-get counsel--async-exit-code-plist