# HG changeset patch # User Tassilo Horn # Date 1294948106 -3600 # Node ID f78d631cd428346f3efbe3c73755dba0096fe7df # Parent 86a21f19b9e662f9f8469b692b87c92c03db3658 * doc-view.el (doc-view-open-text): Use meaningful text buffer name. Keep original document's directory as default-directory (bug#6446). diff -r 86a21f19b9e6 -r f78d631cd428 lisp/ChangeLog --- a/lisp/ChangeLog Thu Jan 13 19:58:28 2011 +0100 +++ b/lisp/ChangeLog Thu Jan 13 20:48:26 2011 +0100 @@ -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 -r 86a21f19b9e6 -r f78d631cd428 lisp/doc-view.el --- a/lisp/doc-view.el Thu Jan 13 19:58:28 2011 +0100 +++ b/lisp/doc-view.el Thu Jan 13 20:48:26 2011 +0100 @@ -1061,7 +1061,12 @@ (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