help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Please Help me to find the .emacs file.


From: Pascal J. Bourguignon
Subject: Re: Please Help me to find the .emacs file.
Date: Tue, 04 May 2010 15:41:20 -0000
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (darwin)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> If you want to know what directory is used by Emacs as home, you may use
>> this function:
>
> Hmm.... this code looks rather odd:
>
>> (defun dirname (path)
>>   (if (string-match "^\\(.*/\\)\\([^/]*\\)$" path)
>>       (match-string 1 path)
>>     "./"))
>
> Why not use (or (file-name-directory filename) "./") ?

Either because I didn't know about it or it didn't exist when I wrote
dirname.


>> (defun user-homedir-pathname ()
>>   (if user-init-file
>>       (dirname user-init-file)
>>     (dirname (first (file-expand-wildcards "~/.emacs")))))
>
> There are no wildcards in "~/.emacs", so why use file-expand-wildcards?
>
> In any case the homedir is defined as "~" so (expand-file-name "~")
> is really all you need.

Thanks.

-- 
__Pascal Bourguignon__
http://www.informatimago.com


reply via email to

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