diff options
| author | Lars Ingebrigtsen | 2019-10-13 22:22:31 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2019-10-13 22:22:31 +0200 |
| commit | 88eadc75d0de8534b26fd490143c94ab2ee4cc45 (patch) | |
| tree | 4e50b059e782dc2174451070d9dfae0e5ed94c0b | |
| parent | 5c4195fd364fe3b2d0fb591fb04f5be2652b810f (diff) | |
| download | emacs-88eadc75d0de8534b26fd490143c94ab2ee4cc45.tar.gz emacs-88eadc75d0de8534b26fd490143c94ab2ee4cc45.zip | |
Fix hitting RET on some text in compilation-mode
* lisp/progmodes/compile.el (compilation-next-error-function):
Don't bug out with an incomprehensible error message on "make[2]:"
texts (bug#5316).
(compilation-find-file): Protect against there being no file name.
| -rw-r--r-- | lisp/progmodes/compile.el | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 7d7a1b99d97..cd7a5dc677e 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el | |||
| @@ -2509,6 +2509,8 @@ This is the value of `next-error-function' in Compilation buffers." | |||
| 2509 | (loc (compilation--message->loc msg)) | 2509 | (loc (compilation--message->loc msg)) |
| 2510 | (end-loc (compilation--message->end-loc msg)) | 2510 | (end-loc (compilation--message->end-loc msg)) |
| 2511 | (marker (point-marker))) | 2511 | (marker (point-marker))) |
| 2512 | (unless loc | ||
| 2513 | (user-error "No next error")) | ||
| 2512 | (setq compilation-current-error (point-marker) | 2514 | (setq compilation-current-error (point-marker) |
| 2513 | overlay-arrow-position | 2515 | overlay-arrow-position |
| 2514 | (if (bolp) | 2516 | (if (bolp) |
| @@ -2822,7 +2824,8 @@ attempts to find a file whose name is produced by (format FMT FILENAME)." | |||
| 2822 | (expand-file-name directory) | 2824 | (expand-file-name directory) |
| 2823 | default-directory)) | 2825 | default-directory)) |
| 2824 | buffer thisdir fmts name) | 2826 | buffer thisdir fmts name) |
| 2825 | (if (file-name-absolute-p filename) | 2827 | (if (and filename |
| 2828 | (file-name-absolute-p filename)) | ||
| 2826 | ;; The file name is absolute. Use its explicit directory as | 2829 | ;; The file name is absolute. Use its explicit directory as |
| 2827 | ;; the first in the search path, and strip it from FILENAME. | 2830 | ;; the first in the search path, and strip it from FILENAME. |
| 2828 | (setq filename (abbreviate-file-name (expand-file-name filename)) | 2831 | (setq filename (abbreviate-file-name (expand-file-name filename)) |
| @@ -2850,8 +2853,11 @@ attempts to find a file whose name is produced by (format FMT FILENAME)." | |||
| 2850 | (and w (progn (compilation-set-window w marker) | 2853 | (and w (progn (compilation-set-window w marker) |
| 2851 | (compilation-set-overlay-arrow w)))) | 2854 | (compilation-set-overlay-arrow w)))) |
| 2852 | (let* ((name (read-file-name | 2855 | (let* ((name (read-file-name |
| 2853 | (format "Find this %s in (default %s): " | 2856 | (format "Find this %s in%s: " |
| 2854 | compilation-error filename) | 2857 | compilation-error |
| 2858 | (if filename | ||
| 2859 | (format " (default %s)" filename) | ||
| 2860 | "")) | ||
| 2855 | spec-dir filename t nil | 2861 | spec-dir filename t nil |
| 2856 | ;; The predicate below is fine when called from | 2862 | ;; The predicate below is fine when called from |
| 2857 | ;; minibuffer-complete-and-exit, but it's too | 2863 | ;; minibuffer-complete-and-exit, but it's too |