Re: [PATCH] Choose syntax



Hello,

On Sun, 10 Jul 2005, Leonard den Ottolander wrote:

> Another approach to overriding the automatic syntax type detection.
> Using a WList instead of a dialog with a quick_input. Patch is against
> MC_4_6_1_PRE.

[...]
+#define MAX_ENTRY_LEN 40
+#define LIST_LINES 14
+#define N_DFLT_ENTRIES 1

Instead of a macro you could use the following construct:

static const int MAX_ENTRY_LEN = 40;
...
...

[...]
diff -pruN MC_4_6_1_PRE/mc/edit/editcmd.c MC_4_6_1_PRE.syntax.input/mc/edit/editcmd.c
--- MC_4_6_1_PRE/mc/edit/editcmd.c	2005-05-29 12:04:00.000000000 +0200
+++ MC_4_6_1_PRE.syntax.input/mc/edit/editcmd.c	2005-07-10 11:07:02.000000000 +0200
@@ -512,7 +512,10 @@ edit_save_as_cmd (WEdit *edit)
 		edit->modified = 0;
 		edit->delete_file = 0;
 		if (different_filename)
-		    edit_load_syntax (edit, 0, 0);
+		    if (option_auto_syntax)
+			edit_load_syntax (edit, 0, 0);
+		    else
+			edit_load_syntax (edit, 0, option_syntax_type);
 		edit->force |= REDRAW_COMPLETELY;
 		return 1;
 	    } else {

Isn't it possible to handle `option_auto_syntax' inside edit_load_syntax() ?



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