+2008-01-09 Tassilo Horn <tassilo@member.fsf.org>
+
+ * doc-view.el (doc-view-mode-p): Add EPS as supported type.
+ (doc-view-mode): Support document files inside archives.
+
2008-01-09 Dan Nicolaescu <dann@ics.uci.edu>
* vc.el (vc-deduce-fileset): Return the currently selected file if
(and (doc-view-mode-p 'pdf)
doc-view-dvipdfm-program
(executable-find doc-view-dvipdfm-program)))
- ((or (eq type 'postscript) (eq type 'ps)
+ ((or (eq type 'postscript) (eq type 'ps) (eq type 'eps)
(eq type 'pdf))
(and doc-view-ghostscript-program
(executable-find doc-view-ghostscript-program)))
toggle between displaying the document or editing it as text."
(interactive)
(if jka-compr-really-do-compress
+
;; This is a compressed file uncompressed by auto-compression-mode.
(when (y-or-n-p (concat "DocView: Cannot convert compressed file. "
"Save it uncompressed first? "))
(kill-buffer nil)
(find-file file)
(doc-view-mode)))
+
+ ;; When opening a pdf/ps/dvi that's inside an archive (tar, zip, ...) the
+ ;; file buffer-file-name doesn't exist, so create the directory and save
+ ;; the file.
+ (when (not (file-exists-p (file-name-directory buffer-file-name)))
+ (dired-create-directory (file-name-directory buffer-file-name)))
+ (when (not (file-exists-p buffer-file-name))
+ (write-file buffer-file-name))
+
(let* ((prev-major-mode (if (eq major-mode 'doc-view-mode)
doc-view-previous-major-mode
major-mode)))
(kill-all-local-variables)
(set (make-local-variable 'doc-view-previous-major-mode) prev-major-mode))
+
(make-local-variable 'doc-view-current-files)
(make-local-variable 'doc-view-current-image)
(make-local-variable 'doc-view-current-page)