[OS X Emacs] Emacs -> Skim sync not workin' [SOLVED]
Alex Hamann
Alexander.Hamann at stud-mail.uni-wuerzburg.de
Sun Sep 21 11:57:36 EDT 2008
Has anybody already notified the Skim developers? Otherwise I will
bring this to notice on the Skim mailing list.
Alex
Am 21.09.2008 um 04:03 schrieb David Reitter:
> On 20 Sep 2008, at 21:26, Christopher Menzel wrote:
>>
>> Tom's problem had to do with loading a file into Aquamacs whose
>> full pathname included the string "TeX". Tom typed "tex" and
>> Aquamacs was smart enough to do the conversion to upper case and
>> load the file, but apparently the incorrectly typed name was
>> stored for use in forward/inverse searching.
>
> Ah, sounds familiar. Thanks for jogging my mind.
>>
>> However, I like having the folders containing all of my research
>> papers in a single directory (~/Research/papers) beneath my Home
>> directory, so I had created *symlinks* to the research folders on
>> my (local) iDisk. The problem with Aquamacs -> Skim syncing only
>> arises if I use the symlink to load a paper into Aquamacs; if I
>> call it instead via its actual path on the iDisk (e.g., /Volumes/
>> c.menzel/Research/papers/foo/foo.tex) I get Aquamacs -> Skim
>> syncing back.
>
> Excellent analysis.
>
>> So the bottom line here is that something in the syncing process
>> doesn't like symlinks. (I'm guessing Applescript.)
>
>
> Applescript should just pass on the POSIX style paths.
>
> I suspect that Skim compares the files, and it uses the canonical
> file name rather than what it was started with.
> I just wrote the code below that addresses this issue - I do think
> that a fix should go into Skim rather than Aquamacs.
>
> - D
>
>
> --
> http://aquamacs.org -- Aquamacs: Emacs on Mac OS X
> http://aquamacs.org/donate -- Could we help you? Return the favor
> and support the Aquamacs Project!
>
>
> (defun canonicalize-file-name (file)
> "Expand symlinks in file name.
> Otherwise, like `expand-file-name'."
> (let ((f ""))
> (mapcar
> (lambda (x)
> (setq f
> (let* ((f2 (concat f "/" x))
> (exp (file-symlink-p f2)))
> (if exp (concat f "/" exp) f2))))
> (cdr (split-string (expand-file-name file) "/")))
> f))
>
>
> (defun aquamacs-call-viewer (the-file line source)
> "Display THE-FILE as PDF at LINE (as in file SOURCE).
> Calls `aquamacs-tex-pdf-viewer' to display the PDF file THE-FILE."
> (let ((full-file-name
> (expand-file-name
> the-file
> (and buffer-file-name (file-name-directory buffer-file-name))))
> (full-source-name
> (expand-file-name
> source
> (and buffer-file-name (file-name-directory buffer-file-name)))))
> (do-applescript
> (format
> "
> set theSink to POSIX file \"%s\"
> set theSource to POSIX file \"%s\"
> tell application \"%s\"
> activate
> open theSink
> tell front document to go to TeX line %d from theSource
> end tell
> " full-file-name (canonicalize-file-name full-source-name)
> aquamacs-tex-pdf-viewer line))))
>
> _____________________________________________________________
> MacOSX-Emacs mailing list
> MacOSX-Emacs at email.esm.psu.edu
> http://email.esm.psu.edu/mailman/listinfo/macosx-emacs
> List Archives: http://dir.gmane.org/gmane.emacs.macintosh.osx
More information about the MacOSX-Emacs
mailing list