diff options
| author | Simon Tatham <anakin@pobox.com> | 2002-08-05 10:31:35 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2002-08-05 10:31:35 +0000 |
| commit | c478f3d9469c09773097eba89342c311ee70a319 (patch) | |
| tree | f7b1e1d1ac577b5571bf14fe70af1dced325dccc /misc/buttress.sl | |
| parent | 6758ed90d7c0015752894202138ecbcef35b80a0 (diff) | |
| download | halibut-c478f3d9469c09773097eba89342c311ee70a319.zip halibut-c478f3d9469c09773097eba89342c311ee70a319.tar.gz halibut-c478f3d9469c09773097eba89342c311ee70a319.tar.bz2 halibut-c478f3d9469c09773097eba89342c311ee70a319.tar.xz | |
Rename Buttress to Halibut. I _think_ I've caught everything in this pass.
[originally from svn r1800]
Diffstat (limited to 'misc/buttress.sl')
| -rw-r--r-- | misc/buttress.sl | 98 |
1 files changed, 0 insertions, 98 deletions
diff --git a/misc/buttress.sl b/misc/buttress.sl deleted file mode 100644 index b7b30bd..0000000 --- a/misc/buttress.sl +++ /dev/null @@ -1,98 +0,0 @@ -% Buttress mode for Jed. - -$1 = "Buttress"; -create_syntax_table ($1); - -define_syntax ("\#", "", '%', $1); % Comment Syntax -define_syntax ('\\', '\\', $1); % Quote character -define_syntax ("{", "}", '(', $1); % are all these needed? -define_syntax ("a-zA-Z0-9", 'w', $1); -set_syntax_flags ($1, 8); - -#ifdef HAS_DFA_SYNTAX -%enable_highlight_cache ("buttress.dfa", $1); - -% A braced comment in Buttress is \#{ ... }, where ... may contain -% any correctly nested sequence of braces. Of course we can't match -% that in a DFA rule, so we'll go down to a reasonable depth of 3 -% instead. -#ifexists dfa_define_highlight_rule -dfa_define_highlight_rule ("\\\\#{[^{}]*({[^{}]*({[^}]*}[^{}]*)*}[^{}]*)*}", - "Qcomment", $1); - -dfa_define_highlight_rule ("\\\\#.*$", "comment", $1); -dfa_define_highlight_rule ("^\\\\c([ \t].*)?$", "string", $1); -dfa_define_highlight_rule ("\\\\[\\\\{}\\-_]", "keyword0", $1); -dfa_define_highlight_rule ("\\\\[A-Za-tv-z][A-Za-z0-9]*", "keyword0", $1); -dfa_define_highlight_rule ("\\\\u[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]", - "keyword0", $1); -dfa_define_highlight_rule ("\\\\u[A-Fa-f0-9]?[A-Fa-f0-9]?[A-Fa-f0-9]?[A-Fa-f0-9]", - "keyword1", $1); -dfa_define_highlight_rule ("[{}]", "delimiter", $1); -dfa_define_highlight_rule (".", "normal", $1); -dfa_build_highlight_table ($1); -#else -define_highlight_rule ("\\\\#{[^{}]*({[^{}]*({[^}]*}[^{}]*)*}[^{}]*)*}", - "Qcomment", $1); - -define_highlight_rule ("\\\\#.*$", "comment", $1); -define_highlight_rule ("^\\\\c([ \t].*)?$", "string", $1); -define_highlight_rule ("\\\\[\\\\{}\\-_]", "keyword0", $1); -define_highlight_rule ("\\\\[A-Za-tv-z][A-Za-z0-9]*", "keyword0", $1); -define_highlight_rule ("\\\\u[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]", - "keyword0", $1); -define_highlight_rule ("\\\\u[A-Fa-f0-9]?[A-Fa-f0-9]?[A-Fa-f0-9]?[A-Fa-f0-9]", - "keyword1", $1); -define_highlight_rule ("[{}]", "delimiter", $1); -define_highlight_rule (".", "normal", $1); -build_highlight_table ($1); -#endif -#endif - -% This hook identifies lines containing comments as paragraph separator -define buttress_is_comment() { - bol (); - while (ffind ("\\\\#")) go_right (3); - ffind ("\\#"); % return value on stack -} - -variable Buttress_Ignore_Comment = 0; % if true, line containing a comment - % does not delimit a paragraph - -define buttress_paragraph_separator() { - bol(); - skip_white(); - if (eolp()) - return 1; - if (looking_at("\\c ") or looking_at("\\c\t") or - looking_at("\\c\n")) - return 1; - return not (Buttress_Ignore_Comment) and buttress_is_comment(); -} - -define buttress_wrap_hook() { - variable yep; - push_spot (); - yep = up_1 () and buttress_is_comment (); - pop_spot (); - if (yep) { - push_spot (); - bol_skip_white (); - insert ("\\# "); - pop_spot (); - } -} - -#ifexists mode_set_mode_info -mode_set_mode_info("Buttress", "fold_info", "\\# {{{\r\\# }}}\r\r"); -#endif - -define buttress_mode() { - variable mode = "Buttress"; - % use_keymap (mode); - set_mode (mode, 0x1 | 0x20); - set_buffer_hook ("par_sep", "buttress_paragraph_separator"); - set_buffer_hook ("wrap_hook", "buttress_wrap_hook"); - use_syntax_table (mode); - runhooks ("buttress_mode_hook"); -} |