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 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
|
% This file should not be byte-compiled.
% It is loaded from site.sl and permits various flavors of jed to share the
% same set of S-Lang files. It is written in RPN for efficiency.
#ifdef MSWINDOWS XWINDOWS MOUSE
. "mouse" evalfile pop
#endif
#ifdef MSWINDOWS
. 4 2 mouse_map_buttons % map Right to Middle
. 2 4 mouse_map_buttons % map Middle to Right
. 0 enable_top_status_line
. "wmenu.sl" evalfile pop
. simple_menu
#endif
#ifdef XWINDOWS
. "HOST" getenv =$1
% . $1 NULL != { "XJed@" $1 strcat x_set_window_name } if
. "skip_word" "^[[c" setkey %/* shift-right */
. "bskip_word" "^[[d" setkey %/* shift-left */
. "goto_top_of_window" "^[[a" setkey %/* shift-up */
. "goto_bottom_of_window" "^[[b" setkey %/* shift-down */
. "beg_of_line" "\e[1~" setkey % Home
. "eol_cmd" "\e[4~" setkey % End
#endif
define goto_visible_eol ()
{
#ifdef HAS_LINE_ATTR
if (down_1 ())
{
if (is_line_hidden ())
skip_hidden_lines_forward (1);
go_left_1 ();
}
#endif
eol ();
}
define mark_to_visible_eol ()
{
push_mark ();
goto_visible_eol ();
}
define transpose_lines ()
{
bol (); push_mark ();
#ifdef HAS_LINE_ATTR
mark_to_visible_eol ();
bufsubstr (); % on stack
go_right_1 ();
del_region();
skip_hidden_lines_backward (1);
bol();
insert(());
newline();
skip_hidden_lines_forward (1); % goes to bol
#else
line_as_string (); % on stack
go_right_1 ();
del_region();
go_up_1 (); bol();
insert(());
newline();
go_down_1 (); % goes to bol
#endif
}
#ifdef HAS_LINE_ATTR
define set_selective_display ()
{
variable c, arg = 1;
c = prefix_argument (-1);
if (c <= 1) arg = 0;
push_spot ();
bob ();
do
{
bol_skip_white ();
set_line_hidden (arg * (what_column () > c));
}
while (down_1 ());
pop_spot ();
}
setkey ("set_selective_display", "^X$");
autoload ("folding_mode", "folding");
add_completion ("folding_mode");
variable Fold_Mode_Ok = 0;
define fold_mode ()
{
if (Fold_Mode_Ok) folding_mode ();
}
#endif
#ifdef HAS_BLOCAL_VAR
define define_blocal_var (name, type, value)
{
create_blocal_var (name, type);
set_blocal_var (value, name);
}
#endif
#ifdef HAS_DFA_SYNTAX
set_highlight_cache_dir (extract_element(get_jed_library_path (), 0, ','));
#else
% dummy functions that enable jed to work in mixed environments
define enable_highlight_cache (x, y);
define define_highlight_rule (x,y,z);
define build_highlight_table (x);
#endif
#ifdef WIN32
MSDOS_Has_Long_File_Names = 1;
#else
# ifdef MSDOS
# ifdef 16_BIT_SYSTEM
MSDOS_Has_Long_File_Names = 0;
# else
$1 = getenv ("LFN");
if ($1 == NULL) $1 = "N";
MSDOS_Has_Long_File_Names = ("Y" == strup ($1));
# endif
# endif
#endif
|