[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemacs-commit] qemacs clang.c
From: |
Charlie Gordon |
Subject: |
[Qemacs-commit] qemacs clang.c |
Date: |
Wed, 26 Dec 2007 09:55:35 +0000 |
CVSROOT: /cvsroot/qemacs
Module name: qemacs
Changes by: Charlie Gordon <chqrlie> 07/12/26 09:55:35
Modified files:
. : clang.c
Log message:
use qe_isalpha_ and qe_isalnum_ in parser
moved block navigation and kill functions to generic command table
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemacs/clang.c?cvsroot=qemacs&r1=1.20&r2=1.21
Patches:
Index: clang.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/clang.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- clang.c 25 Dec 2007 07:54:00 -0000 1.20
+++ clang.c 26 Dec 2007 09:55:35 -0000 1.21
@@ -54,13 +54,13 @@
c = *p;
q = buf;
- if (qe_isalpha(c) || c == '_') {
+ if (qe_isalpha_(c)) {
do {
if ((q - buf) < buf_size - 1)
*q++ = c;
p++;
c = *p;
- } while (qe_isalnum(c) || c == '_');
+ } while (qe_isalnum_(c));
}
*q = '\0';
return q - buf;
@@ -209,7 +209,7 @@
set_color(p_start, p, QE_STYLE_NUMBER);
continue;
}
- if (qe_isalpha(c) || c == '_') {
+ if (qe_isalpha_(c)) {
/* XXX: should support :: and $ */
klen = 0;
@@ -219,7 +219,7 @@
kbuf[klen++] = c;
p++;
c = *p;
- } while (qe_isalnum(c) || c == '_');
+ } while (qe_isalnum_(c));
kbuf[klen] = '\0';
if (strfind(c_mode_keywords, kbuf, 0)) {
@@ -747,21 +747,12 @@
return ret;
}
-/* specific C mode commands */
+/* C mode specific commands */
static CmdDef c_commands[] = {
CMD_( KEY_CTRL('i'), KEY_NONE, "c-indent-command", do_c_indent, "*")
CMD_( KEY_META(KEY_CTRL('\\')), KEY_NONE, "c-indent-region",
do_c_indent_region, "*")
/* should map to KEY_META + KEY_CTRL_LEFT ? */
- CMDV( KEY_META(KEY_CTRL('b')), KEY_NONE,
- "c-backward-block", do_c_forward_block, -1, "*v")
- /* should map to KEY_META + KEY_CTRL_RIGHT */
- CMDV( KEY_META(KEY_CTRL('f')), KEY_NONE,
- "c-forward-block", do_c_forward_block, 1, "*v")
- CMDV( KEY_META(KEY_CTRL('k')), KEY_NONE,
- "c-kill-block", do_c_kill_block, 1, "*v")
- CMDV( KEY_ESC, KEY_DELETE,
- "c-backward-kill-block", do_c_kill_block, -1, "*v")
CMDV( KEY_META('['), KEY_NONE,
"c-backward-preprocessor", do_c_forward_preprocessor, -1, "*v")
CMDV( KEY_META(']'), KEY_NONE,
@@ -774,6 +765,20 @@
CMD_DEF_END,
};
+/* Non C mode specific commands */
+static CmdDef extra_commands[] = {
+ CMDV( KEY_META(KEY_CTRL('b')), KEY_NONE,
+ "c-backward-block", do_c_forward_block, -1, "*v")
+ /* should map to KEY_META + KEY_CTRL_RIGHT */
+ CMDV( KEY_META(KEY_CTRL('f')), KEY_NONE,
+ "c-forward-block", do_c_forward_block, 1, "*v")
+ CMDV( KEY_META(KEY_CTRL('k')), KEY_NONE,
+ "c-kill-block", do_c_kill_block, 1, "*v")
+ CMDV( KEY_ESC, KEY_DELETE,
+ "c-backward-kill-block", do_c_kill_block, -1, "*v")
+ CMD_DEF_END,
+};
+
static ModeDef c_mode;
static int c_init(void)
@@ -786,6 +791,7 @@
qe_register_mode(&c_mode);
qe_register_cmd_table(c_commands, "C");
+ qe_register_cmd_table(extra_commands, NULL);
return 0;
}