1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
diff -ruN qemacs-0.3.1/buffer.c qemacs-0.3.1-aon1/buffer.c
--- qemacs-0.3.1/buffer.c 2003-04-22 01:01:42.000000000 +0300
+++ qemacs-0.3.1-aon1/buffer.c 2004-11-12 18:53:18.510488192 +0200
@@ -1437,11 +1437,12 @@
if (stat(filename, &st) == 0)
mode = st.st_mode & 0777;
- /* backup old file if present */
- strcpy(buf1, filename);
- strcat(buf1, "~");
- rename(filename, buf1);
-
+ /* backup old file if present and make-backup-files is on */
+ if(mbf == 1) {
+ strcpy(buf1, filename);
+ strcat(buf1, "~");
+ rename(filename, buf1);
+ }
ret = b->data_type->buffer_save(b, filename);
if (ret < 0)
return ret;
diff -ruN qemacs-0.3.1/qe.c qemacs-0.3.1-aon1/qe.c
--- qemacs-0.3.1/qe.c 2003-04-22 01:01:42.000000000 +0300
+++ qemacs-0.3.1-aon1/qe.c 2004-11-12 18:53:52.524317304 +0200
@@ -61,7 +61,7 @@
static QEditScreen global_screen;
static int screen_width = 0;
static int screen_height = 0;
-
+mbf = 1;
/* mode handling */
void qe_register_mode(ModeDef *m)
@@ -4319,6 +4319,14 @@
do_refresh(qs->first_window);
}
+static void make_backup_files(EditState *s) {
+ if(mbf == 1) {
+ mbf = 0;
+ } else {
+ mbf = 1;
+ }
+}
+
/* compute default path for find/save buffer */
static void get_default_path(EditState *s, char *buf, int buf_size)
{
diff -ruN qemacs-0.3.1/qe.h qemacs-0.3.1-aon1/qe.h
--- qemacs-0.3.1/qe.h 2003-04-22 01:01:42.000000000 +0300
+++ qemacs-0.3.1-aon1/qe.h 2004-11-12 18:53:18.516487280 +0200
@@ -1140,3 +1140,5 @@
int qe_bitmap_format_to_pix_fmt(int format);
#endif
+
+int mbf;
diff -ruN qemacs-0.3.1/qeconfig.h qemacs-0.3.1-aon1/qeconfig.h
--- qemacs-0.3.1/qeconfig.h 2003-04-22 01:01:42.000000000 +0300
+++ qemacs-0.3.1-aon1/qeconfig.h 2004-11-12 18:53:18.516487280 +0200
@@ -68,5 +68,7 @@
CMD1( KEY_CTRLX(KEY_CTRL('u')), KEY_NONE, "upcase-region",
do_changecase_region, 1)
+ CMD0( KEY_NONE, KEY_NONE, "make-backup-files", make_backup_files)
+
/* keyboard macros */
CMD0( KEY_CTRLX('('), KEY_NONE, "start-kbd-macro", do_start_macro)
CMD0( KEY_CTRLX(')'), KEY_NONE, "end-kbd-macro", do_end_macro)
|