all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Changing $HOME
@ 2005-02-23 23:34 Shug Boabby
  2005-02-24  0:17 ` David Hansen
  0 siblings, 1 reply; 17+ messages in thread
From: Shug Boabby @ 2005-02-23 23:34 UTC (permalink / raw)


hi there,

i wish to change the definition of ~/ in the minibuffer. i have a folder
  /Users/shug/GNU
which i wish to use as my base... it makes life a lot easier for me 
since it allows me to seperate the OS X stuff from everything i do in 
Emacs and the CL.

i have tried doing things such as:
  (setenv "HOME" "/Users/shug/GNU")
or
  (setq homedir "/Users/shug/GNU")
but it never seems to work.

the best results i have are by
  (cd "/Users/shug/GNU")
but that just means i always start in that directory when looking for 
new files... it obviously doesn't redefine the ~/ symbol.

does anyone know how to define ~/ as "/Users/shug/GNU"?

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Changing $HOME
  2005-02-23 23:34 Changing $HOME Shug Boabby
@ 2005-02-24  0:17 ` David Hansen
  2005-02-24  0:29   ` Shug Boabby
  0 siblings, 1 reply; 17+ messages in thread
From: David Hansen @ 2005-02-24  0:17 UTC (permalink / raw)


On Wed, 23 Feb 2005 23:34:17 +0000 (UTC) Shug Boabby wrote:

> i wish to change the definition of ~/ in the minibuffer.

Setting $HOME before starting emacs should work.  In bash:

$ HOME=/Users/shug/GNU emacs

David

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Changing $HOME
  2005-02-24  0:17 ` David Hansen
@ 2005-02-24  0:29   ` Shug Boabby
  2005-02-24 16:07     ` Sébastien Kirche
  0 siblings, 1 reply; 17+ messages in thread
From: Shug Boabby @ 2005-02-24  0:29 UTC (permalink / raw)


David Hansen  wrote:
> On Wed, 23 Feb 2005 23:34:17 +0000 (UTC) Shug Boabby wrote:
>> i wish to change the definition of ~/ in the minibuffer.
> Setting $HOME before starting emacs should work.  In bash:

sorry, i should mention... this is on the OS X Panther (CVS Carbon) 
builds... started from the Dock icon. i have absolutely no idea how to 
set envars from the OS X launcher. so thats why i am thinking about
  /Users/shug/.emacs

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Changing $HOME
  2005-02-24  0:29   ` Shug Boabby
@ 2005-02-24 16:07     ` Sébastien Kirche
  2005-03-04 20:28       ` Shug Boabby
  0 siblings, 1 reply; 17+ messages in thread
From: Sébastien Kirche @ 2005-02-24 16:07 UTC (permalink / raw)


Le 24 Feb 2005, Shug Boabby a formulé :

> sorry, i should mention... this is on the OS X Panther (CVS Carbon) 
> builds... started from the Dock icon. i have absolutely no idea how to 
> set envars from the OS X launcher. so thats why i am thinking about
> /Users/shug/.emacs

The environment given  to the graphical applications (is  different from the
shell    environment    and)   is    defined    in    the   property    list
~/.MacOSX/environment.plist

It is an xml  file that you can edit with the  «Property List Editor» app in
/Applications/Utilities folder.

Try «open  .MacOSX/environment.plist» to open  it easily : it  should launch
the editor.

HTH.

-- 
Sébastien Kirche

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Changing $HOME
  2005-02-24 16:07     ` Sébastien Kirche
@ 2005-03-04 20:28       ` Shug Boabby
  2005-03-04 20:31         ` Shug Boabby
  2005-03-04 23:07         ` Pascal Bourguignon
  0 siblings, 2 replies; 17+ messages in thread
From: Shug Boabby @ 2005-03-04 20:28 UTC (permalink / raw)


i do not have a ~/.MacOSX/environment.plist file and i have no idea
what to enter in
order to get Emacs alone to pick up on a few envars. the following
looks like it will
help though:
  http://developer.apple.com/qa/qa2001/qa1067.html

cheers!

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Changing $HOME
  2005-03-04 20:28       ` Shug Boabby
@ 2005-03-04 20:31         ` Shug Boabby
  2005-03-04 23:07         ` Pascal Bourguignon
  1 sibling, 0 replies; 17+ messages in thread
From: Shug Boabby @ 2005-03-04 20:31 UTC (permalink / raw)


actually Sébastien, that sets the envars for ALL apps opened from the
dock.

i only want it to set HOME for Emacs.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Changing $HOME
  2005-03-04 20:28       ` Shug Boabby
  2005-03-04 20:31         ` Shug Boabby
@ 2005-03-04 23:07         ` Pascal Bourguignon
  2005-03-04 23:33           ` Shug Boabby
  1 sibling, 1 reply; 17+ messages in thread
From: Pascal Bourguignon @ 2005-03-04 23:07 UTC (permalink / raw)


"Shug Boabby" <Shug.Boabby@gmail.com> writes:

> i do not have a ~/.MacOSX/environment.plist file and i have no idea
> what to enter in
> order to get Emacs alone to pick up on a few envars. the following
> looks like it will
> help though:
>   http://developer.apple.com/qa/qa2001/qa1067.html
> 
> cheers!

For example:
 
$ cat /g/naiad-macosx/pascal/dot-files/.MacOSX/environment.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<!-- automatically generated by ~/.bash_profile -->
<dict>
    <key>DYLD_NO_FIX_PREBINDING</key>
    <string>1</string>
    <key>PATH</key>
    <string>/Users/pascal/bin:/usr/local/bin:/sw/bin:/Developer/Tools:/Users/pascal/bin:/usr/local/bin:/sw/bin:/Developer/Tools:/sw/bin:/sw/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin</string>
    <key>MANPATH</key>
    <string>/usr/local/man:/usr/local/share/man:/sw/share/man:/usr/X11R6/man:/usr/share/man</string>
    <key>LC_MONETARY</key>
    <string>es_ES</string>
    <key>LC_NUMERIC</key>
    <string>en_US</string>
    <key>LC_MESSAGES</key>
    <string>en_US</string>
    <key>LC_COLLATE</key>
    <string>C</string>
    <key>LC_CTYPE</key>
    <string>fr_FR</string>
    <key>LC_TIME</key>
    <string>en_US</string>
</dict>
</plist>


Extracted from ~/.bash_profile :
----------------------------------------

function update-environment-plist () {
    local vars=$@
    local tmpf=$HOME/.MacOSX/newenvironment.plist
    local plif=$HOME/.MacOSX/environment.plist
    cat > $tmpf <<'EOF'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<!-- automatically generated by ~/.bash_profile -->
<dict>
EOF
    for v in ${vars[@]} ; do
	cat >> $tmpf <<EOF
    <key>${v}</key>
    <string>${!v}</string>
EOF
    done
    cat >> $tmpf <<'EOF'
</dict>
</plist>
EOF
    mv "${plif}" "${plif}~"
    mv "${tmpf}" "${plif}"
}

update-environment-plist  DYLD_NO_FIX_PREBINDING PATH  MANPATH \
 LC_MONETARY LC_NUMERIC LC_MESSAGES LC_COLLATE LC_CTYPE LC_TIME

----------------------------------------


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS d? s++:++ a+ C+++ UL++++ P--- L+++ E+++ W++ N+++ o-- K- w--- 
O- M++ V PS PE++ Y++ PGP t+ 5+ X++ R !tv b+++ DI++++ D++ 
G e+++ h+ r-- z? 
------END GEEK CODE BLOCK------

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Changing $HOME
  2005-03-04 23:07         ` Pascal Bourguignon
@ 2005-03-04 23:33           ` Shug Boabby
  2005-03-04 23:51             ` Kevin Rodgers
  2005-03-05  0:16             ` Pascal Bourguignon
  0 siblings, 2 replies; 17+ messages in thread
From: Shug Boabby @ 2005-03-04 23:33 UTC (permalink / raw)


thanks pascal... but the problem is that i only wish to set HOME for
emacs, but not the other dock (or OS X) apps.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Changing $HOME
  2005-03-04 23:33           ` Shug Boabby
@ 2005-03-04 23:51             ` Kevin Rodgers
  2005-03-05  0:14               ` Shug Boabby
  2005-03-05  0:16             ` Pascal Bourguignon
  1 sibling, 1 reply; 17+ messages in thread
From: Kevin Rodgers @ 2005-03-04 23:51 UTC (permalink / raw)


Shug Boabby wrote:
> thanks pascal... but the problem is that i only wish to set HOME for
> emacs, but not the other dock (or OS X) apps.

Does this do the trick:

emacs -q --no-site-file
C-x C-f ~/.emacs RET
(setenv "HOME" "/where/you/want/to/be") RET
C-x C-s
C-x C-c
emacs

-- 
Kevin Rodgers

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Changing $HOME
  2005-03-04 23:51             ` Kevin Rodgers
@ 2005-03-05  0:14               ` Shug Boabby
  0 siblings, 0 replies; 17+ messages in thread
From: Shug Boabby @ 2005-03-05  0:14 UTC (permalink / raw)


i'm afraid not... that was the first thing i tried. try it yourself...
what happens if i try to open ~/file on the second loading is that it
tries to load the file
  /Users/shug/GNU/GNU/file
instead of
  /Users/shug/GNU/file

i think perhaps finding a way to get OS X to tell Emacs what HOME is on
starting is the best way to fix this problem. unfortunatley i cannot
find a way to do that... (unless i start emacs from the shell. but i'd
prefer to do it from the dock icon)

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Changing $HOME
  2005-03-04 23:33           ` Shug Boabby
  2005-03-04 23:51             ` Kevin Rodgers
@ 2005-03-05  0:16             ` Pascal Bourguignon
  2005-03-05  0:18               ` Pascal Bourguignon
  2005-03-05  0:22               ` Shug Boabby
  1 sibling, 2 replies; 17+ messages in thread
From: Pascal Bourguignon @ 2005-03-05  0:16 UTC (permalink / raw)


"Shug Boabby" <Shug.Boabby@gmail.com> writes:

> thanks pascal... but the problem is that i only wish to set HOME for
> emacs, but not the other dock (or OS X) apps.

Then you can put:
     (putenv "HOME" "/some/path") 
at the start of your ~/.emacs

Of course, it'll use the normal $HOME to find ~/.emacs. If that's not
what you want, you only can write a trampoline script:

% cat ~/bin/emacs
#!/bin/bash
export HOME=/some/path
exec /usr/local/bin/emacs "$@"




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

Nobody can fix the economy.  Nobody can be trusted with their finger
on the button.  Nobody's perfect.  VOTE FOR NOBODY.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Changing $HOME
  2005-03-05  0:16             ` Pascal Bourguignon
@ 2005-03-05  0:18               ` Pascal Bourguignon
  2005-03-05  0:23                 ` Shug Boabby
  2005-03-05  0:22               ` Shug Boabby
  1 sibling, 1 reply; 17+ messages in thread
From: Pascal Bourguignon @ 2005-03-05  0:18 UTC (permalink / raw)


Pascal Bourguignon <spam@mouse-potato.com> writes:

> "Shug Boabby" <Shug.Boabby@gmail.com> writes:
> 
> > thanks pascal... but the problem is that i only wish to set HOME for
> > emacs, but not the other dock (or OS X) apps.
> 
> Then you can put:
>      (putenv "HOME" "/some/path") 

Make it setenv

(I only use (setf (getenv "HOME") "/some/path") personnally...)

> at the start of your ~/.emacs
> 
> Of course, it'll use the normal $HOME to find ~/.emacs. If that's not
> what you want, you only can write a trampoline script:
> 
> % cat ~/bin/emacs
> #!/bin/bash
> export HOME=/some/path
> exec /usr/local/bin/emacs "$@"
> 
> 
> 
> 
> -- 
> __Pascal Bourguignon__                     http://www.informatimago.com/
> 
> Nobody can fix the economy.  Nobody can be trusted with their finger
> on the button.  Nobody's perfect.  VOTE FOR NOBODY.

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
In deep sleep hear sound,
Cat vomit hairball somewhere.
Will find in morning.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Changing $HOME
  2005-03-05  0:16             ` Pascal Bourguignon
  2005-03-05  0:18               ` Pascal Bourguignon
@ 2005-03-05  0:22               ` Shug Boabby
  1 sibling, 0 replies; 17+ messages in thread
From: Shug Boabby @ 2005-03-05  0:22 UTC (permalink / raw)


cheers pascal... but again, the problem is that i wish to do this in OS
X... from the dock start icon. you cannot put a script in the dock,
otherwise i would.

btw, putenv is void on my version.

my original plan was to have two .emacs files:
  /Users/shug/.emacs
    which would set HOME and load my *real*
  /Users/shug/GNU/.emacs
     which is my .emacs which i use on many platforms and i syncronise
quite a lot. so adding OS X specific stuff into this file is bad in my
book.

but an alternative would be to scrap the unnecessary .emacs and get OS
X to pass the HOME envar to emacs when started from the dock.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Changing $HOME
  2005-03-05  0:18               ` Pascal Bourguignon
@ 2005-03-05  0:23                 ` Shug Boabby
  2005-03-05  7:07                   ` Oliver Scholz
  2005-03-05  7:08                   ` Oliver Scholz
  0 siblings, 2 replies; 17+ messages in thread
From: Shug Boabby @ 2005-03-05  0:23 UTC (permalink / raw)


Pascal wrote:
> Make it setenv

i already tried that (see my first post)

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Changing $HOME
  2005-03-05  0:23                 ` Shug Boabby
@ 2005-03-05  7:07                   ` Oliver Scholz
  2005-03-07  4:30                     ` Shug Boabby
  2005-03-05  7:08                   ` Oliver Scholz
  1 sibling, 1 reply; 17+ messages in thread
From: Oliver Scholz @ 2005-03-05  7:07 UTC (permalink / raw)


"Shug Boabby" <Shug.Boabby@gmail.com> writes:

> Pascal wrote:
>> Make it setenv
>
> i already tried that (see my first post)

That's strange. If I read the code of `expand-file-name' correctly,
setenvinv HOME should be the right thing to do for what you want, as
it determines the expansion of "~" via a call to a C function:
egetenv ("HOME") -- which does the obvious.

Could you explain, in what way this does not work?  What directory do
you see, if you type `C-x d ~ RET'?

If not at the right one, please start Emacs like this:

emacs -q --no-site-file --eval '(setenv "HOME" "/User/shug/GNU")'

and post the value of the variable `process-environment' (which you
can get via `C-h v').

    Oliver
-- 
15 Ventôse an 213 de la Révolution
Liberté, Egalité, Fraternité!

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Changing $HOME
  2005-03-05  0:23                 ` Shug Boabby
  2005-03-05  7:07                   ` Oliver Scholz
@ 2005-03-05  7:08                   ` Oliver Scholz
  1 sibling, 0 replies; 17+ messages in thread
From: Oliver Scholz @ 2005-03-05  7:08 UTC (permalink / raw)


"Shug Boabby" <Shug.Boabby@gmail.com> writes:

> Pascal wrote:
>> Make it setenv
>
> i already tried that (see my first post)

That's strange. If I read the code of `expand-file-name' correctly,
setenving HOME should be the right thing to do for what you want, as
it determines the expansion of "~" via a call to a C function:
egetenv ("HOME") -- which does the obvious. And in fact, `setenv'
works for me.

Could you explain, in what way this does not work?  What directory do
you see, if you type `C-x d ~ RET'?

If not at the right one, please start Emacs like this:

emacs -q --no-site-file --eval '(setenv "HOME" "/User/shug/GNU")'

and post the value of the variable `process-environment' (which you
can get via `C-h v').

    Oliver
-- 
15 Ventôse an 213 de la Révolution
Liberté, Egalité, Fraternité!

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Changing $HOME
  2005-03-05  7:07                   ` Oliver Scholz
@ 2005-03-07  4:30                     ` Shug Boabby
  0 siblings, 0 replies; 17+ messages in thread
From: Shug Boabby @ 2005-03-07  4:30 UTC (permalink / raw)


> What directory do you see, if you type `C-x d ~ RET'?

/Users/shug/GNU:
  wildcard GNU
  ls: GNU: No such file or directory

but i assure you that /Users/shug/GNU does indeed exist

> If not at the right one, please start Emacs like this:
> emacs -q --no-site-file --eval '(setenv "HOME" "/User/shug/GNU")'

(note i changed your "User" to "Users")

and i get the same results.

perhaps this is only broken in the OS X carbon builds?

i think i will try to solve this problem by getting OS X to pass the
correct environment onto Emacs when it starts. until then... a command
line wrapper is my friend.

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2005-03-07  4:30 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-23 23:34 Changing $HOME Shug Boabby
2005-02-24  0:17 ` David Hansen
2005-02-24  0:29   ` Shug Boabby
2005-02-24 16:07     ` Sébastien Kirche
2005-03-04 20:28       ` Shug Boabby
2005-03-04 20:31         ` Shug Boabby
2005-03-04 23:07         ` Pascal Bourguignon
2005-03-04 23:33           ` Shug Boabby
2005-03-04 23:51             ` Kevin Rodgers
2005-03-05  0:14               ` Shug Boabby
2005-03-05  0:16             ` Pascal Bourguignon
2005-03-05  0:18               ` Pascal Bourguignon
2005-03-05  0:23                 ` Shug Boabby
2005-03-05  7:07                   ` Oliver Scholz
2005-03-07  4:30                     ` Shug Boabby
2005-03-05  7:08                   ` Oliver Scholz
2005-03-05  0:22               ` Shug Boabby

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.