help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to edit/modify patches using emacs?


From: Stefan Monnier
Subject: Re: How to edit/modify patches using emacs?
Date: Mon, 09 May 2005 18:53:45 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

> 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]