unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* using new versions of emacs without stoping a session
@ 2019-04-17 13:31 Jean-Christophe Helary
  2019-04-17 14:01 ` Stefan Monnier
  0 siblings, 1 reply; 8+ messages in thread
From: Jean-Christophe Helary @ 2019-04-17 13:31 UTC (permalink / raw)
  To: Help Gnu Emacs mailing list

Is it possible to keep emacs running and update its code ?

For lisp code I guess that's not an issue, but for the c code ?

Jean-Christophe Helary
-----------------------------------------------
http://mac4translators.blogspot.com @brandelune





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

* Re: using new versions of emacs without stoping a session
  2019-04-17 13:31 using new versions of emacs without stoping a session Jean-Christophe Helary
@ 2019-04-17 14:01 ` Stefan Monnier
  2019-04-17 14:35   ` Jean-Christophe Helary
  2019-04-17 16:13   ` Eli Zaretskii
  0 siblings, 2 replies; 8+ messages in thread
From: Stefan Monnier @ 2019-04-17 14:01 UTC (permalink / raw)
  To: help-gnu-emacs

> Is it possible to keep emacs running and update its code ?
> For lisp code I guess that's not an issue, but for the c code ?

You can definitely edit Emacs's C code while it's running as well as
compile this new code.  I do that all the time.
But in order for Emacs to start using this new code, you're going to
have to start a new process (but you don't have to stop the old
process for that).

That's one of the main reasons why we generally prefer when the
code is written in Elisp rather than in C,


        Stefan




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

* Re: using new versions of emacs without stoping a session
  2019-04-17 14:01 ` Stefan Monnier
@ 2019-04-17 14:35   ` Jean-Christophe Helary
  2019-04-17 16:13   ` Eli Zaretskii
  1 sibling, 0 replies; 8+ messages in thread
From: Jean-Christophe Helary @ 2019-04-17 14:35 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: help-gnu-emacs

Thank you Stephan.

Jean-Christophe 

> On Apr 17, 2019, at 23:01, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
> 
>> Is it possible to keep emacs running and update its code ?
>> For lisp code I guess that's not an issue, but for the c code ?
> 
> You can definitely edit Emacs's C code while it's running as well as
> compile this new code.  I do that all the time.
> But in order for Emacs to start using this new code, you're going to
> have to start a new process (but you don't have to stop the old
> process for that).
> 
> That's one of the main reasons why we generally prefer when the
> code is written in Elisp rather than in C,
> 
> 
>        Stefan
> 
> 

Jean-Christophe Helary
-----------------------------------------------
http://mac4translators.blogspot.com @brandelune




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

* Re: using new versions of emacs without stoping a session
  2019-04-17 14:01 ` Stefan Monnier
  2019-04-17 14:35   ` Jean-Christophe Helary
@ 2019-04-17 16:13   ` Eli Zaretskii
  2019-04-18  2:47     ` YUE Daian
  2019-04-18 12:46     ` Yuri Khan
  1 sibling, 2 replies; 8+ messages in thread
From: Eli Zaretskii @ 2019-04-17 16:13 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Date: Wed, 17 Apr 2019 10:01:16 -0400
> 
> You can definitely edit Emacs's C code while it's running as well as
> compile this new code.

With one caveat: Windows won't let you overwrite a running executable,
so the link step of compiling Emacs will fail on Windows until you
shut down your running session.



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

* Re: using new versions of emacs without stoping a session
  2019-04-17 16:13   ` Eli Zaretskii
@ 2019-04-18  2:47     ` YUE Daian
  2019-04-18 12:42       ` Eli Zaretskii
  2019-04-18 12:46     ` Yuri Khan
  1 sibling, 1 reply; 8+ messages in thread
From: YUE Daian @ 2019-04-18  2:47 UTC (permalink / raw)
  To: help-gnu-emacs

On 2019-04-17 19:13, Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Stefan Monnier <monnier@iro.umontreal.ca>
>> Date: Wed, 17 Apr 2019 10:01:16 -0400
>> 
>> You can definitely edit Emacs's C code while it's running as well as
>> compile this new code.
>
> With one caveat: Windows won't let you overwrite a running executable,
> so the link step of compiling Emacs will fail on Windows until you
> shut down your running session.

Just out of curiosity: Why does Windows do so?

I mean, compilation process should have no effect on running processes.

What its point?



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

* Re: using new versions of emacs without stoping a session
  2019-04-18  2:47     ` YUE Daian
@ 2019-04-18 12:42       ` Eli Zaretskii
  2019-04-18 13:56         ` Stefan Monnier
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2019-04-18 12:42 UTC (permalink / raw)
  To: help-gnu-emacs

> From: YUE Daian <sheepduke@gmail.com>
> Date: Thu, 18 Apr 2019 10:47:01 +0800
> 
> > With one caveat: Windows won't let you overwrite a running executable,
> > so the link step of compiling Emacs will fail on Windows until you
> > shut down your running session.
> 
> Just out of curiosity: Why does Windows do so?
> 
> I mean, compilation process should have no effect on running processes.

Most (all?) modern systems use the executable files as backing store,
loading code and data from them lazily, as needed.  So they all cannot
allow the data of the executable file to be removed or replaced by
something different.  So your "should have no effect" assertion is
inaccurate.

The difference between the systems is on the filesystem level: by
default Windows doesn't allow to unlink file's data from its directory
entry, if some application has that file open, while most Unix
filesystems by default do allow that.  I don't know why Windows'
default is what it is.  Some say that such a default leads to a safer
system: at any given moment all the programs that run use the same
version of a certain library and the same executable code.  But I'm
not convinced that this is the real reason.



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

* Re: using new versions of emacs without stoping a session
  2019-04-17 16:13   ` Eli Zaretskii
  2019-04-18  2:47     ` YUE Daian
@ 2019-04-18 12:46     ` Yuri Khan
  1 sibling, 0 replies; 8+ messages in thread
From: Yuri Khan @ 2019-04-18 12:46 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

On Wed, Apr 17, 2019 at 11:13 PM Eli Zaretskii <eliz@gnu.org> wrote:

> With one caveat: Windows won't let you overwrite a running executable,
> so the link step of compiling Emacs will fail on Windows until you
> shut down your running session.

However, Windows happily lets you *rename* a running executable (or
loaded shared library) out of the way, then put a new executable under
the old name.



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

* Re: using new versions of emacs without stoping a session
  2019-04-18 12:42       ` Eli Zaretskii
@ 2019-04-18 13:56         ` Stefan Monnier
  0 siblings, 0 replies; 8+ messages in thread
From: Stefan Monnier @ 2019-04-18 13:56 UTC (permalink / raw)
  To: help-gnu-emacs

> The difference between the systems is on the filesystem level: by
> default Windows doesn't allow to unlink file's data from its directory
> entry, if some application has that file open, while most Unix
> filesystems by default do allow that.  I don't know why Windows'
> default is what it is.

My guess would be that it's linked to the FAT file-system where there is
no notion of "inode": the data usually contained in the inode (size,
access rights, location of the data blocks, ...) is contained directly
in the directory entry.  IOW typical "unix" filesystems have an
additional indirection, where a directory entry only contains a name and
a pointer to an inode (which describes the file), whereas in FAT you
don't have that indirection, which makes it impossible for the file to
exist at several places at the same time (hardlinks) or for a file to
exist without being stored in a directory somewhere.

But maybe there's also something about the tradition from which the OS
grew.  In Unix the tradition is to say that it's the applications's
responsability to synchronize between themselves (e.g. locking or
somesuch) when accessing the same file (i.e. the OS doesn't make any
effort to try and prevent them from stomping on each other), whereas
I get the impression that Windows was designed with a more
"restrictive/secure" mindset in this respect.


        Stefan




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

end of thread, other threads:[~2019-04-18 13:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-17 13:31 using new versions of emacs without stoping a session Jean-Christophe Helary
2019-04-17 14:01 ` Stefan Monnier
2019-04-17 14:35   ` Jean-Christophe Helary
2019-04-17 16:13   ` Eli Zaretskii
2019-04-18  2:47     ` YUE Daian
2019-04-18 12:42       ` Eli Zaretskii
2019-04-18 13:56         ` Stefan Monnier
2019-04-18 12:46     ` Yuri Khan

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