From: Stephen Berman Date: Mon, 28 Jul 2014 09:07:56 +0000 (+0200) Subject: Open doc text also if it's not saved to a file. X-Git-Tag: emacs-25.0.90~2636^3~17 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=414e1537ab09d2f4571e61b420523dcd082f2d3a;p=emacs.git 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). --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e00e58c20b5..23e66fe3158 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-07-28 Stephen Berman + + * 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 Parse completion input in a iPython friendly way. (Bug#18084) diff --git a/lisp/doc-view.el b/lisp/doc-view.el index 5d2c897e4f9..9458cace74e 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -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)))