]> git.eshelyaron.com Git - emacs.git/commitdiff
* doc-view.el (doc-view-open-text): Use meaningful text buffer
authorTassilo Horn <tassilo@member.fsf.org>
Thu, 13 Jan 2011 19:48:26 +0000 (20:48 +0100)
committerTassilo Horn <tassilo@member.fsf.org>
Thu, 13 Jan 2011 19:48:26 +0000 (20:48 +0100)
name.  Keep original document's directory as default-directory
(bug#6446).

lisp/ChangeLog
lisp/doc-view.el

index df39fb29cd75801d463612023610152fe9bb45e3..78a20ea5e43eb92fa30675c5d72a13691942db71 100644 (file)
@@ -1,5 +1,9 @@
 2011-01-13  Tassilo Horn  <tassilo@member.fsf.org>
 
+       * 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.
index 636f78031faa83ecaba6356c94a16866f6eae95c..30b3f56956e0648b3287002bd7b1b8514d0ac9f2 100644 (file)
@@ -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