Re: mc editor small changes III - unified diff
Hi František, On Thu, 2005-08-11 at 09:07 +0200, František Řezníček wrote: -const char * const b = {}{[][()(, *p; +const char * const b = {}{[][()(, *p; -if (strchr ({[(, c)) +if (strchr ({[(, c)) If you'd like the extra match please implement this so the strings above are configurable via ~/.mc/ini. If you do this please also add match for an empty string so this feature can be disabled. Maybe the config string should just contain the bracket from which b and the second string can be constructed. Leonard. ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re: mc editor small changes III - unified diff
Hi Jindrich, thanks for your mehodology hints... I'll keep it in my mind. To your question. I'd prefer to have '' ... '' highlightment mainly for c++ code (nested templates ...). You're right that nowadays C code doesn't require that, but are we sure that for instance function templates feature aren't going to be available in C ? We may think about conditioning this feature, but it requires bigger changes to CoolEdit used in MC. Kind Regards, Frantisek Puvodni zprava Od: Jindrich Novy [EMAIL PROTECTED] Predmet: Re: mc editor small changes III - unified diff Datum: 13.8.2005 12:45:59 Hello Frantisek, On Thu, 2005-08-11 at 09:07 +0200, František Řezníček wrote: here are the changes (just unified diff) : Please send the patch as an attachment for the next time, it makes extraction of it less painful. # Should I use the latest nighbuild and incorporate the changes there or you can # do it? The best is probably to send here a ported patch to one of the latest releases as it's likely that the patch will be applied smoothly to HEAD. # Could I hope to have these minor changes in the official mc? I modified the patch a bit so that it looks bit better now. Please avoid shipping commented-out code within the patch. The question is whether highlighting of '' and '' is desirable in all cases. Highlighting of such characters doesn't make too much sense when editing C source files for instance. mc-devel, what's your opition on this? Yes/No? Attaching the updated patch - applies smoothly to 4.6.1. Best, Jindrich -- Jindrich Novy [EMAIL PROTECTED], http://people.redhat.com/jnovy/ (o_ _o) //\ The worst evil in the world is refusal to think. //\ V_/_ _\_V ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re: mc editor small changes III - unified diff
On Sat, Aug 13, 2005 at 11:08:48PM +0200, Leonard den Ottolander wrote: On Sat, 2005-08-13 at 15:25, Jindrich Novy wrote: I can imagine the enhancement can be useful for XML/HTML/PHP, etc. but maybe it could be a configurable feature if considered to be committed at all. I like that idea. i don't. An editor_match_bracket_open_str and editor_match_bracket_close_str option in ini. i think it should be part of the syntax definition, which would be extended from highlighting only. actually, there might be more options in this cathegory. another thing to consider: bracket matching is context-dependant (quoted string, comments), which in turn is syntax-specific as well. -- Hi! I'm a .signature virus! Copy me into your ~/.signature, please! -- Chaos, panic, and disorder - my work here is done. ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re: mc editor small changes III - unified diff
On Sun, Aug 14, 2005 at 02:03:25PM +0200, Leonard den Ottolander wrote: i think it should be part of the syntax definition, which would be extended from highlighting only. This is not about highlighting, the highlighting is a side effect of the jump to matching bracket option. This code in no way interferes with the syntax highlighting. wow, _that_ was new to me ... haha. and now re-read the sentence you quoted yourself and think about it. I wouldn't see why we can't make these strings configurable for people who like to use them. because it's pretty much useless that way. i can choose to be annoyed in most cases or to permanently resign from the feature where it would make sense. It's not like it hurts when somebody likes jumping from '' to '' in a c file, even if this doesn't make any sense syntactically. the highlighting hurts - not much, but it is still annoying. -- Hi! I'm a .signature virus! Copy me into your ~/.signature, please! -- Chaos, panic, and disorder - my work here is done. ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re: mc editor small changes III - unified diff
On Sun, 2005-08-14 at 15:01, Oswald Buddenhagen wrote: On Sun, Aug 14, 2005 at 02:03:25PM +0200, Leonard den Ottolander wrote: i think it should be part of the syntax definition, which would be extended from highlighting only. This is not about highlighting, the highlighting is a side effect of the jump to matching bracket option. This code in no way interferes with the syntax highlighting. wow, _that_ was new to me ... haha. ? Not sure what to make of this (cynicism or a genuine remark). I ment they use different code paths (afaict). and now re-read the sentence you quoted yourself and think about it. Well, should be part of the syntax definition yes. But that's not currently the case. So I don't see why we couldn't extend the current functionality (until you've finished the syntax highlighting rewrite ;) ). the highlighting hurts - not much, but it is still annoying. It's already there for the other brackets, and if this would be configurable you wouldn't have to look at extra highlighted characters. Maybe we should add a match for NULL strings to disable that code path so we would make you even more happy. Leonard. -- mount -t life -o ro /dev/dna /genetic/research ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re: mc editor small changes III - unified diff
On Sun, Aug 14, 2005 at 03:27:45PM +0200, Leonard den Ottolander wrote: So I don't see why we couldn't extend the current functionality (until you've finished the syntax highlighting rewrite ;)). :-P the highlighting hurts - not much, but it is still annoying. It's already there for the other brackets, yes - parens, braces and brackets. they tend to come in pairs, at least in syntactically relevant parts of programs. unlike angle brackets. well this is not really an issue i care too much about, but now you know what i'd consider ideal. :) -- Hi! I'm a .signature virus! Copy me into your ~/.signature, please! -- Chaos, panic, and disorder - my work here is done. ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re: mc editor small changes III - unified diff
Hello Frantisek, On Thu, 2005-08-11 at 09:07 +0200, František Řezníček wrote: here are the changes (just unified diff) : Please send the patch as an attachment for the next time, it makes extraction of it less painful. # Should I use the latest nighbuild and incorporate the changes there or you can # do it? The best is probably to send here a ported patch to one of the latest releases as it's likely that the patch will be applied smoothly to HEAD. # Could I hope to have these minor changes in the official mc? I modified the patch a bit so that it looks bit better now. Please avoid shipping commented-out code within the patch. The question is whether highlighting of '' and '' is desirable in all cases. Highlighting of such characters doesn't make too much sense when editing C source files for instance. mc-devel, what's your opition on this? Yes/No? Attaching the updated patch - applies smoothly to 4.6.1. Best, Jindrich -- Jindrich Novy [EMAIL PROTECTED], http://people.redhat.com/jnovy/ (o_ _o) //\ The worst evil in the world is refusal to think. //\ V_/_ _\_V --- mc-4.6.1/src/color.h.bracket 2004-09-02 00:33:43.0 +0200 +++ mc-4.6.1/src/color.h 2005-08-13 11:02:16.0 +0200 @@ -83,6 +83,8 @@ #define ERROR_HOT_NORMAL IF_COLOR (37, 0) #define ERROR_HOT_FOCUSIF_COLOR (38, 0) +#define EDITOR_MARKEDBRACKET_COLOR IF_COLOR (39, A_REVERSE) + #ifdef HAVE_SLANG # define CTYPE const char * #else --- mc-4.6.1/src/color.c.bracket 2005-05-27 16:19:18.0 +0200 +++ mc-4.6.1/src/color.c 2005-08-13 11:02:16.0 +0200 @@ -100,6 +100,7 @@ /* error dialog colors start at 37 */ { errdhotnormal=, 0, 0 }, /* Error dialog normal/hot */ /* 37 */ { errdhotfocus=, 0, 0 }, /* Error dialog focused/hot */ +{ markedbracket=, 0, 0 }, /* marked/selected bracket */ }; struct color_table_s { @@ -162,7 +163,8 @@ editbold=yellow,blue: editmarked=black,cyan: errdhotnormal=yellow,red: -errdhotfocus=yellow,lightgray; +errdhotfocus=yellow,lightgray: +markedbracket=yellow,brightmagenta; #ifdef HAVE_SLANG # define color_value(i) color_table [i].name --- mc-4.6.1/edit/edit.c.bracket 2005-08-13 11:02:15.0 +0200 +++ mc-4.6.1/edit/edit.c 2005-08-13 11:02:16.0 +0200 @@ -2147,7 +2147,7 @@ /* this find the matching bracket in either direction, and sets edit-bracket */ static long edit_get_bracket (WEdit * edit, int in_screen, unsigned long furthest_bracket_search) { -const char * const b = {}{[][()(, *p; +const char * const b = {}{[][()(, *p; int i = 1, a, inc = -1, c, d, n = 0; unsigned long j = 0; long q; @@ -2163,7 +2163,7 @@ /* the matching bracket */ d = p[1]; /* going left or right? */ -if (strchr ({[(, c)) +if (strchr ({[(, c)) inc = 1; for (q = edit-curs1 + inc;; q += inc) { /* out of buffer? */ --- mc-4.6.1/edit/editdraw.c.bracket 2005-08-13 11:02:15.0 +0200 +++ mc-4.6.1/edit/editdraw.c 2005-08-13 11:07:19.0 +0200 @@ -38,6 +38,7 @@ #define MOD_BOLD (1 9) #define MOD_MARKED (1 10) #define MOD_CURSOR (1 11) +#define MOD_MARKEDBRACKET (1 12) #define FONT_OFFSET_X 0 #define FONT_OFFSET_Y 0 @@ -235,6 +236,8 @@ set_color (EDITOR_BOLD_COLOR); } else if (style MOD_MARKED) { set_color (EDITOR_MARKED_COLOR); + } else if (style MOD_MARKEDBRACKET) { + set_color (EDITOR_MARKEDBRACKET_COLOR); } else { lowlevel_set_color (color); } @@ -292,7 +295,7 @@ p-style |= MOD_MARKED; } if (q == edit-bracket) - p-style |= MOD_BOLD; + p-style |= MOD_MARKEDBRACKET; if (q = edit-found_start q edit-found_start + edit-found_len) p-style |= MOD_BOLD; ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re: mc editor small changes III - unified diff
Hi Jindrich, On Sat, 2005-08-13 at 11:45, Jindrich Novy wrote: The question is whether highlighting of '' and '' is desirable in all cases. Highlighting where? Is this in any way related to the syntax highlighting? Highlighting of such characters doesn't make too much sense when editing C source files for instance. That was a thought that crossed my mind as well. Now only if I knew what we are speaking of ;-) . Leonard. -- mount -t life -o ro /dev/dna /genetic/research ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re: mc editor small changes III - unified diff
Hi Jindrich, On Sat, 2005-08-13 at 11:45, Jindrich Novy wrote: The question is whether highlighting of '' and '' is desirable in all cases. Highlighting of such characters doesn't make too much sense when editing C source files for instance. I figured this patch is about the Go to matching bracket command. The introduction of MOD_MARKEDBRACKET seems totally redundant. The highlighting of the matching bracket currently uses MOD_BOLD which is fine. Also the jump to the matching '' or '' is only slightly useful as afaict these are only used in unnested ways. So all it could be used for is jumping to the beginning of end of the current XML/HTML tag. I'd say we need at most the two hunks for edit.c. Leonard. -- mount -t life -o ro /dev/dna /genetic/research ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re: mc editor small changes III - unified diff
Hello, On Thu, 11 Aug 2005, Leonard den Ottolander wrote: Hi František, On Thu, 2005-08-11 at 09:07, František Řezníček wrote: 4 files changed edit/edit.c, edit/editdraw.c, src/color.c, src/color.h. Changes were done on night build mc-2004-12-01-22.tar.gz. If you request to be redone on the last code, let me know. Could you please briefly explain what behaviour it is you attempt to change? Thanks. The description of the patch can be found at the end of the email i.e. after the patch :) Btw from what I see the patch should be applied with -R. ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re: mc editor small changes III - unified diff
Hi Pavel, On Fri, 2005-08-12 at 15:45, Pavel Tsekov wrote: The description of the patch can be found at the end of the email i.e. after the patch :) What exactly is edit_get_bracket used for? Doesn't seem to have anything to do with syntax highlighting. So my question is what this bracket matching is used for in the editor. Btw from what I see the patch should be applied with -R. Yeah, that seems indeed to be the case now I look at the code ;) . Leonard. -- mount -t life -o ro /dev/dna /genetic/research ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel