Commit 5e9fde5e authored by Stefan Monnier's avatar Stefan Monnier
Browse files

Make it work for non-file buffers (bug#5102).

* doc-view.el (doc-view-current-cache-dir):
Use doc-view-buffer-file-name rather than buffer-file-name.
(doc-view-mode): Use buffer-name when buffer-file-name is nil.
parent 2f2f5242
2009-12-07 Stefan Monnier <monnier@iro.umontreal.ca>
Make it work for non-file buffers (bug#5102).
* doc-view.el (doc-view-current-cache-dir):
Use doc-view-buffer-file-name rather than buffer-file-name.
(doc-view-mode): Use buffer-name when buffer-file-name is nil.
2009-12-06 Óscar Fuentes <ofv@wanadoo.es> 2009-12-06 Óscar Fuentes <ofv@wanadoo.es>
* vc-bzr.el (vc-bzr-annotate-command): Handle the case where the * vc-bzr.el (vc-bzr-annotate-command): Handle the case where the
...@@ -5,8 +12,8 @@ ...@@ -5,8 +12,8 @@
2009-12-06 Dan Nicolaescu <dann@ics.uci.edu> 2009-12-06 Dan Nicolaescu <dann@ics.uci.edu>
* vc-git.el (vc-git-print-log): Handle a limit argument. Display * vc-git.el (vc-git-print-log): Handle a limit argument.
the short log in graph form and with labels. Display the short log in graph form and with labels.
(vc-git-log-view-mode): Handle labels. (vc-git-log-view-mode): Handle labels.
Make vc-revert change VC state from 'added to 'unregistered. Make vc-revert change VC state from 'added to 'unregistered.
......
...@@ -563,7 +563,7 @@ It's a subdirectory of `doc-view-cache-directory'." ...@@ -563,7 +563,7 @@ It's a subdirectory of `doc-view-cache-directory'."
(setq doc-view-current-cache-dir (setq doc-view-current-cache-dir
(file-name-as-directory (file-name-as-directory
(expand-file-name (expand-file-name
(concat (file-name-nondirectory buffer-file-name) (concat (file-name-nondirectory doc-view-buffer-file-name)
"-" "-"
(let ((file doc-view-buffer-file-name)) (let ((file doc-view-buffer-file-name))
(with-temp-buffer (with-temp-buffer
...@@ -1228,6 +1228,7 @@ toggle between displaying the document or editing it as text. ...@@ -1228,6 +1228,7 @@ toggle between displaying the document or editing it as text.
(set (make-local-variable 'doc-view-buffer-file-name) (set (make-local-variable 'doc-view-buffer-file-name)
(cond (cond
(jka-compr-really-do-compress (jka-compr-really-do-compress
;; FIXME: there's a risk of name conflicts here.
(expand-file-name (expand-file-name
(file-name-nondirectory (file-name-nondirectory
(file-name-sans-extension buffer-file-name)) (file-name-sans-extension buffer-file-name))
...@@ -1237,9 +1238,12 @@ toggle between displaying the document or editing it as text. ...@@ -1237,9 +1238,12 @@ toggle between displaying the document or editing it as text.
;; supposed to return nil for things like local files accessed via ;; supposed to return nil for things like local files accessed via
;; `su' or via file://... ;; `su' or via file://...
((let ((file-name-handler-alist nil)) ((let ((file-name-handler-alist nil))
(not (file-readable-p buffer-file-name))) (not (and buffer-file-name (file-readable-p buffer-file-name))))
;; FIXME: there's a risk of name conflicts here.
(expand-file-name (expand-file-name
(if buffer-file-name
(file-name-nondirectory buffer-file-name) (file-name-nondirectory buffer-file-name)
(buffer-name))
doc-view-cache-directory)) doc-view-cache-directory))
(t buffer-file-name))) (t buffer-file-name)))
(when (not (string= doc-view-buffer-file-name buffer-file-name)) (when (not (string= doc-view-buffer-file-name buffer-file-name))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment