Mercurial > emacs
comparison lisp/mh-e/mh-xface.el @ 73986:2443b8a6f498
(mh-x-image-url-cache-canonicalize): Add `*' to reserved Windows
filename characters (closes SF #1396499).
author | Bill Wohler <wohler@newt.com> |
---|---|
date | Tue, 14 Nov 2006 06:30:43 +0000 |
parents | d81780942bb8 |
children | e3694f1cb928 |
comparison
equal
deleted
inserted
replaced
73985:5783c1198e3b | 73986:2443b8a6f498 |
---|---|
359 (defun mh-x-image-url-cache-canonicalize (url) | 359 (defun mh-x-image-url-cache-canonicalize (url) |
360 "Canonicalize URL. | 360 "Canonicalize URL. |
361 Replace the ?/ character with a ?! character and append .png. | 361 Replace the ?/ character with a ?! character and append .png. |
362 Also replaces special characters with `mh-url-hexify-string' | 362 Also replaces special characters with `mh-url-hexify-string' |
363 since not all characters, such as :, are legal within Windows | 363 since not all characters, such as :, are legal within Windows |
364 filenames. See URL | 364 filenames. In addition, replaces * with %2a. See URL |
365 `http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/naming_a_file.asp'." | 365 `http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/ifaces/iitemnamelimits/GetValidCharacters.asp'." |
366 (format "%s/%s.png" mh-x-image-cache-directory | 366 (format "%s/%s.png" mh-x-image-cache-directory |
367 (mh-url-hexify-string | 367 (mh-replace-regexp-in-string |
368 (with-temp-buffer | 368 "\*" "%2a" |
369 (insert url) | 369 (mh-url-hexify-string |
370 (mh-replace-string "/" "!") | 370 (with-temp-buffer |
371 (buffer-string))))) | 371 (insert url) |
372 (mh-replace-string "/" "!") | |
373 (buffer-string)))))) | |
372 | 374 |
373 (defun mh-x-image-get-download-state (file) | 375 (defun mh-x-image-get-download-state (file) |
374 "Check the state of FILE by following any symbolic links." | 376 "Check the state of FILE by following any symbolic links." |
375 (unless (file-exists-p mh-x-image-cache-directory) | 377 (unless (file-exists-p mh-x-image-cache-directory) |
376 (call-process "mkdir" nil nil nil mh-x-image-cache-directory)) | 378 (call-process "mkdir" nil nil nil mh-x-image-cache-directory)) |