[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: doc-view.el --- View PDF/PostStript/DVI files in Emacs
From: |
Tassilo Horn |
Subject: |
Re: doc-view.el --- View PDF/PostStript/DVI files in Emacs |
Date: |
Thu, 23 Aug 2007 09:56:12 +0200 |
User-agent: |
Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux) |
Reiner Steib <address@hidden> writes:
Hi Reiner,
>> (defcustom doc-view-cache-directory "/tmp/doc-view"
>
> Maybe use `temporary-file-directory' or `make-temp-name'.
I use the former now.
>> (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".
Winwhat?!? ;-)
> 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")))
Yes, now I do a bit as the package formely known as `tumme'.
--8<---------------cut here---------------start------------->8---
(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 (file-name-as-directory doc-view-cache-directory)
(file-name-nondirectory file) "-"
(md5 file)))
--8<---------------cut here---------------end--------------->8---
> ,----[ (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'.
> `----
I'll try to memorize it.
Thanks for the pointers,
Tassilo
--
The desire to be rewarded for one's creativity does not justify
depriving the world in general of all or part of that creativity.
(Richard M. Stallman)
- Re: doc-view.el --- View PDF/PostStript/DVI files in Emacs, (continued)
- Message not available
- Re: doc-view.el --- View PDF/PostStript/DVI files in Emacs, Tim X, 2007/08/25
- Re: doc-view.el --- View PDF/PostStript/DVI files in Emacs, Tassilo Horn, 2007/08/26
- Re: doc-view.el --- View PDF/PostStript/DVI files in Emacs, Henrik Enberg, 2007/08/26
- Message not available
- Re: doc-view.el --- View PDF/PostStript/DVI files in Emacs, Tim X, 2007/08/27
- Message not available
- Re: doc-view.el --- View PDF/PostStript/DVI files in Emacs, Stefan Monnier, 2007/08/26
- Message not available
- Message not available
- Re: doc-view.el --- View PDF/PostStript/DVI files in Emacs, Bill Clementson, 2007/08/26
- Re: doc-view.el --- View PDF/PostStript/DVI files in Emacs, Tassilo Horn, 2007/08/23
Message not available
- Re: doc-view.el --- View PDF/PostStript/DVI files in Emacs,
Tassilo Horn <=