Avoid file-name errors when viewing PDF from Gnus

* lisp/doc-view.el (doc-view-mode): Run the output file name
through 'convert-standard-filename', to avoid problems with
characters that are not allowed in file names on some
systems.  (Bug#32989)

Copyright-paperwork-exempt: yes
This commit is contained in:
Jordan Wilson 2018-10-10 11:45:57 +01:00 committed by Eli Zaretskii
parent c9390423d6
commit 88ef31abd4

View file

@ -1772,6 +1772,7 @@ toggle between displaying the document or editing it as text.
(doc-view-make-safe-dir doc-view-cache-directory) (doc-view-make-safe-dir doc-view-cache-directory)
;; Handle compressed files, remote files, files inside archives ;; Handle compressed files, remote files, files inside archives
(setq-local doc-view--buffer-file-name (setq-local doc-view--buffer-file-name
(convert-standard-filename
(cond (cond
(jka-compr-really-do-compress (jka-compr-really-do-compress
;; FIXME: there's a risk of name conflicts here. ;; FIXME: there's a risk of name conflicts here.
@ -1792,7 +1793,7 @@ toggle between displaying the document or editing it as text.
(file-name-nondirectory buffer-file-name) (file-name-nondirectory buffer-file-name)
(buffer-name)) (buffer-name))
doc-view-cache-directory)) doc-view-cache-directory))
(t buffer-file-name))) (t buffer-file-name))))
(when (not (string= doc-view--buffer-file-name buffer-file-name)) (when (not (string= doc-view--buffer-file-name buffer-file-name))
(write-region nil nil doc-view--buffer-file-name)) (write-region nil nil doc-view--buffer-file-name))