From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Will Parsons Newsgroups: gmane.emacs.help Subject: mismatch between what Emacs considers read-only and file permissions Date: 4 Feb 2015 17:12:52 GMT Message-ID: Reply-To: gyliamos@gmail.com NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1423070118 4504 80.91.229.3 (4 Feb 2015 17:15:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 4 Feb 2015 17:15:18 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Feb 04 18:15:18 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 1YJ3Xp-00055e-Qq for geh-help-gnu-emacs@m.gmane.org; Wed, 04 Feb 2015 18:15:17 +0100 Original-Received: from localhost ([::1]:37530 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJ3Xo-0000Qd-Vs for geh-help-gnu-emacs@m.gmane.org; Wed, 04 Feb 2015 12:15:16 -0500 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 32 Original-X-Trace: individual.net Ye/hrj0Mba7WTVB/rumJAQeaanltxyeRRmG6MBQXcdCYi9OnVy Cancel-Lock: sha1:f8WJuUnKwc8bVgl13Xe9UzGkZM0= User-Agent: slrn/1.0.2 (FreeBSD) Original-Xref: usenet.stanford.edu gnu.emacs.help:210199 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:102476 Archived-At: How does Emacs determine whether to mark a buffer read-only when visiting a file that is writable? I've encountered anomalies under two separate conditions: 1) Under Windows I make heavy use of the Cygwin environment under Windows, but usually use the native Windows Emacs. I've never bothered to track down the exact circumstances, but assume that Cygwin is setting file permissions in a way that confuses native Emacs. I've dealt with this by simply binding a key to toggle-read-only and using it when editing a writable file that is marked read-only. 2) Editing system configuration files as root under FreeBSD This is more puzzling. Normally, if I edit a system configuration file (e.g., /etc/fstab), I'm working in an X-session as a regular user. I then su to root and fire up Emacs to edit the file, and there is no problem. Occasionally, however, I log into a console directly as root to edit a configuation file, and here Emacs marks the buffer as read-only when the file permissions are: -rw-r--r-- 1 root wheel Thre is no problem actually editing and saving the file if the buffer read-only attribute is turned off, but why is Emacs marking it read-only in the first place? (Emacs version is 24.4.1.) -- Will