unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Luca Ferrari <fluca1978@gmail.com>
To: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: Re: emacsclient and sudo
Date: Mon, 8 Mar 2021 16:32:09 +0100	[thread overview]
Message-ID: <CAKoxK+6keFX67zh+MfOgYRZFxmBw9NvdNDdXhR6Ki8379CT+pw@mail.gmail.com> (raw)
In-Reply-To: <CAKoxK+7MVmqgmGGRSh1g=GFggY66SGvw+uZ0Xr5kXTzG6XY-6A@mail.gmail.com>

On Wed, Feb 24, 2021 at 6:48 PM Luca Ferrari <fluca1978@gmail.com> wrote:
>
> So far, I'm starting it normally (without sudo) and use tramp to edit
> a file with sudo, but sometimes my fingers are faster than my brain
> and I type "sudo emacs ...".

Another solution I found is to export SUDO_EDITOR variable set to
emacsclient and then use `sudo -e` to edit a file. While this works
with regard to emacsclient, it does prevent emacs to load my .emacs
configuration file.

% export SUDO_EDITOR="emacsclient -t -a ''"
% sudo -e /etc/fstab

I would like to be able to use my customizations, any idea?

Thanks,
Luca



  parent reply	other threads:[~2021-03-08 15:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-24 17:48 emacsclient and sudo Luca Ferrari
2021-02-24 18:01 ` 2QdxY4RzWzUUiLuE
2021-03-08 15:32 ` Luca Ferrari [this message]
2021-03-09  6:04   ` Jean Louis

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=CAKoxK+6keFX67zh+MfOgYRZFxmBw9NvdNDdXhR6Ki8379CT+pw@mail.gmail.com \
    --to=fluca1978@gmail.com \
    --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.
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).