From fd161081309462a90cc7f00dab40057a2f7aa481 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Fri, 7 Nov 2014 15:42:51 +0100 Subject: [PATCH] * files.el (file-name-non-special): Wrap the call of `insert-file-contents' by `unwind-protect', in order to set the buffer's file name anyway. Fixes: debbugs:18891 --- lisp/ChangeLog | 6 ++++++ lisp/files.el | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c134e589c30..7c7683a5f82 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2014-11-07 Michael Albinus + + * files.el (file-name-non-special): Wrap the call of + `insert-file-contents' by `unwind-protect', in order to set the + buffer's file name anyway. (Bug#18891) + 2014-11-07 Daiki Ueno * epg.el (epg--list-keys-1): Ignore fields after the 15th field diff --git a/lisp/files.el b/lisp/files.el index 5ed5f8a6e1e..edcb459e26d 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -6664,7 +6664,7 @@ only these files will be asked to be saved." (`add (concat "/:" (apply operation arguments))) (`insert-file-contents (let ((visit (nth 1 arguments))) - (prog1 + (unwind-protect (apply operation arguments) (when (and visit buffer-file-name) (setq buffer-file-name (concat "/:" buffer-file-name)))))) -- 2.11.4.GIT