From: Tassilo Horn Date: Thu, 13 Jan 2011 19:48:26 +0000 (+0100) Subject: * doc-view.el (doc-view-open-text): Use meaningful text buffer X-Git-Tag: emacs-pretest-24.0.90~104^2~618^2~1322^2~235^2~5 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5b3553158d4193cbc11753a936b455c0425f4716;p=emacs.git * doc-view.el (doc-view-open-text): Use meaningful text buffer name. Keep original document's directory as default-directory (bug#6446). --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index df39fb29cd7..78a20ea5e43 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2011-01-13 Tassilo Horn + * doc-view.el (doc-view-open-text): Use meaningful text buffer + name. Keep original document's directory as default-directory + (bug#6446). + * simple.el (shell-command): Don't error out if shell command buffer contains text with non-nil read-only property when erasing the buffer. 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