]> git.eshelyaron.com Git - emacs.git/commitdiff
(doc-view-start-process): Don't set
authorTassilo Horn <tassilo@member.fsf.org>
Mon, 14 Apr 2008 11:02:31 +0000 (11:02 +0000)
committerTassilo Horn <tassilo@member.fsf.org>
Mon, 14 Apr 2008 11:02:31 +0000 (11:02 +0000)
default-directory to "~/" if the current value is valid.  This
broke PS files that run other files in the same directory.

lisp/ChangeLog
lisp/doc-view.el

index c9348ba79248b381b756cc877f36bddd2a1c7a31..bd495063f65fb71cde8d87ee631de8a896cb858e 100644 (file)
@@ -1,3 +1,9 @@
+2008-04-14  Tassilo Horn  <tassilo@member.fsf.org>
+
+       * doc-view.el (doc-view-start-process): Don't set
+       default-directory to "~/" if the current value is valid.  This
+       broke PS files that run other files in the same directory.
+
 2008-04-14  Dan Nicolaescu  <dann@ics.uci.edu>
 
        * vc.el (vc-status-kill-query): New function.
index dec372614b6664ea2e7fda01ddc122744becdd00..942e3521d27aed2af8635da73e3d5188b23c44b1 100644 (file)
@@ -559,9 +559,11 @@ Should be invoked when the cached images aren't up-to-date."
         (funcall (process-get proc 'callback))))))
 
 (defun doc-view-start-process (name program args callback)
-  ;; Make sure the process is started in an existing directory,
-  ;; (rather than some file-name-handler-managed dir, for example).
-  (let* ((default-directory (expand-file-name "~/"))
+  ;; Make sure the process is started in an existing directory, (rather than
+  ;; some file-name-handler-managed dir, for example).
+  (let* ((default-directory (if (file-readable-p default-directory)
+                               default-directory
+                             (expand-file-name "~/")))
          (proc (apply 'start-process name doc-view-conversion-buffer
                       program args)))
     (push proc doc-view-current-converter-processes)
@@ -585,7 +587,7 @@ Should be invoked when the cached images aren't up-to-date."
            (list (format "-r%d" (round doc-view-resolution))
                  (concat "-sOutputFile=" png)
                  pdf-ps))
-   (lambda () 
+   (lambda ()
      (when doc-view-current-timer
        (cancel-timer doc-view-current-timer)
        (setq doc-view-current-timer nil))