all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Bob Proulx <bob@proulx.com>
To: help-gnu-emacs@gnu.org
Subject: Re: I'am root user, but 'emacs /etc/sudoers' still report Buffer is read-only: #<buffer sudoers> in modeline
Date: Thu, 30 Apr 2015 15:36:23 -0600	[thread overview]
Message-ID: <20150430152220879774708@bob.proulx.com> (raw)
In-Reply-To: <87383iu18y.fsf@debian.uxu>

Emanuel Berg wrote:
> Indeed, however because you must run Emacs with
> superuser rights in order to edit /etc/sudoers (I.e.
> you won't get your everyday user's Emacs configs)

That depends upon how you invoked sudo and emacs.  Normally you will
have your non-root emacs configuration.

  $ sudo printenv HOME USER
  /home/rwp
  root

When running commands such as 'sudo emacs' the process id is changed,
and USER=root, but the HOME variable is not changed.  However that is
configurable.  It is possible your system has been configured
otherwise.  But that would be the normal default for most people.

> it can be preferable to use something altogether
> different and above all more simple, like nano, which
> seems to be the default -

Because both emacs and vim (the two most popular technical editors)
need some knowledge and learning in order to use them distributions
often include nano as a simple editor that can be used without any
pre-existing knowledge.  Nano includes an on screen menu so that you
need learn nothing ahead of the time of using it.  And there are few
features beyond what is available on the menu.

> in spite of the name (or perhaps "vi"sudo refers to "visual" and not
> vi(m)).

It really meant vi.  The 'visudo' name follows 'vipw' program (and
'vigr') which originally would spawn vi on the password file.  Or any
other program as specified in the EDITOR field.  But they fell back to
using vi if EDITOR was not set.  Now in the modern age things are more
configurable for different user preferences such as editor.

It was long very popular to use use the language "vi a file" as a
generic in the same way that people might say Kleenex or Escalator or
Xerox even though those are all company tradmarks and should not be
used generically.

And so we have vipw and visudo which both would have originally
spawned vi on the respective files.  But now the vi part of the name
of those classic tools is used generically to mean edit the file.
Anything else would require changing the name and that would be
egregiously breaking scripts and things that used the previous name.

> If you are dead set on using Emacs, try
> 
>     sudo EDITOR='/usr/bin/emacs -u USER' visudo

Not necessary when using the typical sudo configuration.  Really!  :-)
What does this say for you?

  $ sudo printenv HOME

Bob



  reply	other threads:[~2015-04-30 21:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-29  6:27 I'am root user, but 'emacs /etc/sudoers' still report Buffer is read-only: #<buffer sudoers> in modeline Show Dont
2015-04-29  8:25 ` Bob Proulx
2015-04-29  8:36 ` tomas
2015-04-29  9:24 ` Alex Kost
2015-04-29 10:33 ` tomas
     [not found] ` <mailman.1889.1430298251.904.help-gnu-emacs@gnu.org>
2015-04-29 20:08   ` Emanuel Berg
2015-04-29 20:29     ` Emanuel Berg
2015-04-30 21:36       ` Bob Proulx [this message]
     [not found]       ` <mailman.2062.1430429791.904.help-gnu-emacs@gnu.org>
2015-05-01  1:23         ` Emanuel Berg
2015-05-01  2:31         ` Emanuel Berg

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=20150430152220879774708@bob.proulx.com \
    --to=bob@proulx.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.
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.