From 7ad1d075b940f276adaf3b6bb0c024079c403f80 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 8 Apr 2016 11:05:20 +0300 Subject: [PATCH] Avoid signaling errors in 'M-n' at the 'C-x C-f' prompt * lisp/ffap.el (ffap-guess-file-name-at-point): Ignore errors while 'ffap-guesser' runs. (Bug#23218) --- lisp/ffap.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/ffap.el b/lisp/ffap.el index 36727b3747d..8343b475c1b 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -1966,7 +1966,9 @@ Only intended for interactive use." (defun ffap-guess-file-name-at-point () "Try to get a file name at point. This hook is intended to be put in `file-name-at-point-functions'." - (let ((guess (ffap-guesser))) + ;; ffap-guesser can signal an error, and we don't want that when, + ;; e.g., the user types M-n at the "C-x C-f" prompt. + (let ((guess (ignore-errors (ffap-guesser)))) (when (stringp guess) (let ((url (ffap-url-p guess))) (or url -- 2.39.2