help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sudo emacsclient can't find the path to the user emacsserver.


From: XeCycle
Subject: Re: sudo emacsclient can't find the path to the user emacsserver.
Date: Tue, 25 Oct 2011 18:25:00 +0800
User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.90 (gnu/linux)

Clément Aymé <clmnt.wrk@gmail.com> writes:

> Here is the case:
> I got a emacsserver running as a Linux ubuntu normal user that is
> working fine.
> When I switch under sudo the path to the emacsserver is lost:
>
> For example
> sudo emacsclient /etc/udev/rules.d/51-android.rules
> returns
> emacsclient: can't find socket; have you started the server?
> To start the server in Emacs, type "M-x server-start".
> emacsclient: No socket or alternate editor. Please use:
>
> --socket-name
> --server-file (or environment variable EMACS_SERVER_FILE)
> --alternate-editor (or environment variable ALTERNATE_EDITOR)
>
> And what I would like is to use the same emacs server as in user
> mode not having any additional one ...
>
> Also this doesn't work as it is said into the sudo manual
> sudo -u <username> emacsclient ....
> the file is effectively loaded into the emacs server but still
> remains read-only
> so any help welcome...
>
> What could be the work-around here ?

I don't think the file will be opened by `emacsclient' in this way ---
it should be opened by `emacs'.  If you want to edit the file as root,
try tramp, e.g.:

C-x C-f /sudo::/etc/udev/rules.d/51-android.rules

-- 
Carl Lei (XeCycle)
Department of Physics, Shanghai Jiao Tong University
OpenPGP public key: 7795E591
Fingerprint: 1FB6 7F1F D45D F681 C845 27F7 8D71 8EC4 7795 E591

Attachment: pgpYSq5sZme8h.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]