summaryrefslogtreecommitdiff
path: root/lisp/doc-view.el
diff options
context:
space:
mode:
authorTassilo Horn <tassilo@member.fsf.org>2011-01-13 20:48:26 +0100
committerTassilo Horn <tassilo@member.fsf.org>2011-01-13 20:48:26 +0100
commit5b3553158d4193cbc11753a936b455c0425f4716 (patch)
treec7e199138ffe3d52d98a5d387289886e99d35ffd /lisp/doc-view.el
parent50f8cd9617d28c0d06103abd1bbbabcb27a9ef94 (diff)
downloademacs-5b3553158d4193cbc11753a936b455c0425f4716.tar.gz
* doc-view.el (doc-view-open-text): Use meaningful text buffer
name. Keep original document's directory as default-directory (bug#6446).
Diffstat (limited to 'lisp/doc-view.el')
-rw-r--r--lisp/doc-view.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index 636f78031fa..30b3f56956e 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -1061,7 +1061,12 @@ For now these keys are useful:
(message "DocView: please wait till conversion finished.")
(let ((txt (expand-file-name "doc.txt" (doc-view-current-cache-dir))))
(if (file-readable-p txt)
- (find-file txt)
+ (let ((name (concat "Text contents of "
+ (file-name-nondirectory buffer-file-name)))
+ (dir (file-name-directory buffer-file-name)))
+ (with-current-buffer (find-file txt)
+ (rename-buffer name)
+ (setq default-directory dir)))
(doc-view-doc->txt txt 'doc-view-open-text)))))
;;;;; Toggle between editing and viewing