all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Startup screen default directory
@ 2008-02-10 23:29 Juri Linkov
  2008-02-11 13:34 ` Richard Stallman
  0 siblings, 1 reply; 9+ messages in thread
From: Juri Linkov @ 2008-02-10 23:29 UTC (permalink / raw)
  To: emacs-devel

When desktop-mode is active, then after loading the desktop file and
restoring all saved files, the startup screen have the default directory
set to the directory of the last restored file.  Since the last file is
not visible (only the startup screen is shown), this leaves to wonder
why the default directory of the startup screen is set to some arbitrary
directory.  This is very confusing.  I propose to set the default
directory of the startup screen to the directory where Emacs was run.
Fortunately, there is a special variable that holds this value:

Index: lisp/startup.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/startup.el,v
retrieving revision 1.475
diff -c -r1.475 startup.el
*** lisp/startup.el	7 Feb 2008 14:05:53 -0000	1.475
--- lisp/startup.el	10 Feb 2008 23:28:32 -0000
***************
*** 1490,1495 ****
--- 1490,1496 ----
      (with-current-buffer splash-buffer
        (let ((inhibit-read-only t))
  	(erase-buffer)
+ 	(setq default-directory command-line-default-directory)
  	(make-local-variable 'startup-screen-inhibit-startup-screen)
  	(if pure-space-overflow
  	    (insert pure-space-overflow-message))
***************
*** 1588,1593 ****
--- 1589,1595 ----
      (with-current-buffer (get-buffer-create "*About GNU Emacs*")
        (setq buffer-read-only nil)
        (erase-buffer)
+       (setq default-directory command-line-default-directory)
        (set (make-local-variable 'tab-width) 8)
        (if (not startup)
  	  (set (make-local-variable 'mode-line-format)

-- 
Juri Linkov
http://www.jurta.org/emacs/




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

* Re: Startup screen default directory
  2008-02-10 23:29 Startup screen default directory Juri Linkov
@ 2008-02-11 13:34 ` Richard Stallman
  2008-02-12  0:14   ` Juri Linkov
  0 siblings, 1 reply; 9+ messages in thread
From: Richard Stallman @ 2008-02-11 13:34 UTC (permalink / raw)
  To: Juri Linkov; +Cc: emacs-devel

    When desktop-mode is active, then after loading the desktop file and
    restoring all saved files, the startup screen have the default directory
    set to the directory of the last restored file.  Since the last file is
    not visible (only the startup screen is shown), this leaves to wonder
    why the default directory of the startup screen is set to some arbitrary
    directory.  This is very confusing.  I propose to set the default
    directory of the startup screen to the directory where Emacs was run.

That seems like a good idea.

However, maybe desktop.el should switch to the restored buffers.  If
someone is restoring an old desktop, he has seen the splash screen
before, and has probably used Emacs for some time.
There is no need to show him the startup screen again.




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

* Re: Startup screen default directory
  2008-02-11 13:34 ` Richard Stallman
@ 2008-02-12  0:14   ` Juri Linkov
  2008-02-12  1:48     ` Robert J. Chassell
  2008-02-12  3:51     ` Richard Stallman
  0 siblings, 2 replies; 9+ messages in thread
From: Juri Linkov @ 2008-02-12  0:14 UTC (permalink / raw)
  To: rms; +Cc: emacs-devel

>     When desktop-mode is active, then after loading the desktop file and
>     restoring all saved files, the startup screen have the default directory
>     set to the directory of the last restored file.  Since the last file is
>     not visible (only the startup screen is shown), this leaves to wonder
>     why the default directory of the startup screen is set to some arbitrary
>     directory.  This is very confusing.  I propose to set the default
>     directory of the startup screen to the directory where Emacs was run.
>
> That seems like a good idea.

It seems setting the default directory of the startup screen to the
directory where Emacs was run is good even in case when the user doesn't
use the desktop.

> However, maybe desktop.el should switch to the restored buffers.  If
> someone is restoring an old desktop, he has seen the splash screen
> before, and has probably used Emacs for some time.
> There is no need to show him the startup screen again.

Wouldn't it be enough to check for the autoloaded variable
`desktop-save-mode'? When it is non-nil, we can assume that
the user has customized it to load the desktop, so don't show
the splash screen.

-- 
Juri Linkov
http://www.jurta.org/emacs/




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

* Re: Startup screen default directory
  2008-02-12  0:14   ` Juri Linkov
@ 2008-02-12  1:48     ` Robert J. Chassell
  2008-02-12 21:30       ` Juri Linkov
  2008-02-12  3:51     ` Richard Stallman
  1 sibling, 1 reply; 9+ messages in thread
From: Robert J. Chassell @ 2008-02-12  1:48 UTC (permalink / raw)
  To: emacs-devel

    Wouldn't it be enough to check for the autoloaded variable
    `desktop-save-mode'? When it is non-nil, we can assume that
    the user has customized it to load the desktop, so don't show
    the splash screen.

No.  My current value in this instance in which I am writing:

    desktop-save-mode is a variable defined in `desktop.el'.
    Its value is nil

In my major instance of GNU Emacs, I load over 20 files from a saved
desktop, but my `desktop-save-mode' variable is nil because I want
always to load the same files, but often look at others that I do not
necessarily want the next time I start Emacs.

On the other hand, in a root owned instance, in a `when' expression, I
evoke

  (desktop-save-mode 1)
  (desktop-read "/root")

The root owned instance says: 

    desktop-save-mode is a variable defined in `desktop.el'.
    Its value is t

That is an advantage of having nil, t and one .emacs file loaded with

   -q -l ~bob/.emacs

-- 
    Robert J. Chassell                          GnuPG Key ID: 004B4AC8
    bob@rattlesnake.com                         bob@gnu.org
    http://www.rattlesnake.com                  http://www.teak.cc




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

* Re: Startup screen default directory
  2008-02-12  0:14   ` Juri Linkov
  2008-02-12  1:48     ` Robert J. Chassell
@ 2008-02-12  3:51     ` Richard Stallman
  1 sibling, 0 replies; 9+ messages in thread
From: Richard Stallman @ 2008-02-12  3:51 UTC (permalink / raw)
  To: Juri Linkov; +Cc: emacs-devel

    Wouldn't it be enough to check for the autoloaded variable
    `desktop-save-mode'? When it is non-nil, we can assume that
    the user has customized it to load the desktop, so don't show
    the splash screen.

That seems right.




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

* Re: Startup screen default directory
  2008-02-12  1:48     ` Robert J. Chassell
@ 2008-02-12 21:30       ` Juri Linkov
  2008-02-12 22:31         ` Stefan Monnier
  2008-02-13  2:21         ` Robert J. Chassell
  0 siblings, 2 replies; 9+ messages in thread
From: Juri Linkov @ 2008-02-12 21:30 UTC (permalink / raw)
  To: bob; +Cc: emacs-devel

> In my major instance of GNU Emacs, I load over 20 files from a saved
> desktop, but my `desktop-save-mode' variable is nil because I want
> always to load the same files, but often look at others that I do not
> necessarily want the next time I start Emacs.
>
> On the other hand, in a root owned instance, in a `when' expression, I
> evoke
>
>   (desktop-save-mode 1)
>   (desktop-read "/root")
>
> The root owned instance says:
>
>     desktop-save-mode is a variable defined in `desktop.el'.
>     Its value is t

A more relevant variable that determines if the desktop was really
loaded and that it created some buffers is `desktop-buffer-ok-count'.

Currently it is locally bound in `desktop-read' but could be changed
to be global.  So if `desktop-buffer-ok-count' > 0 then don't show
the startup screen.

-- 
Juri Linkov
http://www.jurta.org/emacs/




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

* Re: Startup screen default directory
  2008-02-12 21:30       ` Juri Linkov
@ 2008-02-12 22:31         ` Stefan Monnier
  2008-02-12 23:42           ` Juri Linkov
  2008-02-13  2:21         ` Robert J. Chassell
  1 sibling, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2008-02-12 22:31 UTC (permalink / raw)
  To: Juri Linkov; +Cc: bob, emacs-devel

>> In my major instance of GNU Emacs, I load over 20 files from a saved
>> desktop, but my `desktop-save-mode' variable is nil because I want
>> always to load the same files, but often look at others that I do not
>> necessarily want the next time I start Emacs.
>> 
>> On the other hand, in a root owned instance, in a `when' expression, I
>> evoke
>> 
>> (desktop-save-mode 1)
>> (desktop-read "/root")
>> 
>> The root owned instance says:
>> 
>> desktop-save-mode is a variable defined in `desktop.el'.
>> Its value is t

> A more relevant variable that determines if the desktop was really
> loaded and that it created some buffers is `desktop-buffer-ok-count'.

> Currently it is locally bound in `desktop-read' but could be changed
> to be global.  So if `desktop-buffer-ok-count' > 0 then don't show
> the startup screen.

Couldn't we do it the other way around: have desktop.el change
inhibit-startup-screen or something like that?
startup.el has no business looking at desktop's internal variables.


        Stefan




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

* Re: Startup screen default directory
  2008-02-12 22:31         ` Stefan Monnier
@ 2008-02-12 23:42           ` Juri Linkov
  0 siblings, 0 replies; 9+ messages in thread
From: Juri Linkov @ 2008-02-12 23:42 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: bob, emacs-devel

>>> In my major instance of GNU Emacs, I load over 20 files from a saved
>>> desktop, but my `desktop-save-mode' variable is nil because I want
>>> always to load the same files, but often look at others that I do not
>>> necessarily want the next time I start Emacs.
>>>
>>> On the other hand, in a root owned instance, in a `when' expression, I
>>> evoke
>>>
>>> (desktop-save-mode 1)
>>> (desktop-read "/root")
>>>
>>> The root owned instance says:
>>>
>>> desktop-save-mode is a variable defined in `desktop.el'.
>>> Its value is t
>
>> A more relevant variable that determines if the desktop was really
>> loaded and that it created some buffers is `desktop-buffer-ok-count'.
>
>> Currently it is locally bound in `desktop-read' but could be changed
>> to be global.  So if `desktop-buffer-ok-count' > 0 then don't show
>> the startup screen.
>
> Couldn't we do it the other way around: have desktop.el change
> inhibit-startup-screen or something like that?
> startup.el has no business looking at desktop's internal variables.

Yes, and there even exists already a proper place in desktop.el that
loads the desktop on startup.  Fixed in CVS and Emacs 22.

-- 
Juri Linkov
http://www.jurta.org/emacs/




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

* Re: Startup screen default directory
  2008-02-12 21:30       ` Juri Linkov
  2008-02-12 22:31         ` Stefan Monnier
@ 2008-02-13  2:21         ` Robert J. Chassell
  1 sibling, 0 replies; 9+ messages in thread
From: Robert J. Chassell @ 2008-02-13  2:21 UTC (permalink / raw)
  To: emacs-devel

    A more relevant variable that determines if the desktop was really
    loaded and that it created some buffers is `desktop-buffer-ok-count'.

I cannot see the variable.  In

GNU Emacs CVS snapshot of Tue, 2008 Feb 12  20:32 UTC
GNU Emacs 23.0.60.8 (i686-pc-linux-gnu, GTK+ Version 2.12.5)

  (describe-variable desktop-buffer-ok-count)

produces

  Debugger entered--Lisp error: (void-variable desktop-buffer-ok-count)

when I evaluate the form, but 

  (describe-variable desktop-save-mode)

works fine.

-- 
    Robert J. Chassell                          GnuPG Key ID: 004B4AC8
    bob@rattlesnake.com                         bob@gnu.org
    http://www.rattlesnake.com                  http://www.teak.cc




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

end of thread, other threads:[~2008-02-13  2:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-10 23:29 Startup screen default directory Juri Linkov
2008-02-11 13:34 ` Richard Stallman
2008-02-12  0:14   ` Juri Linkov
2008-02-12  1:48     ` Robert J. Chassell
2008-02-12 21:30       ` Juri Linkov
2008-02-12 22:31         ` Stefan Monnier
2008-02-12 23:42           ` Juri Linkov
2008-02-13  2:21         ` Robert J. Chassell
2008-02-12  3:51     ` Richard Stallman

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.