Reiner Steib <[EMAIL PROTECTED]> 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) _______________________________________________ gnu-emacs-sources mailing list gnu-emacs-sources@gnu.org http://lists.gnu.org/mailman/listinfo/gnu-emacs-sources