diff options
| -rw-r--r-- | lisp/progmodes/xref.el | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 9b6a560971c..c43f3a4ca83 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el | |||
| @@ -929,14 +929,16 @@ IGNORES is a list of glob patterns." | |||
| 929 | ignores)) | 929 | ignores)) |
| 930 | (buf (get-buffer-create " *xref-grep*")) | 930 | (buf (get-buffer-create " *xref-grep*")) |
| 931 | (grep-re (caar grep-regexp-alist)) | 931 | (grep-re (caar grep-regexp-alist)) |
| 932 | status | ||
| 932 | hits) | 933 | hits) |
| 933 | (with-current-buffer buf | 934 | (with-current-buffer buf |
| 934 | (erase-buffer) | 935 | (erase-buffer) |
| 935 | (call-process-shell-command command nil t) | 936 | (setq status |
| 936 | ;; FIXME: What to do when the call fails? | 937 | (call-process-shell-command command nil t)) |
| 937 | ;; "find: ‘xyzgrep’: No such file or directory\n" | 938 | (when (and (not (zerop status)) |
| 938 | ;; The problem is, find-grep can exit with a nonzero code even | 939 | ;; Nonzero status can mean "no matches found". |
| 939 | ;; when there are some matches in the output. | 940 | (/= (point-min) (point-max))) |
| 941 | (user-error "Search failed with status %d: %s" status (buffer-string))) | ||
| 940 | (goto-char (point-min)) | 942 | (goto-char (point-min)) |
| 941 | (while (re-search-forward grep-re nil t) | 943 | (while (re-search-forward grep-re nil t) |
| 942 | (push (list (string-to-number (match-string 2)) | 944 | (push (list (string-to-number (match-string 2)) |