File: tex.sl

package info (click to toggle)
jed 0.98.7-14
  • links: PTS
  • area: main
  • in suites: slink
  • size: 3,088 kB
  • ctags: 3,851
  • sloc: ansic: 29,315; makefile: 257; sh: 248
file content (73 lines) | stat: -rw-r--r-- 2,248 bytes parent folder | download | duplicates (2)
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
70
71
72
73
%
%  simple TeX mode for JED
%
%  When tex mode is loaded, 'tex_mode_hook' is called.  This hook will allow
%  users to customize the mode.  In particular, certain functions here have
%  no keybindings, e.g., 'latex_do_environment'.  So, in your jed.rc file,
%  add something like:
%    define tex_mode_hook () {
%       local_setkey ("latex_do_environment", "^C^E");
%    }
%  which binds the function to Ctrl-C Ctrl-E.


% Load the common definitions if not already loaded.
!if (is_defined ("tex_ldots")) () = evalfile ("texcom");


$1 = "TeX-Mode";

!if (keymap_p($1))
{
   make_keymap ($1);
   definekey ("tex_insert_quote", "\"", $1);
   definekey ("tex_insert_quote", "'", $1);
   definekey ("tex_blink_dollar", "$", $1);
   definekey ("tex_ldots", ".", $1);
}


%!% Mode useful for editing TeX and LaTeX modes.  
%!% Useful bindings:
%!%  '"'  :  tex_insert_quote
%!%  '\'' :  tex_insert_quote
%!%  '$'  :  tex_blink_dollar
%!%  '.'  :  tex_ldots.  Inserts a '.' except if preceeded by two dots.  In 
%!%           this case, the dots are converted to \ldots.
%!%
%!%  When tex mode is loaded, 'tex_mode_hook' is called.  This hook will allow
%!%  users to customize the mode.  In particular, certain functions here have
%!%  no keybindings, e.g., 'latex_do_environment'.  So, in your jed.rc file,
%!%  add something like:
%!%    define tex_mode_hook () {
%!%       local_setkey ("latex_do_environment", "^C^E");
%!%    }
%!%  which binds the function to Ctrl-C Ctrl-E.
define tex_mode ()
{
   variable mode = "TeX";
   variable texmode = "TeX-Mode";
   use_keymap (texmode);
   set_mode ("TeX", 0x1 | 0x20);
   set_buffer_hook ("par_sep", "tex_paragraph_separator");
   set_buffer_hook ("wrap_hook", "tex_wrap_hook");
   use_syntax_table (texmode);
   runhooks ("tex_mode_hook");
   % This is called after the hook to give the hook a chance to load the
   % abbrev table.
   if (abbrev_table_p (mode)) use_abbrev_table (mode);
}

%-----------------------------------------------------------%
#ifdef 0
define tex_info_find_node ()
{
   variable node;
   
   node = read_mini ("Node:", Null_String, Null_String);
   !if (strlen (node)) return;
   info_mode ();
   info_find_node ("(latex)top");
   info_find_node ("(latex)" + node);
}
#endif