unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Fast emacs?
@ 2009-05-17 21:05 kj
  2009-05-17 21:39 ` Anselm Helbig
                   ` (4 more replies)
  0 siblings, 5 replies; 26+ messages in thread
From: kj @ 2009-05-17 21:05 UTC (permalink / raw)
  To: help-gnu-emacs




For ***years*** I've been looking for a solution to this problem,
and I'm truly amazed that I have yet to find it: how to get a
fast-starting version of emacs.  The problem is that I have a big
.emacs file and a big Emacs desktop, which means that my Emacs takes
forever to start.  This is fine most of the time, but occasionally
I want a fast-starting emacs session (e.g. when I run "sudo emacs"
to edit a superuser-owned config file), and it's infuriating to
wait for emacs to go through a lengthy and useless song-and-dance...

I just can't believe there is no way around this.  (Other than, of
course, using vi.)

Note that using the emacsclient is no solution, because this requires
that a version of Emacs be already running, which often defeats
the purpose (not only do I have to wait another eternity for this
new Emacs session to start, but then I have to start the server in
the new session).

Any words of wisdom would be much appreciated!

TIA!

Kynn
-- 
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.


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

* Re: Fast emacs?
  2009-05-17 21:05 Fast emacs? kj
@ 2009-05-17 21:39 ` Anselm Helbig
  2009-05-18  1:13   ` Giorgos Keramidas
  2009-05-18 11:03   ` Bernardo
  2009-05-17 22:12 ` Michael Ekstrand
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 26+ messages in thread
From: Anselm Helbig @ 2009-05-17 21:39 UTC (permalink / raw)
  To: help-gnu-emacs

Hi!

> For ***years*** I've been looking for a solution to this problem,
> and I'm truly amazed that I have yet to find it: how to get a
> fast-starting version of emacs.  The problem is that I have a big
> .emacs file and a big Emacs desktop, which means that my Emacs takes
> forever to start.  This is fine most of the time, but occasionally
> I want a fast-starting emacs session (e.g. when I run "sudo emacs"
> to edit a superuser-owned config file), and it's infuriating to
> wait for emacs to go through a lengthy and useless song-and-dance...
> 
> I just can't believe there is no way around this.  (Other than, of
> course, using vi.)
> 
> Note that using the emacsclient is no solution, because this requires
> that a version of Emacs be already running, which often defeats
> the purpose (not only do I have to wait another eternity for this
> new Emacs session to start, but then I have to start the server in
> the new session).
> 
> Any words of wisdom would be much appreciated!

Emacs has tons of functionality baked in right from the start, yet its
startup time is reasonably fast if you don't have customizations. So,
learning from core emacs means learning how to start up fast. There
are lots of possible improvements you can make:

- don't use `require', use autoloads:
  http://www.emacswiki.org/emacs/AutoLoad
  Magic comments can help, see (info "(elisp) Autoload")
  Use `update-autoloads-from-directories' to automatically generate
  the autoloads for you.

- for stuff that can only be configured once a library is loaded, use
  `eval-after-load'. 

- make a new emacs image with all your favourite libraries already
  loaded: http://www.emacswiki.org/emacs/DumpingEmacs

- start emacs as part of system startup with the --daemon switch:
  http://www.emacswiki.org/emacs/EmacsAsDaemon

- byte-compile the libraries you use; consider byte-compiling your
  .emacs if it is huge

- remove extensions you don't use

- measure the progress you make: use the lisp function benchmark-run,
  or `time' on the command line. Try adding (kill-emacs) at the end
  of your .emacs file to get meaningful results for this.

My init file has 1677 lines, emacs starts in 2.3 seconds (hot
cache). Hmmm... this could be improved. 8-)

Happy tuning!

Anselm


-- 
Anselm Helbig 
mailto:anselm.helbig+news2009@googlemail.com


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

* Re: Fast emacs?
  2009-05-17 21:05 Fast emacs? kj
  2009-05-17 21:39 ` Anselm Helbig
@ 2009-05-17 22:12 ` Michael Ekstrand
  2009-05-18  0:16 ` Jason Rumney
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 26+ messages in thread
From: Michael Ekstrand @ 2009-05-17 22:12 UTC (permalink / raw)
  To: help-gnu-emacs

kj <socyl@987jk.com.invalid> writes:
> For ***years*** I've been looking for a solution to this problem,
> and I'm truly amazed that I have yet to find it: how to get a
> fast-starting version of emacs.  The problem is that I have a big
> .emacs file and a big Emacs desktop, which means that my Emacs takes
> forever to start.  This is fine most of the time, but occasionally
> I want a fast-starting emacs session (e.g. when I run "sudo emacs"
> to edit a superuser-owned config file), and it's infuriating to
> wait for emacs to go through a lengthy and useless song-and-dance...
>
> I just can't believe there is no way around this.  (Other than, of
> course, using vi.)

I frequently use Zile in that context.  Bare-bones editor with Emacs
keybindings.  Great for the odd config file edit from a terminal.

- Michael

-- 
mouse, n: A device for pointing at the xterm in which you want to type.


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

* Re: Fast emacs?
  2009-05-17 21:05 Fast emacs? kj
  2009-05-17 21:39 ` Anselm Helbig
  2009-05-17 22:12 ` Michael Ekstrand
@ 2009-05-18  0:16 ` Jason Rumney
  2009-05-18  2:51   ` kj
  2009-05-21 10:04 ` Christian Herenz
  2009-08-02 15:28 ` David Kastrup
  4 siblings, 1 reply; 26+ messages in thread
From: Jason Rumney @ 2009-05-18  0:16 UTC (permalink / raw)
  To: help-gnu-emacs

On May 18, 5:05 am, kj <so...@987jk.com.invalid> wrote:
>  The problem is that I have a big
> .emacs file and a big Emacs desktop, which means that my Emacs takes
> forever to start.  This is fine most of the time, but occasionally
> I want a fast-starting emacs session (e.g. when I run "sudo emacs"
> to edit a superuser-owned config file), and it's infuriating to
> wait for emacs to go through a lengthy and useless song-and-dance...

emacs -Q


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

* Re: Fast emacs?
  2009-05-17 21:39 ` Anselm Helbig
@ 2009-05-18  1:13   ` Giorgos Keramidas
  2009-05-18 11:03   ` Bernardo
  1 sibling, 0 replies; 26+ messages in thread
From: Giorgos Keramidas @ 2009-05-18  1:13 UTC (permalink / raw)
  To: help-gnu-emacs

On Sun, 17 May 2009 23:39:30 +0200, Anselm Helbig <anselm.helbig+news2009@googlemail.com> wrote:
>> Note that using the emacsclient is no solution, because this requires
>> that a version of Emacs be already running, which often defeats
>> the purpose (not only do I have to wait another eternity for this
>> new Emacs session to start, but then I have to start the server in
>> the new session).
>>
>> Any words of wisdom would be much appreciated!

> - don't use `require', use autoloads:
>   http://www.emacswiki.org/emacs/AutoLoad

> - for stuff that can only be configured once a library is loaded, use
>   `eval-after-load'.

> - make a new emacs image with all your favourite libraries already
>   loaded: http://www.emacswiki.org/emacs/DumpingEmacs

> - start emacs as part of system startup with the --daemon switch:
>   http://www.emacswiki.org/emacs/EmacsAsDaemon

> - byte-compile the libraries you use; consider byte-compiling your
>   .emacs if it is huge

> - remove extensions you don't use

> - measure the progress you make: use the lisp function benchmark-run,
>   or `time' on the command line. Try adding (kill-emacs) at the end
>   of your .emacs file to get meaningful results for this.

All good points :)

I use all of (1) autoloading, (2) --daemon mode for most of my quick
editing sessions, (3) I keep trimming my configuration from stuff I have
not used for months, and (4) fire up 1-2 different instances besides the
background daemon process: one for Gnus-only stuff, and maybe another
one for IRC windows.

Another neat thing to do is install a light-weight clone like `mg' and
use that for very basic editing.  I even went so far as to import mg in
my own copy of the FreeBSD src/ tree and attach it to the normal build
process, so my laptop's custom FreeBSD version now includes:

    $ which mg
    /usr/bin/mg

This way even when my full Emacs installation is not available (i.e. in
single user mode) I can use a lean and fast editor with very familiar
key bindings.

There are packages for `mg' and other mini clones of Emacs in the
package collection of most UNIX-like systems today, so installing one of
them is another thing that may be useful to consider.



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

* Re: Fast emacs?
  2009-05-18  0:16 ` Jason Rumney
@ 2009-05-18  2:51   ` kj
  2009-05-18  3:38     ` B. T. Raven
  2009-05-18 18:05     ` Drew Adams
  0 siblings, 2 replies; 26+ messages in thread
From: kj @ 2009-05-18  2:51 UTC (permalink / raw)
  To: help-gnu-emacs

In <7a909198-c1e9-4ac1-aa69-94ba302deadc@u9g2000pre.googlegroups.com> Jason Rumney <jasonrumney@gmail.com> writes:

>On May 18, 5:05=A0am, kj <so...@987jk.com.invalid> wrote:
>> =A0The problem is that I have a big
>> .emacs file and a big Emacs desktop, which means that my Emacs takes
>> forever to start. =A0This is fine most of the time, but occasionally
>> I want a fast-starting emacs session (e.g. when I run "sudo emacs"
>> to edit a superuser-owned config file), and it's infuriating to
>> wait for emacs to go through a lengthy and useless song-and-dance...

>emacs -Q

I've gotten some very useful ideas in this thread (thanks Anselm,
Michael, and Giorgios), but this one actually blew me away.  In
all my years using emacs (decades really) I never knew of this
command-line switch.  In fact, after rummaging through the man page
and the emacs docs, I was not able to find it.  But it works like
gangbusters.  Thanks!

kynn
-- 
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.


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

* Re: Fast emacs?
  2009-05-18  2:51   ` kj
@ 2009-05-18  3:38     ` B. T. Raven
  2009-05-18 18:05     ` Drew Adams
  1 sibling, 0 replies; 26+ messages in thread
From: B. T. Raven @ 2009-05-18  3:38 UTC (permalink / raw)
  To: help-gnu-emacs

kj wrote:
> In <7a909198-c1e9-4ac1-aa69-94ba302deadc@u9g2000pre.googlegroups.com> Jason Rumney <jasonrumney@gmail.com> writes:
> 
>> On May 18, 5:05=A0am, kj <so...@987jk.com.invalid> wrote:
>>> =A0The problem is that I have a big
>>> .emacs file and a big Emacs desktop, which means that my Emacs takes
>>> forever to start. =A0This is fine most of the time, but occasionally
>>> I want a fast-starting emacs session (e.g. when I run "sudo emacs"
>>> to edit a superuser-owned config file), and it's infuriating to
>>> wait for emacs to go through a lengthy and useless song-and-dance...
> 
>> emacs -Q
> 
> I've gotten some very useful ideas in this thread (thanks Anselm,
> Michael, and Giorgios), but this one actually blew me away.  In
> all my years using emacs (decades really) I never knew of this
> command-line switch.  In fact, after rummaging through the man page
> and the emacs docs, I was not able to find it.  But it works like
> gangbusters.  Thanks!
> 
> kynn

Just like the spaghetti sauce "it's in theya":

C-h r m intial options


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

* Re: Fast emacs?
@ 2009-05-18  5:43 Dirk-Jan C. Binnema
  0 siblings, 0 replies; 26+ messages in thread
From: Dirk-Jan C. Binnema @ 2009-05-18  5:43 UTC (permalink / raw)
  To: help-gnu-emacs


> > Note that using the emacsclient is no solution, because this requires
> > that a version of Emacs be already running, which often defeats
> > the purpose (not only do I have to wait another eternity for this
> > new Emacs session to start, but then I have to start the server in
> > the new session).

Well, maybe you'd need to take another look at emacs --daemon ;-) I have
run it when my (X) *session* starts (no need for tricks to put it in
system startup scripts). Emacs starts within a cpl of seconds (1000 line
.emacs). 

Then for the rest of the day I use emacsclient -c; lightning fast.

With emacs --daemon all the trimming, autoloading etc becomes much less
important.
 
Best wishes,
Dirk.

-- 
Dirk-Jan C. Binnema                  Helsinki, Finland
e:djcb@djcbsoftware.nl           w:www.djcbsoftware.nl
pgp: D09C E664 897D 7D39 5047 A178 E96A C7A1 017D DA3C




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

* Re: Fast emacs?
       [not found] <mailman.7364.1242625447.31690.help-gnu-emacs@gnu.org>
@ 2009-05-18  8:15 ` Tim X
  2009-05-20 10:04 ` Jean Magnan de Bornier
  1 sibling, 0 replies; 26+ messages in thread
From: Tim X @ 2009-05-18  8:15 UTC (permalink / raw)
  To: help-gnu-emacs

"Dirk-Jan C. Binnema" <djcb.bulk@gmail.com> writes:

>> > Note that using the emacsclient is no solution, because this requires
>> > that a version of Emacs be already running, which often defeats
>> > the purpose (not only do I have to wait another eternity for this
>> > new Emacs session to start, but then I have to start the server in
>> > the new session).
>
> Well, maybe you'd need to take another look at emacs --daemon ;-) I have
> run it when my (X) *session* starts (no need for tricks to put it in
> system startup scripts). Emacs starts within a cpl of seconds (1000 line
> .emacs). 
>
> Then for the rest of the day I use emacsclient -c; lightning fast.
>
> With emacs --daemon all the trimming, autoloading etc becomes much less
> important.
>  
> Best wishes,
> Dirk.

Emacs daemon mode is great, but only available with emacs 23. 

However, another point I wanted to mention. There is no need to do sudo
emacs to edit a file as root. You can do this from within your normal
running emacs using tramp.  'su' will work too.

Tim


-- 
tcross (at) rapttech dot com dot au


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

* Re: Fast emacs?
  2009-05-17 21:39 ` Anselm Helbig
  2009-05-18  1:13   ` Giorgos Keramidas
@ 2009-05-18 11:03   ` Bernardo
  2009-05-18 11:29     ` ken
  1 sibling, 1 reply; 26+ messages in thread
From: Bernardo @ 2009-05-18 11:03 UTC (permalink / raw)
  To: emacs help

> Hi!
> 
>> For ***years*** I've been looking for a solution to this problem,
>> and I'm truly amazed that I have yet to find it: how to get a
>> fast-starting version of emacs.  The problem is that I have a big
>> .emacs file and a big Emacs desktop, which means that my Emacs takes
>> forever to start.  This is fine most of the time, but occasionally
>> I want a fast-starting emacs session (e.g. when I run "sudo emacs"
>> to edit a superuser-owned config file), and it's infuriating to
>> wait for emacs to go through a lengthy and useless song-and-dance...
>>
>> I just can't believe there is no way around this.  (Other than, of
>> course, using vi.)
>>
>> Note that using the emacsclient is no solution, because this requires
>> that a version of Emacs be already running, which often defeats
>> the purpose (not only do I have to wait another eternity for this
>> new Emacs session to start, but then I have to start the server in
>> the new session).
>>
>> Any words of wisdom would be much appreciated!

this one is pretty good cure for a fat desktop file

,----[ C-h v desktop-restore-eager ]
| desktop-restore-eager is a variable defined in `desktop.el'.
| Its value is 5
|
| Documentation:
| Number of buffers to restore immediately.
| Remaining buffers are restored lazily (when Emacs is idle).
| If value is t, all buffers are restored immediately.
|
| You can customize this variable.
|
| This variable was introduced, or its default value was changed, in
| version 22.1 of Emacs.
`----





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

* Re: Fast emacs?
  2009-05-18 11:03   ` Bernardo
@ 2009-05-18 11:29     ` ken
  0 siblings, 0 replies; 26+ messages in thread
From: ken @ 2009-05-18 11:29 UTC (permalink / raw)
  To: emacs help


>>> For ***years*** I've been looking for a solution to this problem,
>>> and I'm truly amazed that I have yet to find it: how to get a
>>> fast-starting version of emacs.  The problem is that I have a big
>>> .emacs file and a big Emacs desktop, which means that my Emacs takes
>>> forever to start.  This is fine most of the time, but occasionally
>>> I want a fast-starting emacs session (e.g. when I run "sudo emacs"
>>> to edit a superuser-owned config file), and it's infuriating to
>>> wait for emacs to go through a lengthy and useless song-and-dance...
>>>
>>> ....

It should speed things up quite a bit to byte compile a major part of
your ~/.emacs as another file which is then loaded on start-up.






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

* RE: Fast emacs?
  2009-05-18  2:51   ` kj
  2009-05-18  3:38     ` B. T. Raven
@ 2009-05-18 18:05     ` Drew Adams
  1 sibling, 0 replies; 26+ messages in thread
From: Drew Adams @ 2009-05-18 18:05 UTC (permalink / raw)
  To: 'kj', help-gnu-emacs

> >emacs -Q
> 
> In all my years using emacs (decades really) I never knew of this
> command-line switch.  In fact, after rummaging through the man page
> and the emacs docs, I was not able to find it.

In releases of Emacs prior to 22, you can use `emacs -q --no-site-file'. It does
the same thing as does `emacs -Q' in Emacs 22 and later.





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

* Re: Fast emacs?
       [not found] <mailman.7364.1242625447.31690.help-gnu-emacs@gnu.org>
  2009-05-18  8:15 ` Tim X
@ 2009-05-20 10:04 ` Jean Magnan de Bornier
  2009-05-20 13:24   ` Jean Magnan de Bornier
  1 sibling, 1 reply; 26+ messages in thread
From: Jean Magnan de Bornier @ 2009-05-20 10:04 UTC (permalink / raw)
  To: help-gnu-emacs

"Dirk-Jan C. Binnema" <djcb.bulk@gmail.com> wrote :

| > > Note that using the emacsclient is no solution, because this requires
| > > that a version of Emacs be already running, which often defeats
| > > the purpose (not only do I have to wait another eternity for this
| > > new Emacs session to start, but then I have to start the server in
| > > the new session).
>
| Well, maybe you'd need to take another look at emacs --daemon ;-) I have
| run it when my (X) *session* starts (no need for tricks to put it in
| system startup scripts). Emacs starts within a cpl of seconds (1000 line
| .emacs). 
>
| Then for the rest of the day I use emacsclient -c; lightning fast.
>
| With emacs --daemon all the trimming, autoloading etc becomes much less
| important.
  
Hi all,

emacs --daemon is really great!

However I wonder what's the best place to write the command; I'm running a
linux box with xorg started by "startx".
A first try was to write "emacs --daemon" in ~/.xsession, but then if I
leave my x session and enter another one, it aks a new emacs start and
that causes trouble.
I have then written "emacs --daemon" in my ~/.zshenv, and it starts all
right, but then opening a zsh shell also make it attempt to start the
daemon again!

I probably miss something very straightforward!

Thanks for any help,
-- 
Jean


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

* Re: Fast emacs?
  2009-05-20 10:04 ` Jean Magnan de Bornier
@ 2009-05-20 13:24   ` Jean Magnan de Bornier
  2009-05-20 16:54     ` thierry.volpiatto
                       ` (2 more replies)
  0 siblings, 3 replies; 26+ messages in thread
From: Jean Magnan de Bornier @ 2009-05-20 13:24 UTC (permalink / raw)
  To: help-gnu-emacs

Jean Magnan de Bornier <jean@bornier.net> wrote :

| However I wonder what's the best place to write the command; I'm running a
| linux box with xorg started by "startx".
| A first try was to write "emacs --daemon" in ~/.xsession, but then if I
| leave my x session and enter another one, it aks a new emacs start and
| that causes trouble.
| I have then written "emacs --daemon" in my ~/.zshenv, and it starts all
| right, but then opening a zsh shell also make it attempt to start the
| daemon again!

Well I ended writing a zsh script (lauched in .xsession) to check if an
emacs server is running, and lauching the server only if there isn't any.
bye,
-- 
Jean


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

* Re: Fast emacs?
  2009-05-20 13:24   ` Jean Magnan de Bornier
@ 2009-05-20 16:54     ` thierry.volpiatto
       [not found]     ` <mailman.7547.1242838889.31690.help-gnu-emacs@gnu.org>
  2009-05-21 10:13     ` Hugo Heden
  2 siblings, 0 replies; 26+ messages in thread
From: thierry.volpiatto @ 2009-05-20 16:54 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

Jean Magnan de Bornier <jean@bornier.net> writes:

> Jean Magnan de Bornier <jean@bornier.net> wrote :
>
> | However I wonder what's the best place to write the command; I'm running a
> | linux box with xorg started by "startx".
> | A first try was to write "emacs --daemon" in ~/.xsession, but then if I
> | leave my x session and enter another one, it aks a new emacs start and
> | that causes trouble.
> | I have then written "emacs --daemon" in my ~/.zshenv, and it starts all
> | right, but then opening a zsh shell also make it attempt to start the
> | daemon again!
>
> Well I ended writing a zsh script (lauched in .xsession) to check if an
> emacs server is running, and lauching the server only if there isn't any.
> bye,
If you use gentoo,
you will find a gentoo package called emacs-daemon.
It start emacs --daemon as a service.
Even if you don't use gentoo, it should be easy to make it working in
another linux. 
-- 
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France





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

* Re: Fast emacs?
       [not found]     ` <mailman.7547.1242838889.31690.help-gnu-emacs@gnu.org>
@ 2009-05-21  6:20       ` Jean Magnan de Bornier
  2009-05-21  9:49         ` Pascal J. Bourguignon
  2009-05-21 15:08         ` thierry.volpiatto
  0 siblings, 2 replies; 26+ messages in thread
From: Jean Magnan de Bornier @ 2009-05-21  6:20 UTC (permalink / raw)
  To: help-gnu-emacs

thierry.volpiatto@gmail.com wrote :

| If you use gentoo,
| you will find a gentoo package called emacs-daemon.
| It start emacs --daemon as a service.
| Even if you don't use gentoo, it should be easy to make it working in
| another linux. 

No, I am not (anymore) a gentoo user.
When using a system-wide emacs daemon, I imagine that all user
customizations are only loaded with emacsclient, while if started as a
user emacs daemon loads the config. 
So I still wonder what is the best way (I'm the only user).

Cheers,
-- 
Jean (near Aix-en-Provence :-) )


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

* Re: Fast emacs?
  2009-05-21  6:20       ` Jean Magnan de Bornier
@ 2009-05-21  9:49         ` Pascal J. Bourguignon
  2009-05-21 15:08         ` thierry.volpiatto
  1 sibling, 0 replies; 26+ messages in thread
From: Pascal J. Bourguignon @ 2009-05-21  9:49 UTC (permalink / raw)
  To: help-gnu-emacs

Jean Magnan de Bornier <jean@bornier.net> writes:

> thierry.volpiatto@gmail.com wrote :
>
> | If you use gentoo,
> | you will find a gentoo package called emacs-daemon.
> | It start emacs --daemon as a service.
> | Even if you don't use gentoo, it should be easy to make it working in
> | another linux. 
>
> No, I am not (anymore) a gentoo user.
> When using a system-wide emacs daemon, I imagine that all user
> customizations are only loaded with emacsclient, while if started as a
> user emacs daemon loads the config. 


> So I still wonder what is the best way (I'm the only user).

I just launch emacs interactively once, and then on use emacsclient
(or just open from one of the emacs frames).


Of notable interest, when I change of workstation but still want to go
on working in the same emacs session, is:

    laptop$        xhost +maincomputer
    laptop$        ssh -X myself@maincomputer
    maincomputer$  emacsclient --eval "(make-frame-on-display \"$DISPLAY\")"

which will open a frame on the X server in laptop from the emacs
running on maincomputer.  


Since I don't log-out every day, I get usually emacs uptimes as long
as the computer uptimes (ie _months_).  It wouldn't matter if my
.emacs  needed five minutes to load...

-- 
__Pascal Bourguignon__


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

* Re: Fast emacs?
  2009-05-17 21:05 Fast emacs? kj
                   ` (2 preceding siblings ...)
  2009-05-18  0:16 ` Jason Rumney
@ 2009-05-21 10:04 ` Christian Herenz
  2009-08-02 15:28 ` David Kastrup
  4 siblings, 0 replies; 26+ messages in thread
From: Christian Herenz @ 2009-05-21 10:04 UTC (permalink / raw)
  To: help-gnu-emacs

kj schrieb:
>(e.g. when I run "sudo emacs"
> to edit a superuser-owned config file)

hm... this can be done with tramp mode, right?

greets,
Christian


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

* Re: Fast emacs?
  2009-05-20 13:24   ` Jean Magnan de Bornier
  2009-05-20 16:54     ` thierry.volpiatto
       [not found]     ` <mailman.7547.1242838889.31690.help-gnu-emacs@gnu.org>
@ 2009-05-21 10:13     ` Hugo Heden
  2009-05-21 10:29       ` Lennart Borgman
  2 siblings, 1 reply; 26+ messages in thread
From: Hugo Heden @ 2009-05-21 10:13 UTC (permalink / raw)
  To: Jean Magnan de Bornier; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 772 bytes --]

On Wed, May 20, 2009 at 3:24 PM, Jean Magnan de Bornier <jean@bornier.net>wrote:

> Jean Magnan de Bornier <jean@bornier.net> wrote :
>

 [snip]


>
> Well I ended writing a zsh script (lauched in .xsession) to check if an
> emacs server is running, and lauching the server only if there isn't any.
> bye,
> --


I do something similar (but using bash). I have a script that is *not*
intended to be launched in some init-file. Instead, the user invokes the
script when he wants to use emacs. The script starts the emacs-daemon if not
already started, and then invokes the client.

I am not completely sure it covers all your requirements, but it works very
well for me.

See
http://hugoheden.wordpress.com/2009/03/21/invoking-emacs-daemon-and-client-easily/



>
> Jean
>

[-- Attachment #2: Type: text/html, Size: 1614 bytes --]

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

* Re: Fast emacs?
  2009-05-21 10:13     ` Hugo Heden
@ 2009-05-21 10:29       ` Lennart Borgman
  0 siblings, 0 replies; 26+ messages in thread
From: Lennart Borgman @ 2009-05-21 10:29 UTC (permalink / raw)
  To: Hugo Heden; +Cc: help-gnu-emacs, Jean Magnan de Bornier

On Thu, May 21, 2009 at 12:13 PM, Hugo Heden <hugoheden@gmail.com> wrote:
> On Wed, May 20, 2009 at 3:24 PM, Jean Magnan de Bornier <jean@bornier.net>
> wrote:
>>
>> Jean Magnan de Bornier <jean@bornier.net> wrote :
>
>  [snip]
>
>>
>> Well I ended writing a zsh script (lauched in .xsession) to check if an
>> emacs server is running, and lauching the server only if there isn't any.
>> bye,
>> --
>
> I do something similar (but using bash). I have a script that is *not*
> intended to be launched in some init-file. Instead, the user invokes the
> script when he wants to use emacs. The script starts the emacs-daemon if not
> already started, and then invokes the client.

For that purpose you may also instead patch emacsclient. I have done
that in EmacsW32. Those patches are written to work on all platforms
(but I have no idea if they do at the moment).




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

* Re: Fast emacs?
  2009-05-21  6:20       ` Jean Magnan de Bornier
  2009-05-21  9:49         ` Pascal J. Bourguignon
@ 2009-05-21 15:08         ` thierry.volpiatto
  1 sibling, 0 replies; 26+ messages in thread
From: thierry.volpiatto @ 2009-05-21 15:08 UTC (permalink / raw)
  To: help-gnu-emacs

Jean Magnan de Bornier <jean@bornier.net> writes:

> thierry.volpiatto@gmail.com wrote :
>
> | If you use gentoo,
> | you will find a gentoo package called emacs-daemon.
> | It start emacs --daemon as a service.
> | Even if you don't use gentoo, it should be easy to make it working in
> | another linux. 
>
> No, I am not (anymore) a gentoo user.
> When using a system-wide emacs daemon, I imagine that all user
> customizations are only loaded with emacsclient, while if started as a
> user emacs daemon loads the config. 
No you use a symlink for each user and each user will have his own init
file (.emacs) loaded.
The daemon in /etc/init.d is called emacs but the one i start is a
symlink of emacs called emacs.thierry that use the .emacs of user
thierry.

> So I still wonder what is the best way (I'm the only user).
>
> Cheers,

-- 
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France





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

* Re: Fast emacs?
  2009-05-17 21:05 Fast emacs? kj
                   ` (3 preceding siblings ...)
  2009-05-21 10:04 ` Christian Herenz
@ 2009-08-02 15:28 ` David Kastrup
  2009-08-02 20:34   ` Richard Riley
  2009-10-13  8:50   ` Cecil Westerhof
  4 siblings, 2 replies; 26+ messages in thread
From: David Kastrup @ 2009-08-02 15:28 UTC (permalink / raw)
  To: help-gnu-emacs

kj <socyl@987jk.com.invalid> writes:

> For ***years*** I've been looking for a solution to this problem,
> and I'm truly amazed that I have yet to find it: how to get a
> fast-starting version of emacs.  The problem is that I have a big
> .emacs file and a big Emacs desktop, which means that my Emacs takes
> forever to start.  This is fine most of the time, but occasionally
> I want a fast-starting emacs session (e.g. when I run "sudo emacs"
> to edit a superuser-owned config file),

C-x C-f /sudo::/etc/fstab RET

-- 
David Kastrup


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

* Re: Fast emacs?
  2009-08-02 15:28 ` David Kastrup
@ 2009-08-02 20:34   ` Richard Riley
  2009-10-13  8:50   ` Cecil Westerhof
  1 sibling, 0 replies; 26+ messages in thread
From: Richard Riley @ 2009-08-02 20:34 UTC (permalink / raw)
  To: help-gnu-emacs

David Kastrup <dak@gnu.org> writes:

> kj <socyl@987jk.com.invalid> writes:
>
>> For ***years*** I've been looking for a solution to this problem,
>> and I'm truly amazed that I have yet to find it: how to get a
>> fast-starting version of emacs.  The problem is that I have a big
>> .emacs file and a big Emacs desktop, which means that my Emacs takes
>> forever to start.  This is fine most of the time, but occasionally
>> I want a fast-starting emacs session (e.g. when I run "sudo emacs"
>> to edit a superuser-owned config file),
>
> C-x C-f /sudo::/etc/fstab RET

I use this which is great. Open the file in normal mode, and then C-x
C-r to switch to root privs.

,----
| (defun find-alternative-file-with-sudo ()
|   "Open current buffer as root!"
|   (interactive)
|   (when buffer-file-name
|     (find-alternate-file
|      (concat "/sudo:root@localhost:"
| 	     buffer-file-name))))
| 
| (global-set-key (kbd "C-x C-r") 'find-alternative-file-with-sudo)
`----


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

* Re: Fast emacs?
  2009-08-02 15:28 ` David Kastrup
  2009-08-02 20:34   ` Richard Riley
@ 2009-10-13  8:50   ` Cecil Westerhof
  2009-10-13 13:17     ` Teemu Likonen
  1 sibling, 1 reply; 26+ messages in thread
From: Cecil Westerhof @ 2009-10-13  8:50 UTC (permalink / raw)
  To: help-gnu-emacs

David Kastrup <dak@gnu.org> writes:
>> For ***years*** I've been looking for a solution to this problem,
>> and I'm truly amazed that I have yet to find it: how to get a
>> fast-starting version of emacs.  The problem is that I have a big
>> .emacs file and a big Emacs desktop, which means that my Emacs takes
>> forever to start.  This is fine most of the time, but occasionally
>> I want a fast-starting emacs session (e.g. when I run "sudo emacs"
>> to edit a superuser-owned config file),
>
> C-x C-f /sudo::/etc/fstab RET

Nice one. Only the first time I use it, it take some time. When I do it
a second time, it is quit fast.


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

* Re: Fast emacs?
  2009-10-13  8:50   ` Cecil Westerhof
@ 2009-10-13 13:17     ` Teemu Likonen
  2009-10-16 10:28       ` Cecil Westerhof
  0 siblings, 1 reply; 26+ messages in thread
From: Teemu Likonen @ 2009-10-13 13:17 UTC (permalink / raw)
  To: help-gnu-emacs

On 2009-10-13 10:50 (+0200), Cecil Westerhof wrote:

> David Kastrup <dak@gnu.org> writes:
>> C-x C-f /sudo::/etc/fstab RET
>
> Nice one. Only the first time I use it, it take some time. When I do
> it a second time, it is quit fast.

With Emacs 22 it's slow first time. Fortunately with Emacs 23 /sudo: and
/su: are always fast.


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

* Re: Fast emacs?
  2009-10-13 13:17     ` Teemu Likonen
@ 2009-10-16 10:28       ` Cecil Westerhof
  0 siblings, 0 replies; 26+ messages in thread
From: Cecil Westerhof @ 2009-10-16 10:28 UTC (permalink / raw)
  To: help-gnu-emacs

Teemu Likonen <tlikonen@iki.fi> writes:
>>> C-x C-f /sudo::/etc/fstab RET
>>
>> Nice one. Only the first time I use it, it take some time. When I do
>> it a second time, it is quit fast.
>
> With Emacs 22 it's slow first time. Fortunately with Emacs 23 /sudo: and
> /su: are always fast.

That explains it. The system I tried it on was still running 22.3.1. I
tried it on another system with 23 and there was no delay.


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

end of thread, other threads:[~2009-10-16 10:28 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-17 21:05 Fast emacs? kj
2009-05-17 21:39 ` Anselm Helbig
2009-05-18  1:13   ` Giorgos Keramidas
2009-05-18 11:03   ` Bernardo
2009-05-18 11:29     ` ken
2009-05-17 22:12 ` Michael Ekstrand
2009-05-18  0:16 ` Jason Rumney
2009-05-18  2:51   ` kj
2009-05-18  3:38     ` B. T. Raven
2009-05-18 18:05     ` Drew Adams
2009-05-21 10:04 ` Christian Herenz
2009-08-02 15:28 ` David Kastrup
2009-08-02 20:34   ` Richard Riley
2009-10-13  8:50   ` Cecil Westerhof
2009-10-13 13:17     ` Teemu Likonen
2009-10-16 10:28       ` Cecil Westerhof
  -- strict thread matches above, loose matches on Subject: below --
2009-05-18  5:43 Dirk-Jan C. Binnema
     [not found] <mailman.7364.1242625447.31690.help-gnu-emacs@gnu.org>
2009-05-18  8:15 ` Tim X
2009-05-20 10:04 ` Jean Magnan de Bornier
2009-05-20 13:24   ` Jean Magnan de Bornier
2009-05-20 16:54     ` thierry.volpiatto
     [not found]     ` <mailman.7547.1242838889.31690.help-gnu-emacs@gnu.org>
2009-05-21  6:20       ` Jean Magnan de Bornier
2009-05-21  9:49         ` Pascal J. Bourguignon
2009-05-21 15:08         ` thierry.volpiatto
2009-05-21 10:13     ` Hugo Heden
2009-05-21 10:29       ` Lennart Borgman

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