emacs-devel
[Top][All Lists]
Advanced

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

Re: file-name-shadow-mode


From: David Kastrup
Subject: Re: file-name-shadow-mode
Date: Mon, 21 Mar 2005 16:14:57 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Miles Bader <address@hidden> writes:

> On Mon, 21 Mar 2005 08:24:38 -0500, Stefan Monnier
> <address@hidden> wrote:
>> How 'bout the patch below which makes no assumption (that I know of) about
>> substitute-in-file-name, and will thus correctly even with weird
>> magic file name handlers.
>
> Um, I should note that the original code was designed to be fast and
> not cons unnecessarily, because it runs on every keystroke -- that's
> the reason it uses just a regexp match and a move-overlay.  Your
> suggested replacement looks ... less careful.

substitute-in-file-name is a built-in function in `C source code'.
(substitute-in-file-name FILENAME &optional PARSEINFO)

Substitute environment variables referred to in FILENAME.
`$FOO' where FOO is an environment variable name means to substitute
the value of that variable.  The variable name should be terminated
with a character not a letter, digit or underscore; otherwise, enclose
the entire variable name in braces.
If `/~' appears, all of FILENAME through that `/' is discarded.

On VMS, `$' substitution is not done; this function does little and only
duplicates what `expand-file-name' does.

If PARSEINFO is not NIL, it is a list used or reused for storing
parsing information (it is extended as necessary).

Elements 2N point to positions in the original string, Elements 2N+1
to corresponding positions in the substituted string.

[...]

Something like that.  And then one looks for the last [x,0] pair in
the list, and x is the position from which to shadow.

No consing done except when the syntax changes on entry.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

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