[Top][All Lists]

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

RE: abbreviate-file-name on Windows seems incorrect

From: Drew Adams
Subject: RE: abbreviate-file-name on Windows seems incorrect
Date: Sun, 7 Jan 2007 18:04:27 -0800

> The value of HOME is cached the first time abbreviate-file-name is
> called, and never updated, using exactly the code you quoted here:
> > The code for `abbreviate-file-name' defines `abbreviated-home-dir' as
> > follows, in order to be able to "substitute `~' for the user's home
> > directory", as the doc string says:
> >
> > (or abbreviated-home-dir
> >     (setq abbreviated-home-dir
> >           (let ((abbreviated-home-dir "$foo"))
> >             (concat "^" (abbreviate-file-name
> >                          (expand-file-name "~"))
> >                     "\\(/\\|\\'\\)"))))
> >
> > The comment for this code is as follows, which indicates that a slash is
> > added to distinguish the home dir from a file in that dir:
> If you look up 3 lines from that comment about the slash, you'll see:
>       ;; Compute and save the abbreviated homedir name.
>       ;; We defer computing this until the first time it's needed,

Right. I saw that (but forgot about it - thanks for reminding me).

I think that's a mistake. What's gained by that? We already saw what is lost
by it.

BTW, the comment about deferring computation seems off base. I don't see any
computation deferral, but I do see computation caching. That's what is
important (and wrong), I think: `abbreviated-home-dir' is computed only

reply via email to

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