all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Strange behaviour with custom set HOME env variable
@ 2012-04-01 19:28 Matus Kmit
  2012-04-01 23:08 ` Peter Dyballa
  0 siblings, 1 reply; 5+ messages in thread
From: Matus Kmit @ 2012-04-01 19:28 UTC (permalink / raw)
  To: help-gnu-emacs

Hello everybody

Perhaps someone can help me with the following problem:

I am using the "site-start.el" file to set a custom home environmental
variable ("/home/nimaai/Dropbox/emacs/emacs-home-dir") before loading
the .emacs file. This home variable points to a Dropbox folder where
the .emacs file is located which I share between different machines.
The home variable seems to work as the content of the .emacs file
loads correctly. Visiting the .emacs file with "Find file ~/.emacs"
also works ok but only on the windows machines. On all my linux
machines I am encountering the following phenomenon:

- Visiting the .emacs file gives en error: "Use M-x make-directory RET
RET to create the directory and its parents"
- Trying saving the file sheds then more light about this error:
"basic-save-buffer-2:
/home/nimaai/Dropbox/emacs/emacs-home-dir/Dropbox/emacs/emacs-home-dir/:
no such directory"

I don't know how emacs got this path. It should simply be
"/home/nimaai/Dropbox/emacs/emacs-home-dir/" instead, which is the
value of my home variable set in the "site-start.el" file.

Does anybody have any idea?

Thanks
Matus



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

* Re: Strange behaviour with custom set HOME env variable
  2012-04-01 19:28 Strange behaviour with custom set HOME env variable Matus Kmit
@ 2012-04-01 23:08 ` Peter Dyballa
       [not found]   ` <CALvESw7MwBnxuCsLcwfRaJu7mhhbP2Q7dOuoKGCaxJmgfCNUKw@mail.gmail.com>
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Dyballa @ 2012-04-01 23:08 UTC (permalink / raw)
  To: Matus Kmit; +Cc: help-gnu-emacs


Am 1.4.2012 um 21:28 schrieb Matus Kmit:

> Does anybody have any idea?

Setting user-init-file ?

--
Greetings

  Pete

Claiming that the Macintosh is inferior to Windows because most people use Windows, is like saying that all other restaurants serve food that is inferior to McDonald's.




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

* Re: Strange behaviour with custom set HOME env variable
       [not found]       ` <CALvESw4jBbEpERYa+KU-eqWUwX6AXfDF-S0uixqcDmsB8MvJGw@mail.gmail.com>
@ 2012-04-03  6:17         ` Matus Kmit
       [not found]         ` <DBA85948-AF47-4AEF-B6DC-1EEB98F3FA4E@web.de>
       [not found]         ` <05D90AA0-EF76-4CEE-BAA8-06E3A7ADCCF7@web.de>
  2 siblings, 0 replies; 5+ messages in thread
From: Matus Kmit @ 2012-04-03  6:17 UTC (permalink / raw)
  To: help-gnu-emacs

On Mon, Apr 2, 2012 at 3:02 PM, Peter Dyballa <Peter_Dyballa@web.de> wrote:
>
> Am 2.4.2012 um 10:09 schrieb Matus Kmit:
>
>> What do you exactly mean with user-init-file as there are several
>> possibilities (http://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html)?
>
> There is only one variable name, I presume. It points to user-init-file.

Ok, I got it.

>
>> Among them, as already explained in my previous email, I am currently
>> using:
>> 1. "site-start.el" which sets my custom HOME environmental variable
>> (path to my Dropbox folder)
>
> This is a Bad Thing®. Site-start.el is meant to adapt GNU Emacs to the system it runs on. It's not really an user choice.

Which would be a better solution? I need to set that variable before
emacs loads my init file, so that it knows that it is located in
Dropbox.

>
>> 2. ".emacs" which is then found and loaded from the path of the
>> previously set HOME variable
>
> It is found when user-init-file is not naming a different file.

The value of "user-init-file" is correct:
"/home/nimaai/Dropbox/emacs/emacs-home-dir/.emacs"

(find-file user-init-file) opens a new .emacs file under a different
location. "M-x dired" in its buffer shows:

"Dired (directory):
~/Dropbox/emacs/emacs-home-dir/Dropbox/emacs/emacs-home-dir/" which is
wrong. Emacs somehow concatenates the path two times...

>
> --
> Greetings
>
>  Pete
>
> There's something the technicians need to learn from the artists. If it isn't aesthetically pleasing, it's probably wrong.
>



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

* Re: Strange behaviour with custom set HOME env variable
       [not found]         ` <DBA85948-AF47-4AEF-B6DC-1EEB98F3FA4E@web.de>
@ 2012-04-03  6:19           ` Matus Kmit
  0 siblings, 0 replies; 5+ messages in thread
From: Matus Kmit @ 2012-04-03  6:19 UTC (permalink / raw)
  To: help-gnu-emacs

Am 2.4.2012 um 16:02 schrieb Matus Kmit:

>> This is a Bad Thing®. Site-start.el is meant to adapt GNU Emacs to the system it runs on. It's not really an user choice.
>
> Which would be a better solution? I need to set that variable before
> emacs loads my init file, so that it knows that it is located in
> Dropbox.

Why not use symbolic links, sym-links? Let ~/.emacs, i.e., the
variable user-init-file and $HOME, be unmanipulated and substitute the
real file with a sym-link that points into the Dropbox volume:

       ln -s /home/nimaai/Dropbox/emacs/emacs-home-dir/.emacs ~

or

       pushd ~ ; ln -s Dropbox/emacs/emacs-home-dir/.emacs

(I have no idea of Dropbox, but I am sure that this external has to be
mounted some way, by some protocol, to the local file systems. So you
have a path to its contents. And I presume you gave this path in your
eMail.)

--
Greetings

 Pete

Encryption, n.:
       A powerful algorithmic encoding technique employed in the
creation of computer manuals.



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

* Re: Strange behaviour with custom set HOME env variable
       [not found]         ` <05D90AA0-EF76-4CEE-BAA8-06E3A7ADCCF7@web.de>
@ 2012-04-08 14:46           ` Matus Kmit
  0 siblings, 0 replies; 5+ messages in thread
From: Matus Kmit @ 2012-04-08 14:46 UTC (permalink / raw)
  To: Peter Dyballa, help-gnu-emacs

Hi Peter

Thanks for all those tips. I will try what suits me best.

Matus

On Tue, Apr 3, 2012 at 10:41 AM, Peter Dyballa <Peter_Dyballa@web.de> wrote:
>
> Am 2.4.2012 um 16:02 schrieb Matus Kmit:
>
>>>> Among them, as already explained in my previous email, I am currently
>>>> using:
>>>> 1. "site-start.el" which sets my custom HOME environmental variable
>>>> (path to my Dropbox folder)
>>>
>>> This is a Bad Thing®. Site-start.el is meant to adapt GNU Emacs to the system it runs on. It's not really an user choice.
>>
>> Which would be a better solution? I need to set that variable before
>> emacs loads my init file, so that it knows that it is located in
>> Dropbox.
>
> Other ways are to use shell aliases or shell functions. You're not limited to typing the whole command every time but can use an "abbreviation". On the command line you can make GNU Emacs execute code, so maybe this works:
>
>        emacs --eval '(setq user-init-file "/home/nimaai/Dropbox/emacs/emacs-home-dir/.emacs")' &
>
> The ELisp code can also be put into a file:
>
>        emacs --script my-startup.el &
>
> The most easiest way should be this one (I also use, to set up some minimal customisation for debugging):
>
>        emacs -q -l /home/nimaai/Dropbox/emacs/emacs-home-dir/.emacs &
>
> Instead of -q you could also use -Q.
>
> These lengthy commands can then be put into a shell alias (or function) to save some typing.
>
> --
> Greetings
>
>  Pete
>
> Got Mole problems?
> Call Avogadro 6.02 x 10^23
>



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

end of thread, other threads:[~2012-04-08 14:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-01 19:28 Strange behaviour with custom set HOME env variable Matus Kmit
2012-04-01 23:08 ` Peter Dyballa
     [not found]   ` <CALvESw7MwBnxuCsLcwfRaJu7mhhbP2Q7dOuoKGCaxJmgfCNUKw@mail.gmail.com>
     [not found]     ` <EF54B51C-1FA4-4E49-9A26-6FF5159C6825@web.de>
     [not found]       ` <CALvESw4jBbEpERYa+KU-eqWUwX6AXfDF-S0uixqcDmsB8MvJGw@mail.gmail.com>
2012-04-03  6:17         ` Matus Kmit
     [not found]         ` <DBA85948-AF47-4AEF-B6DC-1EEB98F3FA4E@web.de>
2012-04-03  6:19           ` Matus Kmit
     [not found]         ` <05D90AA0-EF76-4CEE-BAA8-06E3A7ADCCF7@web.de>
2012-04-08 14:46           ` Matus Kmit

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.