unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Unknown option `--no-desktop'
@ 2004-11-15 16:14 Robert J. Chassell
  2004-11-15 16:37 ` Stephan Stahl
  0 siblings, 1 reply; 7+ messages in thread
From: Robert J. Chassell @ 2004-11-15 16:14 UTC (permalink / raw)


Today's GNU Emacs CVS snapshot, Mon, 2004 Nov 15  12:17 UTC
GNU Emacs 21.3.50.6 (i686-pc-linux-gnu, GTK+ Version 2.4.13)
started with

    emacs -Q --no-desktop

does not recognize the initial option  --no-desktop

I see this error message:

    Unknown option `--no-desktop'

This occurs even when starting Emacs with a .emacs file that says to
`desktop-read'.

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

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

* Re: Unknown option `--no-desktop'
  2004-11-15 16:14 Unknown option `--no-desktop' Robert J. Chassell
@ 2004-11-15 16:37 ` Stephan Stahl
  2004-11-15 17:55   ` Robert J. Chassell
  0 siblings, 1 reply; 7+ messages in thread
From: Stephan Stahl @ 2004-11-15 16:37 UTC (permalink / raw)
  Cc: emacs-devel

Hi Robert.

Robert J. Chassell said:
> Today's GNU Emacs CVS snapshot, Mon, 2004 Nov 15  12:17 UTC
> GNU Emacs 21.3.50.6 (i686-pc-linux-gnu, GTK+ Version 2.4.13)
> started with
>
>     emacs -Q --no-desktop
>
> does not recognize the initial option  --no-desktop

I think this is what is to be expected.  emacs -Q does not load any startup
files so there is nothing that loads desktop.el so emacs really does not know
the option --no-desktop.  This should not be new and should not be a bug.

Stephan
-- 
Stephan Stahl

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

* Re: Unknown option `--no-desktop'
  2004-11-15 16:37 ` Stephan Stahl
@ 2004-11-15 17:55   ` Robert J. Chassell
  2004-11-15 18:30     ` Stephan Stahl
  0 siblings, 1 reply; 7+ messages in thread
From: Robert J. Chassell @ 2004-11-15 17:55 UTC (permalink / raw)
  Cc: emacs-devel

   >     emacs -Q --no-desktop
   >
   > does not recognize the initial option  --no-desktop

   I think this is what is to be expected.  emacs -Q does not load any
   startup files so there is nothing that loads desktop.el so emacs
   really does not know the option --no-desktop.  

That makes sense, but the documentation does not help.  It should
point this out.

In any event, the option also fails when starting Emacs with a .emacs
file that loads or saves a desktop.  (I was trying to create a test
version of Emacs that used most of my regular .emacs file, but did not
load or save its desktop.)

There are two issues and --no-desktop fails both:

  1. It does not match its documentation by not automatically reloading a
     saved desktop.  The documentation says   (emacs)Initial Options

             Do not reload any saved desktop.

  2. It does not turn off a turned-on Save Desktop.

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

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

* Re: Unknown option `--no-desktop'
  2004-11-15 17:55   ` Robert J. Chassell
@ 2004-11-15 18:30     ` Stephan Stahl
  2004-11-15 22:24       ` Robert J. Chassell
  0 siblings, 1 reply; 7+ messages in thread
From: Stephan Stahl @ 2004-11-15 18:30 UTC (permalink / raw)
  Cc: Stephan Stahl, emacs-devel

Hi Robert.

Robert J. Chassell said:

> In any event, the option also fails when starting Emacs with a .emacs
> file that loads or saves a desktop.  (I was trying to create a test
> version of Emacs that used most of my regular .emacs file, but did not
> load or save its desktop.)

I'm not sure i understand what you mean.  I suppose you start 'emacs
--no-desktop' and have some lines in your .emacs that load/save your desktop. 
You think those lines should not load/save your desktop when --no-desktop was
specified?

Well emacs does what you tell it to do ;-).

>   2. It does not turn off a turned-on Save Desktop.

--no-desktop can not 'turn off a turned-on Save Desktop' because when emacs is
started there is no 'turned-on Save Desktop'.

It seems you would like --no-desktop to be much more final??

I think it would be wrong.  When i start emacs with --no-desktop then yes it
should not load any saved desktop.  But then later when a "desktop-save"
command is issued (no matter if via M-x or .emacs) i expect emacs to do just
that.

Stephan
-- 
Stephan Stahl

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

* Re: Unknown option `--no-desktop'
  2004-11-15 18:30     ` Stephan Stahl
@ 2004-11-15 22:24       ` Robert J. Chassell
  2004-11-15 22:38         ` Stephan Stahl
  0 siblings, 1 reply; 7+ messages in thread
From: Robert J. Chassell @ 2004-11-15 22:24 UTC (permalink / raw)
  Cc: emacs-devel

   I'm not sure i understand what you mean.  I suppose you start
   'emacs --no-desktop' and have some lines in your .emacs that
   load/save your desktop.  

Right.  In fact, the `--no-desktop' option means that a desktop is
loaded, contrary to the documentation.

It also means, as separate issue, that even though I have specified
`no desktop', I am asked about saving a desktop when I quit Emacs.

    You think those lines should not load/save your desktop when
    --no-desktop was specified?

Yes.  My understanding is that `Hairy startup options' (as the Emacs
manual calls them) override .emacs files.

   I think it would be wrong.  When i start emacs with --no-desktop
   then yes it should not load any saved desktop.  

But it does.  This is one problem.  I agree with you, it should not.

   But then later when a "desktop-save" command is issued (no matter
   if via M-x or .emacs) i expect emacs to do just that.

There is a time issue:  if I were to load the .emacs before the
--no-desktop option, I would expect *all* the desktop related
functions to be turned off.  If I ran `M-x desktop-save' after first
turning all the functions off, I would expect the functions to be
autoloaded and the `desktop-save' function to be executed.

(Actually, the order in which you write args in a command line should
not matter.  In this case, the start up option should overrule the
.emacs file.  This provides a straightforward sequence: start up
options overrule a personal .emacs file which overrules the default.
But after start up, you can do anything.)

If Emacs does not behave this way (or even when it does) the actions
(whatever they be) should be documented in a non-confusing manner.

My preference is that the `Hairy startup options' options work as I
expect them to.  And they be documented.

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

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

* Re: Unknown option `--no-desktop'
  2004-11-15 22:24       ` Robert J. Chassell
@ 2004-11-15 22:38         ` Stephan Stahl
  2004-11-16 13:47           ` Robert J. Chassell
  0 siblings, 1 reply; 7+ messages in thread
From: Stephan Stahl @ 2004-11-15 22:38 UTC (permalink / raw)
  Cc: Stephan Stahl, emacs-devel

Hi Robert.

Robert J. Chassell said:

> Right.  In fact, the `--no-desktop' option means that a desktop is
> loaded, contrary to the documentation.
>
> It also means, as separate issue, that even though I have specified
> `no desktop', I am asked about saving a desktop when I quit Emacs.
>
> Yes.  My understanding is that `Hairy startup options' (as the Emacs
> manual calls them) override .emacs files.
>
> There is a time issue:  if I were to load the .emacs before the
> --no-desktop option, I would expect *all* the desktop related
> functions to be turned off.  If I ran `M-x desktop-save' after first
> turning all the functions off, I would expect the functions to be
> autoloaded and the `desktop-save' function to be executed.

Well yes you are right. --no-desktop does not have any effect in your case
because of coding and timing.

--no-desktop is only honored once. When the file is loaded. In that case
desktop-save-mode does not get enabled. after that one test the string
"--no-desktop" is removed from the options list.

Maybe the fact that --no-deskop was given should be saved in a variable the
the desktop save functions test und only save when that variable is nil oder
where called interactively?

However i do not understand why you have some lines in you .emacs files that
cause the desktop to get saved. desktop.el should do that automaticly when
emacs  is killed..  Maybe you should just remove those lines.

Stephan
-- 
Stephan Stahl

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

* Re: Unknown option `--no-desktop'
  2004-11-15 22:38         ` Stephan Stahl
@ 2004-11-16 13:47           ` Robert J. Chassell
  0 siblings, 0 replies; 7+ messages in thread
From: Robert J. Chassell @ 2004-11-16 13:47 UTC (permalink / raw)


"Stephan Stahl" <stahl@eos.franken.de> said

    ...  i do not understand why you have some lines in you .emacs
    files that cause the desktop to get saved. desktop.el should do
    that automaticly when emacs is killed. ...

This is so I can avoid using the desktop with specifically named
instances of Emacs.  Here is what I say in my .emacs file:

;;  Do not use desktop-save-mode for Short or Experimental Emacs:
(if (or
       (string= (cdr (assq 'name (frame-parameters))) "Bobs Short Emacs")
       (string= (cdr (assq 'name (frame-parameters))) "Experimental Emacs"))
    (desktop-save-mode 0)
  (desktop-save-mode 1))

Here is my proposal for how the start up option should work:

  1.  Emacs started with   emacs -Q --no-desktop

      -- Do not start a desktop, since there is none; do nothing.

      -- _Also_, 
         do not say  "Unknown option `--no-desktop'"
         but do nothing since the initial option should be recognized
         as having nothing to work on.

  2.  Emacs started with   emacs --no-desktop 
      and with a .emacs file that says       (desktop-save-mode 1)
      (and no desktop function called during session)

      -- Do not start the desktop
      -- Do not save a desktop when this instance of Emacs is ended

  3.  Emacs started with   emacs --no-desktop 
      and with a .emacs file that says       (desktop-save-mode 1)
      but a desktop function is called during the session
      after this instance of Emacs has started

      -- Do whatever the desktop function says

  4.  Emacs started with   emacs --no-desktop 
      and with a .emacs file that says         (desktop-read "/user")

      -- Do not start the desktop
      -- If a desktop function is called during the session,
         do whatever it says.

A key question is whether the single option --no-desktop should do two
different actions, in effect, combine two different options:

  * --no-desktop-read: prevent starting a desktop when an instance of
      Emacs starts, 
      but permitting a save when the .emacs file says
      (desktop-save-mode 1)

  * --no-desktop-save: prevent saving a desktop when an instance of
      Emacs ends, 
      but permitting a pre-existing desktop to be read,
      and not changing it during the session, when the .emacs file says
      (desktop-save-mode 1)

I think there should be just the one option --no-desktop and it should
do both actions.  Morover the one option should apply only to the
start up.  If you call a desktop function when running, then that
should take effect, just as your .emacs file gets loaded if you load
your .emacs after starting with `emacs -Q'.

Under no circumstances should the message 
    Unknown option `--no-desktop'
appear, as it does with this morning's CVS, of Tue, 2004 Nov 16 12:52
UTC, GNU Emacs 21.3.50.7 (i686-pc-linux-gnu, GTK+ Version 2.4.13)
started with
    emacs -Q --no-desktop

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

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

end of thread, other threads:[~2004-11-16 13:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-15 16:14 Unknown option `--no-desktop' Robert J. Chassell
2004-11-15 16:37 ` Stephan Stahl
2004-11-15 17:55   ` Robert J. Chassell
2004-11-15 18:30     ` Stephan Stahl
2004-11-15 22:24       ` Robert J. Chassell
2004-11-15 22:38         ` Stephan Stahl
2004-11-16 13:47           ` Robert J. Chassell

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).