unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Close .emacs file after customization?
@ 2003-01-14  9:31 Kevin A. Burton (burtonator)
  2003-01-15 16:57 ` Kevin Rodgers
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Kevin A. Burton (burtonator) @ 2003-01-14  9:31 UTC (permalink / raw)



If the user is running with a fresh Emacs instance (no open buffers), then
customizes a variable, the .emacs file is left as an open buffer.

Why is this?  Is there a reason?

It would seem that we should pollute the buffer list if the .emacs file hasn't
already been opened manually.

This isn't a theoretical problem.  I am trying to run multiple .emacs versions
and I want to maintain the same customization options across Emacs instances.

If I open the .emacs file in one instance, customize it, then do the same in
another instance, they both have an open copy of the buffer and there are race
conditions as to which emacs version should be modifying the file.

Can we just fix customization to close the .emacs file after it modifies it?

Kevin

-- 
Kevin A. Burton ( burton@apache.org, burton@openprivacy.org, burton@peerfear.org )
             Location - San Francisco, CA, Cell - 415.595.9965
           AIM - sfburtonator,  Web - http://www.peerfear.org/
        GPG fingerprint: 4D20 40A0 C734 307E C7B4  DCAA 0303 3AC5 BD9D 7C4D
         IRC - openprojects.net #infoanarchy | #p2p-hackers | #reptile

Who wants to be responsible?  Every time something goes wrong they say 'who's
responsible for this?'
  -- Jerry Seinfeld

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

* Re: Close .emacs file after customization?
  2003-01-15 23:29 ` Richard Stallman
@ 2003-01-15  4:08   ` Kevin A. Burton (burtonator)
  2003-01-18  0:48     ` Richard Stallman
  0 siblings, 1 reply; 15+ messages in thread
From: Kevin A. Burton (burtonator) @ 2003-01-15  4:08 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman <rms@gnu.org> writes:

>     Can we just fix customization to close the .emacs file after it modifies it?
> 
> It would be reasonable to delete the buffer afterwards if the buffer
> was newly created for the purpose.  Would you like to implement it?

Now that I have signed papers I might take care of this...

Kevin

-- 
Kevin A. Burton ( burton@apache.org, burton@openprivacy.org, burton@peerfear.org )
             Location - San Francisco, CA, Cell - 415.595.9965
           AIM - sfburtonator,  Web - http://www.peerfear.org/
        GPG fingerprint: 4D20 40A0 C734 307E C7B4  DCAA 0303 3AC5 BD9D 7C4D
         IRC - openprojects.net #infoanarchy | #p2p-hackers | #reptile

This email has been secured with rot26 encryption; any attempt at circumvention
is illegal within the US under the DMCA and will be prosecuted to the fullest
extent of the law.

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

* Re: Close .emacs file after customization?
  2003-01-15 16:57 ` Kevin Rodgers
@ 2003-01-15  6:16   ` Kevin A. Burton (burtonator)
  0 siblings, 0 replies; 15+ messages in thread
From: Kevin A. Burton (burtonator) @ 2003-01-15  6:16 UTC (permalink / raw)
  Cc: emacs-devel

Kevin Rodgers <kevin.rodgers@ihs.com> writes:

> Kevin A. Burton (burtonator) wrote:
> 
> > This isn't a theoretical problem.  I am trying to run multiple .emacs versions
> > and I want to maintain the same customization options across Emacs instances.
> > If I open the .emacs file in one instance, customize it, then do the same in
> > another instance, they both have an open copy of the buffer and there are race
> > conditions as to which emacs version should be modifying the file.
> 
> Shouldn't the locking mechanism at least ask you what to do before editing or
> saving the buffer?
<snip/>

It does in some situations but it isn't as persistent as I would like.

It is also just VERY annoying.

Kevin

-- 
Kevin A. Burton ( burton@apache.org, burton@openprivacy.org, burton@peerfear.org )
             Location - San Francisco, CA, Cell - 415.595.9965
           AIM - sfburtonator,  Web - http://www.peerfear.org/
        GPG fingerprint: 4D20 40A0 C734 307E C7B4  DCAA 0303 3AC5 BD9D 7C4D
         IRC - openprojects.net #infoanarchy | #p2p-hackers | #reptile

Heil Bush!

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

* Re: Close .emacs file after customization?
  2003-01-14  9:31 Close .emacs file after customization? Kevin A. Burton (burtonator)
@ 2003-01-15 16:57 ` Kevin Rodgers
  2003-01-15  6:16   ` Kevin A. Burton (burtonator)
  2003-01-15 23:29 ` Richard Stallman
  2003-02-15 14:10 ` Per Abrahamsen
  2 siblings, 1 reply; 15+ messages in thread
From: Kevin Rodgers @ 2003-01-15 16:57 UTC (permalink / raw)


Kevin A. Burton (burtonator) wrote:

> This isn't a theoretical problem.  I am trying to run multiple .emacs versions
> and I want to maintain the same customization options across Emacs instances.
> 
> If I open the .emacs file in one instance, customize it, then do the same in
> another instance, they both have an open copy of the buffer and there are race
> conditions as to which emacs version should be modifying the file.

Shouldn't the locking mechanism at least ask you what to do before editing or
saving the buffer?

-- 
<a href="mailto:&lt;kevin.rodgers&#64;ihs.com&gt;">Kevin Rodgers</a>

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

* Re: Close .emacs file after customization?
  2003-01-14  9:31 Close .emacs file after customization? Kevin A. Burton (burtonator)
  2003-01-15 16:57 ` Kevin Rodgers
@ 2003-01-15 23:29 ` Richard Stallman
  2003-01-15  4:08   ` Kevin A. Burton (burtonator)
  2003-02-15 14:10 ` Per Abrahamsen
  2 siblings, 1 reply; 15+ messages in thread
From: Richard Stallman @ 2003-01-15 23:29 UTC (permalink / raw)
  Cc: emacs-devel

    Can we just fix customization to close the .emacs file after it modifies it?

It would be reasonable to delete the buffer afterwards if the buffer
was newly created for the purpose.  Would you like to implement it?

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

* Re: Close .emacs file after customization?
  2003-01-15  4:08   ` Kevin A. Burton (burtonator)
@ 2003-01-18  0:48     ` Richard Stallman
  0 siblings, 0 replies; 15+ messages in thread
From: Richard Stallman @ 2003-01-18  0:48 UTC (permalink / raw)
  Cc: emacs-devel

    > It would be reasonable to delete the buffer afterwards if the buffer
    > was newly created for the purpose.  Would you like to implement it?

    Now that I have signed papers I might take care of this...

Please do.

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

* Re: Close .emacs file after customization?
  2003-01-14  9:31 Close .emacs file after customization? Kevin A. Burton (burtonator)
  2003-01-15 16:57 ` Kevin Rodgers
  2003-01-15 23:29 ` Richard Stallman
@ 2003-02-15 14:10 ` Per Abrahamsen
  2003-02-15 14:24   ` Robert J. Chassell
  2003-02-17  7:19   ` Richard Stallman
  2 siblings, 2 replies; 15+ messages in thread
From: Per Abrahamsen @ 2003-02-15 14:10 UTC (permalink / raw)


burton@openprivacy.org (Kevin A. Burton (burtonator)) writes:

> If I open the .emacs file in one instance, customize it, then do the
> same in another instance, they both have an open copy of the buffer
> and there are race conditions as to which emacs version should be
> modifying the file.
>
> Can we just fix customization to close the .emacs file after it modifies it?

It is possible, but it will not solve the problem.

When saving customizations, customize does not actually read the
customizations in the .emacs. Instead, it deletes *all* of them, and
then saves all those customizations it knows about.  If the user has
added or changed customizations meanwhile from another Emacs instance,
those customizations will be lost.

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

* Re: Close .emacs file after customization?
  2003-02-15 14:10 ` Per Abrahamsen
@ 2003-02-15 14:24   ` Robert J. Chassell
  2003-02-17  7:19   ` Richard Stallman
  1 sibling, 0 replies; 15+ messages in thread
From: Robert J. Chassell @ 2003-02-15 14:24 UTC (permalink / raw)
  Cc: emacs-devel

Per Abrahamsen <abraham@dina.kvl.dk> wrote:

   When saving customizations, customize does not actually read the
   customizations in the .emacs. Instead, it deletes *all* of them,
   and then saves all those customizations it knows about.  If the
   user has added or changed customizations meanwhile from another
   Emacs instance, those customizations will be lost.

Thank you!  This explains some occasional problems I have run into
that I previously attributed to carelessness.

I normally run several instances of GNU Emacs and do not expect this
behavior.  I expect the same behavior as with other conflicting
modifications, a message like this:

    foo changed on disk; really edit the buffer? (y, n, r or C-h) 

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

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

* RE: Close .emacs file after customization?
@ 2003-02-16  6:15 Zaretskii Eli
  0 siblings, 0 replies; 15+ messages in thread
From: Zaretskii Eli @ 2003-02-16  6:15 UTC (permalink / raw)
  Cc: emacs-devel


This message was scanned for viruses and other malicious code by PrivaWall.


This mail was sent from ELTA SYS LTD.


> From: Per Abrahamsen [mailto:abraham@dina.kvl.dk] 
> Sent: Saturday, February 15, 2003 4:10 PM
> 
> When saving customizations, customize does not actually read the
> customizations in the .emacs. Instead, it deletes *all* of them, and
> then saves all those customizations it knows about.  If the user has
> added or changed customizations meanwhile from another Emacs instance,
> those customizations will be lost.

IMHO, this is worth mentioning in the user's manual.

P.S.  Sorry for the possibly messed-up messages you will see from me in
the
near future, as well as for a nasty mailer.  Our sysadmins here changed
the
email setup, and it will take some time for me to recover.  In the
meantime,
I have an alternative of not responding at all, which I decided to
reject.


This message is processed by the PrivaWall Email Security Server. 

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

* Re: Close .emacs file after customization?
  2003-02-15 14:10 ` Per Abrahamsen
  2003-02-15 14:24   ` Robert J. Chassell
@ 2003-02-17  7:19   ` Richard Stallman
  2003-02-26 15:21     ` Per Abrahamsen
  1 sibling, 1 reply; 15+ messages in thread
From: Richard Stallman @ 2003-02-17  7:19 UTC (permalink / raw)
  Cc: emacs-devel

    > If I open the .emacs file in one instance, customize it, then do the
    > same in another instance, they both have an open copy of the buffer
    > and there are race conditions as to which emacs version should be
    > modifying the file.
    >
    > Can we just fix customization to close the .emacs file after it modifies it?

    It is possible, but it will not solve the problem.

Emacs interlocking should detect automatically when you lose with one
Emacs edits that were made with another Emacs.  If custom visits the
file in the normal way and does not do anything to disable or override
this mechanism, it will operate.

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

* Re: Close .emacs file after customization?
  2003-02-17  7:19   ` Richard Stallman
@ 2003-02-26 15:21     ` Per Abrahamsen
  2003-02-27 22:30       ` Richard Stallman
  0 siblings, 1 reply; 15+ messages in thread
From: Per Abrahamsen @ 2003-02-26 15:21 UTC (permalink / raw)


Richard Stallman <rms@gnu.org> writes:

>     > If I open the .emacs file in one instance, customize it, then do the
>     > same in another instance, they both have an open copy of the buffer
>     > and there are race conditions as to which emacs version should be
>     > modifying the file.
>     >
>     > Can we just fix customization to close the .emacs file after it modifies it?
>
>     It is possible, but it will not solve the problem.
>
> Emacs interlocking should detect automatically when you lose with one
> Emacs edits that were made with another Emacs.  If custom visits the
> file in the normal way and does not do anything to disable or override
> this mechanism, it will operate.

It will operate, but changes to all but the last Emacs instance to
save the customizations will be lost.

You will get a warning if customize *does not* kill the .emacs buffer
after saving customization, which is currently the case, but that is
precisely what the original poster wanted to change.

Also, you will not get a warning if the user manually kills the .emacs
buffer.

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

* Re: Close .emacs file after customization?
  2003-02-26 15:21     ` Per Abrahamsen
@ 2003-02-27 22:30       ` Richard Stallman
  2003-02-27 23:18         ` David Masterson
  2003-02-28  7:48         ` Per Abrahamsen
  0 siblings, 2 replies; 15+ messages in thread
From: Richard Stallman @ 2003-02-27 22:30 UTC (permalink / raw)
  Cc: emacs-devel

    You will get a warning if customize *does not* kill the .emacs buffer
    after saving customization, which is currently the case, but that is
    precisely what the original poster wanted to change.

If Emacs already has a buffer visiting .emacs, and that file has
changed on disk, visiting it again will ask whether to reread the
file.  The only advantage of killing the buffer is that you won't have
to answer that question.  Is that a major advantage?

We could make Custom kill the buffer if it didn't exist before
Custom created it.

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

* Re: Close .emacs file after customization?
  2003-02-27 22:30       ` Richard Stallman
@ 2003-02-27 23:18         ` David Masterson
  2003-03-01  2:26           ` Richard Stallman
  2003-02-28  7:48         ` Per Abrahamsen
  1 sibling, 1 reply; 15+ messages in thread
From: David Masterson @ 2003-02-27 23:18 UTC (permalink / raw)


>>>>> Richard Stallman writes:

>     You will get a warning if customize *does not* kill the .emacs buffer
>     after saving customization, which is currently the case, but that is
>     precisely what the original poster wanted to change.

> If Emacs already has a buffer visiting .emacs, and that file has
> changed on disk, visiting it again will ask whether to reread the
> file.  The only advantage of killing the buffer is that you won't
> have to answer that question.  Is that a major advantage?

The other advantage is that it no longer is in memory, but that may
not be major.  I think the real question, though, should be is there a
major advantage to *not* killing the buffer.  This becomes more
important when you remember that it's not about killing the .emacs
buffer, but rather the custom-file buffer.

> We could make Custom kill the buffer if it didn't exist before
> Custom created it.

That's probably preferable to prevent confusion.

-- 
David Masterson                David DOT Masterson AT synopsys DOT com
Sr. R&D Engineer               Synopsys, Inc.
Software Engineering           Sunnyvale, CA

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

* Re: Close .emacs file after customization?
  2003-02-27 22:30       ` Richard Stallman
  2003-02-27 23:18         ` David Masterson
@ 2003-02-28  7:48         ` Per Abrahamsen
  1 sibling, 0 replies; 15+ messages in thread
From: Per Abrahamsen @ 2003-02-28  7:48 UTC (permalink / raw)


Richard Stallman <rms@gnu.org> writes:

>     You will get a warning if customize *does not* kill the .emacs buffer
>     after saving customization, which is currently the case, but that is
>     precisely what the original poster wanted to change.
>
> If Emacs already has a buffer visiting .emacs, and that file has
> changed on disk, visiting it again will ask whether to reread the
> file.  The only advantage of killing the buffer is that you won't have
> to answer that question.  Is that a major advantage?

Is it an advantage at all?  

Emacs will warn in a situation where there is a very real danger that
it will overwrite some customization saved from another Emacs
instance, i.e. the user will lose some work.  

I'd expect we want a warning in that case.

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

* Re: Close .emacs file after customization?
  2003-02-27 23:18         ` David Masterson
@ 2003-03-01  2:26           ` Richard Stallman
  0 siblings, 0 replies; 15+ messages in thread
From: Richard Stallman @ 2003-03-01  2:26 UTC (permalink / raw)
  Cc: emacs-devel

    > We could make Custom kill the buffer if it didn't exist before
    > Custom created it.

    That's probably preferable to prevent confusion.

Would someone like to implement this?

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

end of thread, other threads:[~2003-03-01  2:26 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-14  9:31 Close .emacs file after customization? Kevin A. Burton (burtonator)
2003-01-15 16:57 ` Kevin Rodgers
2003-01-15  6:16   ` Kevin A. Burton (burtonator)
2003-01-15 23:29 ` Richard Stallman
2003-01-15  4:08   ` Kevin A. Burton (burtonator)
2003-01-18  0:48     ` Richard Stallman
2003-02-15 14:10 ` Per Abrahamsen
2003-02-15 14:24   ` Robert J. Chassell
2003-02-17  7:19   ` Richard Stallman
2003-02-26 15:21     ` Per Abrahamsen
2003-02-27 22:30       ` Richard Stallman
2003-02-27 23:18         ` David Masterson
2003-03-01  2:26           ` Richard Stallman
2003-02-28  7:48         ` Per Abrahamsen
  -- strict thread matches above, loose matches on Subject: below --
2003-02-16  6:15 Zaretskii Eli

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).