emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Emacs server and org-protocol
@ 2014-09-17  7:26 Gonzalo Camarillo
  2014-09-17  7:36 ` Paul Rudin
  2014-09-17  7:46 ` Fabrice Popineau
  0 siblings, 2 replies; 17+ messages in thread
From: Gonzalo Camarillo @ 2014-09-17  7:26 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

I am using org-protocol to have my firefox browser talk to my emacs (to
capture stuff).

I am using Windows 7. So, I cannot use the --daemon flag to simply start
a sever (it is not supported under Windows). Instead, I have added a
(server-start) line to my .emacs file (init.el).

When I run emacs for the first time, everything works correctly (i.e.,
the server starts and I can connect to it from firefox). However, when I
open a second instance of emacs, it processes again the .emacs file and,
thus, I get the following error:

> Warning (server): Unable to start the Emacs server.
> There is an existing Emacs server, named "server".
> To start the server in this Emacs process, stop the existing
> server or call `M-x server-force-delete' to forcibly disconnect it.

Does anybody know a workaround so that the server is only started
once?... maybe in connection to opening a particular .org file?

Thanks,

Gonzalo

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

* Re: Emacs server and org-protocol
  2014-09-17  7:26 Emacs server and org-protocol Gonzalo Camarillo
@ 2014-09-17  7:36 ` Paul Rudin
  2014-09-17  8:17   ` Gonzalo Camarillo
  2014-09-17  7:46 ` Fabrice Popineau
  1 sibling, 1 reply; 17+ messages in thread
From: Paul Rudin @ 2014-09-17  7:36 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Gonzalo Camarillo <gcamaril-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:


> Does anybody know a workaround so that the server is only started
> once?... 

Does the function server-running-p work on windows? If so then you can
replace (server-start) with (unless (server-running-p) (server-start)).

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

* Re: Emacs server and org-protocol
  2014-09-17  7:26 Emacs server and org-protocol Gonzalo Camarillo
  2014-09-17  7:36 ` Paul Rudin
@ 2014-09-17  7:46 ` Fabrice Popineau
  2014-09-17  7:56   ` Paul Rudin
  2014-09-17  8:03   ` Thorsten Jolitz
  1 sibling, 2 replies; 17+ messages in thread
From: Fabrice Popineau @ 2014-09-17  7:46 UTC (permalink / raw)
  To: Gonzalo Camarillo; +Cc: emacs-orgmode@gnu.org

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

What is the purpose of opening a second instance of emacs ?
I precisely tend to avoid it.

If the emacs server is running, why not using emacsclient(w) instead of a
new instance ?

Fabrice

2014-09-17 9:26 GMT+02:00 Gonzalo Camarillo <gcamaril@gmail.com>:

> Hi,
>
> I am using org-protocol to have my firefox browser talk to my emacs (to
> capture stuff).
>
> I am using Windows 7. So, I cannot use the --daemon flag to simply start
> a sever (it is not supported under Windows). Instead, I have added a
> (server-start) line to my .emacs file (init.el).
>
> When I run emacs for the first time, everything works correctly (i.e.,
> the server starts and I can connect to it from firefox). However, when I
> open a second instance of emacs, it processes again the .emacs file and,
> thus, I get the following error:
>
> > Warning (server): Unable to start the Emacs server.
> > There is an existing Emacs server, named "server".
> > To start the server in this Emacs process, stop the existing
> > server or call `M-x server-force-delete' to forcibly disconnect it.
>
> Does anybody know a workaround so that the server is only started
> once?... maybe in connection to opening a particular .org file?
>
> Thanks,
>
> Gonzalo
>
>
>


-- 
Fabrice Popineau
-----------------------------
SUPELEC
Département Informatique
3, rue Joliot Curie
91192 Gif/Yvette Cedex
Tel direct : +33 (0) 169851950
Standard : +33 (0) 169851212
------------------------------

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

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

* Re: Emacs server and org-protocol
  2014-09-17  7:46 ` Fabrice Popineau
@ 2014-09-17  7:56   ` Paul Rudin
  2014-09-17  8:43     ` Fabrice Popineau
  2014-09-17  8:03   ` Thorsten Jolitz
  1 sibling, 1 reply; 17+ messages in thread
From: Paul Rudin @ 2014-09-17  7:56 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Fabrice Popineau <fabrice.popineau-vbcOdlJ0SulGWvitb5QawA@public.gmane.org> writes:

> What is the purpose of opening a second instance of emacs ? 
> I precisely tend to avoid it.

There are situations where it can be useful - e.g. using emacs as
a news or mail client where the whole process can block for a few
seconds.

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

* Re: Emacs server and org-protocol
  2014-09-17  7:46 ` Fabrice Popineau
  2014-09-17  7:56   ` Paul Rudin
@ 2014-09-17  8:03   ` Thorsten Jolitz
  1 sibling, 0 replies; 17+ messages in thread
From: Thorsten Jolitz @ 2014-09-17  8:03 UTC (permalink / raw)
  To: emacs-orgmode

Fabrice Popineau <fabrice.popineau@supelec.fr> writes:

> What is the purpose of opening a second instance of emacs ? 
> I precisely tend to avoid it.
>
> If the emacs server is running, why not using emacsclient(w) instead
> of a new instance ?

I had that setup for quite some time - starting one Emacs server on the
console, and then several emacsclients as parts of tmux and stumpwm
window configurations. 

But it crashed too often - and it was just too painful to recover all
the emacsclients in all the window-configurations. 

So nowadays I have one (non-server) Emacs instance for doing the real
work, and another server instance which I use for the convenience of
getting emacsclients everywhere for some quick adhoc stuff, without
caring much when it crashes.

-- 
cheers,
Thorsten

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

* Re: Emacs server and org-protocol
  2014-09-17  7:36 ` Paul Rudin
@ 2014-09-17  8:17   ` Gonzalo Camarillo
  0 siblings, 0 replies; 17+ messages in thread
From: Gonzalo Camarillo @ 2014-09-17  8:17 UTC (permalink / raw)
  To: Paul Rudin; +Cc: emacs-orgmode

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

Hi Paul,

yes, adding (require 'server) makes the function available. That is exactly
what I was looking for. Thanks for the quick response!

Cheers,

Gonzalo


On Wed, Sep 17, 2014 at 9:36 AM, Paul Rudin <paul@rudin.co.uk> wrote:

> Gonzalo Camarillo <gcamaril@gmail.com> writes:
>
>
> > Does anybody know a workaround so that the server is only started
> > once?...
>
> Does the function server-running-p work on windows? If so then you can
> replace (server-start) with (unless (server-running-p) (server-start)).
>
>
>
>

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

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

* Re: Emacs server and org-protocol
  2014-09-17  7:56   ` Paul Rudin
@ 2014-09-17  8:43     ` Fabrice Popineau
  2014-09-17  8:54       ` Alexis
  0 siblings, 1 reply; 17+ messages in thread
From: Fabrice Popineau @ 2014-09-17  8:43 UTC (permalink / raw)
  To: Paul Rudin; +Cc: emacs-orgmode@gnu.org

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

2014-09-17 9:56 GMT+02:00 Paul Rudin <paul@rudin.co.uk>:

> Fabrice Popineau <fabrice.popineau@supelec.fr> writes:
>
> > What is the purpose of opening a second instance of emacs ?
> > I precisely tend to avoid it.
>
> There are situations where it can be useful - e.g. using emacs as
> a news or mail client where the whole process can block for a few
> seconds.
>
>
Yes seconds or even much more.
This is the reason I don't use Emacs to read my mail/news anymore :-/

-- 
Fabrice

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

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

* Re: Emacs server and org-protocol
  2014-09-17  8:43     ` Fabrice Popineau
@ 2014-09-17  8:54       ` Alexis
  2014-09-17  9:06         ` Eric S Fraga
  2014-09-17 19:57         ` Brett Viren
  0 siblings, 2 replies; 17+ messages in thread
From: Alexis @ 2014-09-17  8:54 UTC (permalink / raw)
  To: emacs-orgmode


Fabrice Popineau writes:

> Yes seconds or even much more.
> This is the reason I don't use Emacs to read my mail/news anymore :-/

If i may ask, which email front-end were you using? (Gnus, perhaps?) i
used to use notmuch.el, and currently use mu4e, and basically don't have
this issue ....


Alexis.

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

* Re: Emacs server and org-protocol
  2014-09-17  8:54       ` Alexis
@ 2014-09-17  9:06         ` Eric S Fraga
  2014-09-17  9:13           ` Alexis
  2014-09-17  9:41           ` Fabrice Popineau
  2014-09-17 19:57         ` Brett Viren
  1 sibling, 2 replies; 17+ messages in thread
From: Eric S Fraga @ 2014-09-17  9:06 UTC (permalink / raw)
  To: Alexis; +Cc: emacs-orgmode

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

On Wednesday, 17 Sep 2014 at 18:54, Alexis wrote:

[...]

> If i may ask, which email front-end were you using? (Gnus, perhaps?) i
> used to use notmuch.el, and currently use mu4e, and basically don't have
> this issue ....

The issue is not the email front-end per se but the email servers (IMAP,
POP, whatever).  A couple of years ago, I ended up having to use an
email server that would take many seconds, often minutes, to access,
even just to query to find out if there was any new email.

The easiest solution, for me, was to get into the habit of starting two
emacs instances.  The first for all my work (org, writing, coding, etc.)
and a second just for email.  The first starts the emacs server so
emacsclient always goes to the non-email instance.  I've been doing this
for two years now and it has become second nature for me.

Obviously, the real fix is to have proper multi-threading in Emacs and,
as in nuclear fusion, this will be with us *soon* ;-)

-- 
: Eric S Fraga, GnuPG: 0xFFFCF67D
: in Emacs 24.4.50.1 + Ma Gnus v0.12 + evil-git-0469bee
: BBDB version 3.1.2 (2014-05-06 11:45:08 -0500)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 180 bytes --]

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

* Re: Emacs server and org-protocol
  2014-09-17  9:06         ` Eric S Fraga
@ 2014-09-17  9:13           ` Alexis
  2014-09-17  9:41           ` Fabrice Popineau
  1 sibling, 0 replies; 17+ messages in thread
From: Alexis @ 2014-09-17  9:13 UTC (permalink / raw)
  To: emacs-orgmode


Eric S Fraga writes:

> The issue is not the email front-end per se but the email servers (IMAP,
> POP, whatever).  A couple of years ago, I ended up having to use an
> email server that would take many seconds, often minutes, to access,
> even just to query to find out if there was any new email.

Well, i run getmail+procmail to fetch and sort my mail, so if a server
is running slowly, that doesn't affect Emacs. Emacs is only affected by
e.g. mu indexing newly-arrived emails, which is fast enough that i don't
notice it.


Alexis.

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

* Re: Emacs server and org-protocol
  2014-09-17  9:06         ` Eric S Fraga
  2014-09-17  9:13           ` Alexis
@ 2014-09-17  9:41           ` Fabrice Popineau
  2014-09-17 10:57             ` Eric S Fraga
  2014-09-17 13:50             ` Stefan Huchler
  1 sibling, 2 replies; 17+ messages in thread
From: Fabrice Popineau @ 2014-09-17  9:41 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org, e.fraga

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

2014-09-17 11:06 GMT+02:00 Eric S Fraga <e.fraga@ucl.ac.uk>:

> On Wednesday, 17 Sep 2014 at 18:54, Alexis wrote:
>
> [...]
>
> > If i may ask, which email front-end were you using? (Gnus, perhaps?) i
> > used to use notmuch.el, and currently use mu4e, and basically don't have
> > this issue ....
>
> The issue is not the email front-end per se but the email servers (IMAP,
> POP, whatever).  A couple of years ago, I ended up having to use an
> email server that would take many seconds, often minutes, to access,
> even just to query to find out if there was any new email.
>
> The easiest solution, for me, was to get into the habit of starting two
> emacs instances.  The first for all my work (org, writing, coding, etc.)
> and a second just for email.  The first starts the emacs server so
> emacsclient always goes to the non-email instance.  I've been doing this
> for two years now and it has become second nature for me.
>
> Obviously, the real fix is to have proper multi-threading in Emacs and,
> as in nuclear fusion, this will be with us *soon* ;-)
>

I disagree on this. The problem is less servers than the sheer slowness of
elisp.
And Gnus offers so many fancy opportunities to process your mail that it is
easy to
overuse it.

Emacs won't become any more efficient without switching its own elisp
implementation to something with a true compiler (or jit).

Threading would gain some responsiveness, but that may not be so obvious
nor so easy to implement.
http://www.emacswiki.org/emacs/ConcurrentEmacs
http://www.emacswiki.org/emacs/NoThreading

Fabrice

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

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

* Re: Emacs server and org-protocol
  2014-09-17  9:41           ` Fabrice Popineau
@ 2014-09-17 10:57             ` Eric S Fraga
  2014-09-17 13:50             ` Stefan Huchler
  1 sibling, 0 replies; 17+ messages in thread
From: Eric S Fraga @ 2014-09-17 10:57 UTC (permalink / raw)
  To: Fabrice Popineau; +Cc: emacs-orgmode@gnu.org

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

On Wednesday, 17 Sep 2014 at 11:41, Fabrice Popineau wrote:

[...]

> I disagree on this. The problem is less servers than the sheer slowness of
> elisp.

Sure, elisp is not fast but I it seems to be perfectly fast enough for
me for gnus, even on my little OpenPandora.  In my case, the limiting
factor is the email server and not elisp.  YMMV, of course!

-- 
: Eric S Fraga, GnuPG: 0xFFFCF67D
: in Emacs 24.4.50.1 + Ma Gnus v0.12 + evil-git-0469bee
: BBDB version 3.1.2 (2014-05-06 11:45:08 -0500)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 180 bytes --]

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

* Re: Emacs server and org-protocol
  2014-09-17  9:41           ` Fabrice Popineau
  2014-09-17 10:57             ` Eric S Fraga
@ 2014-09-17 13:50             ` Stefan Huchler
  2014-09-17 14:03               ` Rainer M Krug
  1 sibling, 1 reply; 17+ messages in thread
From: Stefan Huchler @ 2014-09-17 13:50 UTC (permalink / raw)
  To: emacs-orgmode

I dont really get what the problem is here, email servers checkup is
fast enough, and rss u can use that:

nnrss-use-local to ‘t’ and use ‘nnrss-generate-download-script

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

* Re: Emacs server and org-protocol
  2014-09-17 13:50             ` Stefan Huchler
@ 2014-09-17 14:03               ` Rainer M Krug
  2014-09-17 20:11                 ` Stefan Huchler
  0 siblings, 1 reply; 17+ messages in thread
From: Rainer M Krug @ 2014-09-17 14:03 UTC (permalink / raw)
  To: Stefan Huchler; +Cc: emacs-orgmode

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

Stefan Huchler <stefan.huchler@mail.de> writes:

> I dont really get what the problem is here, email servers checkup is

Not necessarily - depends which mail server (e.g. gmail or local), if
you have one or many folders / tags, your network connection, ...

Often used solution:

mail server (e.g. gmail) <- offlineimap -> local imap server <- gnus ->
the user

So offlineimap runs in the background and the local email server check
is fast enough.

I have two instances running, because of longer calculation in my second
(non-email) emacs instance...

Cheers,

Rainer


> fast enough, and rss u can use that:
>
> nnrss-use-local to ‘t’ and use ‘nnrss-generate-download-script
>
>
>
>

-- 
Rainer M. Krug
email: Rainer<at>krugs<dot>de
PGP: 0x0F52F982

[-- Attachment #2: Type: application/pgp-signature, Size: 494 bytes --]

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

* Re: Emacs server and org-protocol
  2014-09-17  8:54       ` Alexis
  2014-09-17  9:06         ` Eric S Fraga
@ 2014-09-17 19:57         ` Brett Viren
  1 sibling, 0 replies; 17+ messages in thread
From: Brett Viren @ 2014-09-17 19:57 UTC (permalink / raw)
  To: Alexis; +Cc: emacs-orgmode

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

Alexis <flexibeast@gmail.com> writes:

> If i may ask, which email front-end were you using? (Gnus, perhaps?) i
> used to use notmuch.el, and currently use mu4e, and basically don't have
> this issue ....

My GNUS + IMAP subprocess + Maildir used to lead to long wait times when
updating for new mail ("g" in Groups).  Things have now vastly improved
since moving my Maildirs to a SSD.

-Brett.

[-- Attachment #2: Type: application/pgp-signature, Size: 180 bytes --]

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

* Re: Emacs server and org-protocol
  2014-09-17 14:03               ` Rainer M Krug
@ 2014-09-17 20:11                 ` Stefan Huchler
  2014-09-18  1:03                   ` Alexis
  0 siblings, 1 reply; 17+ messages in thread
From: Stefan Huchler @ 2014-09-17 20:11 UTC (permalink / raw)
  To: Rainer M Krug; +Cc: emacs-orgmode

Rainer M Krug <Rainer@krugs.de> writes:

> Stefan Huchler <stefan.huchler@mail.de> writes:
>
>> I dont really get what the problem is here, email servers checkup is
>
> Not necessarily - depends which mail server (e.g. gmail or local), if
> you have one or many folders / tags, your network connection, ...

I just did setup the nnrss-download thing and yes mail still takes a bit
longer. I dont even see the big problem in waithing here 2 seks or so,
dont have to check my mails every 10 mins.

What I have more a problem with is that it often hangs have to cancel it
at least every seond time.

And btw is there a way to update my rss things in emacs every 10 mins
automaticly? because if it automaticly downloads every 10 mins the xml
files it would make sense taht in gnus u see the new entries automaticly
after that.

and yes a local email (offline-email-server) would be the solution for
mail, but I am to lazy to setup and backup all that data :)

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

* Re: Emacs server and org-protocol
  2014-09-17 20:11                 ` Stefan Huchler
@ 2014-09-18  1:03                   ` Alexis
  0 siblings, 0 replies; 17+ messages in thread
From: Alexis @ 2014-09-18  1:03 UTC (permalink / raw)
  To: emacs-orgmode


Stefan Huchler writes:

> What I have more a problem with is that it often hangs have to cancel
> it at least every seond time.

Sounds like something that might need to be reported as a bug?


Alexis.

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

end of thread, other threads:[~2014-09-18  1:05 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-17  7:26 Emacs server and org-protocol Gonzalo Camarillo
2014-09-17  7:36 ` Paul Rudin
2014-09-17  8:17   ` Gonzalo Camarillo
2014-09-17  7:46 ` Fabrice Popineau
2014-09-17  7:56   ` Paul Rudin
2014-09-17  8:43     ` Fabrice Popineau
2014-09-17  8:54       ` Alexis
2014-09-17  9:06         ` Eric S Fraga
2014-09-17  9:13           ` Alexis
2014-09-17  9:41           ` Fabrice Popineau
2014-09-17 10:57             ` Eric S Fraga
2014-09-17 13:50             ` Stefan Huchler
2014-09-17 14:03               ` Rainer M Krug
2014-09-17 20:11                 ` Stefan Huchler
2014-09-18  1:03                   ` Alexis
2014-09-17 19:57         ` Brett Viren
2014-09-17  8:03   ` Thorsten Jolitz

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

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).