gnu-emacs-sources
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: doc-view.el --- View PDF/PostStript/DVI files in Emacs


From: Reiner Steib
Subject: Re: doc-view.el --- View PDF/PostStript/DVI files in Emacs
Date: Wed, 22 Aug 2007 22:28:38 +0200
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux)

[ Crosspost & Followup-To: gnu.emacs.help ]

On Wed, Aug 22 2007, Tassilo Horn wrote:

> (defcustom doc-view-cache-directory "/tmp/doc-view"

Maybe use `temporary-file-directory' or `make-temp-name'.

>   "The base directory, where the PNG imoges will be saved."
                                       images


> (defun doc-view-file-name-to-directory-name (file)
>   "Return the directory where the png files of FILE should be saved.
>
> It'a a subdirectory of `doc-view-cache-directory'."
>   (concat (directory-file-name doc-view-cache-directory)
>           "/"
>           (replace-regexp-in-string "/" "!" file)))

Probably not portable, I think.  Windows users may set the directory
to "c:\foo\bar".  Maybe you could do like the package formerly knows
as `tumme.el' does it.  Ah, it's `image-dired.el' now:
`image-dired-thumb-name'.

> (defun doc-view-convert-file (file)
[...]
>   (let* ((dir (doc-view-file-name-to-directory-name file))
>          (png-file (concat dir "/" "page.png")))

,----[ (info "(elisp)Directory Names") ]
|    If you want to use a directory file name in making such a
| combination, you must first convert it to a directory name using
| `file-name-as-directory':
| 
|      (concat (file-name-as-directory DIRFILE) RELFILE)
| 
| Don't try concatenating a slash by hand, as in
| 
|      ;;; Wrong!
|      (concat DIRFILE "/" RELFILE)
| 
| because this is not portable.  Always use `file-name-as-directory'.
`----

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/


reply via email to

[Prev in Thread] Current Thread [Next in Thread]