]> code.delx.au - gnu-emacs/blobdiff - lisp/doc-view.el
gnus-util.el (gnus-define-keys): Convert [?\S-\ ] to [(shift space)] for XEmacs
[gnu-emacs] / lisp / doc-view.el
index da0b728ce91720f134424a84b1f0cba4c9ed8b55..89d2edd3dbb429edaa9e00d71720c59e165f94a2 100644 (file)
@@ -390,6 +390,7 @@ Typically \"page-%s.png\".")
     (define-key map [remap forward-page]  'doc-view-next-page)
     (define-key map [remap backward-page] 'doc-view-previous-page)
     (define-key map (kbd "SPC")       'doc-view-scroll-up-or-next-page)
+    (define-key map (kbd "S-SPC")     'doc-view-scroll-down-or-previous-page)
     (define-key map (kbd "DEL")       'doc-view-scroll-down-or-previous-page)
     (define-key map (kbd "C-n")       'doc-view-next-line-or-next-page)
     (define-key map (kbd "<down>")    'doc-view-next-line-or-next-page)
@@ -939,22 +940,21 @@ is named like ODF with the extension turned to pdf."
   "Convert ODF to PDF asynchronously and call CALLBACK when finished.
 The converted PDF is put into the current cache directory, and it
 is named like ODF with the extension turned to pdf."
-  (doc-view-start-process "odf->pdf" doc-view-odf->pdf-converter-program
-                         (list
-                          ;; FIXME: soffice doesn't work when there's
-                          ;; another running LibreOffice instance, in
-                          ;; which case it returns success without
-                          ;; actually doing anything.  See
-                          ;; LibreOffice bug
-                          ;; https://bugs.freedesktop.org/show_bug.cgi?id=37531.
-                          ;; A workaround is to start soffice with a
-                          ;; separate UserInstallation directory.
-                          (concat "-env:UserInstallation=file://"
-                                  (expand-file-name (format "libreoffice-docview%d" (user-uid))
-                                                    temporary-file-directory))
-                          "--headless" "--convert-to" "pdf"
-                          "--outdir" (doc-view-current-cache-dir) odf)
-                         callback))
+  ;; FIXME: soffice doesn't work when there's another running
+  ;; LibreOffice instance, in which case it returns success without
+  ;; actually doing anything.  See LibreOffice bug
+  ;; https://bugs.freedesktop.org/show_bug.cgi?id=37531.  A workaround
+  ;; is to start soffice with a separate UserInstallation directory.
+  (let ((tmp-user-install-dir (make-temp-file "libreoffice-docview" t)))
+    (doc-view-start-process "odf->pdf" doc-view-odf->pdf-converter-program
+                           (list
+                            (concat "-env:UserInstallation=file://"
+                                    tmp-user-install-dir)
+                            "--headless" "--convert-to" "pdf"
+                            "--outdir" (doc-view-current-cache-dir) odf)
+                           (lambda ()
+                             (delete-directory tmp-user-install-dir t)
+                             (funcall callback)))))
 
 (defun doc-view-pdf/ps->png (pdf-ps png)
   ;; FIXME: Fix name and docstring to account for djvu&tiff.