From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: How to edit/modify patches using emacs? Date: Mon, 09 May 2005 18:53:45 -0400 Organization: Bell Sympatico Message-ID: <878y2of24c.fsf-monnier+gnu.emacs.help@gnu.org> References: <427df645$0$26177$9b622d9e@news.freenet.de> <427fbef8$0$15822$9b622d9e@news.freenet.de> <87psw0f7o1.fsf-monnier+gnu.emacs.help@gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1115680275 32330 80.91.229.2 (9 May 2005 23:11:15 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 9 May 2005 23:11:15 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue May 10 01:11:14 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DVHOu-0004iq-AK for geh-help-gnu-emacs@m.gmane.org; Tue, 10 May 2005 01:11:00 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DVHUq-0002gv-4A for geh-help-gnu-emacs@m.gmane.org; Mon, 09 May 2005 19:17:08 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!cyclone.bc.net!snoopy.risq.qc.ca!News.Dal.Ca!ursa-nb00s0.nbnet.nb.ca!nf3.bellglobal.com!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:xeMkuGCukMh6RgHCCCjmlj/aolk= Original-Lines: 23 Original-NNTP-Posting-Host: 67.71.32.212 Original-X-Complaints-To: abuse@sympatico.ca Original-X-Trace: news20.bellglobal.com 1115679225 67.71.32.212 (Mon, 09 May 2005 18:53:45 EDT) Original-NNTP-Posting-Date: Mon, 09 May 2005 18:53:45 EDT Original-Xref: shelby.stanford.edu gnu.emacs.help:130810 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:26465 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:26465 > I use diff-mode a lot, but the _vast_ majority of diff files I visit are > only examined or applied from emacs, not edited; indeed almost always > the first thing I do when I visit one is toggle-read-only to prevent > inadvertent modification and enable the move convenient command > bindings. That's also how I felt originally, but over time I came to appreciate the advantage of behaving in a more normal way and I think they outweigh the benefits of defaulting to read-only. Most of the diffs I look at are in *vc-diff* rather than in files anyway. > So, anyway I guess now I know I can set `diff-default-read-only' to t... I'm sure you knew you could do (add-hook 'diff-mode-hook (lambda () (toggle-read-only 1)). Other interesting things to put there are: diff-delete-empty-files and diff-make-unified which I find most useful for .rej files (especially in combination with Arch). I still need to add a mode where hunk-application removes the hunk from the buffer, so as to make diff-delete-empty-files even more meaningful for Arch's .rej files. Stefan