diff options
| author | Stephen Berman | 2014-07-28 11:07:56 +0200 |
|---|---|---|
| committer | Tassilo Horn | 2014-07-28 11:07:56 +0200 |
| commit | 414e1537ab09d2f4571e61b420523dcd082f2d3a (patch) | |
| tree | 946f64e761a3001be5356cdd89c8f92080faa34f | |
| parent | 34c6b847fbad20b026ee878f6c3b97ab481f6a92 (diff) | |
| download | emacs-414e1537ab09d2f4571e61b420523dcd082f2d3a.tar.gz emacs-414e1537ab09d2f4571e61b420523dcd082f2d3a.zip | |
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).
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/doc-view.el | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e00e58c20b5..23e66fe3158 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2014-07-28 Stephen Berman <stephen.berman@gmx.net> | ||
| 2 | |||
| 3 | * doc-view.el (doc-view-open-text): Don't require that the | ||
| 4 | document is saved in a file (e.g., email attachment). | ||
| 5 | |||
| 1 | 2014-07-28 Fabián Ezequiel Gallina <fgallina@gnu.org> | 6 | 2014-07-28 Fabián Ezequiel Gallina <fgallina@gnu.org> |
| 2 | 7 | ||
| 3 | Parse completion input in a iPython friendly way. (Bug#18084) | 8 | 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: | |||
| 1396 | (interactive) | 1396 | (interactive) |
| 1397 | (if doc-view--current-converter-processes | 1397 | (if doc-view--current-converter-processes |
| 1398 | (message "DocView: please wait till conversion finished.") | 1398 | (message "DocView: please wait till conversion finished.") |
| 1399 | (let ((txt (expand-file-name "doc.txt" (doc-view--current-cache-dir)))) | 1399 | (let ((txt (expand-file-name "doc.txt" (doc-view--current-cache-dir))) |
| 1400 | (bname (or buffer-file-name (buffer-name)))) | ||
| 1400 | (if (file-readable-p txt) | 1401 | (if (file-readable-p txt) |
| 1401 | (let ((name (concat "Text contents of " | 1402 | (let ((name (concat "Text contents of " |
| 1402 | (file-name-nondirectory buffer-file-name))) | 1403 | (file-name-nondirectory bname))) |
| 1403 | (dir (file-name-directory buffer-file-name))) | 1404 | (dir (or (file-name-directory bname) default-directory))) |
| 1404 | (with-current-buffer (find-file txt) | 1405 | (with-current-buffer (find-file txt) |
| 1405 | (rename-buffer name) | 1406 | (rename-buffer name) |
| 1406 | (setq default-directory dir))) | 1407 | (setq default-directory dir))) |