GNU bug report logs - #12517
24.2; (file-name-directory "~") returns nil

Previous Next

Package: emacs;

Reported by: Leo <sdl.web <at> gmail.com>

Date: Wed, 26 Sep 2012 02:38:02 UTC

Severity: normal

Found in version 24.2

Done: Leo <sdl.web <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 12517 <at> debbugs.gnu.org, Leo <sdl.web <at> gmail.com>
Subject: bug#12517: 24.2; (file-name-directory "~") returns nil
Date: Wed, 26 Sep 2012 09:05:48 -0400
>> I was bitten by this corner case that (file-name-directory "~") returns
>> nil. I wonder if this is a bug/oversight?

I don't know if it should be treated as a misfeature, but at least I've
already relies on it in code such as locate-dominating-file, which
I quote:

  ;; Represent /home/luser/foo as ~/foo so that we don't try to look for
  ;; `name' in /home or in /.
  (setq file (abbreviate-file-name file))


-- Stefan




This bug report was last modified 12 years and 245 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.