1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-30 12:21:25 -08:00

Open doc text also if it's not saved to a file.

* doc-view.el (doc-view-open-text): Don't require that the
document is saved in a file (e.g., email attachment).
This commit is contained in:
Stephen Berman 2014-07-28 11:07:56 +02:00 committed by Tassilo Horn
parent 34c6b847fb
commit 414e1537ab
2 changed files with 9 additions and 3 deletions

View file

@ -1,3 +1,8 @@
2014-07-28 Stephen Berman <stephen.berman@gmx.net>
* doc-view.el (doc-view-open-text): Don't require that the
document is saved in a file (e.g., email attachment).
2014-07-28 Fabián Ezequiel Gallina <fgallina@gnu.org>
Parse completion input in a iPython friendly way. (Bug#18084)

View file

@ -1396,11 +1396,12 @@ For now these keys are useful:
(interactive)
(if doc-view--current-converter-processes
(message "DocView: please wait till conversion finished.")
(let ((txt (expand-file-name "doc.txt" (doc-view--current-cache-dir))))
(let ((txt (expand-file-name "doc.txt" (doc-view--current-cache-dir)))
(bname (or buffer-file-name (buffer-name))))
(if (file-readable-p txt)
(let ((name (concat "Text contents of "
(file-name-nondirectory buffer-file-name)))
(dir (file-name-directory buffer-file-name)))
(file-name-nondirectory bname)))
(dir (or (file-name-directory bname) default-directory)))
(with-current-buffer (find-file txt)
(rename-buffer name)
(setq default-directory dir)))