windows and home path

Andrea Crotti andrea.crotti.0 at gmail.com
Tue Jan 24 11:29:30 EST 2012


On 01/24/2012 04:09 PM, Jerry Hill wrote:
> On Tue, Jan 24, 2012 at 11:05 AM, Jerry Hill<malaclypse2 at gmail.com>  wrote:
>> So, my guess is that emacs is mangling your HOME environment variable.
>>   That appears to be confirmed by the emacs documentation here:
>> http://www.gnu.org/software/emacs/manual/html_node/emacs/General-Variables.html#General-Variables
> I know, it's bad form to follow up to my own email, but here's a more
> concrete reference stating that emacs will set HOME  when emacs
> starts: http://www.gnu.org/software/emacs/manual/html_node/emacs/Windows-HOME.html
>
> "[Wherever Emacs finds your .emacs file], Emacs sets the value of the
> HOME environment variable to point to it, and it will use that
> location for other files and directories it normally creates in the
> user's home directory. "
>

Actually now I treid to move emacs configuration .emacs.d to Users\user 
and it doesn't
find it at all...
So it's not that I can really choose where my home should be..
Anyway this is what I came out with:

def get_base_path():
     if platform == 'win32':
         hd, hp = getenv('HOMEDRIVE', 'HOMEPATH')
         return path.join(hd, hp)
     else:
         return path.join(path.expanduser('~'))

if you don't use HOMEDRIVE too than it will use the current drive,
which is maybe not what you want..



More information about the Python-list mailing list