[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: proxy icon and moved files
From: |
YAMAMOTO Mitsuharu |
Subject: |
Re: proxy icon and moved files |
Date: |
Sun, 27 Aug 2006 16:16:45 +0900 |
User-agent: |
Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.6 (Marutamachi) APEL/10.6 Emacs/22.0.50 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) |
>>>>> On Wed, 23 Aug 2006 12:53:12 +0100, David Reitter <address@hidden> said:
>> The proxy icon is set by giving the corresponding alias record to
>> SetWindowProxyAlias. But the correspondence between file name and
>> alias record seems to be not persistent. Actually, the latter
>> takes care of renaming.
> So if you keep alias records, then you refer to the files by FSRef,
> correct?
I'm not sure, but maybe not. Technical Note TN2078 says:
Like FSSpecs, FSRefs are not guaranteed to be valid across boots in
Mac OS 9 or Mac OS X, across processes in Mac OS X, or even across
separate launches of the same application in Mac OS X, so don't use
them when you need persistent storage. For persistent storage,
aliases are still the recommended approach.
(http://developer.apple.com/technotes/tn2002/tn2078.html)
> Could standard tracking of file changes (e.g. user changes file name
> or moves the file in Finder, Emacs updates its records
> automatically) then be easily implemented?
Yes. You can see the value that the variable `alias' is bound to
tracks the renamed file in the following code:
(let* ((file1 (make-temp-file "foo"))
(file2 (concat file1 "-renamed"))
(alias (mac-coerce-ae-data 'undecoded-file-name
(encode-coding-string file1 'utf-8)
"alis")))
(rename-file file1 file2)
(prog1 (decode-coding-string
(mac-coerce-ae-data "alis" alias 'undecoded-file-name) 'utf-8)
(delete-file file2)))
>> Could you try the following patch? It tries to see if the alias
>> record that is currently set is updated by the current file name.
> I tried it and it seems to work - I can't reproduce the problem
> anymore.
Thanks for testing. I've installed the change.
YAMAMOTO Mitsuharu
address@hidden