From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marius Hofert Newsgroups: gmane.emacs.help Subject: How to change and save a read-only file? Date: Sat, 29 Jun 2013 11:14:00 +0200 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1372497294 3604 80.91.229.3 (29 Jun 2013 09:14:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 29 Jun 2013 09:14:54 +0000 (UTC) To: Emacs help Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jun 29 11:14:56 2013 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 1UsrF9-0001R3-Mc for geh-help-gnu-emacs@m.gmane.org; Sat, 29 Jun 2013 11:14:55 +0200 Original-Received: from localhost ([::1]:36807 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsrF9-0002Ke-8U for geh-help-gnu-emacs@m.gmane.org; Sat, 29 Jun 2013 05:14:55 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40051) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsrEy-0002KU-OE for help-gnu-emacs@gnu.org; Sat, 29 Jun 2013 05:14:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UsrEw-0008WU-Cb for help-gnu-emacs@gnu.org; Sat, 29 Jun 2013 05:14:44 -0400 Original-Received: from mail-pd0-x229.google.com ([2607:f8b0:400e:c02::229]:33907) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsrEw-0008WK-6T for help-gnu-emacs@gnu.org; Sat, 29 Jun 2013 05:14:42 -0400 Original-Received: by mail-pd0-f169.google.com with SMTP id y10so1495533pdj.14 for ; Sat, 29 Jun 2013 02:14:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:from:date:x-google-sender-auth:message-id :subject:to:content-type; bh=m7qpT8wbscp1A8Z0gXiCvCi31bJ3i917sZRowuEzLC0=; b=UrLhGxHCOIVFlqx+GhbC8dVj7oZbvIzWha73VIUQ6fNc+ijR8mG28zb/B6q0IjPMjN 32y3l+lR0eVcQ7Y4nGa7ool15cWjLiYhQnn/4Ua4BATtwPbCB6AtDxdH15JWSf+/4oRX i0qqF/QfLdYItzo0fHpX03fGBY4iTbE4JnXasPj3Et2vZbl/+fJK8E2c1AsaO2M6nOey eUoTGd0w8HYGK9VMPTlbBeo4V4mOufCPuuE90pUZiF6RWgWrzRRgSWgh/cZfCk2SLl5J VkclBjDe5D51ibwvDKPaDgDXxjGZ0UjpiQc3UdfMpDq2BFzYXyTOvIntau4wmYU7J7Vb sHZQ== X-Received: by 10.66.146.9 with SMTP id sy9mr15401039pab.16.1372497281051; Sat, 29 Jun 2013 02:14:41 -0700 (PDT) Original-Received: by 10.68.31.135 with HTTP; Sat, 29 Jun 2013 02:14:00 -0700 (PDT) X-Google-Sender-Auth: okj4KqFvLLGFYs6QcGNYLl04iLo X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c02::229 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:91844 Archived-At: Hi, I often would like to edit files in emacs, which are write-protected (owned by root, for example). With "C-x C-q" I can disable 'read-only mode', which allows me to make changes in the file. But when I want to save the file, I obtain "File ... is write-protected; try to save anyway? (y or n)". Even if I choose 'y', it fails (*Messages* saying: "basic-save-buffer-2: Doing chmod: operation not permitted"). What's the 'correct' approach to easily edit (change + save) such files? Cheers, Marius