]> git.eshelyaron.com Git - emacs.git/commitdiff
Open doc text also if it's not saved to a file.
authorStephen Berman <stephen.berman@gmx.net>
Mon, 28 Jul 2014 09:07:56 +0000 (11:07 +0200)
committerTassilo Horn <tsdh@gnu.org>
Mon, 28 Jul 2014 09:07:56 +0000 (11:07 +0200)
* doc-view.el (doc-view-open-text): Don't require that the
document is saved in a file (e.g., email attachment).

lisp/ChangeLog
lisp/doc-view.el

index e00e58c20b58ae46cc0d44d0af37a0ca5439f5da..23e66fe3158446f457b63bfcd1f9e1c7d1a6bb0b 100644 (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)
index 5d2c897e4f94a713700a63a14d052aebb9707c52..9458cace74ec9d59e606dc16388b2457d6759b13 100644 (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)))