[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 21.x feature request: windows shortcut support

From: Eli Zaretskii
Subject: Re: 21.x feature request: windows shortcut support
Date: Thu, 11 Oct 2001 09:45:51 +0200

On 10 Oct 2001, David Masterson wrote:

> > So in order to support shortcuts as if they were symlinks, the
> > Windows port of Emacs needs to have a wrapper for each file-oriented
> > library function, and that wrapper needs to resolve the shortcut,
> > and then call the library function with the actual file name
> > recorded in the shortcut.
> Perhaps its not that hard and perhaps it doesn't even need to be done
> at the C level.  All you need is a Lisp function that could:
> 1. Parse the binary shortcut file (how do you do that?).
> 2. Extract the filename that the shortcut refers to.
> 3. Call find-alternate-file on the extracted file.
> 4. Maybe call cd to cd back to the original directory?

This won't work, since file operations in Emacs are Lisp primitives,
i.e. they are written in C.  I wrote elsewhere in this thread that the
Lisp solution could only work if every Lisp package is changed to go
through this extra layer, which is impractical.

Besides, you seem to be assuming that this will only be used in
visiting files (otherwise I don't understand how can
find-alternate-file help).  That assumption is probably wrong: Emacs
has functions that deal with files but do not visit those files.  For
example, what about write-region?

> Then you could attach this function to "\\.lnk\\'" (don't shortcuts
> always end in ".lnk"?) in the auto-mode-alist.

The shortcuts do indeed end in `.lnk', but the crucial detail you are
missing is that they are not _referenced_ with that extension
explicitly mentioned.  It's like program invocation: you type "foo
RET", but expect `foo.exe' to be invoked.

So I think any of the Emacs mechanisms which are based on file-name
patterns will not be able to handle this.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]