all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* sudo emacsclient
@ 2009-10-26 17:03 Harry Putnam
  2009-10-26 17:35 ` Thierry Volpiatto
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Harry Putnam @ 2009-10-26 17:03 UTC (permalink / raw)
  To: help-gnu-emacs

How can I make emacslcient as handy to use as:

  sudo vim /etc/some.conf

Do I have to start a daemon as root?

I'd like to start the daemon from user account but be able to access
it like:
   sudo emacsclient -s name file

But trying that produces this error:
 sudo emacsclient -s name file
emacsclient: can't find socket; have you started the server?
To start the server in Emacs, type "M-x server-start".
emacsclient: error accessing socket "/tmp/emacs0/gen"

ps shows the server running:

 ps wwaux|grep emacs.*\-daemon
 reader  [...] emacs --daemon=name





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

* Re: sudo emacsclient
  2009-10-26 17:03 sudo emacsclient Harry Putnam
@ 2009-10-26 17:35 ` Thierry Volpiatto
  2009-10-26 18:30 ` Richard Riley
       [not found] ` <mailman.9516.1256581844.2239.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 9+ messages in thread
From: Thierry Volpiatto @ 2009-10-26 17:35 UTC (permalink / raw)
  To: help-gnu-emacs

Hi!
Try to use tramp:
In your emacs session, just do:
C-x C-f /sudo::/etc/some.conf

If you start emacs --daemon, just start an emacsclient and do like
above.

Or:

emacsclient -t /sudo::/etc/some.conf

Harry Putnam <reader@newsguy.com> writes:

> How can I make emacslcient as handy to use as:
>
>   sudo vim /etc/some.conf
>
> Do I have to start a daemon as root?
>
> I'd like to start the daemon from user account but be able to access
> it like:
>    sudo emacsclient -s name file
>
> But trying that produces this error:
>  sudo emacsclient -s name file
> emacsclient: can't find socket; have you started the server?
> To start the server in Emacs, type "M-x server-start".
> emacsclient: error accessing socket "/tmp/emacs0/gen"
>
> ps shows the server running:
>
>  ps wwaux|grep emacs.*\-daemon
>  reader  [...] emacs --daemon=name
>
>
>
>

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





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

* Re: sudo emacsclient
  2009-10-26 17:03 sudo emacsclient Harry Putnam
  2009-10-26 17:35 ` Thierry Volpiatto
@ 2009-10-26 18:30 ` Richard Riley
       [not found] ` <mailman.9516.1256581844.2239.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 9+ messages in thread
From: Richard Riley @ 2009-10-26 18:30 UTC (permalink / raw)
  To: help-gnu-emacs

Harry Putnam <reader@newsguy.com> writes:

> How can I make emacslcient as handy to use as:
>
>   sudo vim /etc/some.conf
>
> Do I have to start a daemon as root?
>
> I'd like to start the daemon from user account but be able to access
> it like:
>    sudo emacsclient -s name file
>
> But trying that produces this error:
>  sudo emacsclient -s name file
> emacsclient: can't find socket; have you started the server?
> To start the server in Emacs, type "M-x server-start".
> emacsclient: error accessing socket "/tmp/emacs0/gen"
>
> ps shows the server running:
>
>  ps wwaux|grep emacs.*\-daemon
>  reader  [...] emacs --daemon=name
>

I use this small script to start emacs :-

,----
| #!/bin/bash
| # edit
| export GDK_NATIVE_WINDOWS=1
| emacsclient --alternate-editor="" -c $@
`----

It starts the daemon if not already started. use tramp to access files
as root : see other reply.







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

* Re: sudo emacsclient
       [not found] ` <mailman.9516.1256581844.2239.help-gnu-emacs@gnu.org>
@ 2009-10-26 19:03   ` Teemu Likonen
  2009-10-26 20:21     ` Richard Riley
  0 siblings, 1 reply; 9+ messages in thread
From: Teemu Likonen @ 2009-10-26 19:03 UTC (permalink / raw)
  To: help-gnu-emacs

On 2009-10-26 19:30 (+0100), Richard Riley wrote:

> I use this small script to start emacs :-
>
> ,----
> | #!/bin/bash
> | # edit
> | export GDK_NATIVE_WINDOWS=1
> | emacsclient --alternate-editor="" -c $@
> `----

You probably won't need that Bash lying in the background so I would
suggest using "exec" there to replace the script shell. Also, quoting
"$@" is a good idea so it will quote each expanded positional argument.
Like this:

    exec emacsclient --alternate-editor="" -c "$@"


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

* Re: sudo emacsclient
  2009-10-26 19:03   ` Teemu Likonen
@ 2009-10-26 20:21     ` Richard Riley
  2009-10-26 20:55       ` Andreas Politz
       [not found]       ` <mailman.9527.1256590642.2239.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 9+ messages in thread
From: Richard Riley @ 2009-10-26 20:21 UTC (permalink / raw)
  To: help-gnu-emacs

Teemu Likonen <tlikonen@iki.fi> writes:

> On 2009-10-26 19:30 (+0100), Richard Riley wrote:
>
>> I use this small script to start emacs :-
>>
>> ,----
>> | #!/bin/bash
>> | # edit
>> | export GDK_NATIVE_WINDOWS=1
>> | emacsclient --alternate-editor="" -c $@
>> `----
>
> You probably won't need that Bash lying in the background so I would
> suggest using "exec" there to replace the script shell. Also, quoting
> "$@" is a good idea so it will quote each expanded positional argument.
> Like this:
>
>     exec emacsclient --alternate-editor="" -c "$@"
>

Makes sense. Thanks.





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

* Re: sudo emacsclient
  2009-10-26 20:21     ` Richard Riley
@ 2009-10-26 20:55       ` Andreas Politz
  2009-10-26 21:22         ` Richard Riley
       [not found]       ` <mailman.9527.1256590642.2239.help-gnu-emacs@gnu.org>
  1 sibling, 1 reply; 9+ messages in thread
From: Andreas Politz @ 2009-10-26 20:55 UTC (permalink / raw)
  To: help-gnu-emacs

Richard Riley <rileyrgdev@gmail.com> writes:

> Teemu Likonen <tlikonen@iki.fi> writes:
>
>> On 2009-10-26 19:30 (+0100), Richard Riley wrote:
>>
>>> I use this small script to start emacs :-
>>>
>>> ,----
>>> | #!/bin/bash
>>> | # edit
>>> | export GDK_NATIVE_WINDOWS=1
>>> | emacsclient --alternate-editor="" -c $@
>>> `----
>>
>> You probably won't need that Bash lying in the background so I would
>> suggest using "exec" there to replace the script shell. Also, quoting
>> "$@" is a good idea so it will quote each expanded positional argument.
>> Like this:
>>
>>     exec emacsclient --alternate-editor="" -c "$@"
>>
>
> Makes sense. Thanks.

What is the *magic* export good for ?

-ap





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

* Re: sudo emacsclient
  2009-10-26 20:55       ` Andreas Politz
@ 2009-10-26 21:22         ` Richard Riley
  2009-10-26 21:45           ` Andreas Politz
  0 siblings, 1 reply; 9+ messages in thread
From: Richard Riley @ 2009-10-26 21:22 UTC (permalink / raw)
  To: help-gnu-emacs

Andreas Politz <politza@fh-trier.de> writes:

> Richard Riley <rileyrgdev@gmail.com> writes:
>
>> Teemu Likonen <tlikonen@iki.fi> writes:
>>
>>> On 2009-10-26 19:30 (+0100), Richard Riley wrote:
>>>
>>>> I use this small script to start emacs :-
>>>>
>>>> ,----
>>>> | #!/bin/bash
>>>> | # edit
>>>> | export GDK_NATIVE_WINDOWS=1
>>>> | emacsclient --alternate-editor="" -c $@
>>>> `----
>>>
>>> You probably won't need that Bash lying in the background so I would
>>> suggest using "exec" there to replace the script shell. Also, quoting
>>> "$@" is a good idea so it will quote each expanded positional argument.
>>> Like this:
>>>
>>>     exec emacsclient --alternate-editor="" -c "$@"
>>>
>>
>> Makes sense. Thanks.
>
> What is the *magic* export good for ?
>
> -ap

Emacs 23 issues with gtk. Certain menus not appearing. This fixes it for
me. It's logged as a debian/ubuntu bug.






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

* Re: sudo emacsclient
  2009-10-26 21:22         ` Richard Riley
@ 2009-10-26 21:45           ` Andreas Politz
  0 siblings, 0 replies; 9+ messages in thread
From: Andreas Politz @ 2009-10-26 21:45 UTC (permalink / raw)
  To: help-gnu-emacs

Richard Riley <rileyrgdev@gmail.com> writes:

> Andreas Politz <politza@fh-trier.de> writes:
>
>> Richard Riley <rileyrgdev@gmail.com> writes:
>>
>>> Teemu Likonen <tlikonen@iki.fi> writes:
>>>
>>>> On 2009-10-26 19:30 (+0100), Richard Riley wrote:
>>>>
>>>>> I use this small script to start emacs :-
>>>>>
>>>>> ,----
>>>>> | #!/bin/bash
>>>>> | # edit
>>>>> | export GDK_NATIVE_WINDOWS=1
>>>>> | emacsclient --alternate-editor="" -c $@
>>>>> `----
>>>>
>>>> You probably won't need that Bash lying in the background so I would
>>>> suggest using "exec" there to replace the script shell. Also, quoting
>>>> "$@" is a good idea so it will quote each expanded positional argument.
>>>> Like this:
>>>>
>>>>     exec emacsclient --alternate-editor="" -c "$@"
>>>>
>>>
>>> Makes sense. Thanks.
>>
>> What is the *magic* export good for ?
>>
>> -ap
>
> Emacs 23 issues with gtk. Certain menus not appearing. This fixes it for
> me. It's logged as a debian/ubuntu bug.

Yes,I just noticed this recently (the disappearance of menus).

-ap





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

* Re: sudo emacsclient
       [not found]       ` <mailman.9527.1256590642.2239.help-gnu-emacs@gnu.org>
@ 2009-10-26 22:21         ` Colin S. Miller
  0 siblings, 0 replies; 9+ messages in thread
From: Colin S. Miller @ 2009-10-26 22:21 UTC (permalink / raw)
  To: help-gnu-emacs

Andreas Politz wrote:
> 
> What is the *magic* export good for ?

Andreas,
GDK_NATIVE_WINDOWS=1
will set the enviromental variable "GDK_NATIVE_WINDOWS" to "1",
but only for this shell, itself.

export GDK_NATIVE_WINDOWS
will allow any processes started from this shell to see the new value,
otherwise they see the old value.

export GDK_NATIVE_WINDOWS=1
will export and set the variable at the same time.

HTH,
Colin S. Miller



> 
> 
> 


-- 
Replace the obvious in my email address with the first three letters of the hostname to reply.


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

end of thread, other threads:[~2009-10-26 22:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-26 17:03 sudo emacsclient Harry Putnam
2009-10-26 17:35 ` Thierry Volpiatto
2009-10-26 18:30 ` Richard Riley
     [not found] ` <mailman.9516.1256581844.2239.help-gnu-emacs@gnu.org>
2009-10-26 19:03   ` Teemu Likonen
2009-10-26 20:21     ` Richard Riley
2009-10-26 20:55       ` Andreas Politz
2009-10-26 21:22         ` Richard Riley
2009-10-26 21:45           ` Andreas Politz
     [not found]       ` <mailman.9527.1256590642.2239.help-gnu-emacs@gnu.org>
2009-10-26 22:21         ` Colin S. Miller

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.