all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Oliver Kappel <ngreply@gmx.net>
To: help-gnu-emacs@gnu.org
Subject: Re: emacsclient command line use existing client
Date: Mon, 15 Sep 2014 14:28:42 +0200	[thread overview]
Message-ID: <m14mw9dq4l.fsf@edvings.de> (raw)
In-Reply-To: 87iokpuo0j.fsf@gmail.com

In email.so try to set the absolute path for emacsclient.

/usr/local/bin/emacsclient  or whatever fits your environment. We
don't even know on what OS you are. `emacs-client` is unknown to me
and script extension .so is uncommon too.

I'm still not convinced your script is starting the right emacsclient,
as your shell/shortcut does.

Tory S. Anderson wrote:

> Yeah, the problem is starting a new server every time. But all these
> commands just run `emacs-client`. I've even ditched the auto-start
> one and just execute a later emacs-client. I've added server names
> and specifications to each command. I now have:  
>
> in .emacs:
> ----------
> (require 'server)
> (setq server-name "my-emacs-server")
> (unless (server-running-p)
>     (server-start))
>
>
> in email.so:
> ----------
> mailto=$1
> mailto="mailto:${mailto#mailto:}"
> mailto=$(printf '%s\n' "$mailto" | sed -e 's/[\"]/\\&/g')
> emacs_server="my-emacs-server"
> elisp_expr="(mailto-compose-mail \"$mailto\")"
> emacsclient -a "" -c -n -s "$emacs_server" --eval "$elisp_expr" \
> 	'(set-window-dedicated-p (selected-window) t)'
>
>
> my shortcut for opening emacs (which DOES open under the proper server)
> ---------
> emacsclient -c -s "my-emacs-server"
>
>
> And still clicking a @mailto: link (running email.so) starts a new, unattached server. 
>
>
>
> Oliver Kappel <ngreply@gmx.net> writes:
>
>> Hello,
>>
>> my guess: emacsclient inside your script runs another installed
>> instance of emacs as you started emacs server with. With option -a ""
>> this instance will start another emacs in deamon mode. Probably the
>> $PATH while runing the mailto-script is different.
>>
>> Check your OS "autostart `emacs-client` command" - as you mentioned -
>> and make sure your script uses the emacsclient from the same ./bin
>> directory. 
>>
>>   Greetings, Oliver
>>
>> 12.09.2014 at 14:16 Tory S. Anderson wrote:
>>
>>> Thanks for prompting me to be more precise. When my OS starts I launch
>>> a server with the autostart `emacs-client` command, and have the line
>>> in my .emacs to ensure the server is started. As it should, opening
>>> any number of new frames (or launching emacs-client again) will share
>>> the same buffer list, etc. However, this shell script for launching an
>>> email (apparently) starts a new server; it isn't sharing anything with
>>> the other frames, and if I don't `kill-emacs` I end up with two
>>> servers running. Clearly, not acceptable.
>>>
>>> Michael Heerdegen <michael_heerdegen@web.de> writes:
>>>
>>>> torys.anderson@gmail.com (Tory S. Anderson) writes:
>>>>
>>>>> elisp_expr="(mailto-compose-mail \"$mailto\")"
>>>>>
>>>>> emacsclient -a "" -c -n --eval "$elisp_expr" \
>>>>> 	'(set-window-dedicated-p (selected-window) t)'
>>>>>
>>>>> But somehow when I run this it starts a new emacsclient rather than
>>>>> using the one I have running. If I remove the `-a ""` then nothing
>>>>> happens at all. Why won't it connect to my existing emacsclient?
>>>>
>>>> What exactly do you mean with "existing emacsclient"?  You must have a
>>>> running server.  A running Emacs is not enough.
>>>>
>>>> Michael.




  parent reply	other threads:[~2014-09-15 12:28 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-11 12:58 emacsclient command line use existing client Tory S. Anderson
2014-09-12  2:42 ` Michael Heerdegen
2014-09-12  7:43   ` Thorsten Jolitz
2014-09-12 12:16   ` Tory S. Anderson
2014-09-12 13:42     ` Oliver Kappel
2014-09-15 11:22       ` Tory S. Anderson
2014-09-15 12:04         ` Michael Heerdegen
2014-09-15 12:28         ` Oliver Kappel [this message]
2014-09-19 17:12           ` Tory S. Anderson
2014-09-19 17:38             ` Subhan Michael Tindall
2014-09-19 17:44               ` Tory S. Anderson
2014-09-20  2:14             ` Charles Philip Chan
2014-09-20 10:42               ` Tory S. Anderson
2014-09-20 11:35                 ` Charles Philip Chan
2014-09-20 13:04                   ` Tory S. Anderson
2014-09-21  1:32                     ` Charles Philip Chan
2014-09-21  1:32                     ` Charles Philip Chan
2014-09-22 18:53                       ` Tory S. Anderson
2014-09-12 16:28     ` Subhan Michael Tindall
2014-09-13 17:29     ` Harry Putnam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m14mw9dq4l.fsf@edvings.de \
    --to=ngreply@gmx.net \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.