all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Will Parsons <varro@nodomain.invalid>
To: help-gnu-emacs@gnu.org
Subject: mismatch between what Emacs considers read-only and file permissions
Date: 4 Feb 2015 17:12:52 GMT	[thread overview]
Message-ID: <slrnmd4koj.1fb.varro@anukis.local> (raw)

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


             reply	other threads:[~2015-02-04 17:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-04 17:12 Will Parsons [this message]
2015-02-04 19:04 ` mismatch between what Emacs considers read-only and file permissions Eli Zaretskii
     [not found] ` <mailman.19279.1423076671.1147.help-gnu-emacs@gnu.org>
2015-02-04 19:53   ` Will Parsons
2015-02-04 20:00     ` Eli Zaretskii
     [not found]     ` <mailman.19282.1423080028.1147.help-gnu-emacs@gnu.org>
2015-02-04 20:19       ` Will Parsons
2015-02-05 13:24     ` Stefan Monnier

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=slrnmd4koj.1fb.varro@anukis.local \
    --to=varro@nodomain.invalid \
    --cc=gyliamos@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.
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.