summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2019-10-13 22:22:31 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2019-10-13 22:22:31 +0200
commit88eadc75d0de8534b26fd490143c94ab2ee4cc45 (patch)
tree4e50b059e782dc2174451070d9dfae0e5ed94c0b /lisp
parent5c4195fd364fe3b2d0fb591fb04f5be2652b810f (diff)
downloademacs-88eadc75d0de8534b26fd490143c94ab2ee4cc45.tar.gz
emacs-88eadc75d0de8534b26fd490143c94ab2ee4cc45.tar.bz2
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.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/progmodes/compile.el12
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."
(loc (compilation--message->loc msg))
(end-loc (compilation--message->end-loc msg))
(marker (point-marker)))
+ (unless loc
+ (user-error "No next error"))
(setq compilation-current-error (point-marker)
overlay-arrow-position
(if (bolp)
@@ -2822,7 +2824,8 @@ attempts to find a file whose name is produced by (format FMT FILENAME)."
(expand-file-name directory)
default-directory))
buffer thisdir fmts name)
- (if (file-name-absolute-p filename)
+ (if (and filename
+ (file-name-absolute-p filename))
;; The file name is absolute. Use its explicit directory as
;; the first in the search path, and strip it from FILENAME.
(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)."
(and w (progn (compilation-set-window w marker)
(compilation-set-overlay-arrow w))))
(let* ((name (read-file-name
- (format "Find this %s in (default %s): "
- compilation-error filename)
+ (format "Find this %s in%s: "
+ compilation-error
+ (if filename
+ (format " (default %s)" filename)
+ ""))
spec-dir filename t nil
;; The predicate below is fine when called from
;; minibuffer-complete-and-exit, but it's too