From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bob Proulx Newsgroups: gmane.emacs.help Subject: Re: I'am root user, but 'emacs /etc/sudoers' still report Buffer is read-only: # in modeline Date: Thu, 30 Apr 2015 15:36:23 -0600 Message-ID: <20150430152220879774708@bob.proulx.com> References: <819c0a76-13fb-4d38-baa3-8ca429e8cf31@googlegroups.com> <87618e8zq4.fsf@debian.uxu> <87383iu18y.fsf@debian.uxu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1430429843 23709 80.91.229.3 (30 Apr 2015 21:37:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 30 Apr 2015 21:37:23 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Apr 30 23:37:23 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ynw93-0006e3-W2 for geh-help-gnu-emacs@m.gmane.org; Thu, 30 Apr 2015 23:37:22 +0200 Original-Received: from localhost ([::1]:45951 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ynw93-0000YN-DH for geh-help-gnu-emacs@m.gmane.org; Thu, 30 Apr 2015 17:37:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49796) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ynw8D-0007gC-Bd for help-gnu-emacs@gnu.org; Thu, 30 Apr 2015 17:36:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ynw8A-0005yJ-3p for help-gnu-emacs@gnu.org; Thu, 30 Apr 2015 17:36:29 -0400 Original-Received: from joseki.proulx.com ([216.17.153.58]:40728) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ynw89-0005xq-G9 for help-gnu-emacs@gnu.org; Thu, 30 Apr 2015 17:36:26 -0400 Original-Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id 0037021869 for ; Thu, 30 Apr 2015 15:36:24 -0600 (MDT) Original-Received: by hysteria.proulx.com (Postfix, from userid 1000) id CE27A2DC42; Thu, 30 Apr 2015 15:36:23 -0600 (MDT) Mail-Followup-To: help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: <87383iu18y.fsf@debian.uxu> User-Agent: Mutt/1.5.23 (2014-03-12) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 216.17.153.58 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:104113 Archived-At: 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