diff options
author | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2016-01-26 16:46:00 +0100 |
---|---|---|
committer | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2016-01-26 16:46:00 +0100 |
commit | a7439295148fe95fb0fcaaaa464d9521cbda8471 (patch) | |
tree | c0bd0a091316ea2ce35c966739ad3d5e71966b27 /helm-locate.el | |
parent | 22a565dc2b12bfee206d62f77833cbc5805a2569 (diff) |
Notify user when exiting with code 1 in locate (#1360).
* helm-locate.el (helm-locate-init): Do it.
Diffstat (limited to 'helm-locate.el')
-rw-r--r-- | helm-locate.el | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/helm-locate.el b/helm-locate.el index 05dac7f1..53f4bf5b 100644 --- a/helm-locate.el +++ b/helm-locate.el @@ -284,21 +284,29 @@ See also `helm-locate'." cmd) (set-process-sentinel (get-buffer-process helm-buffer) - (lambda (_process event) - (if (string= event "finished\n") - (with-helm-window - (setq mode-line-format - '(" " mode-line-buffer-identification " " - (:eval (format "L%s" (helm-candidate-number-at-point))) " " - (:eval (propertize - (format "[Locate process finished - (%s results)]" - (max (1- (count-lines - (point-min) (point-max))) - 0)) - 'face 'helm-locate-finish)))) - (force-mode-line-update)) - (helm-log "Error: Locate %s" - (replace-regexp-in-string "\n" "" event)))))))) + (lambda (process event) + (let* ((err (process-exit-status process)) + (noresult (= err 1))) + (cond (noresult + (with-helm-buffer + (insert (concat "* Exit with code 1, no result found," + " Command line was:\n\n " + cmd)))) + ((string= event "finished\n") + (with-helm-window + (setq mode-line-format + '(" " mode-line-buffer-identification " " + (:eval (format "L%s" (helm-candidate-number-at-point))) " " + (:eval (propertize + (format "[Locate process finished - (%s results)]" + (max (1- (count-lines + (point-min) (point-max))) + 0)) + 'face 'helm-locate-finish)))) + (force-mode-line-update))) + (t + (helm-log "Error: Locate %s" + (replace-regexp-in-string "\n" "" event)))))))))) (defclass helm-locate-source (helm-source-async helm-type-file) ((init :initform 'helm-locate-set-command) |