all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Default directory in startup buffer
@ 2011-01-21  7:53 Jarmo Hurri
  2011-01-21  8:16 ` Mario Lassnig
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Jarmo Hurri @ 2011-01-21  7:53 UTC (permalink / raw)
  To: help-gnu-emacs


Greetings.

I am installing GNU Emacs on a bunch of Windows machines for a group of
students in order for them to be able to run R via ESS. So the students
will just start Emacs and run R in it. I just installed the newest
version of GNU Emacs from emacs-22.3-bin-i386.zip.

The problem is that the startup screen does not obey
default-directory. Putting the following line in site-startup.el

(setq default-directory "~/")

does change the default directory in buffer "*scratch*", but not in
buffer "*GNU Emacs*" I know about the variables inhibit-startup-screen
and inhibit-splash-screen, but I also know these have been intentionally
designed not to work in site-start.el. (Which I find a bit weird even
after reading the justification.)

The only workaround I was able to invent was to kill the startup buffer
in site-start.el

(kill-buffer "*GNU Emacs*")

so now my students' first introduction to GNU Emacs is a completely
empty "*scratch*" buffer and the message

*GNU Emacs*: no such buffer

(I also tried to change the buffer at site-start.el, but this does not
work.) I think there should be a better way around this.

Note that it is _not_ feasible to make the students edit personal
.emacs-files or something like that. Emacs is just a tool here, and it
should not distract from the main theme (programming and statistics).

[ As a related note, I found it surprising that I had to include the
  line
  (setq default-directory "~/")
  in site-start.el in order to get a reasonable default directory even
  in buffer "*scratch*". Should that kind of behaviour be the default in
  Emacs? ]

-- 
Jarmo Hurri

Remove all garbage from header email address when replying, or just
use firstname.lastname@syk.fi .


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

* Re: Default directory in startup buffer
  2011-01-21  7:53 Default directory in startup buffer Jarmo Hurri
@ 2011-01-21  8:16 ` Mario Lassnig
  2011-01-21  8:41   ` Jarmo Hurri
  2011-01-21  9:07 ` Jarmo Hurri
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Mario Lassnig @ 2011-01-21  8:16 UTC (permalink / raw)
  To: help-gnu-emacs

On 1/21/11 8:53 AM, Jarmo Hurri wrote:
>
> Greetings.
>
> I am installing GNU Emacs on a bunch of Windows machines for a group of
> students in order for them to be able to run R via ESS. So the students
> will just start Emacs and run R in it. I just installed the newest
> version of GNU Emacs from emacs-22.3-bin-i386.zip.
>
> The problem is that the startup screen does not obey
> default-directory. Putting the following line in site-startup.el
>
> (setq default-directory "~/")
>
> does change the default directory in buffer "*scratch*", but not in
> buffer "*GNU Emacs*" I know about the variables inhibit-startup-screen
> and inhibit-splash-screen, but I also know these have been intentionally
> designed not to work in site-start.el. (Which I find a bit weird even
> after reading the justification.)
>
> The only workaround I was able to invent was to kill the startup buffer
> in site-start.el
>
> (kill-buffer "*GNU Emacs*")
>
> so now my students' first introduction to GNU Emacs is a completely
> empty "*scratch*" buffer and the message
>
> *GNU Emacs*: no such buffer
>
> (I also tried to change the buffer at site-start.el, but this does not
> work.) I think there should be a better way around this.
>
> Note that it is _not_ feasible to make the students edit personal
> .emacs-files or something like that. Emacs is just a tool here, and it
> should not distract from the main theme (programming and statistics).
>
> [ As a related note, I found it surprising that I had to include the
>    line
>    (setq default-directory "~/")
>    in site-start.el in order to get a reasonable default directory even
>    in buffer "*scratch*". Should that kind of behaviour be the default in
>    Emacs? ]
>


How about this for a clean slate,
starting out with a clean scratch-buffer.



(setq inhibit-startup-echo-area-message t)
(setq inhibit-startup-screen t)
(setq initial-scratch-message nil)
(kill-buffer "*Messages*")



oh, and the scratch buffer does not have a directory, because it's not 
associated with a file.


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

* Re: Default directory in startup buffer
  2011-01-21  8:16 ` Mario Lassnig
@ 2011-01-21  8:41   ` Jarmo Hurri
  2011-01-21  9:06     ` rusi
  0 siblings, 1 reply; 7+ messages in thread
From: Jarmo Hurri @ 2011-01-21  8:41 UTC (permalink / raw)
  To: help-gnu-emacs


Mario Lassnig <mario@lassnig.net> writes:

> How about this for a clean slate,
> starting out with a clean scratch-buffer.
>
> (setq inhibit-startup-echo-area-message t)
> (setq inhibit-startup-screen t)
> (setq initial-scratch-message nil)
> (kill-buffer "*Messages*")

I guess that will work in a .emacs, but it has no effect in
site-start.el as I explained above.

> oh, and the scratch buffer does not have a directory, because it's not
> associated with a file.

Yes, and that is why default-directory becomes important. That is why we
are trying to set its value.

I understood something while experimenting with your suggestion. Earlier
I said that the workaround in site-start.el was

(kill-buffer "*GNU Emacs*")

which resulted in a clean screen and an error message. Well, the reason
why it worked was that while in site-start.el, there is no such buffer,
so the code actually caused an error. So my current workaround is to
cause an error in site-start.el.

-- 
Jarmo Hurri

Remove all garbage from header email address when replying, or just
use firstname.lastname@syk.fi .


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

* Re: Default directory in startup buffer
  2011-01-21  8:41   ` Jarmo Hurri
@ 2011-01-21  9:06     ` rusi
  0 siblings, 0 replies; 7+ messages in thread
From: rusi @ 2011-01-21  9:06 UTC (permalink / raw)
  To: help-gnu-emacs

Dont really understand the problem and I am not on windows right now

but as a hack you can make your own R-emacs command

emacs --eval '(setq inhibit-startup-echo-area-message t
               inhibit-startup-screen t
               initial-scratch-message nil
               default-directory "~/")'

(Thats one line -- Remove the newlines)

On windows IIRC default-directory works if you set HOME in the
environment

A better option maybe to set the R mode as default mode


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

* Re: Default directory in startup buffer
  2011-01-21  7:53 Default directory in startup buffer Jarmo Hurri
  2011-01-21  8:16 ` Mario Lassnig
@ 2011-01-21  9:07 ` Jarmo Hurri
  2011-01-23 11:11 ` Peter Dyballa
  2011-02-01  2:16 ` Kevin Rodgers
  3 siblings, 0 replies; 7+ messages in thread
From: Jarmo Hurri @ 2011-01-21  9:07 UTC (permalink / raw)
  To: help-gnu-emacs


Ahem, my bad: I just noticed that I had accidentally installed Emacs
version 22.3, while the newest one is 23.2. The newer version has the
correct default directory in the startup buffer. Sorry.

-- 
Jarmo Hurri

Remove all garbage from header email address when replying, or just
use firstname.lastname@syk.fi .


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

* Re: Default directory in startup buffer
  2011-01-21  7:53 Default directory in startup buffer Jarmo Hurri
  2011-01-21  8:16 ` Mario Lassnig
  2011-01-21  9:07 ` Jarmo Hurri
@ 2011-01-23 11:11 ` Peter Dyballa
  2011-02-01  2:16 ` Kevin Rodgers
  3 siblings, 0 replies; 7+ messages in thread
From: Peter Dyballa @ 2011-01-23 11:11 UTC (permalink / raw)
  To: Jarmo Hurri; +Cc: help-gnu-emacs


Am 21.01.2011 um 08:53 schrieb Jarmo Hurri:

> I just installed the newest
> version of GNU Emacs from emacs-22.3-bin-i386.zip.

No, the newest version is 23.2.

In MS-DOS, before MS Windows, it was possible to write batch files.  
Could it be possible to write in MS Windows one that does the following?

	emacs -Q -l <a file with ELisp commands>

In this script/batch file you could also set (and export) a HOME  
directory variable, which stands usually for the default-directory.

The <file with ELisp commands> can also contain some customisation  
settings.

--
Greetings

   Pete                           <]
              o        __o         |__    o       HPV, the real
     ___o    /I       -\<,         |o \  -\),-%     high speed!
___/\ /\___./ \___...O/ O____.....`-O-'-()--o_________________




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

* Re: Default directory in startup buffer
  2011-01-21  7:53 Default directory in startup buffer Jarmo Hurri
                   ` (2 preceding siblings ...)
  2011-01-23 11:11 ` Peter Dyballa
@ 2011-02-01  2:16 ` Kevin Rodgers
  3 siblings, 0 replies; 7+ messages in thread
From: Kevin Rodgers @ 2011-02-01  2:16 UTC (permalink / raw)
  To: help-gnu-emacs

On 1/21/11 12:53 AM, Jarmo Hurri wrote:
> I am installing GNU Emacs on a bunch of Windows machines for a group of
> students in order for them to be able to run R via ESS. So the students
> will just start Emacs and run R in it. I just installed the newest
> version of GNU Emacs from emacs-22.3-bin-i386.zip.

The most recently released version is actually 23.2.

> The problem is that the startup screen does not obey
> default-directory. Putting the following line in site-startup.el
>
> (setq default-directory "~/")
>
> does change the default directory in buffer "*scratch*", but not in
> buffer "*GNU Emacs*"

(mapc (lambda (buffer)
	(with-current-buffer buffer
	  (setq default-directory "~/")))
       (buffer-list))

...

> [ As a related note, I found it surprising that I had to include the
>    line
>    (setq default-directory "~/")
>    in site-start.el in order to get a reasonable default directory even
>    in buffer "*scratch*". Should that kind of behaviour be the default in
>    Emacs? ]

Did you specify the start directory, in the Start In property of the program
shortcut?

-- 
Kevin Rodgers
Denver, Colorado, USA




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

end of thread, other threads:[~2011-02-01  2:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-21  7:53 Default directory in startup buffer Jarmo Hurri
2011-01-21  8:16 ` Mario Lassnig
2011-01-21  8:41   ` Jarmo Hurri
2011-01-21  9:06     ` rusi
2011-01-21  9:07 ` Jarmo Hurri
2011-01-23 11:11 ` Peter Dyballa
2011-02-01  2:16 ` Kevin Rodgers

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.