emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/pdf-tools f42795274c 3/3: Ask for a file name on save if b


From: ELPA Syncer
Subject: [nongnu] elpa/pdf-tools f42795274c 3/3: Ask for a file name on save if buffer provides none
Date: Mon, 16 Jan 2023 13:59:54 -0500 (EST)

branch: elpa/pdf-tools
commit f42795274c4a34f9e90acec5a9410cee283dc35d
Author: akater <nuclearspace@gmail.com>
Commit: Vedang Manerikar <ved.manerikar@gmail.com>

    Ask for a file name on save if buffer provides none
    
    When visiting a PDF file downloaded by `eww`, `buffer-file-name` returns
    nil so the file can't be saved. In such a case, we should ask the user
    for a file name instead of failing the operation.
    
    Closes: #178
---
 lisp/pdf-view.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/pdf-view.el b/lisp/pdf-view.el
index 5cf7ac7daf..9532162403 100644
--- a/lisp/pdf-view.el
+++ b/lisp/pdf-view.el
@@ -470,7 +470,10 @@ operating on a local copy of a remote file."
             ;; in the process), it may be immediately reopened due to
             ;; redisplay happening inside the pdf-info-close function
             ;; (while waiting for a response from the process.).
-            (copy-file tempfile (buffer-file-name) t)
+            (copy-file tempfile (or (buffer-file-name)
+                                    (read-file-name
+                                     "File name to save PDF to: "))
+                       t)
             (pdf-info-close pdf-view--server-file-name)
 
             (when pdf-view--buffer-file-name



reply via email to

[Prev in Thread] Current Thread [Next in Thread]