The current emacs21 and xemacs21 switches to diff-mode when we open *.patch files. But I fell into the trap hidden in the current diff-mode behavior over one hour.
When I opened the patch file (filename: debian/patches/linux-types-and-time.patch in linux-kernel-headers package), the file was as follows:
--- include.orig/linux/time.h 2005-04-21 09:03:16.000000000 +0900
+++ include/linux/time.h 2005-05-04 15:29:52.266871616 +0900
@@ -1,6 +1,10 @@
#ifndef _LINUX_TIME_H
...
#ifdef __KERNEL__
=> @@ -177,5 +181,6 @@ struct itimerval {
#define TIMER_ABSTIME 0x01
...
#endif
--- include.orig/linux/types.h 2005-04-21 09:03:16.000000000 +0900
+++ include/linux/types.h 2005-05-04 15:30:14.515900970 +0900
@@ -1,6 +1,16 @@
#ifndef _LINUX_TYPES_H
...
=> @@ -169,4 +179,6 @@
char f_fpack[6];
};
Then, I just exchanged the order of two parts as follows:
--- include.orig/linux/types.h 2005-04-21 09:03:16.000000000 +0900
+++ include/linux/types.h 2005-05-04 15:30:14.515900970 +0900
@@ -1,6 +1,16 @@
#ifndef _LINUX_TYPES_H
...
#include
=> @@ -169,5 +179,7 @@
char f_fpack[6];
};
--- include.orig/linux/time.h 2005-04-21 09:03:16.000000000 +0900
+++ include/linux/time.h 2005-05-04 15:29:52.266871616 +0900
@@ -1,6 +1,10 @@
#ifndef _LINUX_TIME_H
...
+
#ifdef __KERNEL__
=> @@ -177,6 +181,7 @@ struct itimerval {
#define TIMER_ABSTIME 0x01
...
@@ lines are suddenly modified without any editing for patch lines.
This behavior is crazy.
I submitted the bug report to
Bug#201816
and
Bug#307617.
I think either this problem should be fixed or emacs should provide
the variable to stop @@ line modification via "setq" and so on.
