├── changes.txt ├── lib ├── ff90.sl ├── emul.sl ├── colors │ ├── README │ ├── white1.sl │ ├── default1.sl │ ├── Xjed │ │ ├── black4.sl │ │ ├── elegant.sl │ │ ├── modern.sl │ │ ├── night.sl │ │ └── pastel0.sl │ ├── black1.sl │ ├── black2.sl │ ├── blue2.sl │ ├── blue1.sl │ ├── black3.sl │ ├── blue3.sl │ └── black4.sl ├── generic.hlp ├── emacs.hlp ├── vms_shell.com ├── aboutjed.hlp ├── aprocess.sl ├── jed.hlp ├── jed.conf ├── cua.hlp ├── simple.hlp ├── cpright.hlp ├── rot13.sl ├── paste.sl ├── pipe.sl ├── util.sl ├── binary.sl ├── iso-latin.sl ├── filter.sl ├── runpgm.sl ├── mimemisc.sl ├── linux.sl ├── wordstar.hlp ├── sortmisc.sl ├── seldisp.sl ├── README ├── tmisc.sl ├── abbrev.sl ├── jedusage.sl ├── iso-lat2.sl ├── dos437.sl ├── spicemod.sl ├── dos852.sl ├── untab.sl ├── nroff.sl ├── ide.hlp ├── tiasm.sl ├── win1250.sl ├── lisp.sl ├── iso-lat3.sl ├── dos850.sl ├── sort.sl ├── verilog.sl ├── replace.sl ├── edt.hlp ├── jedhelp.sl ├── tabs.sl ├── compat.sl ├── occur.sl ├── modeinfo.sl ├── backups.sl ├── iso2xxx.sl ├── regexp.sl ├── preparse.sl ├── xformreg.sl ├── man.sl ├── bookmark.sl ├── pushmode.sl ├── krconv.sl ├── tmmode.sl └── textmode.sl ├── doc ├── manual │ └── rgrep.1 ├── txt │ ├── undo.txt │ ├── xrenderfont.txt │ ├── filelock.txt │ ├── linux-keys.txt │ ├── rgrep.txt │ ├── color.txt │ ├── recentx.txt │ ├── wordstar.txt │ ├── viswrap.txt │ ├── menus.txt │ ├── sessions.txt │ └── compile.txt ├── tm │ ├── README │ ├── rtl │ │ ├── blocal.tm │ │ ├── eval.tm │ │ ├── message.tm │ │ ├── userinfo.tm │ │ └── rect.tm │ └── Makefile └── README ├── bin ├── w32 │ ├── g32shell.exe │ ├── w32shell.exe │ ├── README │ ├── Makefile │ └── w32shell.c └── vms │ ├── jed_mail.com │ └── init_jed.com ├── src ├── mkfiles │ ├── mkmake.exe │ ├── mkmake16.exe │ ├── README │ └── mkmake.c ├── TODO ├── dfasyntx.h ├── line.h ├── userinfo.h ├── lineattr.h ├── test │ ├── runtests.sh │ ├── test_replace.sl │ ├── test_narrow.sl │ ├── test_cmode.sl │ ├── test_search.sl │ └── test_expand.sl ├── blocal.h ├── version.h ├── win32.h ├── replace.h ├── abbrev.h ├── sig.h ├── copyright ├── jedwin.c ├── search.h ├── menu.h ├── modules.unx ├── jedlimit.h ├── vterm.h ├── text.h ├── vfile.h ├── scrwrap.h ├── gtkjed.h ├── display.h ├── hooks.h ├── jdmacros.h ├── ins.h ├── undo.h ├── jprocess.h ├── doskeys.h ├── colors.h ├── line.c ├── paste.h ├── DESCRIP.MMS ├── cmds.h ├── file.h └── misc.h ├── mkfiles ├── setpath.bat ├── m32init.bat └── makefile.m32 ├── desktop ├── xjed.desktop └── jed.desktop ├── autoconf ├── Makefile ├── mkinsdir.sh ├── scripts │ └── getsyslibs.sh └── Makefile.in ├── INSTALL.be ├── README ├── COPYRIGHT ├── info ├── dir.info └── jed.info └── INSTALL.w32 /changes.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jedsoft/jed/HEAD/changes.txt -------------------------------------------------------------------------------- /lib/ff90.sl: -------------------------------------------------------------------------------- 1 | variable F90_Default_Format = "fixed"; 2 | require ("f90"); 3 | -------------------------------------------------------------------------------- /doc/manual/rgrep.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jedsoft/jed/HEAD/doc/manual/rgrep.1 -------------------------------------------------------------------------------- /bin/w32/g32shell.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jedsoft/jed/HEAD/bin/w32/g32shell.exe -------------------------------------------------------------------------------- /bin/w32/w32shell.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jedsoft/jed/HEAD/bin/w32/w32shell.exe -------------------------------------------------------------------------------- /src/mkfiles/mkmake.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jedsoft/jed/HEAD/src/mkfiles/mkmake.exe -------------------------------------------------------------------------------- /src/mkfiles/mkmake16.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jedsoft/jed/HEAD/src/mkfiles/mkmake16.exe -------------------------------------------------------------------------------- /src/TODO: -------------------------------------------------------------------------------- 1 | 1. Allow abbreviation table to dynamically grow with words of 2 | arbitrary length. 3 | -------------------------------------------------------------------------------- /lib/emul.sl: -------------------------------------------------------------------------------- 1 | % Functions in this file allow jed to work with older versions of the 2 | % slang library. 3 | -------------------------------------------------------------------------------- /lib/colors/README: -------------------------------------------------------------------------------- 1 | This directory contains some predefined color schemes for JED. Feel 2 | free to add more. 3 | 4 | -------------------------------------------------------------------------------- /mkfiles/setpath.bat: -------------------------------------------------------------------------------- 1 | set PATH=C:\MinGW\bin;%PATH% 2 | set PATH=C:\MinGW\local\bin;%PATH% 3 | set PATH=C:\MinGW\local\jed\bin;%PATH% 4 | 5 | -------------------------------------------------------------------------------- /lib/generic.hlp: -------------------------------------------------------------------------------- 1 | No help file available for this mode. 2 | Press 'ESC-X describe_bindings' for a list of keybindings. 3 | Also press Ctrl-H ? for simple menus. 4 | -------------------------------------------------------------------------------- /src/dfasyntx.h: -------------------------------------------------------------------------------- 1 | #ifndef JED_DFA_SYNTAX_H_ 2 | #define JED_DFA_SYNTAX_H_ 3 | typedef struct Highlight Highlight; 4 | extern int jed_init_dfa_syntax (void); 5 | extern void jed_dfa_free_highlight_table (Highlight *); 6 | #endif 7 | -------------------------------------------------------------------------------- /lib/emacs.hlp: -------------------------------------------------------------------------------- 1 | JED Emacs keybindings: `^' means to use Ctrl key (e.g., ^X = Ctrl-X). 2 | ^X^C exit ^V PageDn ^Xu Undo ^X^W write to file ^A beg of line 3 | ^L redraw ESC V PageUp ^D delete ^X^F open a file ^E end of line 4 | -------------------------------------------------------------------------------- /bin/w32/README: -------------------------------------------------------------------------------- 1 | w32shell.exe and g32shell.exe are necessary for the win32 versions of 2 | jed to execute shell commands. Do NOT move them from this directory. 3 | 4 | g32shell.exe performs globbing on its command line arguments, but 5 | w32shell.exe does not. 6 | -------------------------------------------------------------------------------- /doc/txt/undo.txt: -------------------------------------------------------------------------------- 1 | The `undo' function is bound to keys `Ctrl-_' and `Ctrl-X u'. There is 2 | no `redo' function. However, it is possible to `redo' by first 3 | pressing `Ctrl-G' followed immediately by either `Ctrl-_' or `Ctrl-X u'. 4 | That is, `Ctrl-G' tells the `undo' function to `redo'. 5 | -------------------------------------------------------------------------------- /desktop/xjed.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Version=1.0 3 | Name=XJed 4 | GenericName=Text Editor 5 | Comment=X version of Jed Editor 6 | Type=Application 7 | TryExec=jed 8 | Exec=xjed %F 9 | Categories=Utility;TextEditor; 10 | MimeType=text/plain;text/html; 11 | Keywords=Text;editor 12 | Icon=xjed 13 | -------------------------------------------------------------------------------- /desktop/jed.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Version=1.0 3 | Name=Jed 4 | GenericName=Text Editor 5 | Comment=Edit text files 6 | Type=Application 7 | TryExec=jed 8 | Exec=jed %F 9 | Terminal=true 10 | Categories=Utility;TextEditor; 11 | MimeType=text/plain;text/html; 12 | Keywords=Text;editor 13 | Icon=jed 14 | -------------------------------------------------------------------------------- /lib/vms_shell.com: -------------------------------------------------------------------------------- 1 | $! 2 | $! This is used by JED to execute a command in the shell. I do 3 | $! it this way because not every command takes a /output qualifier 4 | $! 5 | $ define/user/nolog sys$error sys$output 6 | $ define/user/nolog sys$input nl: 7 | $ 'p1' 'p2' 'p3' 'p4' 'p5' 'p6' 'p7' 'p8' 'p9' 8 | $ exit 9 | -------------------------------------------------------------------------------- /lib/aboutjed.hlp: -------------------------------------------------------------------------------- 1 | Copyright (C) 1994, 1999, 2000-2007 John E. Davis 2 | Email comments or suggestions to jed@jedsoft.org. 3 | 4 | Jed Home Page: 5 | http://www.jedsoft.org/jed/ 6 | 7 | Newsgroups: 8 | alt.lang.s-lang 9 | comp.editors 10 | 11 | Mailing lists: 12 | http://www.jedsoft.org/jed/mailinglists/ 13 | -------------------------------------------------------------------------------- /lib/aprocess.sl: -------------------------------------------------------------------------------- 1 | define aprocess_stringify_status (pid, flags, status) 2 | { 3 | variable str; 4 | 5 | switch (flags) 6 | { case 2: "stopped by signal";} 7 | { case 4: "exit";} 8 | { case 8: "killed by signal";} 9 | { 10 | "??"; 11 | } 12 | str = (); 13 | return sprintf ("%s %d", str, status); 14 | } 15 | -------------------------------------------------------------------------------- /autoconf/Makefile: -------------------------------------------------------------------------------- 1 | ../configure: aclocal.m4 configure.ac 2 | /bin/rm -rf autom4te.cache 3 | autoconf && mv ./configure .. 4 | update: config.sub config.guess 5 | config.guess: /usr/share/misc/config.guess 6 | /bin/cp -f /usr/share/misc/config.guess config.guess 7 | config.sub: /usr/share/misc/config.sub 8 | /bin/cp -f /usr/share/misc/config.sub config.sub 9 | -------------------------------------------------------------------------------- /src/line.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1992-2023 John E. Davis 2 | * This file is part of JED editor library source. 3 | * 4 | * You may distribute this file under the terms the GNU General Public 5 | * License. See the file COPYING for more information. 6 | */ 7 | extern void swap_lines(void); 8 | extern int split_line(void); 9 | extern void splice_line(void); 10 | -------------------------------------------------------------------------------- /lib/jed.hlp: -------------------------------------------------------------------------------- 1 | Basic JED Commands: `^' means to use Ctrl key (e.g., ^D = Ctrl-D) 2 | ^KE exit ^D pagedown ^FF search ^K^B set mark 3 | ^V delete ^U pageup ^FB search back ^KK copy region 4 | ^E end of line ^K^W write buffer ^K^R replace ^K^P paste 5 | ^B beginning of line ^KG find file ^R redraw ^K^V cut region 6 | -------------------------------------------------------------------------------- /lib/jed.conf: -------------------------------------------------------------------------------- 1 | % -*- slang -*- 2 | 3 | % This is a sample jed.conf that the user may put in /etc or /usr/local/etc 4 | % to setup some defaults for all users. 5 | 6 | _Jed_Default_Emulation = "emacs"; 7 | _Jed_Default_Color_Scheme = "blue2"; 8 | %Info_Directory = "/usr/info,/usr/share/info"; 9 | %auto_compression_mode (1); 10 | %enable_dfa_syntax_for_mode ("PostScript", "TCL"); 11 | -------------------------------------------------------------------------------- /src/userinfo.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1999-2023 John E. Davis 2 | * This file is part of JED editor library source. 3 | * 4 | * You may distribute this file under the terms the GNU General Public 5 | * License. See the file COPYING for more information. 6 | */ 7 | extern int jed_init_userinfo (void); 8 | extern char *jed_get_hostname (void); 9 | extern char *jed_get_username (void); 10 | -------------------------------------------------------------------------------- /lib/cua.hlp: -------------------------------------------------------------------------------- 1 | Basic Commands in CUA mode: 2 | File: Region: Search/Replace: Edit: Emergency: 3 | ^Q exit ^C copy ^FF find forward ^A mark all ^H/F1 help 4 | ^O open ^X kill ^L/F3 find next ^B format paragraph ^Z undo 5 | ^S/F2 save ^V paste ^FE regexp search ^K kill line ^D abort 6 | ^P print ^FR replace ^J goto line 7 | -------------------------------------------------------------------------------- /src/lineattr.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1992-2023 John E. Davis 2 | * This file is part of JED editor library source. 3 | * 4 | * You may distribute this file under the terms the GNU General Public 5 | * License. See the file COPYING for more information. 6 | */ 7 | extern SLang_Intrin_Fun_Type JedLine_Intrinsics[]; 8 | extern void jed_skip_hidden_lines_backward (int *); 9 | extern void jed_skip_hidden_lines_forward (int *); 10 | -------------------------------------------------------------------------------- /lib/simple.hlp: -------------------------------------------------------------------------------- 1 | Press Control-X to get simple menus or (^K = Control-K): 2 | ^KE exit ^D pagedown ^FF search ^K^B set mark 3 | ^V delete ^U pageup ^FB search back ^KK copy region 4 | ^E end of line ^K^W write buffer ^K^R replace ^K^P paste 5 | ^B beginning of line ^KG find file ^R redraw ^K^V cut region 6 | ^_ undo ^H^H this help ^Hi jed documentation 7 | -------------------------------------------------------------------------------- /src/test/runtests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | jed="$1" 4 | if [ ! -x "$jed" ]; then 5 | echo "Usage: $0 /path/to/jed" 6 | exit 1 7 | fi 8 | 9 | test_dir=`dirname "$0"` 10 | jed_root=$test_dir/../.. 11 | 12 | export JED_ROOT="$jed_root" 13 | jedscript="$jed -script" 14 | 15 | failed=0 16 | for X in $test_dir/test_*.sl 17 | do 18 | echo Running $jedscript $X 19 | if ! $jedscript ./$X 20 | then 21 | failed=1 22 | fi 23 | done 24 | exit $failed 25 | -------------------------------------------------------------------------------- /lib/cpright.hlp: -------------------------------------------------------------------------------- 1 | 2 | 3 | This is a scratch buffer. It is NOT saved when you exit. 4 | 5 | To access the menus, press F10 or ESC-m and the use the arrow 6 | keys to navigate. 7 | 8 | Latest version information is available on the web from 9 | . To subscribe to the jed-users 10 | mailing list, see . 11 | 12 | Copyright (C) 1994-2025 John E. Davis 13 | Email comments or suggestions to . 14 | -------------------------------------------------------------------------------- /bin/w32/Makefile: -------------------------------------------------------------------------------- 1 | # This Makefile builds two executables: 2 | # g32shell.exe: performs globbing on its command line arguments 3 | # w32shell.exe: performs no globbing 4 | # 5 | # The MING32 is assumed. 6 | CC = gcc 7 | CFLAGS = -O2 -W -Wall 8 | LDFLAGS = -s 9 | 10 | COMPILE = $(CC) $(CFLAGS) $(LDFLAGS) 11 | EXECS = g32shell.exe w32shell.exe 12 | 13 | all: $(EXECS) 14 | g32shell.exe: w32shell.c 15 | $(COMPILE) -o g32shell w32shell.c 16 | w32shell.exe: w32shell.c 17 | $(COMPILE) -DNO_GLOBBING -o w32shell w32shell.c 18 | 19 | -------------------------------------------------------------------------------- /src/blocal.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1992-2023 John E. Davis 2 | * This file is part of JED editor library source. 3 | * 4 | * You may distribute this file under the terms the GNU General Public 5 | * License. See the file COPYING for more information. 6 | */ 7 | #if JED_HAS_BUFFER_LOCAL_VARS 8 | 9 | typedef struct _Jed_BLocal_Table_Type Jed_BLocal_Table_Type; 10 | 11 | extern int jed_blocal_init (void); 12 | extern void jed_delete_blocal_vars (Jed_BLocal_Table_Type *); 13 | 14 | #endif /* JED_HAS_BUFFER_LOCAL_VARS */ 15 | -------------------------------------------------------------------------------- /src/version.h: -------------------------------------------------------------------------------- 1 | #ifndef JED_VERSION 2 | #define JED_VERSION 9920 3 | 4 | #define JED_VERSION_STR "pre0.99.20-197" 5 | 6 | /* Copyright (c) 1999, 2000, 2001, 2005-2023 John E. Davis 7 | * This file is part of JED editor library source. 8 | * 9 | * You may distribute this file under the terms the GNU General Public 10 | * License. See the file COPYING for more information. 11 | */ 12 | 13 | extern int Jed_Version_Number; 14 | extern char *Jed_Version_String; 15 | 16 | extern void jed_show_version (FILE *); 17 | 18 | #endif /* JED_VERSION */ 19 | -------------------------------------------------------------------------------- /src/win32.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2007-2023 John E. Davis 2 | * This file is part of JED editor library source. 3 | * 4 | * You may distribute this file under the terms the GNU General Public 5 | * License. See the file COPYING for more information. 6 | */ 7 | 8 | #ifndef _JED_WIN32_H_ 9 | #define _JED_WIN32_H_ 10 | extern FILE *w32_popen(char *, char *); 11 | extern int w32_pclose(FILE *); 12 | extern char *w32_build_command (char **, unsigned int); 13 | extern int w32_init_subprocess_support (int); 14 | extern int jed_init_w32_support (void); 15 | #endif 16 | -------------------------------------------------------------------------------- /INSTALL.be: -------------------------------------------------------------------------------- 1 | BeOS is largely Unix/GNU compatible so for installing you should read the 2 | instructions in INSTALL.unx. But there are a few issues: 3 | 4 | - If you get the message 'error: cannot guess host type; you must specifiy 5 | one' you need a autoconf/config.guess and autoconf/config.sub. Those from 6 | autoconf-2.13 work. 7 | 8 | - BeOS neither needs nor supports -lm. You should remove them (after 9 | configure) from the Makefile manually. 10 | 11 | - BeOS uses a blinking white-on-black cursor. This is largely unreadable in 12 | the default Jed 0.99 color-scheme. 13 | -------------------------------------------------------------------------------- /mkfiles/m32init.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | echo - Generating Makefile in src... 3 | src\mkfiles\mkmake WIN32 MINGW32 DLL < src\mkfiles\makefile.all > src\Makefile 4 | 5 | echo - Creating config file... 6 | copy src\jedconf.h src\config.h 7 | 8 | echo - Creating a top-level Makefile 9 | copy mkfiles\makefile.m32 Makefile 10 | 11 | echo Now run mingw32-make to build the editor. But first, you should 12 | echo look at Makefile and change the installation locations if 13 | echo necessary. In particular, the PREFIX variable in the top-level 14 | echo Makefile controls where the editor will be installed. 15 | echo - 16 | -------------------------------------------------------------------------------- /src/replace.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1992-2023 John E. Davis 2 | * This file is part of JED editor library source. 3 | * 4 | * You may distribute this file under the terms the GNU General Public 5 | * License. See the file COPYING for more information. 6 | */ 7 | extern int Replace_Preserve_Case; 8 | extern SLang_Intrin_Fun_Type Jed_Other_Intrinsics []; 9 | #ifndef SIXTEEN_BIT_SYSTEM 10 | extern void append_region_to_kill_array (int *); 11 | extern void prepend_region_to_kill_array (int *); 12 | extern void insert_from_kill_array (int *); 13 | extern void copy_region_to_kill_array (int *); 14 | extern int Kill_Array_Size; 15 | #endif 16 | -------------------------------------------------------------------------------- /lib/rot13.sl: -------------------------------------------------------------------------------- 1 | %% 2 | %% rot13.sl---- rotates text by 13 characters 3 | %% 4 | define rot13 () 5 | { 6 | variable i, j; 7 | 8 | check_region (1); % spot pushed 9 | 10 | variable a = String_Type[256]; 11 | _for ('A', 'M', 1) 12 | { 13 | i = (); 14 | a[i] = char (i + 13); 15 | % Now take care of lower case ones 16 | i = i | 0x20; 17 | a[i] = char (i + 13); 18 | } 19 | 20 | _for ('N', 'Z', 1) 21 | { 22 | i = (); 23 | a[i] = char (i - 13); 24 | % Now take care of lower case ones 25 | i = i | 0x20; 26 | a[i] = char (i - 13); 27 | } 28 | translate_region (a); 29 | pop_spot (); 30 | } 31 | -------------------------------------------------------------------------------- /doc/tm/README: -------------------------------------------------------------------------------- 1 | The .tm files in this directory form the source for documentation of 2 | jed specific intrinsic functions and variables. The Makefile produces 3 | documentation in a variety formats via SGML-Tools. 4 | 5 | The documentation for the library functions (jed/lib/*.sl) are 6 | actually in the .sl files themselves. The documentation is stripped 7 | via sl2tm and then processed via tm2txt. Both these programs may be 8 | found in the slang distribution (slang/doc/tm/tools/). 9 | 10 | To produce .sgml files from the .tm source, you will need to install 11 | the text-macro distribution. See http://www.jedsoft.org/ for 12 | availablity. 13 | 14 | -------------------------------------------------------------------------------- /lib/paste.sl: -------------------------------------------------------------------------------- 1 | define paste () 2 | { 3 | flush ("Ready for data..."); 4 | 5 | if (0 == input_pending (300)) 6 | { 7 | message ("You have taken too much time"); 8 | return; 9 | } 10 | variable as = _test_buffer_flag (2); 11 | ERROR_BLOCK 12 | { 13 | if (as) _set_buffer_flag (2); 14 | } 15 | _unset_buffer_flag (2); 16 | 17 | flush ("Pasting in progress..."); 18 | while (input_pending (10)) 19 | { 20 | variable ch = _getkey (); 21 | if (ch == '\r') 22 | { 23 | ch = '\n'; 24 | } 25 | insert_byte (ch); 26 | update (0); 27 | } 28 | EXECUTE_ERROR_BLOCK; 29 | message ("Done"); 30 | } 31 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | README file for JED. 2 | 3 | For installation instructions on 4 | 5 | Unix: 6 | read INSTALL.unx 7 | 8 | VMS: 9 | read INSTALL.vms 10 | 11 | Windows: 12 | read INSTALL.pc 13 | 14 | Then, read INSTALL for more installation tips. For changes and new 15 | features, read changes.txt. 16 | 17 | Addition information about JED is available from 18 | The documentation for the slang library 19 | and interpreter is available from . 20 | 21 | A mailing list is also available. See 22 | for more information 23 | about it. 24 | -------------------------------------------------------------------------------- /lib/pipe.sl: -------------------------------------------------------------------------------- 1 | variable Last_Process_Command = Null_String; 2 | 3 | define process_region () 4 | { 5 | variable cmd, tmp_file; 6 | cmd = read_mini ("Pipe to command:", Last_Process_Command, Null_String); 7 | ifnot (strlen (cmd)) return; 8 | 9 | Last_Process_Command = cmd; 10 | 11 | tmp_file = make_tmp_file ("/tmp/jedpipe"); 12 | cmd = strncat (cmd, " > ", tmp_file, " 2>&1", 4); 13 | 14 | ifnot (dupmark ()) error ("Mark not set."); 15 | 16 | if (pipe_region (cmd)) 17 | { 18 | error ("Process returned a non-zero exit status."); 19 | } 20 | del_region (); 21 | () = insert_file (tmp_file); 22 | () = delete_file (tmp_file); 23 | } 24 | 25 | -------------------------------------------------------------------------------- /src/abbrev.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1992-2023 John E. Davis 2 | * This file is part of JED editor library source. 3 | * 4 | * You may distribute this file under the terms the GNU General Public 5 | * License. See the file COPYING for more information. 6 | */ 7 | extern void use_abbrev_table (char *); 8 | extern void define_abbrev (char *, char *, char *); 9 | extern void create_abbrev_table (char *, char *); 10 | extern int jed_expand_abbrev (SLwchar_Type); 11 | extern int abbrev_table_p (char *); 12 | extern void dump_abbrev_table (char *); 13 | extern void what_abbrev_table (void); 14 | extern int list_abbrev_tables (void); 15 | extern void delete_abbrev_table (char *); 16 | 17 | -------------------------------------------------------------------------------- /lib/util.sl: -------------------------------------------------------------------------------- 1 | %% 2 | %% utility functions which Must be available (e.g., autoload) 3 | %% 4 | 5 | %% 6 | %% A routine that trims the buffer by: removing excess whitespace at the 7 | %% end of lines and removing excess newlines 8 | %% 9 | 10 | define trim_buffer() 11 | { 12 | push_spot(); 13 | bob(); 14 | do 15 | { 16 | eol_trim(); bol(); 17 | if (eolp()) 18 | { 19 | go_down_1 (); 20 | while (eol_trim(), bol(), 21 | eolp() and not(eobp())) del(); 22 | } 23 | } 24 | while (down_1 ()); 25 | 26 | bob(); eol_trim(); bol(); 27 | if (eolp() and not(eobp ())) del(); 28 | pop_spot(); 29 | ifnot (BATCH) message ("done."); 30 | } 31 | 32 | -------------------------------------------------------------------------------- /lib/binary.sl: -------------------------------------------------------------------------------- 1 | % It is used to read a file in binary mode. 2 | 3 | define find_binary_file () 4 | { 5 | variable file, bytes, len, pos; 6 | 7 | file = read_file_from_mini ("Find Binary File:"); 8 | try 9 | { 10 | set_file_translation (1); 11 | () = find_file (file); 12 | } 13 | finally set_file_translation (0); 14 | no_mode(); 15 | set_overwrite(1); 16 | % 17 | % set the binary file flags 18 | getbuf_info(); 19 | setbuf_info(() | 0x200); 20 | 21 | bytes = count_chars(); 22 | if (string_match(bytes, ".*of \\([0-9]+\\)$", 1)) 23 | { 24 | (pos, len) = string_match_nth(1); 25 | bytes = substr(bytes, pos + 1, len); 26 | message (bytes + " bytes."); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/iso-latin.sl: -------------------------------------------------------------------------------- 1 | %% 2 | %% Initializes upper/lowercase lookup tables for ISO Latin 1 3 | %% Information here derived from staring at a vt420 4 | %% 5 | if (_slang_utf8_ok == 0) 6 | { 7 | . 0 64 1 { dup define_case } _for 8 | . 65 90 1 { dup 32 + define_case } _for 9 | . 91 96 1 { dup define_case } _for 10 | . 123 191 1 { dup define_case } _for 11 | . 192 222 1 { dup 32 + define_case } _for 12 | 13 | . 215 215 define_case 14 | . 223 223 define_case 15 | . 247 247 define_case 16 | . 255 255 define_case 17 | 18 | %. "0-9a-zA-Z\d191-\d214\d216-\d222\d224-\d246\d248-\d254" define_word 19 | %. "0-9a-zA-Z\d191-\d214\d216-\d246\d248-\d255" define_word 20 | . "0-9a-zA-Z\d192-\d214\d216-\d246\d248-\d255" define_word 21 | } 22 | -------------------------------------------------------------------------------- /autoconf/mkinsdir.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # mkinstalldirs --- make directory hierarchy 3 | # Author: Noah Friedman 4 | # Created: 1993-05-16 5 | # Public domain 6 | 7 | errstatus=0 8 | 9 | for file 10 | do 11 | set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` 12 | shift 13 | 14 | pathcomp= 15 | for d in ${1+"$@"} ; do 16 | pathcomp="$pathcomp$d" 17 | case "$pathcomp" in 18 | -* ) pathcomp=./$pathcomp ;; 19 | esac 20 | 21 | if test ! -d "$pathcomp"; then 22 | echo "mkdir $pathcomp" 1>&2 23 | mkdir "$pathcomp" || errstatus=$? 24 | fi 25 | 26 | pathcomp="$pathcomp/" 27 | done 28 | done 29 | 30 | exit $errstatus 31 | 32 | # mkinstalldirs ends here 33 | -------------------------------------------------------------------------------- /src/sig.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1992-2023 John E. Davis 2 | * This file is part of JED editor library source. 3 | * 4 | * You may distribute this file under the terms the GNU General Public 5 | * License. See the file COPYING for more information. 6 | */ 7 | #ifndef _JED_SIG_H_ 8 | #define _JED_SIG_H_ 9 | 10 | #ifndef __MSDOS_16BIT__ 11 | extern void init_signals (void); 12 | extern void jed_reset_signals (void); 13 | #endif 14 | extern int Stdin_Is_TTY; 15 | 16 | #ifdef SIGTSTP 17 | # ifdef __unix__ 18 | extern void sig_sys_spawn_cmd(int); 19 | extern int Signal_Sys_Spawn_Flag; /* used if something else sends stop */ 20 | # endif 21 | extern int Jed_Handle_SIGTSTP; 22 | #endif 23 | 24 | extern int jed_handle_interrupt (void); 25 | 26 | #endif /* _JED_SIG_H_ */ 27 | -------------------------------------------------------------------------------- /COPYRIGHT: -------------------------------------------------------------------------------- 1 | Copyright (c) 1992, 1998, 2000, 2005, 2006-2025 John E. Davis 2 | 3 | This program is free software; you can redistribute it and/or modify it 4 | under the terms of the GNU General Public License as published by the Free 5 | Software Foundation; either version 2 of the License, or (at your option) 6 | any later version. 7 | 8 | This program is distributed in the hope that it will be useful, but WITHOUT 9 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 11 | more details. 12 | 13 | You should have received a copy of the GNU General Public License along 14 | with this program; if not, write to the Free Software Foundation, Inc., 675 15 | Mass Ave, Cambridge, MA 02139, USA. 16 | -------------------------------------------------------------------------------- /src/copyright: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1992, 1993 by John E. Davis 2 | 3 | Permission to use, copy, modify, and distribute this software and its 4 | documentation for any non-commercial purpose and without fee is hereby 5 | granted, provided that the above copyright notice appear in all copies 6 | and that both that copyright notice and this permission notice appear in 7 | supporting documentation. 8 | 9 | This software is provided AS IS with no warranties of any kind. The author 10 | shall have no liability with respect to the infringement of copyrights, 11 | trade secrets or any patents by this software or any part thereof. In no 12 | event will the author be liable for any lost revenue or profits or other 13 | special, indirect and consequential damages. */ 14 | -------------------------------------------------------------------------------- /src/jedwin.c: -------------------------------------------------------------------------------- 1 | /* -*- default window hooks for non-GUI jed */ 2 | /* Copyright (c) 2009-2023 John E. Davis 3 | * This file is part of JED editor library source. 4 | * 5 | * You may distribute this file under the terms the GNU General Public 6 | * License. See the file COPYING for more information. 7 | */ 8 | 9 | #include "config.h" 10 | #include "jed-feat.h" 11 | #include "window.h" 12 | 13 | int (*jed_new_window_cb) (Window_Type *) = NULL; 14 | void (*jed_free_window_cb) (Window_Type *) = NULL; 15 | int (*jed_create_mini_window_cb) (Window_Type *) = NULL; 16 | int (*jed_leave_window_cb) (Window_Type *) = NULL; 17 | int (*jed_enter_window_cb) (Window_Type *) = NULL; 18 | int (*jed_split_window_cb) (Window_Type *, Window_Type *) = NULL; 19 | int (*jed_window_geom_change_cb) (void) = NULL; 20 | 21 | -------------------------------------------------------------------------------- /src/search.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1992-2023 John E. Davis 2 | * This file is part of JED editor library source. 3 | * 4 | * You may distribute this file under the terms the GNU General Public 5 | * License. See the file COPYING for more information. 6 | */ 7 | 8 | extern int search(char *, int, int); 9 | extern int search_forward(char *); 10 | extern int search_backward(char *); 11 | extern int forward_search_line(char *); 12 | extern int backward_search_line(char *); 13 | extern int bol_fsearch(char *); 14 | extern int bol_bsearch(char *); 15 | extern int re_search_forward(char *); 16 | extern int re_search_backward(char *); 17 | extern int replace_match(char *, int *); 18 | extern void regexp_nth_match(int *); 19 | int insert_file_region (char *, char *, char *); 20 | int search_file(char *, char *, int *); 21 | 22 | -------------------------------------------------------------------------------- /src/menu.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2007-2023 John E. Davis 2 | * This file is part of JED editor library source. 3 | * 4 | * You may distribute this file under the terms the GNU General Public 5 | * License. See the file COPYING for more information. 6 | */ 7 | 8 | #ifndef _JED_MENU_H_ 9 | #define _JED_MENU_H_ 1 10 | 11 | typedef struct _Menu_Bar_Type Menu_Bar_Type; 12 | 13 | extern int jed_init_menus (void); 14 | extern int jed_redraw_menus (void); 15 | extern int jed_select_menu_bar (void); 16 | extern int jed_exit_menu_bar (void); 17 | extern void jed_delete_menu_bar (Menu_Bar_Type *); 18 | 19 | extern int jed_menu_handle_mouse (unsigned int, int, int, int, int); 20 | 21 | extern SLang_Key_Type *jed_menu_do_key (void); 22 | extern int Jed_Menus_Active; 23 | extern void jed_notify_menu_buffer_changed (void); 24 | #endif 25 | -------------------------------------------------------------------------------- /lib/filter.sl: -------------------------------------------------------------------------------- 1 | define filter_region () 2 | { 3 | variable cmd, file; 4 | 5 | check_region (1); % spot pushed 6 | () = dupmark (); 7 | 8 | ERROR_BLOCK 9 | { 10 | pop_mark (0); 11 | pop_spot (); 12 | } 13 | 14 | do 15 | { 16 | cmd = read_mini ("Filter command:", Null_String, Null_String); 17 | } 18 | while (not (strlen (cmd))); 19 | 20 | file = make_tmp_file ("/tmp/jedfilter"); 21 | 22 | ERROR_BLOCK 23 | { 24 | pop_spot (); 25 | () = delete_file (file); 26 | } 27 | () = pipe_region (sprintf ("%s > %s", cmd, file)); 28 | 29 | push_spot (); 30 | if (-1 == insert_file (file)) 31 | { 32 | pop_spot (); 33 | error ("Error encountered running filter."); 34 | } 35 | pop_spot (); 36 | 37 | del_region (); 38 | 39 | EXECUTE_ERROR_BLOCK; 40 | } 41 | 42 | -------------------------------------------------------------------------------- /lib/runpgm.sl: -------------------------------------------------------------------------------- 1 | #ifdef XWINDOWS 2 | custom_variable ("XTerm_Pgm", "xterm"); 3 | define _jed_run_program_hook (s) 4 | { 5 | s = strtrim_end (s, " \t&"); 6 | return system (sprintf ("%s -e %s &", XTerm_Pgm, s)); 7 | } 8 | #endif 9 | 10 | #ifdef WIN32 11 | custom_variable("W32shell_Perform_Globbing", 0); 12 | define _win32_get_helper_app_name () 13 | { 14 | variable s, h; 15 | 16 | s = getenv ("COMSPEC"); 17 | if (s == NULL) 18 | s = "cmd.exe"; 19 | if (W32shell_Perform_Globbing) 20 | h = dircat (Jed_Bin_Dir, "w32/g32shell.exe"); 21 | else 22 | h = dircat (Jed_Bin_Dir, "w32/w32shell.exe"); 23 | 24 | sprintf ("%s %s /c", h, s); 25 | } 26 | #endif 27 | 28 | public define vrun_program () 29 | { 30 | variable args = __pop_args (_NARGS); 31 | return run_program (sprintf (__push_args (args))); 32 | } 33 | 34 | -------------------------------------------------------------------------------- /src/modules.unx: -------------------------------------------------------------------------------- 1 | buffer abbrev.h 2 | cmds blocal.h 3 | misc buffer.h 4 | file cmds.h 5 | main display.h 6 | ins file.h 7 | sig hooks.h 8 | sysdep indent.h 9 | screen ins.h 10 | paste jdmacros.h 11 | ledit jed-feat.h 12 | line jprocess.h 13 | search keymap.h 14 | text ledit.h 15 | keymap line.h 16 | replace lineattr.h 17 | window menu.h 18 | undo misc.h 19 | vfile paste.h 20 | intrin replace.h 21 | syntax screen.h 22 | abbrev search.h 23 | indent sig.h 24 | jprocess sysdep.h 25 | lineattr text.h 26 | blocal undo.h 27 | mouse userinfo.h 28 | menu version.h 29 | userinfo vfile.h 30 | lock vmsmail.h 31 | version vterm.h 32 | hooks window.h 33 | colors 34 | -------------------------------------------------------------------------------- /lib/mimemisc.sl: -------------------------------------------------------------------------------- 1 | require ("base64"); 2 | 3 | private define gather (sp, s) 4 | { 5 | @sp = @sp + s; 6 | } 7 | 8 | define mime_base64_decode (str) 9 | { 10 | variable s = ""; 11 | variable b = _base64_decoder_new (&gather, &s); 12 | _base64_decoder_accumulate (b, str); 13 | _base64_decoder_close (b); 14 | return s; 15 | } 16 | 17 | define mime_base64_encode (str) 18 | { 19 | variable s = ""; 20 | variable b = _base64_encoder_new (&gather, &s); 21 | _base64_encoder_accumulate (b, str); 22 | _base64_decoder_close (b); 23 | return str; 24 | } 25 | 26 | require ("iconv"); 27 | define mime_iconv (to, from, str) 28 | { 29 | variable save = str; 30 | try 31 | { 32 | variable f = iconv_open (to, from); 33 | str = iconv (f, str); 34 | iconv_close (f); 35 | } 36 | catch AnyError: str = save; 37 | return str; 38 | } 39 | -------------------------------------------------------------------------------- /src/jedlimit.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2007-2023 John E. Davis 2 | * This file is part of JED editor library source. 3 | * 4 | * You may distribute this file under the terms the GNU General Public 5 | * License. See the file COPYING for more information. 6 | */ 7 | 8 | #ifndef _JED_LIMIT_H_ 9 | #define _JED_LIMIT_H_ 10 | 11 | #include 12 | 13 | #if defined(SIXTEEN_BIT_SYSTEM) 14 | # define JED_KBD_MACRO_SIZE 256 15 | # define JED_MAX_ADD_COMPLETIONS 32 16 | #else 17 | # define JED_KBD_MACRO_SIZE 8192 18 | # define JED_MAX_ADD_COMPLETIONS 512 19 | #endif 20 | 21 | #ifdef PATH_MAX 22 | # define JED_MAX_PATH_LEN PATH_MAX 23 | #else 24 | # ifdef IBMPC_SYSTEM 25 | # define JED_MAX_PATH_LEN 256 26 | # else 27 | # define JED_MAX_PATH_LEN 1024 28 | # endif 29 | #endif 30 | 31 | #define JED_MAX_STATUS_LEN 256 32 | 33 | #endif /* _JED_LIMIT_H_ */ 34 | -------------------------------------------------------------------------------- /lib/linux.sl: -------------------------------------------------------------------------------- 1 | % 2 | % Special file for Linux systems. 3 | % 4 | 5 | % This file sets up the console keys pgup/dn, etc. 6 | % To use it, simply rename it to defaults.sl. 7 | 8 | % The directory where info files are kept. Modify this appropriately. See 9 | % 'install.all' for a discussion of this. 10 | 11 | %Info_Directory = ??? 12 | 13 | $1 = getenv ("TERM"); 14 | if ($1 == NULL) $1 = ""; 15 | if (is_list_element ("linux,console,con80x25,con80x28", $1, ',')) 16 | { 17 | USE_ANSI_COLORS = 1; % uncomment if your console is a color one! 18 | OUTPUT_RATE = 0; 19 | TERM_CANNOT_SCROLL = -1; % Truth is, linux console does not scroll well. 20 | setkey("bol_cmd", "\e[1~"); % home 21 | setkey("toggle_overwrite", "\e[2~"); % insert 22 | setkey("delete_char_cmd", "\e[3~"); % delete 23 | setkey("eol_cmd", "\e[4~"); % end 24 | setkey("page_up", "\e[5~"); 25 | setkey("page_down", "\e[6~"); 26 | } 27 | -------------------------------------------------------------------------------- /src/vterm.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1992-2023 John E. Davis 2 | * This file is part of JED editor library source. 3 | * 4 | * You may distribute this file under the terms the GNU General Public 5 | * License. See the file COPYING for more information. 6 | */ 7 | extern int VTerm_Num_Rows, VTerm_Num_Cols; 8 | extern SLsmg_Char_Type **VTerm_Display; 9 | extern int VTerm_Suspend_Update; 10 | 11 | extern int vterm_init_display (int, int); 12 | extern int vterm_reset_display (void); 13 | extern void vterm_set_scroll_region (int, int); 14 | extern void vterm_delete_nlines (int); 15 | extern void vterm_reverse_index (int); 16 | extern void vterm_del_eol (void); 17 | extern void vterm_goto_rc (int, int); 18 | extern void vterm_reverse_video (int); 19 | extern void vterm_cls (void); 20 | extern void vterm_write_nchars (char *, unsigned int); 21 | extern void vterm_forward_cursor (int); 22 | /* extern void vterm_write (unsigned short *, unsigned int); */ 23 | -------------------------------------------------------------------------------- /doc/txt/xrenderfont.txt: -------------------------------------------------------------------------------- 1 | XJed is able to utilize the X Render extensions in order to display 2 | anti-aliased fonts. If you're going to use this, do the following easy 3 | steps: 4 | 5 | 1. Read http://www.xfree86.org/~keithp/render/aafont.txt (and act) 6 | 2. Make sure "xterm -fa mono" renders anti-aliased fonts 7 | 3. Edit the jed src/Makefile (AFTER you've run configure) and modify the 8 | XRENDERFONT_LIBS and XRENDERFONT_CFLAGS variables. 9 | 4. Build JED 10 | 5. With the newly compiled xjed, try something like: 11 | xjed -fn mono -fs 16 masterpiece.c 12 | If you don't specify -fs somenumber (facesize, e.g. -fs 12 or -fs 16) jed 13 | will revert to traditional font rendering. When -fs is specified, the -fn 14 | parameter is treated as facename, so you can do things like: 15 | xjed -fn trebuc -fs 16 bomb.c 16 | 17 | This functionality was brought to you by: 18 | Charl P. Botha 19 | March 26, 2001 20 | (updated Oct 2005) 21 | -------------------------------------------------------------------------------- /lib/wordstar.hlp: -------------------------------------------------------------------------------- 1 | JED Wordstar keybindings: `^' means to use Ctrl key (e.g., ^X = Ctrl-X). 2 | Press ^KI to close this window. Use ^6 to quit the command line. 3 | 4 | CURSOR GO TO BLOCK DELETE MISC EXIT 5 | ^S left ^D right ^R prev.screen ^KB begin ^G char ^B reformat ^KX save 6 | ^E up ^X down ^C next screen ^KK end ^Y line ^K0..9 set ^KZ shell 7 | ^A word ^QS beg.of line ^KV move ^T >word bookmark FILE 8 | SEARCH ^QD end of line ^KC copy ^[o line window ^KR insert 10 | ^QF find text ^QC end of file ^KY del ^U undo ALT-X cmd ^KQ kill 11 | ^QA replace ^Q0..9 bookmark ^KT word line ^KD save 12 | ^L find next ^QI to line No. ^K/ filter ^KS s.new 13 | ^QP previous ^KU upcase ^KP switch 14 | -------------------------------------------------------------------------------- /src/text.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1992-2023 John E. Davis 2 | * This file is part of JED editor library source. 3 | * 4 | * You may distribute this file under the terms the GNU General Public 5 | * License. See the file COPYING for more information. 6 | */ 7 | extern int wrap_line(int); 8 | extern int forward_paragraph(void); 9 | extern void set_paragraph_separator (char *); 10 | extern int backward_paragraph(void); 11 | extern int text_format_paragraph(void); 12 | extern int narrow_paragraph(void); 13 | extern int center_line(void); 14 | extern int text_smart_quote(void); 15 | extern void define_word(char *); 16 | extern void transform_region(int *); 17 | extern void skip_word_chars(void); 18 | extern void bskip_word_chars(void); 19 | extern void skip_non_word_chars(void); 20 | extern void bskip_non_word_chars(void); 21 | extern void jed_skip_chars (char *); 22 | extern void jed_bskip_chars (char *); 23 | 24 | extern char Jed_Word_Range[256]; 25 | extern char *jed_get_word_chars (void); 26 | -------------------------------------------------------------------------------- /lib/sortmisc.sl: -------------------------------------------------------------------------------- 1 | % This function sorts a region of lines of the form: 2 | % keyname 3 | % text... 4 | % delimeter string 5 | % keyname 6 | % text... 7 | % delimeter string 8 | 9 | define sort_region_internal (line_break_str, delim) 10 | { 11 | check_region (0); 12 | narrow (); 13 | 14 | bob (); 15 | 16 | do 17 | { 18 | push_mark (); 19 | ifnot (bol_fsearch (delim)) eob (); 20 | narrow (); 21 | ERROR_BLOCK 22 | { 23 | widen(); widen (); 24 | } 25 | 26 | bob (); 27 | while (eol(), not(eobp())) 28 | { 29 | del (); insert (line_break_str); 30 | } 31 | widen (); 32 | } 33 | while (down_1 ()); 34 | 35 | mark_buffer (); 36 | goto_column (32); 37 | 38 | ERROR_BLOCK 39 | { 40 | variable len = strlen (line_break_str); 41 | bob (); 42 | while (fsearch (line_break_str)) 43 | { 44 | deln (len); newline (); 45 | } 46 | widen (); 47 | } 48 | 49 | sort (); 50 | EXECUTE_ERROR_BLOCK; 51 | } 52 | -------------------------------------------------------------------------------- /lib/seldisp.sl: -------------------------------------------------------------------------------- 1 | #ifdef HAS_LINE_ATTR 2 | define set_selective_display () 3 | { 4 | variable c, arg, h; 5 | variable msg; 6 | 7 | c = prefix_argument (-1); 8 | 9 | % Allow the current column be used to set the indent level. 10 | if (c == -1) 11 | c = what_column (); 12 | 13 | if (c <= 1) 14 | { 15 | arg = 0; 16 | msg = "Cancelling selective display mode..."; 17 | } 18 | else 19 | { 20 | arg = 1; 21 | c--; 22 | msg = sprintf ("Hiding all lines beyond column %d...", c); 23 | } 24 | flush (msg); 25 | 26 | push_spot (); 27 | bob (); 28 | h = 0; 29 | variable ws = get_blocal_var ("seldisp_whitespace", " \t"); 30 | do 31 | { 32 | bol(); skip_chars (ws); 33 | ifnot (eolp ()) 34 | h = arg * (what_column () > c); 35 | % Otherwise, a blank line to if the last line was hidden, then 36 | % hide this one too. 37 | set_line_hidden (h); 38 | } 39 | while (down_1 ()); 40 | 41 | pop_spot (); 42 | message (msg + "done"); 43 | } 44 | -------------------------------------------------------------------------------- /lib/README: -------------------------------------------------------------------------------- 1 | Most of the files in this directory are written in the S-Lang 2 | language, which is the extension language of the editor. See 3 | for more information about the 4 | language. 5 | 6 | Please note that much of the code in these files may not be 7 | understandable to those with little exposure to S-Lang. Some of the 8 | code has been written in such a way that it byte-compiles to as few 9 | bytes as possible. For example, consider the go_down function which 10 | is used as: 11 | 12 | go_down (10); % Move down 10 lines 13 | 14 | site.sl defines this function as: 15 | 16 | define go_down() { () = down(); } 17 | 18 | which makes it appear not to take any arguments as all. However, this 19 | is equivalent to: 20 | 21 | define go_down (n) { () = down (n); } 22 | 23 | but the body of the latter version requires twice as many byte-codes. 24 | The implemented version allows the argument passed to `go_down' to 25 | stay on the stack to be picked up by the `down' function. 26 | 27 | -------------------------------------------------------------------------------- /lib/tmisc.sl: -------------------------------------------------------------------------------- 1 | % 2 | % Miscellaneous text functions 3 | % 4 | 5 | define text_justify_line () 6 | { 7 | variable min, max, r, count; 8 | count = 100; 9 | push_spot(); bol_skip_white(); 10 | if (eolp) {pop_spot(); return; } 11 | min = what_column(); 12 | eol_trim(); 13 | max = what_column(); 14 | while ((max < WRAP) and count) 15 | { 16 | r = random(0, max); 17 | --count; 18 | if (r < min) continue; 19 | goto_column(r); skip_white(); 20 | if (ffind_char (' ')) { insert_single_space(); ++max; eol();} 21 | } 22 | pop_spot(); 23 | } 24 | 25 | define format_paragraph_hook() 26 | { 27 | variable n; 28 | push_spot(); 29 | 30 | backward_paragraph(); 31 | n = what_line(); 32 | forward_paragraph (); 33 | go_up(2); 34 | if (n - what_line() > 0) {pop_spot(); return; } 35 | push_mark(); 36 | backward_paragraph(); 37 | if (what_line() != 1) go_down_1 (); 38 | narrow(); 39 | bob(); 40 | do text_justify_line (); while (down_1 ()); 41 | widen(); 42 | pop_spot(); 43 | } 44 | 45 | -------------------------------------------------------------------------------- /lib/abbrev.sl: -------------------------------------------------------------------------------- 1 | ifnot (is_defined ("Abbrev_File")) 2 | { 3 | variable Abbrev_File; 4 | $1 = getenv ("JED_HOME"); 5 | if ($1 == NULL) 6 | { 7 | $1 = getenv ("HOME"); 8 | if ($1 == NULL) $1 = ""; 9 | } 10 | 11 | #ifdef VMS 12 | if (0 == strlen ($1)) 13 | { 14 | Abbrev_File = "SYS$LOGIN:abbrevs.sl"; 15 | } 16 | else Abbrev_File = dircat ($1, Abbrev_File); 17 | #else 18 | 19 | #ifdef UNIX 20 | Abbrev_File = ".abbrevs.sl"; 21 | #else 22 | Abbrev_File = "abbrevs.sl"; 23 | #endif 24 | Abbrev_File = dircat ($1, Abbrev_File); 25 | #endif % VMS 26 | } 27 | 28 | if (file_status (Abbrev_File) > 0) pop (evalfile (Abbrev_File)); 29 | 30 | define set_abbrev_mode (val) 31 | { 32 | if (val) 33 | _set_buffer_flag (0x800); 34 | else 35 | _unset_buffer_flag (0x800); 36 | } 37 | 38 | define abbrev_mode () 39 | { 40 | _toggle_buffer_flag (0x800); 41 | 42 | if (_test_buffer_flag (0x800)) 43 | message ("Abbrev mode ON"); 44 | else 45 | message ("Abbrev mode OFF"); 46 | } 47 | 48 | provide ("abbrev"); 49 | -------------------------------------------------------------------------------- /lib/jedusage.sl: -------------------------------------------------------------------------------- 1 | private define p(x) 2 | { 3 | () = fprintf (stdout, "%s\n", x); 4 | } 5 | 6 | p("Jed usage forms:"); 7 | p(""); 8 | p("0. jed [--version | --help]"); 9 | p("1. jed [--batch] [-n] [-e emulation] [-a alt-jedrc-file] \\"); 10 | p(" [file ...] \\ % edit files"); 11 | p(" [-g linenumber] \\ % goto line"); 12 | p(" [-s search-string] \\ % performa search"); 13 | p(" [-l file-to-load] \\ % load slang file"); 14 | p(" [-f function] \\ % execute function"); 15 | p(" [-i file-to-insert] \\ % insert file"); 16 | p(" [-2] \\ % split window"); 17 | p(" [-tmp] \\ % do not backup buffer"); 18 | p(" [-hook funct (argv)] \\ % exec funct with rest of argv parameters"); 19 | p(" [--ANYTHING] % execute ANYTHING as a function"); 20 | p(""); 21 | p("2. jed -script FILE [arg ...]"); 22 | p(""); 23 | p("3. jed-script FILE [arg ...]"); 24 | p(" This form sets __argv[0] to FILE, __argv[1] to arg, ..."); 25 | p(""); 26 | quit_jed (); 27 | -------------------------------------------------------------------------------- /src/test/test_replace.sl: -------------------------------------------------------------------------------- 1 | private variable Failed = 0; 2 | private define new_buffer (str) 3 | { 4 | setbuf ("*scratch*"); 5 | erase_buffer (); 6 | insert (str); 7 | bob (); 8 | } 9 | private define buffer_contents () 10 | { 11 | bob (); 12 | push_mark (); 13 | eob (); 14 | return bufsubstr (); 15 | } 16 | 17 | private define test_replace (str, s, t) 18 | { 19 | variable new_s; 20 | 21 | new_buffer (str); 22 | 23 | replace (s, t); 24 | (new_s,) = strreplace (str, s, t, strlen (str)); 25 | 26 | if (new_s != buffer_contents ()) 27 | { 28 | (s,) = strreplace (s, "\n", "\\n", strlen(s)); 29 | (t,) = strreplace (t, "\n", "\\n", strlen(t)); 30 | () = fprintf (stderr, "failed to replace \"$s\" with \"$t\"\n"$, s, t); 31 | Failed++; 32 | } 33 | } 34 | private define main () 35 | { 36 | test_replace ("\n\n\n\n\nx\n\ny", "x", "t"); 37 | test_replace ("\n\n\n\n\nx\n\ny", "\n", "t"); 38 | test_replace ("\n\n\n\n\nx\n\ny", "\n", "\ny"); 39 | test_replace ("\n\n\n\n\nx\n\ny", "\n", "x"); 40 | } 41 | main (); 42 | 43 | exit (Failed); 44 | -------------------------------------------------------------------------------- /lib/iso-lat2.sl: -------------------------------------------------------------------------------- 1 | %% 2 | %% Initializes upper/lowercase lookup tables for ISO Latin 2 3 | %% 4 | if (_slang_utf8_ok == 0) 5 | { 6 | . 0 64 1 { dup define_case } _for 7 | . 65 90 1 { dup 32 + define_case } _for 8 | . 91 96 1 { dup define_case } _for 9 | . 123 160 1 { dup define_case } _for 10 | . 161 177 define_case 11 | . 162 162 define_case 12 | . 163 179 define_case 13 | . 164 164 define_case 14 | . 165 166 1 { dup 16 + define_case } _for 15 | . 167 168 1 { dup define_case } _for 16 | . 169 172 1 { dup 16 + define_case } _for 17 | . 173 173 define_case 18 | . 174 175 1 { dup 16 + define_case } _for 19 | . 176 176 define_case 20 | . 178 178 define_case 21 | . 180 180 define_case 22 | . 183 183 define_case 23 | . 184 184 define_case 24 | . 189 189 define_case 25 | . 192 222 1 { dup 32 + define_case } _for 26 | . 215 215 define_case 27 | . 223 223 define_case 28 | . 247 247 define_case 29 | . 255 255 define_case 30 | 31 | define_word (strcat ("0-9a-zA-Z\d161\d163\d165-\d166\d169-\d172", 32 | "\d174\d175\d177\d179\d181\d182\d185-\d188", 33 | "\d190-\d214\d216-\d222\d224-\d246\d248-\d254")); 34 | } 35 | -------------------------------------------------------------------------------- /src/test/test_narrow.sl: -------------------------------------------------------------------------------- 1 | private variable Failed = 0; 2 | 3 | public define test_narrow (str, narrow_str) 4 | { 5 | setbuf ("*scratch*"); 6 | 7 | c_mode (); 8 | 9 | erase_buffer (); 10 | insert (str); 11 | bob (); 12 | 13 | ifnot (fsearch (narrow_str)) 14 | error ("fsearch failed"); 15 | 16 | push_mark (); 17 | go_right (strlen (narrow_str)); 18 | narrow_to_region (); 19 | 20 | () = parse_to_point (); 21 | 22 | bob (); 23 | push_mark (); 24 | eob (); 25 | variable b = bufsubstr (); 26 | 27 | if (b != narrow_str) 28 | { 29 | Failed++; 30 | () = fprintf (stderr, "narrow_to_region produced %s\n", b); 31 | } 32 | 33 | widen_region (); 34 | bob (); 35 | push_mark (); 36 | eob (); 37 | b = bufsubstr (); 38 | 39 | if (b != str) 40 | { 41 | Failed++; 42 | () = fprintf (stderr, "widen_region failed %s\n", b); 43 | } 44 | } 45 | 46 | test_narrow ("A single line", "single"); 47 | test_narrow ("\nNewline + A single line", "single"); 48 | test_narrow ("\nNewline + A single line+newline", "single"); 49 | exit (Failed); 50 | -------------------------------------------------------------------------------- /src/vfile.h: -------------------------------------------------------------------------------- 1 | #ifndef _DAVIS_VFILE_H_ 2 | #define _DAVIS_VFILE_H_ 3 | /* Copyright (c) 1992-2023 John E. Davis 4 | * This file is part of JED editor library source. 5 | * 6 | * You may distribute this file under the terms the GNU General Public 7 | * License. See the file COPYING for more information. 8 | */ 9 | 10 | #define VFILE_TEXT 1 11 | #define VFILE_BINARY 2 12 | extern unsigned int VFile_Mode; 13 | 14 | typedef struct 15 | { 16 | char *buf; /* buffer for stream */ 17 | char *bmax; /* pointer to end buffer */ 18 | char *bp; /* current pointer in stream */ 19 | char *eof; /* pointer to EOF if non NULL */ 20 | int fd; /* file descrip for stream */ 21 | unsigned int size; /* default buffer size */ 22 | unsigned int mode; 23 | unsigned int cr_flag; /* true if lines end in cr */ 24 | } VFILE; 25 | 26 | extern char *vgets(VFILE *, unsigned int *); 27 | extern VFILE *vopen(SLFUTURE_CONST char *, unsigned int, unsigned int); 28 | extern void vclose(VFILE *); 29 | extern VFILE *vstream(int, unsigned int, unsigned int); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /info/dir.info: -------------------------------------------------------------------------------- 1 | This is the file, dir, which contains the topmost node of the 2 | Info hierarchy. The first time you invoke Info you start off 3 | looking at that node, which is (dir)Top. 4 |  5 | File: dir Node: Top This is the top of the INFO tree 6 | This (the Directory node) gives a menu of major topics. 7 | Typing "d" returns here, "q" exits, "?" lists all INFO commands, "h" 8 | gives a primer for first-timers, "mTexinfo" visits Texinfo topic, 9 | etc. 10 | --- PLEASE ADD DOCUMENTATION TO THIS TREE. (See INFO topic first.) --- 11 | 12 | * Menu: The list of major topics begins on the next line. 13 | 14 | * Info: (info). Documentation browsing system. (From GNU Emacs) 15 | 16 | * JED: (jed). JED editor documentation. 17 | 18 | * Latex: (latex). latex 19 | 20 | ------------------------------------------------------------------ 21 | The following info directories may not exist on all systems. 22 | ------------------------------------------------------------------ 23 | 24 | * /usr/info: (/usr/info/dir). Additional info topics. 25 | 26 | * /usr/local/info: (/usr/local/info/dir). Additional info topics. 27 | -------------------------------------------------------------------------------- /lib/dos437.sl: -------------------------------------------------------------------------------- 1 | #ifdef IBMPC_SYSTEM 2 | % Initializes upper/lowercase lookup tables for DOS code page 437. 3 | % 437 is the original DOS character table. So if your DOS version 4 | % does not support code pages, use this table. 437 is also the 5 | % default code page for USA, United Kingdom, and International English. 6 | % It is the alternate code page for Belgium, Brazil, Finland, France, 7 | % Germany, Italy, Latin America, Netherlands, Spain, Sweden, and 8 | % Switzerland. 9 | % Information from MSDOS 5.0 manual 10 | % 11 | . 0 64 1 { dup define_case } _for 12 | . 65 90 1 { dup 32 + define_case } _for 13 | . 91 96 1 { dup define_case } _for 14 | . 123 255 1 { dup define_case } _for 15 | . 128 135 define_case 16 | . 142 132 define_case 17 | . 143 134 define_case 18 | . 144 130 define_case 19 | . 146 145 define_case 20 | . 153 148 define_case 21 | . 154 129 define_case 22 | . 165 164 define_case 23 | % 24 | % Now define a word. This IS NOT based on above 25 | % 26 | . "0-9a-zA-Z\d128-\d167\d224-\d235" define_word 27 | % Marko thinks: 28 | . "0-9a-zA-Z\d128-\d154\d160-\d165\d224-\d235" define_word 29 | 30 | #endif 31 | 32 | -------------------------------------------------------------------------------- /src/scrwrap.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2025 John E. Davis 2 | * This file is part of JED editor library source. 3 | * 4 | * You may distribute this file under the terms the GNU General Public 5 | * License. See the file COPYING for more information. 6 | */ 7 | #ifndef JED_SCRWRAP_H_ 8 | #define JED_SCRWRAP_H_ 9 | 10 | /* 0 based row */ 11 | typedef struct 12 | { 13 | int wrap_mode; 14 | int row, col; /* current physical screen row/col */ 15 | int rmin, rmax; /* physical window where writes take place: rmin<=r", ',', $1); 16 | define_syntax ('X', '#', $1); 17 | define_syntax ("%-+/&*<>|!~^", '+', $1); 18 | set_syntax_flags ($1, 4); 19 | 20 | () = define_keywords ($1, "LWlw", 1); 21 | () = define_keywords ($1, "ADASCDPDPSacadascdpdps", 2); 22 | () = define_keywords ($1, "ENDSDCONNMOSPMOSPOSTendsdconnmospmospost", 4); 23 | () = define_keywords ($1, "BEGINbriefnomod", 5); 24 | () = define_keywords ($1, "SUBCKTsubckt", 6); 25 | () = define_keywords ($1, "INCLUDEOPTIONSincludeoptions", 7); 26 | 27 | define spice_mode () 28 | { 29 | variable sp = "SPICE"; 30 | set_mode(sp, 0); 31 | use_syntax_table (sp); 32 | run_mode_hooks("spice_mode_hook"); 33 | } 34 | -------------------------------------------------------------------------------- /src/gtkjed.h: -------------------------------------------------------------------------------- 1 | #ifndef _GTK_JED_H_ 2 | #define _GTK_JED_H_ 3 | 4 | #include 5 | 6 | /* extern void jedGtkUpdateEdSize( int, int ); */ 7 | extern void jGtkCheckEdSize( int, int ); 8 | extern void jGtkWidenEd( int, int, int ); 9 | extern void jgtk_updMiniWinWidgetWinXRef( int ); 10 | extern void jgtk_updEdWidgetWinXRef( Window_Type *, int, int ); 11 | 12 | extern void jgtk_updOWEdWin( Window_Type *, int, int, int, int ); 13 | extern void jgtk_delEdWin( Window_Type *, Window_Type *, int, int, int, int, int ); 14 | extern void jgtk_splitEdWin( Window_Type *, Window_Type *, int, int, int, int, int ); 15 | extern void jgtk_createTopEdWin( Window_Type *, int, int, int, int, int ); 16 | extern int jgtk_createEditorMiniWin( Window_Type * ); 17 | extern void updateScrollbar( Window_Type * ); 18 | extern void jGtkSetWinSizes(void); 19 | 20 | extern void jGtkSetWinSizes(void); 21 | 22 | extern void jgtk_initToolbarArray(void); 23 | extern void jgtk_initMenubarStruct(void); 24 | 25 | extern int jgtk_createKeyEvents (char *); 26 | extern void jGtkSetFocus(void); 27 | extern void jGtkAttachMenubar( GtkWidget *mb ); 28 | extern void jGtkAddToolbar(GtkWidget *tb, int where); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /lib/dos852.sl: -------------------------------------------------------------------------------- 1 | % Initializes upper/lowercase lookup tables for DOS code page 852. 2 | % 852 is the default code page for Czech, ... 3 | % not complete! - Czech only (Petr Peringer ) 4 | % 5 | . 0 64 1 { dup define_case } _for 6 | . 65 90 1 { dup 32 + define_case } _for 7 | . 91 96 1 { dup define_case } _for 8 | . 123 255 1 { dup define_case } _for 9 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10 | . 0xB5 0xA0 define_case % \'A --> \'a 11 | . 0xAC 0x9F define_case % \v{C} --> etc. in TeX sequences 12 | . 0xD2 0xD4 define_case % \v{D} 13 | . 0xB7 0xD8 define_case % \v{E} 14 | . 0x90 0x82 define_case % \'E 15 | . 0xD6 0xA1 define_case % \'I 16 | . 0xD5 0xE5 define_case % \v{N} 17 | . 0xE0 0xA2 define_case % \'O 18 | . 0xFC 0xFD define_case % \v{R} 19 | . 0xE6 0xE7 define_case % \v{S} 20 | . 0x9B 0x9C define_case % \v{T} 21 | . 0xDE 0x85 define_case % \r{U} 22 | . 0xE9 0xA3 define_case % \'U 23 | . 0xED 0xEC define_case % \'Y 24 | . 0xA6 0xA7 define_case % \v{Z} 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | . "0-9a-zA-Z_\xB5\xA0\xAC\x9F\xD2\xD4\xB7\xD8\x90\x82\xD6\xA1\xD5\xE5\xE0\xA2\xFC\xFD\xE6\xE7\x9B\x9C\xDE\x85\xE9\xA3\xED\xEC\xA6\xA7" 27 | . define_word 28 | -------------------------------------------------------------------------------- /src/mkfiles/README: -------------------------------------------------------------------------------- 1 | The *only* makefile here that I will continue to support is 2 | makefile.all. It is used in conjunction with the DOS executable 3 | `mkmake.exe' to produce other makefiles. 4 | 5 | To produce makefiles for, e.g., an MSDOS executable compiled with BCC, use 6 | the command 7 | 8 | mkmake MSDOS BCC < makefile.all > makefile 9 | 10 | Similarly, other makefiles may be produced as 11 | 12 | mkmake MSDOS DJGPP < makefile.all > makefile 13 | mkmake WIN32 MINGW32 < makefile.all > makefile 14 | mkmake OS2 EMX < makefile.all > makefile 15 | mkmake WIN16 BCC NO_FOLD < makefile.all > makefile 16 | 17 | (Note: NO_FOLD is to compile without folding support.) 18 | 19 | If you want to submit a makefile to me, please make additions to 20 | makefile.all. 21 | 22 | Notes: 23 | 24 | 1. I have only tested makefiles for BCC, DJGPP, and MINGW32 25 | development environments. It is conceivable that makefile.all 26 | may need modifed for other systems. 27 | 28 | 2. I think that the MINGW32 and CYGWIN32 spawnvp function is broken. 29 | For that reason, I recommend that you use the BCC compiled 30 | mswshell.exe executable in jed/bin. Better yet, find out how to 31 | achieve the same effect without using spawnvp. 32 | -------------------------------------------------------------------------------- /lib/untab.sl: -------------------------------------------------------------------------------- 1 | % untabify region function 2 | 3 | define untab_convert_to_tabs () 4 | { 5 | variable c; 6 | while (fsearch_char (' ')) 7 | { 8 | c = what_column (); 9 | push_mark (); 10 | skip_white (); 11 | c = what_column () - c; 12 | if (c > 1) 13 | { 14 | del_region (); 15 | whitespace (c); 16 | } 17 | else pop_mark_0 (); 18 | } 19 | } 20 | 21 | %!%+ 22 | %\function{untab} 23 | %\synopsis{untab} 24 | %\usage{Void untab ();} 25 | %\description 26 | % This function may be used either to convert tabs to spaces or, if called 27 | % with a prefix argument, it will perform the opposite conversion from 28 | % spaces to tabs. This function operates on a region. 29 | %!%- 30 | define untab () 31 | { 32 | check_region (0); 33 | narrow (); 34 | bob (); 35 | if (-1 != prefix_argument (-1)) 36 | { 37 | untab_convert_to_tabs (); 38 | } 39 | else 40 | { 41 | while (fsearch ("\t")) 42 | { 43 | TAB; % on stack 44 | skip_white (); 45 | what_column (); % on stack 46 | bskip_chars ("\t "); 47 | () - what_column (); % on stack 48 | trim (); 49 | TAB = 0; 50 | whitespace (()); 51 | TAB = (); 52 | } 53 | } 54 | 55 | widen (); 56 | } 57 | 58 | -------------------------------------------------------------------------------- /mkfiles/makefile.m32: -------------------------------------------------------------------------------- 1 | # -*-sh-*- 2 | 3 | # mingw32-make is used for both 32 and 64 bit builds. 4 | MAKE = mingw32-make 5 | 6 | # Note: copy.exe does not exist on windows since it is a cmd.exe built-in 7 | # The same appears to be true for del. 8 | MFLAGS = COPY="cmd /c copy /y" RM="cmd /c del" 9 | 10 | # DESTDIR is used for building a package for use on another machine. 11 | DESTDIR = 12 | 13 | # PREFIX controls where the library will be installed. 14 | PREFIX = C:/mingw/local 15 | CONFDIR = $(PREFIX)/etc 16 | # 17 | SLANG_DEFS = prefix=$(PREFIX) 18 | 19 | all: 20 | cd src && $(MAKE) $(MFLAGS) $(SLANG_DEFS) 21 | cd src && $(MAKE) $(MFLAGS) $(SLANG_DEFS) wjed 22 | @echo . 23 | @echo To install it, run $(MAKE) install. 24 | @echo . 25 | # 26 | clean: 27 | cd src && $(MAKE) $(MFLAGS) clean 28 | # 29 | # Note the use of X- below. Windows regards '=' as a commandline whitespace 30 | # character that needs to be quoted. However I have not been able to figure 31 | # out how to do that in the context of the mingw32-make command parser. 32 | # As a major hack, I added the X- prefix and modified mkfiles/install.sl 33 | # to remove the X-. 34 | # 35 | install: all 36 | slsh mkfiles/install.sl --destdir="X-$(DESTDIR)" --prefix="$(PREFIX)" install 37 | # 38 | .PHONY: all install clean 39 | -------------------------------------------------------------------------------- /lib/nroff.sl: -------------------------------------------------------------------------------- 1 | % nroff.sl -*- SLang -*- 2 | % 3 | % Primitive nroff editing mode -- just enough to define paragraphs 4 | % to prevent CMD from wrapping 5 | % 6 | 7 | define nroff_parsep () 8 | { 9 | bol (); 10 | (looking_at_char('.') or looking_at_char('\\') or (skip_white(), eolp())); 11 | } 12 | 13 | $1 = "nroff"; 14 | create_syntax_table ($1); 15 | 16 | define_syntax ("'\\\"", "", '%', $1); % Comment Syntax 17 | define_syntax ('.', '\\', $1); % Quote character 18 | define_syntax ("({[", ")]}", '(', $1); % are all these needed? 19 | define_syntax ("{}[]<>()", ',', $1); % delimiters 20 | define_syntax (".a-zA-Z", 'w', $1); 21 | 22 | % A few standard keywords -- uppercase only, nothing fancy 23 | () = define_keywords ($1, ".B.I", 2); 24 | () = define_keywords ($1, ".BR.DT.IP.PP.RB.RI.RE.RS.SB.SH.TH.TP.fi.nf", 3); 25 | 26 | %!%+ 27 | %\function{nroff_mode} 28 | %\synopsis{nroff_mode} 29 | %\description 30 | % Protoytype: Void nroff_mode (); 31 | % A primitive mode for editing nroff/troff files. 32 | % mostly to define the paragraph separator 33 | %!%- 34 | define nroff_mode () 35 | { 36 | variable nroff = "nroff"; 37 | set_mode (nroff, 1); 38 | use_syntax_table (nroff); 39 | set_buffer_hook ("par_sep", "nroff_parsep"); 40 | run_mode_hooks ("nroff_mode_hook"); 41 | } 42 | 43 | -------------------------------------------------------------------------------- /doc/txt/linux-keys.txt: -------------------------------------------------------------------------------- 1 | Matti-Oskari Leppänen suggested the following: 2 | 3 | I think that you should mention somewhere in documents how to make 4 | shift-arrow etc. work under linux-console ... because it's quite simple 5 | 6 | just make file that has following lines save it as some.map and 7 | loadkeys some.map then you have same keysyms as used in wmark.sl 8 | ________________________________________________ 9 | # S+Up 10 | shift keycode 103 = F100 11 | string F100 = "\033[a" 12 | 13 | #S+Left 14 | shift keycode 106 = F101 15 | string F101 = "\033[c" 16 | 17 | #S+Right 18 | shift keycode 105 = F102 19 | string F102 = "\033[d" 20 | 21 | # S+Down 22 | shift keycode 108 = F103 23 | string F103 = "\033[b" 24 | 25 | #C+Ins 26 | control keycode 110 = F104 27 | string F104="\033[2^" 28 | 29 | #S+Ins 30 | shift keycode 110 = F105 31 | string F105="\033[2$" 32 | 33 | #S+PgUp 34 | shift keycode 104 = F106 35 | string F106 = "\033[5$" 36 | 37 | #S+PgDn 38 | shift keycode 109 = F107 39 | string F107 = "\033[6$" 40 | 41 | #S+Home 42 | shift keycode 102 = F108 43 | string F108 = "\033[1$" 44 | 45 | #S+End 46 | shift keycode 107 = F109 47 | string F109 = "\033[4$" 48 | 49 | #S+Del 50 | shift keycode 111 = F110 51 | string F110 = "\033[3$" 52 | 53 | #C+Del 54 | control keycode 111 = F111 55 | string F111 = "\033[3^" 56 | 57 | -------------------------------------------------------------------------------- /lib/ide.hlp: -------------------------------------------------------------------------------- 1 | JED IDE mode 1.3.4. ^ = Ctrl (e.g., ^X = Ctrl-X); M = Alt (M-X = Alt-X) 2 | Press `q' to quit this help screen; F6 or ^KP to switch to the next buffer 3 | 4 | CURSOR GO TO BLOCK DELETE EXIT 5 | ^S left ^D right ^R prev. screen ^KB begin M-G char ^KX save 6 | ^E up ^X down ^C next screen ^KY cut ^Y line ^KZ shell 7 | ^A word ^QS beg. of line ^KH copy ^T >word 8 | ^QD end of line ^KC paste M-BS line ^KE new 10 | ^QF find text ^QX screen end ^KT word ^U undo ^KR insert 11 | ^QA replace ^QR top of file ^K/ filter ^KQ kill 12 | ^L find next ^QC end of file ^KG to reg. MACRO ^KD save 13 | ^QT toggle case ^Q0-9 bookmark ^KJ from reg. ESC-( beg. ^KS save as 14 | ^QI line No. ^KU up. case ESC-) end ^KN next 15 | MISC ^QP prev.position ^KL lo. case M-R run ^KP prev. 16 | ^B reformat 17 | ^K0-9 set bookmark ^KI one window ^V completion ^P compose char 18 | 19 | Press M-X or ESC-X to issue commands; press ^G to quit the command line 20 | Press F10 to activate the menus. Please read the documentation! 21 | -------------------------------------------------------------------------------- /src/display.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1992-2023 John E. Davis 2 | * This file is part of JED editor library source. 3 | * 4 | * You may distribute this file under the terms the GNU General Public 5 | * License. See the file COPYING for more information. 6 | */ 7 | 8 | # define JX_SETXXX_RETURN_TYPE int 9 | # define JX_SETXXX_RETURN_VAL 0 10 | 11 | /* This is the main hook that must be set at compile-time. */ 12 | extern void (*tt_get_terminfo)(void); 13 | 14 | /* These hooks should be set during run-time by the tt_get_terminfo hook */ 15 | extern void (*tt_beep)(void); 16 | extern void (*tt_write_string)(SLFUTURE_CONST char *); 17 | extern void (*tt_get_screen_size)(int *, int *); 18 | extern JX_SETXXX_RETURN_TYPE (*tt_set_color)(int, SLFUTURE_CONST char *, SLFUTURE_CONST char *, SLFUTURE_CONST char *); 19 | extern JX_SETXXX_RETURN_TYPE (*tt_set_mono) (int, SLFUTURE_CONST char *, SLtt_Char_Type); 20 | 21 | #ifndef IBMPC_SYSTEM 22 | extern void (*tt_wide_width)(void); 23 | extern void (*tt_narrow_width)(void); 24 | extern void (*tt_enable_cursor_keys)(void); 25 | extern void (*tt_set_term_vtxxx)(int *); 26 | #endif 27 | 28 | extern int *tt_Ignore_Beep; 29 | extern int *tt_Use_Ansi_Colors; 30 | extern int *tt_Term_Cannot_Scroll; 31 | extern int *tt_Term_Cannot_Insert; 32 | 33 | #ifndef IBMPC_SYSTEM 34 | extern int *tt_Blink_Mode; 35 | #endif 36 | 37 | extern void flush_output (void); 38 | -------------------------------------------------------------------------------- /lib/tiasm.sl: -------------------------------------------------------------------------------- 1 | % A simple TI asm mode 2 | 3 | $1 = "tiasm"; 4 | create_syntax_table ($1); 5 | 6 | define_syntax (";", "", '%', $1); % Comment Syntax 7 | %define_syntax ('\\', '\\', $1); % Quote character 8 | define_syntax ("{[", "}]", '(', $1); % are all these needed? 9 | define_syntax ('\'', '"', $1); % string 10 | define_syntax ("$~^_&#", '+', $1); % operators 11 | define_syntax ("|&{}[],", ',', $1); % delimiters 12 | define_syntax ("a-zA-Z0-9.", 'w', $1); 13 | set_syntax_flags ($1, 1 | 2); 14 | set_fortran_comment_chars ($1, "*"); 15 | 16 | % Type 0 keywords 17 | () = define_keywords_n ($1, 18 | "andashbuddbdldaldilshmh1noppopsti", 19 | 3, 0); 20 | 21 | () = define_keywords_n ($1, 22 | "addibeqdbledcmpildizlhu0lhu1pushretsrptbsubi", 23 | 4, 0); 24 | 25 | () = define_keywords_n ($1, 26 | "ldinzrptbd", 27 | 5, 0); 28 | 29 | % Type 1 keywords 30 | () = define_keywords_n ($1, 31 | ".if", 32 | 3, 1); 33 | () = define_keywords_n ($1, 34 | ".end", 35 | 4, 1); 36 | () = define_keywords_n ($1, 37 | ".else.text", 38 | 5, 1); 39 | () = define_keywords_n ($1, 40 | ".endif.globl", 41 | 6, 1); 42 | 43 | define tiasm_mode () 44 | { 45 | variable kmap = "tiasm"; 46 | set_mode(kmap, 4); 47 | use_syntax_table (kmap); 48 | mode_set_mode_info (kmap, "fold_info", "*{{{\r*}}}\r\r"); 49 | run_mode_hooks("tiasm_mode_hook"); 50 | } 51 | -------------------------------------------------------------------------------- /doc/tm/rtl/blocal.tm: -------------------------------------------------------------------------------- 1 | \function{blocal_var_exists} 2 | \synopsis{Determine whether a buffer-local variable exists} 3 | \usage{Int_Type blocal_var_exists (String_Type name)} 4 | \description 5 | The \var{blocal_var_exists} function returns non-zero if the 6 | specified buffer-local variable exists. It returns zero of the 7 | variable does not exists. 8 | \seealso{get_blocal_var, create_blocal_var, set_blocal_var, define_blocal_var} 9 | \done 10 | 11 | \function{create_blocal_var} 12 | \synopsis{Create a buffer local variable "name"} 13 | \usage{Void create_blocal_var (String name)} 14 | \description 15 | This function is used to create a buffer local variable named 16 | \var{name}. A buffer local variable is a variable whose value is 17 | local to the current buffer. 18 | \seealso{get_blocal_var, set_blocal_var, define_blocal_var} 19 | \done 20 | 21 | \function{set_blocal_var} 22 | \synopsis{Set the buffer local variable "v" to value "val"} 23 | \usage{Void set_blocal_var (val, String v)} 24 | \description 25 | This function sets the value of the buffer local variable with name \var{v} 26 | to value \var{val}. The buffer local variable specified by \var{v} must have 27 | been previously created by the \var{create_blocal_var} function. \var{val} must 28 | have the type that was declared when \var{create_blocal_var} was called. 29 | \seealso{get_blocal_var, create_blocal_var} 30 | \done 31 | 32 | -------------------------------------------------------------------------------- /doc/txt/rgrep.txt: -------------------------------------------------------------------------------- 1 | This file documents rgrep, a recursive, highlighting grep program. 2 | 3 | Currently, rgrep is only available on Unix systems. To build it, move to 4 | the src directory for JED and enter: `make rgrep'. 5 | 6 | Why use rgrep instead of more traditional Unix tools? 7 | ------------------------------------------------------ 8 | 9 | Unlike grep and egrep, rgrep has the ability to recursively descend 10 | directories. The traditional way of performing this kind of search on Unix 11 | systems utilizes the `find' command in conjunction with `grep'. However, 12 | this results in very poor performance. Consider the traditional approach 13 | where one wants to search the /usr/include directory for the string `FD_SET': 14 | For this, one would use: 15 | 16 | % find /usr/include -exec grep -l FD_SET \{\} \; -print 17 | 18 | Ignoring the fact that the above expression looks complex, it failed to find 19 | any occurrence of FD_SET under the /usr/include directory of my Ultrix 20 | system. 21 | 22 | Now, if rgrep is used, one types: 23 | 24 | % rgrep -lFr FD_SET /usr/include 25 | 26 | which yielded: /usr/include/sys/types.h 27 | 28 | The reason that `find' failed is that /usr/include/sys is a symbolic link to 29 | /sys/h. `rgrep' was able to succeed because of the `-F' flag which 30 | tells it to follow links. I looked in the man page for a similar option for 31 | `find' but nothing turned up. 32 | 33 | -------------------------------------------------------------------------------- /src/test/test_search.sl: -------------------------------------------------------------------------------- 1 | private variable Failed = 0; 2 | private define test_rebsearch () 3 | { 4 | setbuf ("*scratch*"); 5 | erase_buffer (); 6 | variable n = 20; 7 | loop(20) 8 | newline (); 9 | 10 | loop (n) 11 | { 12 | if (0 == re_bsearch ("^\n")) 13 | { 14 | ()=fprintf (stderr, "re_bsearch for newlines failed"); 15 | Failed++; 16 | return; 17 | } 18 | } 19 | ifnot (bobp ()) 20 | { 21 | ()=fprintf(stderr,"re_bsearch: expected to be at the bob"); 22 | Failed++; 23 | return; 24 | } 25 | } 26 | test_rebsearch (); 27 | 28 | private define test_search_char () 29 | { 30 | if (0 == _slang_utf8_ok ()) 31 | { 32 | () = fprintf (stdout, "UTF-8 mode not enabled-- test_search_char not run.\n"); 33 | return; 34 | } 35 | 36 | setbuf ("*scratch*"); 37 | erase_buffer (); 38 | insert ("foo\x{ABCD}bar\n"); 39 | bob (); 40 | if (1 != ffind_char (0xABCD)) 41 | { 42 | () = fprintf (stderr, "ffind_char: failed to find a wide-character\n"); 43 | Failed++; 44 | } 45 | eol (); 46 | if (1 != bfind_char (0xABCD)) 47 | { 48 | () = fprintf (stderr, "ffind_char: failed to find a wide-character\n"); 49 | Failed++; 50 | } 51 | if (1 != looking_at_char (0xABCD)) 52 | { 53 | () = fprintf (stderr, "looking_at_char: failed\n"); 54 | Failed++; 55 | } 56 | } 57 | test_search_char (); 58 | 59 | exit (Failed); 60 | -------------------------------------------------------------------------------- /src/hooks.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1992-2023 John E. Davis 2 | * This file is part of JED editor library source. 3 | * 4 | * You may distribute this file under the terms the GNU General Public 5 | * License. See the file COPYING for more information. 6 | */ 7 | extern int (*X_Read_Hook) (void); 8 | extern int (*X_Input_Pending_Hook) (void); 9 | extern void (*X_Suspend_Hook)(void); 10 | extern int (*X_Argc_Argv_Hook)(int, char **); 11 | #if 0 12 | extern int (*X_Init_SLang_Hook)(void); 13 | #endif 14 | extern int jed_add_init_slang_hook (int (*)(void)); 15 | 16 | extern int (*X_Init_Term_Hook) (void); 17 | extern void (*X_Reset_Term_Hook) (void); 18 | extern void (*X_Update_Open_Hook)(void); /* hooks called when starting */ 19 | extern void (*X_Update_Close_Hook)(void); /* and finishing update */ 20 | extern void (*X_Define_Keys_Hook) (SLKeyMap_List_Type *); 21 | extern int (*X_Set_Abort_Char_Hook) (unsigned char); 22 | 23 | #ifdef HAS_MOUSE 24 | extern int (*X_Open_Mouse_Hook)(void); 25 | extern void (*X_Close_Mouse_Hook)(void); 26 | extern int (*JMouse_Event_Hook)(void); 27 | extern void (*JMouse_Hide_Mouse_Hook)(int); 28 | #endif 29 | 30 | #define JED_HOOKS_RUN_ALL 1 31 | #define JED_HOOKS_RUN_UNTIL_0 2 32 | #define JED_HOOKS_RUN_UNTIL_NON_0 3 33 | extern int jed_init_user_hooks (void); 34 | extern int jed_va_run_hooks (char *name, int method, unsigned int nargs, ...); 35 | extern int jed_hook_exists (char *); 36 | 37 | -------------------------------------------------------------------------------- /lib/win1250.sl: -------------------------------------------------------------------------------- 1 | % Initializes upper/lowercase lookup tables for Windows 1250 code page. 2 | % Derived from dos852.sl by the code conversion utility. 3 | % 852 is the default code page for Czech in DOS, 1250 is the equivalent 4 | % for Windows (ask Microsoft why the encoding is different). 5 | % not complete! - Czech only (Petr Peringer ) 6 | % 7 | . 0 64 1 { dup define_case } _for 8 | . 65 90 1 { dup 32 + define_case } _for 9 | . 91 96 1 { dup define_case } _for 10 | . 123 255 1 { dup define_case } _for 11 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 12 | . 0xC1 0xE1 define_case % \'A --> \'a 13 | . 0xC8 0xE8 define_case % \v{C} --> etc. in TeX sequences 14 | . 0xCF 0xEF define_case % \v{D} 15 | . 0xCC 0xEC define_case % \v{E} 16 | . 0xC9 0xE9 define_case % \'E 17 | . 0xCD 0xED define_case % \'I 18 | . 0xD2 0xF2 define_case % \v{N} 19 | . 0xD3 0xF3 define_case % \'O 20 | . 0xD8 0xF8 define_case % \v{R} 21 | . 0x8A 0x9A define_case % \v{S} 22 | . 0x8D 0x9D define_case % \v{T} 23 | . 0xD9 0xF9 define_case % \r{U} 24 | . 0xDA 0xFA define_case % \'U 25 | . 0xDD 0xFD define_case % \'Y 26 | . 0x8E 0x9E define_case % \v{Z} 27 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 28 | . "0-9a-zA-Z_\xC1\xE1\xC8\xE8\xCF\xEF\xCC\xEC\xC9\xE9\xCD\xED\xD2\xF2\xD3\xF3\xD8\xF8\x8A\x9A\x8D\x9D\xD9\xF9\xDA\xFA\xDD\xFD\x8E\x9E" 29 | . define_word 30 | -------------------------------------------------------------------------------- /lib/lisp.sl: -------------------------------------------------------------------------------- 1 | % Lisp mode 2 | 3 | $1 = "LISP"; 4 | create_syntax_table ($1); 5 | define_syntax ("([", ")]", '(', $1); 6 | define_syntax (";", "", '%', $1); 7 | define_syntax ('"', '"', $1); 8 | define_syntax ('\\', '\\', $1); 9 | 10 | define_syntax ("0-9a-zA-Z_", 'w', $1); % words 11 | define_syntax ("-+0-9", '0', $1); % Numbers 12 | % define_syntax ("", ',', $1); % Delimiters 13 | define_syntax ('#', '#', $1); % preprocessor 14 | % define_syntax ("%-+/&*=<>|!~^", '+', $1); % binary operators 15 | 16 | () = define_keywords ($1, "eqifor", 2); 17 | () = define_keywords ($1, "letnot", 3); 18 | () = define_keywords ($1, "setq", 4); 19 | () = define_keywords ($1, "defunprognwhile", 5); 20 | 21 | define lisp_indent_line () 22 | { 23 | variable val, col; 24 | push_spot (); 25 | bol (); 26 | val = find_matching_delimiter (')'); 27 | col = what_column (); 28 | if (val == 1) col += 3; 29 | pop_spot (); 30 | push_spot (); 31 | bol_skip_white (); 32 | if (col != what_column ()) 33 | { 34 | bol_trim (); 35 | col--; whitespace (col); 36 | } 37 | pop_spot (); 38 | push_mark (); 39 | bskip_white (); 40 | if (bolp ()) 41 | { 42 | skip_white (); 43 | pop_mark_0 (); 44 | } 45 | else pop_mark_1 (); 46 | } 47 | 48 | define lisp_mode () 49 | { 50 | set_mode("lisp", 2); 51 | set_buffer_hook ("indent_hook", "lisp_indent_line"); 52 | use_syntax_table ("LISP"); 53 | run_mode_hooks ("lisp_mode_hook"); 54 | } 55 | -------------------------------------------------------------------------------- /src/jdmacros.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1992-2023 John E. Davis 2 | * This file is part of JED editor library source. 3 | * 4 | * You may distribute this file under the terms the GNU General Public 5 | * License. See the file COPYING for more information. 6 | */ 7 | #ifndef _JD_MACROS_H_ 8 | #define _JD_MACROS_H_ 9 | 10 | /* This file defines some macros that I use with programs that link to 11 | * the slang library. 12 | */ 13 | 14 | #ifdef HAVE_MALLOC_H 15 | # if !defined(__FreeBSD__) 16 | # include 17 | # endif 18 | #endif 19 | 20 | #ifdef HAVE_MEMORY_H 21 | # include 22 | #endif 23 | 24 | #ifndef SLMEMSET 25 | # ifdef HAVE_MEMSET 26 | # define SLMEMSET memset 27 | # else 28 | # define SLMEMSET SLmemset 29 | # endif 30 | #endif 31 | 32 | #ifndef SLMEMCHR 33 | # ifdef HAVE_MEMCHR 34 | # define SLMEMCHR memchr 35 | # else 36 | # define SLMEMCHR SLmemchr 37 | # endif 38 | #endif 39 | 40 | #ifndef SLMEMCPY 41 | # ifdef HAVE_MEMCPY 42 | # define SLMEMCPY memcpy 43 | # else 44 | # define SLMEMCPY SLmemcpy 45 | # endif 46 | #endif 47 | 48 | /* Note: HAVE_MEMCMP requires an unsigned memory comparison!!! */ 49 | #ifndef SLMEMCMP 50 | # ifdef HAVE_MEMCMP 51 | # define SLMEMCMP memcmp 52 | # else 53 | # define SLMEMCMP SLmemcmp 54 | # endif 55 | #endif 56 | 57 | #if defined(__QNX__) && defined(__WATCOMC__) 58 | # include 59 | #endif 60 | 61 | #ifndef SLFUTURE_CONST 62 | # define SLFUTURE_CONST 63 | #endif 64 | 65 | #endif /* _JD_MACROS_H_ */ 66 | -------------------------------------------------------------------------------- /lib/iso-lat3.sl: -------------------------------------------------------------------------------- 1 | %% 2 | %% Initializes upper/lowercase lookup tables for ISO Latin 3, 3 | %% defined in the ISO 8859-3 standard. 4 | %% Made by Byrial Jensen 5 | %% 6 | 7 | if (_slang_utf8_ok == 0) 8 | { 9 | . 0 64 1 { dup define_case } _for 10 | . 65 90 1 { dup 32 + define_case } _for 11 | . 91 96 1 { dup define_case } _for 12 | . 123 160 1 { dup define_case } _for 13 | 14 | . 161 177 define_case 15 | . 162 165 1 { dup dup define_case 16 + dup define_case } _for 16 | . 166 182 define_case 17 | . 167 168 1 { dup dup define_case 16 + dup define_case } _for 18 | . 169 172 1 { dup 16 + define_case } _for 19 | . 173 174 1 { dup dup define_case 16 + dup define_case } _for 20 | . 175 191 define_case 21 | 22 | . 192 222 1 { dup 32 + define_case } _for 23 | % That was too much - redefine 3 non-letter holes in the range 192-222 24 | . 195 195 define_case 227 227 define_case 25 | . 208 208 define_case 240 240 define_case 26 | . 215 215 define_case 247 247 define_case 27 | 28 | % character 223 is german sharp s: it cannot be treated correctly 29 | . 223 223 define_case 255 255 define_case 30 | 31 | % And now the definition of a word. 32 | % I have included all ciphers, letters, hyphen, and soft hyphen (char. 173). 33 | define_word (strcat ("-0-9A-Za-z", "\d161\d177", "\d166\d182", 34 | "\d169-\d173\d185-\d188", "\d175\d191", 35 | "-\d194", "\d196-\d207", "\d209-\d214", 36 | "\d216-\d226","\d228-\d239","\d241-\d246", 37 | "\d248-\d254")); 38 | } 39 | -------------------------------------------------------------------------------- /lib/dos850.sl: -------------------------------------------------------------------------------- 1 | % Initializes upper/lowercase lookup tables for DOS code page 850. 2 | % 850 is the default code page for Belgium, Brazil, Denmark, 3 | % Finland, France, Germany, Italy, Latin America, Netherlands, 4 | % Norway, Portugal, Spain, Sweden, and Switzerland. 5 | % It is the alternate code page for Canadian-French, 6 | % Czechoslovakia, Hungary, International English, Poland, United 7 | % Kingdom, USA, and (ex-)Yugoslavia 8 | % Information from MSDOS 5.0 manual 9 | % Thanks marko@cs.umd.edu 10 | . 0 64 1 { dup define_case } _for 11 | . 65 90 1 { dup 32 + define_case } _for 12 | . 91 96 1 { dup define_case } _for 13 | . 123 255 1 { dup define_case } _for 14 | % 15 | . 128 135 define_case 16 | . 154 129 define_case 17 | . 144 130 define_case 18 | . 142 132 define_case 19 | . 183 133 define_case 20 | . 143 134 define_case 21 | . 211 137 define_case 22 | . 212 138 define_case 23 | . 216 139 define_case 24 | . 215 140 define_case 25 | . 222 141 define_case 26 | . 146 145 define_case 27 | . 153 148 define_case 28 | . 227 149 define_case 29 | . 234 150 define_case 30 | . 235 151 define_case 31 | . 157 155 define_case 32 | . 181 160 define_case 33 | . 214 161 define_case 34 | . 224 162 define_case 35 | . 233 163 define_case 36 | . 165 164 define_case 37 | . 199 198 define_case 38 | . 209 208 define_case 39 | . 229 228 define_case 40 | . 232 231 define_case 41 | . 237 236 define_case 42 | 43 | . "0-9a-zA-Z\d128-\d155\d157\d160-\d165\d181-\d183\d198\d199\d208\d212\d214-\d216\d222\d224-\d237" 44 | . define_word 45 | -------------------------------------------------------------------------------- /src/ins.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1992-2023 John E. Davis 2 | * This file is part of JED editor library source. 3 | * 4 | * You may distribute this file under the terms the GNU General Public 5 | * License. See the file COPYING for more information. 6 | */ 7 | 8 | /* For undo, these flags assumed to be <= 0xFF */ 9 | #define CDELETE 0x1 10 | #define CINSERT 0x2 11 | #define LDELETE 0x4 12 | #define NLINSERT 0x8 /* causes marks to be moved to next line */ 13 | #define NLDELETE 0x10 /* opposite of above */ 14 | #define UNDO_POSITION 0x20 /* records position */ 15 | 16 | extern void jed_update_marks(int, int); 17 | extern int No_Screen_Update; 18 | extern int jed_del_nbytes (int); 19 | extern int jed_generic_del_nbytes (int); 20 | extern int jed_del_wchar(void); 21 | extern int jed_del_through_eol(void); 22 | extern int _jed_ins_byte (unsigned char); /* \n will not split the line */ 23 | extern int jed_insert_wchar (SLwchar_Type); 24 | extern int jed_insert_byte (unsigned char); 25 | extern void insert_buffer(Buffer *); 26 | extern int jed_quick_insert(register unsigned char *, int); 27 | extern int jed_insert_nbytes(unsigned char *, int); 28 | extern int jed_insert_wchar_n_times (SLwchar_Type, unsigned int); 29 | extern int jed_del_newline(void); 30 | extern int _jed_replace_wchar (SLwchar_Type); /* \n not allowed */ 31 | extern int jed_insert_string (SLFUTURE_CONST char *s); 32 | extern int jed_insert_newline (void); 33 | extern int Suspend_Screen_Update; 34 | extern int jed_prepare_for_modification (int); 35 | -------------------------------------------------------------------------------- /doc/tm/Makefile: -------------------------------------------------------------------------------- 1 | # To create the SGML files, you will need to install the tmexpand 2 | # package. See http://www.jedsoft.org/ for more information. 3 | # 4 | TMEXPAND = tmexpand 5 | TM2SGML = $(TMEXPAND) 6 | TM2HLP = $(TMEXPAND) -Mslhlp 7 | DOCBOOK2MAN = docbook2man 8 | 9 | FILES = jedfuns libfuns # quickref 10 | SL_LIBDIR = ../../lib 11 | 12 | HLP_FILES = jedfuns.hlp libfuns.hlp 13 | 14 | TM_FILES = $(addsuffix .tm,$(FILES)) 15 | SGML_FILES = $(addsuffix .sgml,$(FILES)) 16 | HTML_FILES = $(addsuffix .html,$(FILES)) 17 | TXT_FILES = $(addsuffix .txt,$(FILES)) 18 | TEX_FILES = $(addsuffix .tex,$(FILES)) 19 | 20 | RM = /bin/rm 21 | MV = /bin/mv 22 | CP = /bin/cp 23 | 24 | SGML2LATEX = sgml2latex 25 | SGML2HTML = sgml2html 26 | SGML2TXT = sgml2txt -f 27 | SL2TM = sl2tm 28 | 29 | help: jedfuns.hlp libfuns.hlp 30 | all: $(HTML_FILES) $(TEX_FILES) 31 | jedfuns.hlp : rtl/*.tm 32 | cat rtl/*.tm | $(TM2HLP) - jedfuns.hlp 33 | libfuns.hlp : $(SL_LIBDIR)/*.sl 34 | $(SL2TM) -sl $(SL_LIBDIR)/*.sl | $(TM2HLP) - libfuns.hlp 35 | jed.1: jed.sgml 36 | $(DOCBOOK2MAN) jed.sgml 37 | jed.sgml: jed.tm 38 | $(TM2SGML) -I$(MACRODIR) jed.tm jed.sgml 39 | view: jed.1 40 | nroff -man jed.1 | most 41 | # 42 | %.tex : %.sgml 43 | $(SGML2LATEX) $*.sgml 44 | %.html : %.sgml 45 | $(SGML2HTML) $*.sgml 46 | %.txt : %.sgml 47 | $(SGML2TXT) $*.sgml 48 | %.sgml : %.tm 49 | $(TM2SGML) -I$(MACRODIR) $*.tm $@ < /dev/null 50 | install: $(HLP_FILES) 51 | $(CP) $(HLP_FILES) ../hlp 52 | clean: 53 | -rm -f *~ *.dvi *.log *.aux *.toc rtl/*.BAK rtl/*~ *.html *.txt *.hlp 54 | -------------------------------------------------------------------------------- /lib/sort.sl: -------------------------------------------------------------------------------- 1 | define sort_using_function (sort_fun) 2 | { 3 | variable end_line, n, index, i, beg, begc, endc, keys; 4 | 5 | check_region(0); 6 | endc = what_column(); 7 | end_line = what_line(); 8 | pop_mark_1 (); 9 | beg = what_line(); 10 | 11 | n = end_line - beg; ++n; %/* number of lines */ 12 | begc = what_column(); 13 | 14 | if (endc < begc) 15 | { 16 | endc; endc = begc; begc = (); 17 | } 18 | 19 | keys = String_Type [n]; 20 | 21 | % 22 | % extract keys and fill array 23 | % 24 | 25 | goto_line(beg); 26 | for (i = 0; i < n; ++i) 27 | { 28 | goto_column(begc); 29 | push_mark_eol(); 30 | if (what_column() > endc) goto_column(endc); 31 | keys[i] = bufsubstr(); 32 | go_down_1 (); 33 | } 34 | 35 | index = array_sort(keys, sort_fun;; __qualifiers()); 36 | 37 | % 38 | % arrange region 39 | % 40 | goto_line (end_line); 41 | ifnot (down_1 ()) 42 | { 43 | eol(); 44 | newline(); 45 | } 46 | 47 | push_spot(); 48 | for(i = 0; i < n; ++i) 49 | { 50 | goto_line(index[i] + beg); 51 | line_as_string (); % on stack-- also we are at eol now 52 | pop_spot(); 53 | bol(); insert(()); newline(); 54 | push_spot(); 55 | } 56 | pop_spot(); 57 | goto_line(beg); 58 | bol(); push_mark(); 59 | goto_line(end_line + 1); 60 | bol(); del_region(); 61 | } 62 | 63 | define sort () 64 | { 65 | variable dir = (prefix_argument() == NULL) ? +1 : -1; 66 | sort_using_function (&strcmp; dir=dir); 67 | %flush("Done."); 68 | } 69 | -------------------------------------------------------------------------------- /autoconf/scripts/getsyslibs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # This script parses /etc/ld.so.conf and returns lib and include directories 4 | # in a form that JD_CHECK_FOR_LIBRARY can grok. 5 | 6 | SH_TRUE=0 7 | SH_FALSE=1 8 | 9 | # Usage: sh_substr string a b ==> string[a:b] (1s-based) 10 | sh_substr() 11 | { 12 | echo "$1" | cut "-c" "$2-$3" 13 | } 14 | 15 | # if sh_is_comment line; then ... 16 | sh_is_comment() 17 | { 18 | ch=`sh_substr "$1" 1 1` 19 | if test "X$ch" = "X#" -o "X$ch" = "X" 20 | then 21 | return $SH_TRUE; 22 | fi 23 | return $SH_FALSE; 24 | } 25 | 26 | sh_read_ldsoconf () 27 | { 28 | file="$1" 29 | dirlist="" 30 | if test ! -f "$file" 31 | then 32 | return $SH_FALSE; 33 | fi 34 | 35 | while read line 36 | do 37 | if sh_is_comment "$line"; then continue; fi 38 | read p1 p2 pn << EOF 39 | ${line} 40 | EOF 41 | if test "$p1" = "include" 42 | then 43 | for file in $p2 44 | do 45 | dirs=`sh_read_ldsoconf "$file"` 46 | dirlist="$dirlist $dirs" 47 | done 48 | else 49 | dirlist="$dirlist $p1" 50 | fi 51 | done < "$file" 52 | echo "$dirlist" 53 | } 54 | 55 | dirs=`sh_read_ldsoconf "/etc/ld.so.conf"` 56 | XY="" 57 | for Y in $dirs 58 | do 59 | if test "/usr/lib" = `sh_substr $Y 1 8` 60 | then 61 | X="/usr/include" 62 | else 63 | if test "/lib" = `sh_substr $Y 1 4` 64 | then 65 | X="/usr/include" 66 | else 67 | X=`dirname $Y`"/include" 68 | fi 69 | fi 70 | if test -d "$Y" 71 | then 72 | XY="$XY $X,$Y" 73 | fi 74 | done 75 | 76 | echo $XY 77 | 78 | -------------------------------------------------------------------------------- /src/undo.h: -------------------------------------------------------------------------------- 1 | #ifndef DAVIS_UNDO_H_ 2 | #define DAVIS_UNDO_H_ 3 | /* Copyright (c) 1992-2023 John E. Davis 4 | * This file is part of JED editor library source. 5 | * 6 | * You may distribute this file under the terms the GNU General Public 7 | * License. See the file COPYING for more information. 8 | */ 9 | 10 | #if defined (__MSDOS_16BIT__) || defined (__os2_16__) 11 | /* size is something like 2000 x (16) = 32K */ 12 | #define MAX_UNDOS 2000 13 | #else 14 | #define UNDO_HAS_REDO 15 | /* 24 bytes * 10K = 240K */ 16 | #define MAX_UNDOS 10000 17 | #endif 18 | 19 | typedef struct 20 | { 21 | unsigned short type; /* type of damage */ 22 | unsigned int linenum; /* where damage was */ 23 | int point; /* */ 24 | int misc; /* misc information */ 25 | unsigned char buf[8]; /* buffer for chars */ 26 | } Undo_Object_Type; 27 | 28 | typedef struct Undo_Type 29 | { 30 | Undo_Object_Type *Last_Undo; 31 | Undo_Object_Type *First_Undo; 32 | #ifdef UNDO_HAS_REDO 33 | Undo_Object_Type *Current_Undo; 34 | #endif 35 | Undo_Object_Type Undo_Ring[MAX_UNDOS]; 36 | } Undo_Type; 37 | 38 | void record_deletion(unsigned char *, int); 39 | extern void record_insertion(int); 40 | extern void record_newline_insertion(void); 41 | extern int undo(void); 42 | extern void create_undo_ring(void); 43 | extern int Undo_Buf_Unch_Flag; /* 1 if buffer prev not modified */ 44 | 45 | #ifdef UNDO_HAS_REDO 46 | extern void set_current_undo(void); 47 | extern void update_undo_unchanged(void); 48 | #endif 49 | 50 | extern void unmark_undo_boundary (Buffer *); 51 | 52 | extern void jed_undo_record_position (void); 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /lib/verilog.sl: -------------------------------------------------------------------------------- 1 | $1 = "VERILOG"; 2 | 3 | create_syntax_table ($1); 4 | define_syntax ("//","",'%', $1); 5 | define_syntax ("([{", ")]}", '(', $1); 6 | define_syntax ('"', '"', $1); 7 | %define_syntax ('\'', '\'', $1); 8 | define_syntax ('\$', '\\', $1); 9 | define_syntax ('\`', '\\', $1); 10 | define_syntax ("0-9a-zA-Z_", 'w', $1); % words 11 | define_syntax ("-+0-9a-FA-F.xXL", '0', $1); % Numbers 12 | define_syntax (",;.?:=<>", ',', $1); 13 | define_syntax ('#', '#', $1); 14 | define_syntax ("%-+/&*<>|!~^", '+', $1); 15 | set_syntax_flags ($1, 8); 16 | 17 | % Kikutani Makoto suggests: 18 | () = define_keywords ($1, "IFINISOFTOifinisofto", 2); 19 | () = define_keywords ($1, "ANDENDFORMAXMINOUTUSEandendformaxminoutreguse", 3); 20 | () = define_keywords ($1, "CASEELSELOOPPORTTASKTHENWAITWIREcaseelseloopporttaskthenwaitwire", 4); 21 | () = define_keywords ($1, "BEGINEVENTINOUTINPUTINOUTWHILEbegineventinoutinputwhile", 5); 22 | () = define_keywords ($1, "ASSIGNBUFFERDOWNTOENTITYMODULEREPEATRETURNSIGNALASSIGNalwaysassignbufferdowntoentitymoduleoutputrepeatreturnsignal", 6); 23 | () = define_keywords ($1, "DEFAULTENDCASEENDTASKFOREVERINITIALINTEGERNEGEDGEPOSEDGESPECIFYdefaultendcaseendtaskforeverinitialintegernegedgeposedgespecify", 7); 24 | () = define_keywords ($1, "CONSTANTFUNCTIONconstantfunction", 8); 25 | () = define_keywords ($1, "ENDMODULEPARAMETERSPECPARAMendmoduleparameterspecparam", 9); 26 | () = define_keywords ($1, "ENDSPECIFYendspecify", 10); 27 | 28 | define verilog_mode () 29 | { 30 | variable kmap = "VERILOG"; 31 | 32 | set_mode(kmap, 0x28); 33 | use_syntax_table (kmap); 34 | run_mode_hooks("verilog_mode_hook"); 35 | } 36 | -------------------------------------------------------------------------------- /lib/replace.sl: -------------------------------------------------------------------------------- 1 | % 2 | % This function executes a query-replace across all buffers attached to 3 | % a file. 4 | % 5 | 6 | require ("search"); 7 | 8 | define replace_across_buffer_files () 9 | { 10 | variable cbuf = whatbuf (); 11 | variable n = buffer_list (); 12 | variable buf, file, flags; 13 | variable pat, rep; 14 | 15 | pat = read_mini ("Replace:", Null_String, Null_String); 16 | ifnot (strlen (pat)) return; 17 | rep = read_mini ("Replace with:", Null_String, Null_String); 18 | 19 | push_spot (); % save our location 20 | 21 | REPLACE_PRESERVE_CASE_INTERNAL = REPLACE_PRESERVE_CASE; 22 | if ((strlen (rep) == strlen(pat)) and not (strcmp(strlow(rep), strlow(pat)))) 23 | REPLACE_PRESERVE_CASE_INTERNAL = 0; 24 | 25 | if (-1 != prefix_argument (-1)) 26 | REPLACE_PRESERVE_CASE_INTERNAL = not (REPLACE_PRESERVE_CASE_INTERNAL); 27 | 28 | try while (n) 29 | { 30 | buf = (); n--; 31 | 32 | % skip special buffers 33 | if ((buf[0] == '*') or (buf[0] == ' ')) continue; 34 | 35 | sw2buf (buf); 36 | 37 | (file,,,flags) = getbuf_info (); 38 | 39 | % skip if no file associated with buffer, or is read only 40 | ifnot (strlen (file) or (flags & 8)) continue; 41 | 42 | % ok, this buffer is what we want. 43 | 44 | push_spot_bob (); 45 | ERROR_BLOCK 46 | { 47 | pop_spot (); 48 | } 49 | 50 | replace_with_query (&search_search_function, pat, rep, 1, 51 | &replace_do_replace); 52 | pop_spot (); 53 | } 54 | finally 55 | { 56 | sw2buf (cbuf); 57 | pop_spot (); 58 | _pop_n (n); % remove buffers from stack 59 | REPLACE_PRESERVE_CASE_INTERNAL = 0; 60 | } 61 | 62 | message ("Done."); 63 | } 64 | 65 | -------------------------------------------------------------------------------- /lib/edt.hlp: -------------------------------------------------------------------------------- 1 | +-----------------------------------+ +--------+--------+--------+-------+ 2 | | ^ | DOWN | | | | | | FNDNXT | DEL L | 3 | | | | | | <---- | ----> | | *GOLD | HELP | | | 4 | | | | | | LEFT | RIGHT | | | | *FIND | *UND L| 5 | | UP | v | | | +--------+--------+--------+-------+ 6 | +-----------------------------------+ | PAGE | SECT | APPEND | DEL W | 7 | DELETE Delete character | | | | | 8 | LINEFEED Delete to beginning of word |*COMMAND| *FILL |*REPLACE|*UND W | 9 | BACKSPACE Backup to beginning of line +--------+--------+--------+-------+ 10 | CTRL/R Refresh screen | ADVANCE| BACKUP | CUT | DEL C | 11 | GOLD-Q Quit | | | | | 12 | GOLD-E Quit |*BOTTOM | *TOP |*PASTE |*UND C | 13 | +--------+--------+--------+-------+ 14 | | WORD | EOL | CHAR | | 15 | | | | | ENTER | 16 | More help follows below. |*CHGCASE|*DEL EOL|*SPECINS| | 17 | +--------+--------+--------+ | 18 | | LINE | SELECT | | 19 | | | | *SUBS | 20 | | *OPEN LINE | *RESET | | 21 | +-----------------+--------+-------+ 22 | 23 | -------------------------------------------------------------------------------- /lib/jedhelp.sl: -------------------------------------------------------------------------------- 1 | % 2 | % This is supposed to be an easy to use help facility 3 | % 4 | 5 | $1 = " *EZhelp*"; 6 | 7 | ifnot (keymap_p($1)) 8 | { 9 | make_keymap($1); 10 | definekey("page_up", "^?", $1); 11 | definekey("page_up", "u", $1); 12 | definekey("page_up", "U", $1); 13 | definekey("page_down", " ", $1); 14 | definekey("page_down", "d", $1); 15 | definekey("page_down", "D", $1); 16 | definekey("search_forward", "S", $1); 17 | definekey("search_forward", "F", $1); 18 | definekey("search_forward", "f", $1); 19 | definekey("search_forward", "s", $1); 20 | definekey("search_backward", "b", $1); 21 | definekey("search_backward", "B", $1); 22 | definekey("ezhelp_quit", "q", $1); 23 | definekey("ezhelp_quit", "Q", $1); 24 | } 25 | 26 | variable EZhelp_Last_Buffer; 27 | 28 | define ezhelp_quit() 29 | { 30 | sw2buf(EZhelp_Last_Buffer); 31 | } 32 | 33 | define jed_easy_help(file) 34 | { 35 | variable c, hlpbuf, hlpfile, err, flags, dir; 36 | hlpbuf = " *EZhelp*"; 37 | ifnot (strcmp(hlpbuf, whatbuf())) return; 38 | EZhelp_Last_Buffer = whatbuf(); 39 | err = strcat("Help file not found: ", file); 40 | ERROR_BLOCK 41 | { 42 | ezhelp_quit(); 43 | } 44 | 45 | sw2buf(hlpbuf); 46 | (hlpfile, dir, hlpbuf, flags) = getbuf_info(); 47 | 48 | if (strcmp(hlpfile, file)) 49 | { 50 | hlpfile = expand_jedlib_file(file); 51 | ifnot (strlen(hlpfile)) error(err); 52 | erase_buffer(); 53 | set_readonly(0); 54 | if (insert_file(hlpfile) <= 0) error(err); 55 | setbuf_info(file, dir, hlpbuf, flags); 56 | bob(); 57 | set_readonly(1); 58 | } 59 | use_keymap(hlpbuf); 60 | set_status_line(" u:Page Up, d:Page Down, s:Search, q:Quit Help (%p)", 0); 61 | } 62 | 63 | -------------------------------------------------------------------------------- /bin/vms/jed_mail.com: -------------------------------------------------------------------------------- 1 | $ ! Command procedure to invoke an editor for MAIL. 2 | $ ! 3 | $ ! Inputs: 4 | $ ! 5 | $ ! P1 = Input file name. 6 | $ ! P2 = Output file name. 7 | $ ! 8 | $ ! If MAIL$EDIT is undefined, MAIL will invoke callable EDT. 9 | $ ! If MAIL$EDITis defined to be a command procedure, 10 | $ ! MAIL will create a subprocess to edit the mail. 11 | $ ! 12 | $ ! Note that this procedure is run in the context of a subprocess. 13 | $ ! LOGIN.COM is not executed. However, all process logical names 14 | $ ! and DCL global symbols are copied. 15 | $ ! 16 | $ ! The default directory is the same as the parent process 17 | $ ! 18 | $!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 19 | $! 20 | $! jed: 21 | $! 22 | $! 23 | $!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 24 | $! 25 | $! *** jed *** 26 | $! 27 | $ VERIFY = F$VERIFY (0) 28 | $ define/job/nolog jed_attach_to 'f$getjpi("", "PID") 29 | $ define /user sys$input 'f$trnlnm("SYS$OUTPUT")' 30 | $ if (p1 .EQS. "") THEN GOTO NO_INPUT_jed 31 | $! 32 | $ copy 'p1' 'p2' 33 | $! 34 | $ No_Input_Jed: 35 | $! 36 | $ priv_list = f$setprv ("NOWORLD, NOGROUP") 37 | $ pid := 'f$trnlnm("JED_PID")' 38 | $ if (pid .eqs. "") then goto no_attach 39 | $ context = 0 40 | $ Loop: 41 | $ if (pid .eqs. f$pid ( context )) then goto attach 42 | $ if (context .ne. 0) then goto loop 43 | $! 44 | $ no_attach: 45 | $ priv_list = f$setprv (priv_list) 46 | $ runjed 'p2' 47 | $ goto done 48 | $ attach: 49 | $ priv_list = f$setprv (priv_list) 50 | $ define/nolog/job jed_file_name "''p2'" 51 | $ attach/id = 'pid' 52 | $ deassign/job jed_file_name 53 | $ done: 54 | $! 55 | $ IF (VERIFY) THEN SET VERIFY 56 | $ EXIT 57 | -------------------------------------------------------------------------------- /doc/README: -------------------------------------------------------------------------------- 1 | The main reason JED's version number is below 1.0 is due to the lack of 2 | adequate documentation. It is slowing being improved. 3 | 4 | There are several sub-directories here including: 5 | 6 | txt/ 7 | 8 | Many text files that describe various aspects of the editor are 9 | in this directory. They will eventually be stitched together 10 | and included in the manual. 11 | 12 | tm/ 13 | 14 | This directory contains the text-macro source for the intrinsic 15 | functions. In addition, it contains Guido Gonzato's quick 16 | reference guide for jed. 17 | 18 | manual/ 19 | 20 | Eventually the jed manual will be put here. Right now what is 21 | in there is old and is most likely out of date. 22 | 23 | 24 | ACKNOWLEDGEMENTS 25 | ---------------- 26 | 27 | I am extremely grateful to the following individuals for their 28 | contributions to jed. For many of them, this is long overdue. 29 | 30 | Luchesar Ionkov 31 | Mark Olesen 32 | John Burnell 33 | Darrel Hankerson 34 | Dominik Wujastyk 35 | Ulli Horlacher 36 | Hunter Goatley 37 | Simon Tatham 38 | Nick Tatham 39 | Andy Harper 40 | John Skilleter 41 | Jim Knoble 42 | Guido Gonzato 43 | Charl Botha 44 | Eddie Penninkhof 45 | Jouk Jansen 46 | Martin P.J. Zinser 47 | Tom Culliton 48 | Kazuhisa Yoshino 49 | Jim Clifton 50 | Jan Hlavacek 51 | Francesc Rocher 52 | Thomas J. Moore 53 | 54 | There are other names that belong on this list, particularly from 55 | those who supported jed when the version was still 0.8. 56 | Unfortunately I no longer have any records of their contributions. 57 | -------------------------------------------------------------------------------- /src/jprocess.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1992-2023 John E. Davis 2 | * This file is part of JED editor library source. 3 | * 4 | * You may distribute this file under the terms the GNU General Public 5 | * License. See the file COPYING for more information. 6 | */ 7 | #define MAX_PROCESSES 10 8 | 9 | #ifdef __WIN32__ 10 | # ifdef VOID 11 | # undef VOID 12 | # endif 13 | # include 14 | # include 15 | /* # define WIN95BUG 1 */ 16 | /* extern CRITICAL_SECTION Critical_Section; */ 17 | extern HANDLE Input_Events[]; 18 | #else 19 | extern int Subprocess_Read_fds [MAX_PROCESSES][3]; 20 | extern int Max_Subprocess_FD; 21 | #endif 22 | 23 | extern int Num_Subprocesses; 24 | extern volatile int Child_Status_Changed_Flag; 25 | 26 | extern void read_process_input (int); 27 | extern int jed_close_process (int *); 28 | extern int jed_send_process (int *, char *); 29 | extern int jed_open_process (int *); 30 | extern int jed_open_process_pipe (int *); 31 | 32 | extern void jed_get_child_status (void); 33 | extern void jed_kill_process (int); 34 | extern void jed_get_process_mark (int *); 35 | extern void jed_set_process (void); 36 | extern void jed_send_process_eof (int *); 37 | extern void get_process_input (int *); 38 | extern int jed_signal_process (int *, int *); 39 | extern int jed_signal_fg_process (int *, int *); 40 | extern int jed_processes_ok_to_exit (void); 41 | extern void jed_query_process_at_exit (int *, int *); 42 | 43 | extern void jed_set_process_flags (int *, int *); 44 | extern int jed_get_process_flags (int *); 45 | 46 | #ifdef REAL_UNIX_SYSTEM 47 | extern void jed_block_child_signal (int); 48 | extern int jed_fork_monitor (void); 49 | #endif 50 | 51 | extern FILE *jed_popen (char *, char *); 52 | extern int jed_pclose (FILE *); 53 | 54 | -------------------------------------------------------------------------------- /INSTALL.w32: -------------------------------------------------------------------------------- 1 | -*- text -*- 2 | 3 | This file contains the instructions for building jed using the MinGW 4 | (mingw32/64) compiler suite. The compiler and related tools may be obtained 5 | from 6 | 7 | 8 | 9 | 10 | and other places. 11 | 12 | Other than the C compiler, the main prerequisite is the slang library. 13 | Version pre2.3.4-5 or later is required. It is availble from 14 | . Compile and install it first. 15 | By default, the library will be installed under C:\MinGW\local. This 16 | installation directory is assumed in what follows below. 17 | 18 | 1. In a CMD window, make sure that the library is installed and in 19 | your path by running the command: 20 | 21 | C:\path\to\jed> slsh --version 22 | slsh version 0.9.4-0; S-Lang version: pre2.3.4-6 23 | 24 | 2. From the top of the jed source distribution, create the 25 | makefiles by running: 26 | 27 | C:\path\to\jed> mkfiles\m32init.bat 28 | 29 | 3. Now compile the code to create jed.exe (console mode editor) and 30 | wjed.exe (GUI version). 31 | 32 | C:\path\to\jed> mingw32-make 33 | 34 | 4. The next step is to install the editor: 35 | 36 | C:\path\to\slang> mingw32-make install 37 | 38 | Finally you will need to make sure that the $PREFIX/jed/bin directory is 39 | in your PATH. Here, $PREFIX refers to the value of the PREFIX 40 | variable in the Makefile. Assuming the default value for PREFIX, then 41 | a command such as: 42 | 43 | set PATH=C:\MinGW\local\jed\bin;%PATH% 44 | 45 | will add the appropriate value to the path. 46 | 47 | More information on the makefile generation process is available in 48 | src/mkfiles/README. 49 | -------------------------------------------------------------------------------- /lib/tabs.sl: -------------------------------------------------------------------------------- 1 | %% 2 | %% Tab routines for JED 3 | %% 4 | 5 | %% The following defines the tab stops to be 8 column: 6 | custom_variable ("Tab_Stops", [0:19] * TAB_DEFAULT + 1); 7 | 8 | define tab_to_tab_stop () 9 | { 10 | variable c, goal, i; 11 | c = what_column (); 12 | 13 | foreach (Tab_Stops) 14 | { 15 | goal = (); 16 | if (goal > c) break; 17 | } 18 | 19 | insert_spaces (goal - c); 20 | } 21 | 22 | setkey ("tab_to_tab_stop", "^I"); 23 | 24 | private variable _Tabs_Buffer; 25 | 26 | $1 = "*TabsEdit*"; 27 | ifnot (keymap_p($1)) 28 | { 29 | make_keymap ($1); 30 | undefinekey ("^C", $1); 31 | definekey ("tabs_install_tab_stops", "^C^C", $1); 32 | } 33 | 34 | %% emacs like edit tab stops 35 | define edit_tab_stops () 36 | { 37 | variable tbuf, i; 38 | _Tabs_Buffer = whatbuf(); 39 | tbuf = "*TabsEdit*"; 40 | 41 | sw2buf(tbuf); erase_buffer(); 42 | TAB = 0; 43 | 44 | use_keymap(tbuf); 45 | foreach (Tab_Stops) 46 | { 47 | i = (); 48 | goto_column (i); 49 | insert_char ('T'); 50 | } 51 | newline (); 52 | _for (1, 13, 1) 53 | { 54 | i = (); 55 | goto_column (10 * i); 56 | insert (string(i)); 57 | } 58 | newline (); 59 | 60 | loop (13) insert ("1234567890"); 61 | 62 | insert ("\nTo install changes, type control-c control-c."); 63 | bob (); 64 | set_buffer_modified_flag (0); 65 | set_overwrite (1); 66 | } 67 | 68 | define tabs_install_tab_stops () 69 | { 70 | variable i; 71 | bob (); 72 | 73 | _for (0, length (Tab_Stops) - 1, 1) 74 | { 75 | i = (); 76 | skip_white (); 77 | if (eolp()) break; 78 | Tab_Stops[i] = what_column (); 79 | go_right_1 (); 80 | } 81 | 82 | Tab_Stops[[i:]] = 0; 83 | 84 | set_buffer_modified_flag (0); 85 | delbuf (whatbuf ()); 86 | sw2buf ( _Tabs_Buffer); 87 | } 88 | -------------------------------------------------------------------------------- /lib/compat.sl: -------------------------------------------------------------------------------- 1 | define create_array () 2 | { 3 | variable n, dims, type; 4 | variable i, size, dim; 5 | variable a; 6 | 7 | n = (); 8 | dims = Integer_Type [n]; 9 | 10 | i = n; 11 | size = 1; 12 | while (i) 13 | { 14 | i--; 15 | dim = (); 16 | dims[i] = dim; 17 | size = size * dim; 18 | } 19 | type = (); 20 | switch (type) 21 | { 22 | case 'i': 23 | a = Integer_Type [size]; 24 | } 25 | #ifdef SLANG_DOUBLE_TYPE 26 | { 27 | case 'f': 28 | a = Double_Type [size]; 29 | } 30 | #endif 31 | { 32 | case 's': 33 | a = String_Type [size]; 34 | } 35 | { 36 | case 128: 37 | a = Mark_Type [size]; 38 | } 39 | { 40 | % default 41 | verror ("create_array: Type %d not supported.", type); 42 | } 43 | 44 | reshape (a, dims); 45 | 46 | return a; 47 | } 48 | 49 | %{{{ strncat (n) 50 | %!%+ 51 | %\function{strncat} 52 | %\synopsis{strncat} 53 | %\usage{Void strncat (String a, String b, ..., Integer n);} 54 | %\description 55 | % Returns concatenated string "abc..." 56 | %\notes 57 | % This function is obsolete. 58 | %!%- 59 | define strncat (n) 60 | { 61 | ""; 62 | _stk_roll (n + 1); 63 | create_delimited_string (n); 64 | } 65 | 66 | % define info_mode () 67 | % { 68 | % info_reader (); 69 | % } 70 | 71 | % These are function to archive backward compatibiliy and give third 72 | % party mode time to migrate to slang load path. 73 | define get_jed_library_path() 74 | { 75 | variable t = get_slang_load_path (); 76 | 77 | (t,) = strreplace(t, char(path_get_delimiter()), ",", strlen(t)); 78 | return t; 79 | } 80 | 81 | define set_jed_library_path(path) 82 | { 83 | variable t; 84 | (t,) = strreplace(path, ",", char(path_get_delimiter()), strlen(path)); 85 | set_slang_load_path(t); 86 | } 87 | 88 | -------------------------------------------------------------------------------- /autoconf/Makefile.in: -------------------------------------------------------------------------------- 1 | # -*- sh -*- 2 | 3 | #This is a UNIX-only makefile. For other systems, get a makefile from 4 | #src/mkfiles/ 5 | 6 | @SET_MAKE@ 7 | 8 | jed: makefiles 9 | cd src; $(MAKE) jed 10 | @echo If you have X, try 'make xjed' 11 | all: makefiles 12 | cd src; $(MAKE) all 13 | xjed: makefiles 14 | cd src; $(MAKE) xjed 15 | rgrep: makefiles 16 | cd src; $(MAKE) rgrep 17 | Makefile: configure autoconf/Makefile.in 18 | @echo "Makefile is older than the configure script". 19 | @echo "Please re-run the configure script." 20 | @exit 1 21 | src/Makefile: configure src/Makefile.in src/config.hin src/jed-feat.h 22 | @echo "src/Makefile is older than its dependencies". 23 | @echo "Please re-run the configure script." 24 | @exit 1 25 | makefiles: Makefile src/Makefile 26 | clean: 27 | /bin/rm -f *~ 28 | cd src; $(MAKE) clean 29 | # 30 | distclean: 31 | /bin/rm -f *~ Makefile config.status config.log config.cache files.pck 32 | cd src; $(MAKE) distclean 33 | # 34 | install: makefiles 35 | cd src; $(MAKE) install 36 | # 37 | getmail: makefiles 38 | cd src; $(MAKE) getmail 39 | @echo getmail created. Copy it to JED_ROOT/bin. 40 | 41 | # The symlinks target is for my own private use. It simply creates the object 42 | # directory as a symbolic link to a local disk instead of an NFS mounted one. 43 | symlinks: 44 | cd src; $(MAKE) symlinks 45 | configure: autoconf/aclocal.m4 autoconf/configure.ac 46 | cd autoconf && autoconf && mv ./configure .. 47 | update: autoconf/config.sub autoconf/config.guess 48 | autoconf/config.guess: /usr/share/misc/config.guess 49 | /bin/cp -f /usr/share/misc/config.guess autoconf/config.guess 50 | autoconf/config.sub: /usr/share/misc/config.sub 51 | /bin/cp -f /usr/share/misc/config.sub autoconf/config.sub 52 | 53 | .PHONY: jed all xjed rgrep clean distclean install getmail symlinks makefiles 54 | -------------------------------------------------------------------------------- /info/jed.info: -------------------------------------------------------------------------------- 1 | START-INFO-DIR-ENTRY 2 | * JED: (jed). The JED editor 3 | END-INFO-DIR-ENTRY 4 | 5 |  6 | Indirect: 7 | jed.1in: 83 8 | jed.2in: 24234 9 | jed.3in: 49114 10 |  11 | Tag Table: 12 | (Indirect) 13 | Node: Top83 14 | Node: Introduction709 15 | Node: Installing JED1313 16 | Node: Startup Files3430 17 | Node: Starting JED4438 18 | Node: Emulating Other Editors6529 19 | Node: Emacs Emulation7026 20 | Node: EDT Emulation7590 21 | Node: Wordstar Emulation9907 22 | Node: File Types and Sizes10279 23 | Node: Backup and Autosave Files10894 24 | Node: Status line and Windows12656 25 | Node: MiniBuffer13580 26 | Node: Command Line Completion14501 27 | Node: File Names16808 28 | Node: Buffer Name and File Name Completion19290 29 | Node: Basic Editing20155 30 | Node: Undo21943 31 | Node: Marking Text (Point and Mark)22967 32 | Node: Tab Issues.24234 33 | Node: Searching27481 34 | Node: Rectangles29905 35 | Node: Sorting30926 36 | Node: Modes33018 37 | Node: Wrap Mode33723 38 | Node: Formatting paragraphs34040 39 | Node: Smart Quotes35827 40 | Node: C Mode36987 41 | Node: Fortran Mode38152 42 | Node: Keyboard Macros38869 43 | Node: Shells and Shell Commands40843 44 | Node: Getting Help42061 45 | Node: Editing Binary Files42866 46 | Node: Dired43608 47 | Node: Mail45714 48 | Node: Customization47963 49 | Node: Setting Keys49114 50 | Node: Predefined Variables52820 51 | Node: Hooks54172 52 | Node: S-Lang Programming Hints (Debugging)57163 53 | Node: Eight Bit Clean Issues61244 54 | Node: Displaying Characters with the High Bit Set61539 55 | Node: Inputting Characters with the High Bit Set62645 56 | Node: Upper Case - Lower Case Conversions64483 57 | Node: Miscellaneous66739 58 | Node: Abort Character66919 59 | Node: Input Translation67632 60 | Node: Display Sizes68904 61 |  62 | End Tag Table 63 | -------------------------------------------------------------------------------- /src/mkfiles/mkmake.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | char *SLmalloc (SLstrlen_Type len) 7 | { 8 | char *m = malloc (len); 9 | if (m == NULL) 10 | (void) fprintf (stderr, "Out of memory\n"); 11 | return m; 12 | } 13 | 14 | SLFUTURE_VOID *SLcalloc (SLstrlen_Type n, SLstrlen_Type len) 15 | { 16 | SLFUTURE_VOID *p = SLmalloc (n*len); 17 | if (p != NULL) 18 | memset (p, 0, n*len); 19 | return p; 20 | } 21 | 22 | void SLfree (SLFUTURE_VOID *s) 23 | { 24 | if (s != NULL) free (s); 25 | } 26 | 27 | void SLang_free_slstring (SLCONST SLstr_Type *s) 28 | { 29 | if (s != NULL) free ((void *)s); 30 | } 31 | 32 | char *SLang_create_slstring (char *s) 33 | { 34 | char *t; 35 | 36 | t = SLmalloc (strlen (s) + 1); 37 | if (t == NULL) 38 | return t; 39 | 40 | strcpy (t, s); 41 | return t; 42 | } 43 | 44 | 45 | static void usage (void) 46 | { 47 | fprintf (stderr, "Usage: mkmake [DEF1 [DEF2 ...]]\n"); 48 | exit (1); 49 | } 50 | 51 | int main (int argc, char **argv) 52 | { 53 | char buf[1024]; 54 | int i; 55 | SLprep_Type *pt; 56 | 57 | if (isatty (0)) 58 | usage (); 59 | 60 | if (NULL == (pt = SLprep_new ())) 61 | return 1; 62 | 63 | if ((-1 == SLprep_set_prefix (pt, "!")) 64 | || (-1 == SLprep_set_comment (pt, "#", "")) 65 | || (-1 == SLprep_set_flags (pt, SLPREP_BLANK_LINES_OK | SLPREP_COMMENT_LINES_OK))) 66 | { 67 | SLprep_delete (pt); 68 | return 1; 69 | } 70 | 71 | for (i = 1; i < argc; i++) 72 | SLdefine_for_ifdef (argv[i]); 73 | 74 | while (NULL != fgets (buf, sizeof (buf) - 1, stdin)) 75 | { 76 | if (SLprep_line_ok (buf, pt)) 77 | { 78 | fputs (buf, stdout); 79 | } 80 | } 81 | 82 | SLprep_delete (pt); 83 | return 0; 84 | } 85 | 86 | -------------------------------------------------------------------------------- /doc/txt/color.txt: -------------------------------------------------------------------------------- 1 | This is a short note explaining how to use JED with a color terminal. 2 | This only applies to Unix and VMS. This is particularly relevant if 3 | you want to exploit JED's ability to do color syntax highlighting on a 4 | character based terminal. 5 | 6 | *Note: If you use MS-Kermit as a terminal emulator, you will need 7 | to tell it what foreground/background colors you want via 8 | the `set term color' function. For example, if you choose 9 | back on white as the `normal' color, put `set term color 10 | 30 47' in your MSKermit.ini file. This same comment 11 | applies to other color terminals which emulate this flawed 12 | color model. 13 | 14 | To use JED with a color terminal, it is necessary that the terminal 15 | understand ANSI color escape sequences. If so, then it is possible to set 16 | up JED to use different foreground and background colors for the modeline, 17 | region highlighting, syntax highlighting, etc... 18 | 19 | To turn on ANSI color support, set the variable `USE_ANSI_COLORS' to a 20 | non-zero value. If set to zero, the support is turned off. The colors may 21 | be specified using the set_color function as illustrated in jed.rc. They 22 | only become active if USE_ANSI_COLORS is non-zero. 23 | 24 | Unfortunately, few termcaps provide information regarding whether the 25 | terminal is a color one or not. To interactively set USE_ANSI_COLORS, simply 26 | press `Ctrl-X ESC' and enter 27 | 28 | USE_ANSI_COLORS = 1 29 | 30 | at the `S-Lang>' prompt. 31 | 32 | This variable is automatically set to a non-zero value by jed if 33 | environment variable COLORTERM exists. 34 | 35 | Finally, you could simply put: 36 | 37 | define term_use_colors () { USE_ANSI_COLORS = 1; } 38 | 39 | in your jed.rc (.jedrc) and define (alias) jed to be: 40 | 41 | alias colorjed 'jed -f term_use_colors' 42 | 43 | -------------------------------------------------------------------------------- /lib/occur.sl: -------------------------------------------------------------------------------- 1 | %% occur function 2 | %% 3 | 4 | $1 = "Occur"; 5 | ifnot (keymap_p ($1)) 6 | { 7 | make_keymap ($1); 8 | } 9 | 10 | definekey ("occur_goto_line", "g", $1); 11 | variable Occur_Buffer = Null_String; 12 | 13 | define occur_goto_line () 14 | { 15 | variable line; 16 | 17 | ifnot (bufferp (Occur_Buffer)) 18 | return; 19 | 20 | bol (); 21 | push_mark (); 22 | ifnot (ffind (":")) 23 | { 24 | pop_mark_0 (); 25 | return; 26 | } 27 | 28 | line = integer (bufsubstr ()); 29 | 30 | pop2buf (Occur_Buffer); 31 | goto_line (line); 32 | } 33 | 34 | %!%+ 35 | %\function{occur} 36 | %\synopsis{occur} 37 | %\usage{Void occur ();} 38 | %\description 39 | % This function may be used to search for all occurances of a string in the 40 | % current buffer. It creates a separate buffer called \var{*occur*} and 41 | % associates a keymap called \var{Occur} with the new buffer. In this 42 | % buffer, the \var{g} key may be used to go to the line described by the 43 | % match. 44 | %!%- 45 | define occur() 46 | { 47 | variable str, tmp, n; 48 | 49 | str = read_mini("Find All (Regexp):", LAST_SEARCH, Null_String); 50 | ifnot (strlen (str)) 51 | return; 52 | 53 | tmp = "*occur*"; 54 | Occur_Buffer = whatbuf(); 55 | pop2buf(tmp); 56 | erase_buffer(); 57 | pop2buf(Occur_Buffer); 58 | 59 | push_spot(); 60 | bob (); 61 | while (re_fsearch(str)) 62 | { 63 | line_as_string (); % stack-- at eol too 64 | n = what_line (); 65 | 66 | setbuf(tmp); 67 | vinsert ("%4d:", n); 68 | insert(()); 69 | newline(); 70 | setbuf(Occur_Buffer); 71 | ifnot (down_1 ()) %% so we do not find another occurance on same line 72 | break; 73 | } 74 | pop_spot(); 75 | setbuf(tmp); 76 | bob(); set_buffer_modified_flag(0); 77 | 78 | use_keymap ("Occur"); 79 | run_mode_hooks ("occur_mode_hook"); 80 | } 81 | 82 | -------------------------------------------------------------------------------- /src/doskeys.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1992-2023 John E. Davis 2 | * This file is part of JED editor library source. 3 | * 4 | * You may distribute this file under the terms the GNU General Public 5 | * License. See the file COPYING for more information. 6 | */ 7 | #define PC_NULL "\xE0^C" 8 | #define PC_SLASH "\033OQ" 9 | #define PC_STAR "\033OR" 10 | #define PC_MINUS "\033OS" 11 | #define PC_PLUS "\033Om" 12 | #define PC_ENTER "\033OM" 13 | #define PC_KP5 "\033Ou" 14 | #define PC_UP "\xE0H" 15 | #define PC_UP1 "\033Ox" 16 | #define PC_DN "\xE0P" 17 | #define PC_DN1 "\033Or" 18 | #define PC_RT "\xE0M" 19 | #define PC_RT1 "\033Ov" 20 | #define PC_LT "\xE0K" 21 | #define PC_LT1 "\033Ot" 22 | #define PC_PGUP "\xE0I" 23 | #define PC_PGUP1 "\033Oy" 24 | #define PC_PGDN "\xE0Q" 25 | #define PC_PGDN1 "\033Os" 26 | #define PC_INS "\xE0R" 27 | #define PC_INS1 "\033Op" 28 | #define PC_DEL "\xE0S" 29 | #define PC_DEL1 "\033On" 30 | #define PC_END "\xE0O" 31 | #define PC_END1 "\033Oq" 32 | #define PC_HOME "\xE0G" 33 | #define PC_HOME1 "\033Ow" 34 | 35 | #define PC_F1 "^@;" 36 | #define PC_F2 "^@<" 37 | #define PC_F3 "^@=" 38 | #define PC_F4 "^@>" 39 | #define PC_F5 "^@?" 40 | #define PC_F6 "^@@" 41 | #define PC_F7 "^@A" 42 | #define PC_F8 "^@B" 43 | #define PC_F9 "^@C" 44 | #define PC_F10 "^@D" 45 | 46 | #define PC_ALT_F1 "^@h" 47 | #define PC_ALT_F2 "^@i" 48 | #define PC_ALT_F3 "^@j" 49 | #define PC_ALT_F4 "^@k" 50 | #define PC_ALT_F5 "^@l" 51 | #define PC_ALT_F6 "^@m" 52 | #define PC_ALT_F7 "^@n" 53 | #define PC_ALT_F8 "^@o" 54 | #define PC_ALT_F9 "^@p" 55 | #define PC_ALT_F10 "^@q" 56 | 57 | #define PC_SHIFT_F1 "^@T" 58 | #define PC_SHIFT_F2 "^@U" 59 | #define PC_SHIFT_F3 "^@V" 60 | #define PC_SHIFT_F4 "^@W" 61 | #define PC_SHIFT_F5 "^@X" 62 | #define PC_SHIFT_F6 "^@Y" 63 | #define PC_SHIFT_F7 "^@Z" 64 | #define PC_SHIFT_F8 "^@[" 65 | #define PC_SHIFT_F9 "^@\\" 66 | #define PC_SHIFT_F10 "^@]" 67 | -------------------------------------------------------------------------------- /doc/txt/recentx.txt: -------------------------------------------------------------------------------- 1 | Recently edited files 2 | --------------------- 3 | 4 | The `recentx.sl' library file contains functions that enable jed to 5 | maintain a cache of recently edited file names. The older version, 6 | `recent.sl' is deprecated. 7 | 8 | recentx.sl adds the following additional menu entries to the the "File" 9 | menu: 10 | 11 | Recent Files 12 | Recent Files by Ext 13 | 14 | The "Recent Files" menu contains a list of the recently accessed 15 | files. The number displayed is configurable via the 16 | `Recentx_Max_Files' variable. The default is 15. 17 | 18 | The "Recent Files by Ext" menu organizes recently accessed files by 19 | extension. The number per extension is also controlled by the 20 | `Recentx_Max_Files' variable. 21 | 22 | To enable this feature, add the following lines to your .jedrc file: 23 | 24 | require ("recentx"); 25 | Recentx_Cache_Filename = ".jedrecent"; 26 | Recentx_Max_Files = 15; % The number of files per extension 27 | Recentx_Cache_Exclude_Patterns = {"^/tmp/", "\.tmp$"R}; 28 | 29 | The value of the Recentx_Cache_Exclude_Patterns variable is a list of 30 | regular expressions that exclude the caching of filenames that match 31 | any of the patterns. In the above example, files with a ".tmp" 32 | extension or are under the /tmp directory are excluded. 33 | 34 | Recentx_Cache_Filename specifies the name of the list of filenames in 35 | the cache. Its value may either be an absolute pathname or a relative 36 | pathname. If relative, then its value will be interpreted as relative 37 | to the value of Jed_Home_Directory. 38 | 39 | The file format of the Recentx_Cache_Filename consists of lines of the 40 | form: 41 | 42 | time|filename 43 | 44 | Here, `|' is a field delimiter. The time field represents the number 45 | of seconds the file was last accesses since the Unix epoch. The 46 | filename field gives the absolute pathname of the file. 47 | -------------------------------------------------------------------------------- /lib/colors/white1.sl: -------------------------------------------------------------------------------- 1 | $1 = "black"; $2 = "white"; 2 | 3 | set_color("normal", $1, $2); 4 | set_color("status", "yellow", "blue"); 5 | set_color("operator", $1, $2); % +, -, etc.. 6 | set_color("number", "brightblue", $2); % 10, 2.71, etc.. 7 | set_color("comment", "black", "brightcyan");% /* comment */ 8 | set_color("region", "yellow", "brightmagenta"); 9 | set_color("string", "brightblue", $2); % "string" or 'char' 10 | set_color("keyword", "brightred", $2); % if, while, unsigned, ... 11 | set_color("keyword1", "red", $2); % if, while, unsigned, ... 12 | set_color("delimiter", $1, $2); % {}[](),.;... 13 | set_color("preprocess", "magenta", $2); 14 | set_color("message", "blue", $2); 15 | set_color("error", "brightred", $2); 16 | set_color("dollar", "brightred", $2); 17 | set_color("...", "red", $2); % folding indicator 18 | 19 | set_color ("menu_char", "yellow", "blue"); 20 | set_color ("menu", "lightgray", "blue"); 21 | set_color ("menu_popup", "lightgray", "blue"); 22 | set_color ("menu_shadow", "blue", "black"); 23 | set_color ("menu_selection", "green", "red"); 24 | set_color ("menu_selection_char", "yellow", "red"); 25 | 26 | set_color ("cursor", "black", "red"); 27 | set_color ("cursorovr", "black", "red"); 28 | 29 | %% The following have been automatically generated: 30 | set_color("linenum", "yellow", "blue"); 31 | set_color("trailing_whitespace", "black", "brightcyan"); 32 | set_color("tab", "black", "brightcyan"); 33 | set_color("url", "brightblue", $2); 34 | set_color("italic", $1, $2); 35 | set_color("underline", "red", $2); 36 | set_color("bold", "brightred", $2); 37 | set_color("html", "brightred", $2); 38 | set_color("keyword2", $1, $2); 39 | set_color("keyword3", $1, $2); 40 | set_color("keyword4", $1, $2); 41 | set_color("keyword5", $1, $2); 42 | set_color("keyword6", $1, $2); 43 | set_color("keyword7", $1, $2); 44 | set_color("keyword8", $1, $2); 45 | set_color("keyword9", $1, $2); 46 | -------------------------------------------------------------------------------- /lib/colors/default1.sl: -------------------------------------------------------------------------------- 1 | $1 = "default"; $2 = "default"; 2 | 3 | set_color("normal", $1, $2); 4 | set_color("status", "yellow", "blue"); 5 | set_color("operator", $1, $2); % +, -, etc.. 6 | set_color("number", "brightblue", $2); % 10, 2.71, etc.. 7 | set_color("comment", "black", "brightcyan");% /* comment */ 8 | set_color("region", "yellow", "brightmagenta"); 9 | set_color("string", "brightblue", $2); % "string" or 'char' 10 | set_color("keyword", "brightred", $2); % if, while, unsigned, ... 11 | set_color("keyword1", "red", $2); % if, while, unsigned, ... 12 | set_color("delimiter", $1, $2); % {}[](),.;... 13 | set_color("preprocess", "magenta", $2); 14 | set_color("message", "blue", $2); 15 | set_color("error", "brightred", $2); 16 | set_color("dollar", "brightred", $2); 17 | set_color("...", "red", $2); % folding indicator 18 | 19 | set_color ("menu_char", "yellow", "blue"); 20 | set_color ("menu", "lightgray", "blue"); 21 | set_color ("menu_popup", "lightgray", "blue"); 22 | set_color ("menu_shadow", "blue", "black"); 23 | set_color ("menu_selection", "green", "red"); 24 | set_color ("menu_selection_char", "yellow", "red"); 25 | 26 | set_color ("cursor", "black", "red"); 27 | set_color ("cursorovr", "black", "red"); 28 | 29 | %% The following have been automatically generated: 30 | set_color("linenum", "yellow", "blue"); 31 | set_color("trailing_whitespace", "black", "brightcyan"); 32 | set_color("tab", "black", "brightcyan"); 33 | set_color("url", "brightblue", $2); 34 | set_color("italic", $1, $2); 35 | set_color("underline", "red", $2); 36 | set_color("bold", "brightred", $2); 37 | set_color("html", "brightred", $2); 38 | set_color("keyword2", $1, $2); 39 | set_color("keyword3", $1, $2); 40 | set_color("keyword4", $1, $2); 41 | set_color("keyword5", $1, $2); 42 | set_color("keyword6", $1, $2); 43 | set_color("keyword7", $1, $2); 44 | set_color("keyword8", $1, $2); 45 | set_color("keyword9", $1, $2); 46 | -------------------------------------------------------------------------------- /lib/colors/Xjed/black4.sl: -------------------------------------------------------------------------------- 1 | % Contributed by Mark Olesen 2 | $1 = "white"; 3 | $2 = "black"; 4 | $3 = "cyan"; 5 | $4 = "red"; 6 | $5 = "magenta"; 7 | $6 = "gray75"; 8 | 9 | set_color("normal", $1, $2); 10 | % use white/blue status for console color scheme 11 | set_color("status", $1, "gray50"); 12 | set_color("region", "yellow", "blue"); 13 | set_color("operator", $3, $2); 14 | set_color("delimiter", $3, $2); 15 | set_color("number", $4, $2); 16 | set_color("string", $6, $2); 17 | set_color("keyword", "yellow", $2); 18 | set_color("keyword1", "green", $2); 19 | set_color("comment", $3, "gray25"); 20 | set_color("preprocess", $5, $2); 21 | set_color("dollar", "yellow", "gray25"); 22 | set_color("...", $5, $2); 23 | set_color("message", $3, $2); 24 | set_color("error", $4, $2); 25 | 26 | % gray menu - 27 | set_color("menu", $1, "gray25"); 28 | set_color("menu_char", "yellow", "gray25"); 29 | set_color("menu_popup", $1, "gray25"); 30 | set_color("menu_shadow", $4, "gray15"); 31 | set_color("menu_selection", $1, $2); 32 | set_color("menu_selection_char", "yellow", $2); 33 | 34 | set_color("cursor", "black", "yellow"); 35 | set_color("cursorovr", "black", "red"); 36 | set_color("mouse", "green", $2); 37 | 38 | %% some of the following have been automatically generated: 39 | set_color("linenum", "sandybrown", $2); 40 | set_color("trailing_whitespace", $1, "sienna"); 41 | set_color("tab", $1, "gray40"); 42 | set_color("url", $6, $2); 43 | set_color("italic", $1, $2); 44 | set_color("underline", "green", $2); 45 | set_color("bold", $1, $2); 46 | set_color("html", "sandybrown", $2); 47 | set_color("keyword2", "sandybrown", $2); 48 | set_color("keyword3", $1, $2); 49 | set_color("keyword4", $1, $2); 50 | set_color("keyword5", $1, $2); 51 | set_color("keyword6", $1, $2); 52 | set_color("keyword7", $1, $2); 53 | set_color("keyword8", $1, $2); 54 | set_color("keyword9", $1, $2); 55 | 56 | % end 57 | -------------------------------------------------------------------------------- /lib/modeinfo.sl: -------------------------------------------------------------------------------- 1 | % These routines facilitate the manipulation of mode dependent data. 2 | 3 | private variable Mode_Info_Type = struct 4 | { 5 | fold_info, % folding.sl: beg\rend\r\beg1\r\end1 6 | dabbrev_word_chars, % word chars for dabbrev mode 7 | init_mode_menu, 8 | chglog_get_item, 9 | use_dfa_syntax, 10 | }; 11 | 12 | private variable Mode_Info_List = Assoc_Type [Struct_Type]; 13 | 14 | private define find_mode_info (mode_name) 15 | { 16 | ifnot (assoc_key_exists (Mode_Info_List, mode_name)) 17 | return NULL; 18 | 19 | return Mode_Info_List[mode_name]; 20 | } 21 | 22 | define mode_set_mode_info (field_name, field_value) 23 | { 24 | variable mode_info; 25 | variable mode_name = get_mode_name (); 26 | 27 | if (_NARGS == 3) 28 | mode_name = (); 29 | 30 | mode_info = find_mode_info (mode_name); 31 | if (mode_info == NULL) 32 | { 33 | mode_info = @Mode_Info_Type; 34 | Mode_Info_List [mode_name] = mode_info; 35 | } 36 | 37 | variable fields = get_struct_field_names (mode_info); 38 | ifnot (any (fields == field_name)) 39 | { 40 | variable new_mode_info = @Struct_Type ([fields, field_name]); 41 | 42 | foreach (fields) 43 | { 44 | variable f = (); 45 | set_struct_field (new_mode_info, f, get_struct_field (mode_info, f)); 46 | } 47 | mode_info = new_mode_info; 48 | Mode_Info_List [mode_name] = mode_info; 49 | } 50 | set_struct_field (mode_info, field_name, field_value); 51 | } 52 | 53 | define mode_get_mode_info (field_name) 54 | { 55 | variable mode_info; 56 | 57 | if (_NARGS == 1) 58 | get_mode_name (); 59 | 60 | variable mode_name = (); 61 | 62 | mode_info = find_mode_info (mode_name); 63 | if (mode_info == NULL) 64 | return NULL; 65 | 66 | ifnot (any (field_name == get_struct_field_names (mode_info))) 67 | return NULL; 68 | 69 | return get_struct_field (mode_info, field_name); 70 | } 71 | -------------------------------------------------------------------------------- /lib/backups.sl: -------------------------------------------------------------------------------- 1 | % backups.sl -*- SLang -*- 2 | % 3 | % This file provides numbered backups whenever a file is saved, 4 | % in a fashion similar to Emacs. For Jed 0.99.12 upwards. 5 | % Written by Guido Gonzato 6 | % 7 | % Last updated: 5 December 2000 8 | % 9 | % Usage: 10 | % Let's suppose that you edit a new file, foo.bar. If you save it, the 11 | % numbered backup copy foo.bar.~1~ will be created; saving again will 12 | % create foo.bar.~2~, and so on. The standard backup copy is unaffected. 13 | % Win32 users need to set the variable LFN=y to use backups. 14 | % 15 | % To enable numbered backups, put this line in your .jedrc: 16 | % backups_on (); 17 | 18 | private variable DO_BACKUPS = 1; 19 | autoload ("glob", "glob"); 20 | 21 | private define numbered_backups (buf) 22 | { 23 | variable version, max_version; 24 | variable file, files, pattern; 25 | 26 | if (0 == DO_BACKUPS) 27 | return; 28 | 29 | % check whether an old copy or backup files exist 30 | pattern = sprintf("%s.~*~", buf); 31 | files = glob(pattern); 32 | max_version = 0; 33 | 34 | foreach file (files) 35 | { 36 | if (1 == sscanf(path_extname (file), ".~%d~", &version)) 37 | { 38 | if (version > max_version) 39 | max_version = version; 40 | } 41 | } 42 | 43 | % mark the whole buffer and write it to file - don't use write_buffer () 44 | push_spot (); 45 | mark_buffer (); 46 | () = write_region_to_file (sprintf ("%s.~%d~", buf, max_version+1)); 47 | pop_spot(); 48 | } 49 | % 50 | define backups_off () 51 | { 52 | DO_BACKUPS = 0; 53 | flush ("Numbered backups disabled."); 54 | } 55 | % 56 | 57 | define backups_on () 58 | { 59 | DO_BACKUPS = 1; 60 | flush ("Numbered backups enabled."); 61 | } 62 | % 63 | 64 | add_to_hook ("_jed_save_buffer_before_hooks", &numbered_backups); 65 | 66 | % 67 | % --- End of file backups.sl --- 68 | 69 | -------------------------------------------------------------------------------- /doc/txt/wordstar.txt: -------------------------------------------------------------------------------- 1 | JED Wordstar mode notes 2 | 3 | 0. To enable wordstar emulation, comment out the line in jed.rc loading 4 | emacs and edt bindings. Then uncomment the line regarding wordstar 5 | bindings. 6 | 7 | 1. The abort character is changed from ^G to ^^ (^6 on most keyboards). 8 | This is necessary because ^G is bound to delete character in wordstar. 9 | 10 | 2. I have implemented ^K, and ^Q keymaps. I do not know bindings for other 11 | keymaps which is why they are not defined. If there are any missing 12 | bindings and keymaps, please feel free to let me know and I will try to 13 | add them. 14 | 15 | 3. Wordstar idea of block is preserved. I have not changed its meaning as 16 | emacs does. However, note that wordstar's concept of a region is 17 | different from the concept that JED uses. For this reason, blocks in 18 | JED's wordstar mode are not highlighted. Bug me if you want this 19 | changed. 20 | 21 | 4. Since one of the keymaps is ^Q, it is up to the user to make sure that JED 22 | can receive the ^Q character. This means that the user must make sure that 23 | ^Q is not used for flow control. The alternative would be to use the 24 | map_input function to map a different control character to ^Q. See jed.txt 25 | for details. 26 | 27 | 5. Finally, you might consider the native JED keybindings which are based 28 | on my experience using the Turbo Pascal editor. To get an idea of these 29 | bindings, startup jed with no default init file as by using `jed -n'. 30 | Once in jed, press ESC-X and enter `describe_bindings' at the prompt. 31 | If you get lost, press ^H? for menus. 32 | 33 | Using the default JED bindings results in a faster startup of JED since 34 | there is no need to load any keybindings other than possible extensions 35 | to the default ones. 36 | 37 | Mail comments and suggestions for the wordstar mode to 38 | jed@jedsoft.org. 39 | -------------------------------------------------------------------------------- /bin/w32/w32shell.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #ifdef __MINGW32__ 7 | # ifdef NO_GLOBBING 8 | int _CRT_glob = 0; 9 | # endif 10 | #endif 11 | 12 | /* The more I learn about this OS, the less I care for it. This program 13 | * is necessary to run pipes. Yuk! 14 | */ 15 | static char *build_cmd (char **args, unsigned int num) 16 | { 17 | unsigned int len; 18 | unsigned int i; 19 | char *buf; 20 | 21 | len = 0; 22 | for (i = 0; i < num; i++) 23 | len += strlen (args[i]) + 1; 24 | 25 | if (NULL == (buf = malloc (len + 1))) 26 | { 27 | fprintf (stderr, "Out of memory\n"); 28 | return NULL; 29 | } 30 | 31 | len = 0; 32 | for (i = 0; i < num; i++) 33 | { 34 | strcpy (buf + len, args[i]); 35 | len += strlen (args[i]); 36 | buf[len] = ' '; 37 | len++; 38 | } 39 | buf[len] = 0; 40 | return buf; 41 | } 42 | 43 | int main (int argc, char **argv) 44 | { 45 | STARTUPINFO si; 46 | PROCESS_INFORMATION pi; 47 | char *cmd; 48 | 49 | if (argc == 1) 50 | { 51 | fprintf (stderr, "Usage: %s CMD", argv[0]); 52 | return 1; 53 | } 54 | 55 | if (NULL == (cmd = build_cmd (argv + 1, argc-1))) 56 | return 1; 57 | 58 | memset ((char *) &si, 0, sizeof (STARTUPINFO)); 59 | si.cb = sizeof(STARTUPINFO); 60 | si.dwFlags = STARTF_USESTDHANDLES; 61 | si.hStdInput = GetStdHandle (STD_INPUT_HANDLE); 62 | si.hStdOutput = GetStdHandle (STD_OUTPUT_HANDLE); 63 | si.hStdError = GetStdHandle (STD_ERROR_HANDLE); 64 | 65 | if (FALSE == CreateProcess (NULL, cmd, NULL, NULL, TRUE, 0, NULL, NULL, 66 | &si, &pi)) 67 | { 68 | fprintf (stderr, "%s: Command '%s' failed to run\n", argv[0], cmd); 69 | free (cmd); 70 | return 1; 71 | } 72 | 73 | WaitForSingleObject (pi.hProcess, INFINITE); 74 | CloseHandle (pi.hProcess); 75 | CloseHandle (pi.hThread); 76 | free (cmd); 77 | return 0; 78 | } 79 | -------------------------------------------------------------------------------- /bin/vms/init_jed.com: -------------------------------------------------------------------------------- 1 | $! -*-dcl-*- 2 | $! This file defines the appropriate symbols for JED. It requires 3 | $! two parameters. 4 | $! ----- 5 | $! Set up or overwrite the jed_root logical. 6 | $ this_dev= f$parse(f$env("procedure"),,,"device","no_conceal") 7 | $ this_dir= f$parse(f$env("procedure"),,,"directory","no_conceal") 8 | $ this_clp= f$extract(f$length(this_dir)-1,1,this_dir) 9 | $ this_opp[0,7]= f$cvsi(0,8,this_clp)- 2 10 | $ this_dir= this_dir- "''this_clp'''this_opp'" 11 | $ the_2up_dir= this_dir- this_clp+ ".--"+ this_clp 12 | $ the_root_dir= f$parse("''this_dev'''the_2up_dir'",,,"directory") - 13 | - this_clp+ "."+ this_clp 14 | $ define/job /trans=conc jed_root 'this_dev''the_root_dir' 15 | $! 16 | $ define/job jed_library jed_root:[lib] 17 | $ jedexe = "jed_root:[bin.vms]jed." + f$getsyi("ARCH_NAME") + "_EXE" 18 | $ if (p1 .nes "0") .and. (p1 .nes. "1") then goto USAGE 19 | $ if (p2 .nes "0") .and. (p2 .nes. "1") then goto USAGE 20 | $ if (p1 .eqs. "1") then goto KEPT 21 | $! 22 | $! simple editor 23 | $! 24 | $ runjed :== $'jexexe' 25 | $ jed :== $'jedexe' 26 | $ goto do_mail 27 | $! 28 | $ kept: 29 | $ runjed :== $'jedexe' 30 | $ jed :== @jed_root:[bin.vms]keptjed.com 31 | $ do_mail: 32 | $ if (p2 .nes. "1") then goto done 33 | $ define/job mail$edit "@jed_root:[bin.vms]jed_mail.com" 34 | $ done: 35 | $ exit 36 | $! 37 | $ usage: type sys$input 38 | 39 | This command procedure requires two parameters with the value of 40 | either 0 or 1. If first parameter is 1, it indicates that JED is 41 | to run as a kepteditor otherwise JED is run as a normal executable. 42 | If the second parameter has a value of 1, JED is used as the editor 43 | for mail. So, the following are valid: 44 | 45 | @jed_root:[bin.vms]init_jed 0 0 !normal/no mail 46 | @jed_root:[bin.vms]init_jed 0 1 !normal/mail 47 | @jed_root:[bin.vms]init_jed 1 0 !kept/nomail <-- most systems 48 | @jed_root:[bin.vms]init_jed 1 1 !kept/mail 49 | 50 | $ exit 51 | -------------------------------------------------------------------------------- /doc/tm/rtl/eval.tm: -------------------------------------------------------------------------------- 1 | \function{_autoload} 2 | \synopsis{Specify multiple functions to autoload} 3 | \usage{Void _autoload (String fun, String fn, ..., Integer n)} 4 | \description 5 | The \var{_autoload} function is like the \var{autoload} function except that 6 | it takes \var{n} pairs of function name (\var{fun}) / filename (\var{fn}) pairs. 7 | For example, 8 | #v+ 9 | _autoload ("fun_a", "file_a", "fun_b", "file_b", 2); 10 | #v- 11 | is equivalent to 12 | #v+ 13 | autoload ("fun_a", "file_a"); 14 | autoload ("fun_b", "file_b"); 15 | #v- 16 | \seealso{autoload} 17 | \done 18 | 19 | \function{evalbuffer} 20 | \synopsis{Eval the current buffer as S-Lang script} 21 | \usage{Void evalbuffer ([String_Type namespace])} 22 | \description 23 | This function causes the current buffer to be sent to the S-Lang 24 | interpreter for evaluation. If the optional namespace argument is 25 | given, the buffer will be evaluated in the specified namespace. If an 26 | error is encountered while parsing the buffer, the cursor will be 27 | placed at the location of the error. 28 | \seealso{evalfile, require} 29 | \done 30 | 31 | \function{get_jed_library_path} 32 | \synopsis{Return the current search path for jed library files} 33 | \usage{String get_jed_library_path ()} 34 | \description 35 | This function returns the current search path for jed library files. 36 | The path may be set using the function \var{set_jed_library_path}. 37 | \seealso{set_jed_library_path} 38 | \done 39 | 40 | \function{set_jed_library_path} 41 | \synopsis{Set the search path for library files} 42 | \usage{Void set_jed_library_path (String p)} 43 | \description 44 | This function may be used to set the search path for library files. 45 | Its parameter \var{p} may be a comma separated list of directories to 46 | search. When the editor is first started, the path is initialized 47 | from the \var{JED_ROOT}, or \var{JED_LIBRARY} environment variables. 48 | \seealso{get_jed_library_path} 49 | \done 50 | 51 | -------------------------------------------------------------------------------- /src/test/test_expand.sl: -------------------------------------------------------------------------------- 1 | () = chdir ("/tmp"); 2 | 3 | private variable Failed = 0; 4 | define test_expand_filename (a, b) 5 | { 6 | variable b1 = expand_filename (a); 7 | if (b != b1) 8 | { 9 | Failed = 1; 10 | message ("expand_filename ($a) -> $b1, expected $b"$); 11 | } 12 | } 13 | 14 | test_expand_filename ("", "/tmp/"); 15 | test_expand_filename ("./", "/tmp/"); 16 | test_expand_filename (".", "/tmp/"); 17 | test_expand_filename ("..", "/"); 18 | test_expand_filename ("../", "/"); 19 | test_expand_filename (".././", "/"); 20 | test_expand_filename ("foo.././", "/tmp/foo../"); 21 | test_expand_filename ("f.././", "/tmp/f../"); 22 | test_expand_filename ("fo.././", "/tmp/fo../"); 23 | test_expand_filename ("fo.././bar", "/tmp/fo../bar"); 24 | test_expand_filename ("././bar", "/tmp/bar"); 25 | test_expand_filename ("/./bar", "/bar"); 26 | test_expand_filename ("/./bar//gamma", "/gamma"); 27 | test_expand_filename ("//./bar//gamma", "/bar/gamma"); 28 | test_expand_filename ("//./bar//gamma/.", "/bar/gamma/"); 29 | test_expand_filename ("//./bar//gamma/..", "/bar/"); 30 | test_expand_filename ("/..", "/"); 31 | test_expand_filename ("/.", "/"); 32 | test_expand_filename ("~/foo", "$HOME/foo"$); 33 | test_expand_filename ("/foo/bar/~/xx/..", "$HOME/"$); 34 | test_expand_filename ("/foo/bar/~/~/xx/..", "$HOME/"$); 35 | test_expand_filename ("~/foo/bar/~/~/xx/..", "$HOME/"$); 36 | test_expand_filename ("~/foo/bar/~/~xx", "$HOME/~xx"$); 37 | test_expand_filename ("~/foo/bar/~/xx~", "$HOME/xx~"$); 38 | test_expand_filename ("~/foo/bar/~", "$HOME/foo/bar/~"$); 39 | 40 | #ifntrue 41 | % Only for __QNX__ 42 | test_expand_filename ("/foo/bar///1/foo/bar", "//1/foo/bar"); 43 | test_expand_filename ("//23", "//23"); 44 | test_expand_filename ("//23/bar///1/foo/bar", "//1/foo/bar"); 45 | test_expand_filename ("//23/bar///12/foo/bar", "//12/foo/bar"); 46 | test_expand_filename ("//23/bar/~/baz", "$HOME/baz"$); 47 | #endif 48 | %test_expand_filename ("~dph/foo", "/home/dph"); 49 | 50 | 51 | exit (Failed); 52 | -------------------------------------------------------------------------------- /lib/iso2xxx.sl: -------------------------------------------------------------------------------- 1 | % Thanks to torres@upf.es for the bulk of this 2 | _debug_info = 1; 3 | private variable ISO_Latin_Chars = 4 | strcat ("\d225\d233\d237\d243\d250\d193\d201\d205\d211\d218", % "áéíóúÁÉÍÓÚ" 5 | "\d224\d232\d236\d242\d249\d192\d200\d204\d210\d217", % "àèìòùÀÈÌÒÙ" 6 | "\d226\d234\d238\d244\d251\d194\d202\d206\d212\d219", % "âêîôûÂÊÎÔÛ" 7 | "\d228\d235\d239\d246\d252\d196\d203\d207\d214\d220", % "äëïöüÄËÏÖÜ" 8 | "\d161\d191\d231\d199\d241\d209\d230\d198", % "¡¿çÇñÑæÆ" 9 | "\d248\d216\d229\d197\d223"); % "øØåÅß" 10 | 11 | private variable ISO_TeX_Chars = 12 | strcat ("\\'a,\\'e,\\'{\\i},\\'o,\\'u,\\'A,\\'E,\\'I,\\'O,\\'U,", 13 | "\\`a,\\`e,\\`{\\i},\\`o,\\`u,\\`A,\\`E,\\`I,\\`O,\\`U,", 14 | "\\^a,\\^e,\\^{\\i},\\^o,\\^u,\\^A,\\^E,\\^I,\\^O,\\^U,", 15 | "\\\"a,\\\"e,\\\"{\\i},\\\"o,\\\"u,\\\"A,\\\"E,\\\"I,\\\"O,\\\"U,", 16 | "!`,?`,\\c{c},\\c{C},\\~n,\\~N,{\\ae},{\\AE},", 17 | "{\\o},{\\O},{\\aa},{\\AA},{\\ss}"); 18 | 19 | define iso2tex () 20 | { 21 | variable i, str_old, str_new; 22 | variable save_case_search = CASE_SEARCH; 23 | 24 | CASE_SEARCH = 1; 25 | push_spot (); 26 | bob (); 27 | _for (0, strlen (ISO_Latin_Chars) - 1, 1) 28 | { 29 | i = (); 30 | str_new = extract_element (ISO_TeX_Chars, i, ','); 31 | str_old = char (ISO_Latin_Chars[i]); 32 | 33 | %bob (); --- not needed since replace does not move the point 34 | replace (str_old, str_new); 35 | } 36 | pop_spot(); 37 | CASE_SEARCH = save_case_search; 38 | } 39 | 40 | define tex2iso () 41 | { 42 | variable i, str_old, str_new; 43 | variable save_case_search = CASE_SEARCH; 44 | 45 | CASE_SEARCH = 1; 46 | push_spot (); 47 | _for (0, strlen (ISO_Latin_Chars) - 1, 1) 48 | { 49 | i = (); 50 | str_old = extract_element (ISO_TeX_Chars, i, ','); 51 | str_new = char (ISO_Latin_Chars[i]); 52 | 53 | bob (); 54 | replace (str_old, str_new); 55 | } 56 | pop_spot(); 57 | CASE_SEARCH = save_case_search; 58 | } 59 | 60 | -------------------------------------------------------------------------------- /lib/regexp.sl: -------------------------------------------------------------------------------- 1 | % 2 | % Interactive Regular expression searches. These highlight region matched 3 | % until next key is pressed. 4 | % 5 | 6 | require ("srchmisc"); 7 | 8 | define re_search_dir (pat, dir) 9 | { 10 | variable ret; 11 | if (dir > 0) ret = re_fsearch (pat); else ret = re_bsearch (pat); 12 | ret--; ret; 13 | } 14 | 15 | define re_search_forward() 16 | { 17 | variable pat, not_found = 1; 18 | pat = read_mini("Search (Regexp):", Null_String, Null_String); 19 | ifnot (strlen(pat)) return; 20 | 21 | push_mark(); 22 | ERROR_BLOCK 23 | { 24 | pop_mark (not_found); 25 | } 26 | 27 | not_found = not (search_maybe_again (&re_search_dir, pat, 1, 28 | &_function_return_1)); 29 | if (not_found) error ("Not found."); 30 | EXECUTE_ERROR_BLOCK; 31 | } 32 | 33 | define re_search_backward() 34 | { 35 | variable pat, not_found; 36 | pat = read_mini("Backward Search (Regexp):", Null_String, Null_String); 37 | ifnot (strlen(pat)) return; 38 | 39 | push_mark(); 40 | ERROR_BLOCK 41 | { 42 | pop_mark (not_found); 43 | } 44 | 45 | not_found = not (search_maybe_again (&re_search_dir, pat, -1, 46 | &_function_return_1)); 47 | 48 | if (not_found) error ("Not found."); 49 | EXECUTE_ERROR_BLOCK; 50 | } 51 | 52 | private define research_search_function (pat) 53 | { 54 | re_fsearch (pat) - 1; 55 | } 56 | 57 | private define re_replace_function (str, len) 58 | { 59 | ifnot (replace_match(str, 0)) 60 | error ("replace_match failed."); 61 | -2; 62 | } 63 | 64 | define query_replace_match() 65 | { 66 | variable pat, n, rep, prompt, doit, err, ch; 67 | 68 | err = "Replace Failed!"; 69 | pat = read_mini("Regexp:", Null_String, Null_String); 70 | ifnot (strlen(pat)) return; 71 | prompt = strcat (strcat ("Replace '", pat), "' with:"); 72 | rep = read_mini(prompt, Null_String, Null_String); 73 | 74 | replace_with_query (&research_search_function, pat, rep, 1, 75 | &re_replace_function); 76 | } 77 | 78 | -------------------------------------------------------------------------------- /doc/txt/viswrap.txt: -------------------------------------------------------------------------------- 1 | JED's standard behavior for showing long lines is to cut off the 2 | display at the right edge of the window and to scroll the line or 3 | window horizontally to maintain visibility of the current editing 4 | position. Additionally, JED can visually wrap long lines at the right 5 | edge of the window. This wrapping is purely a visual effect and does 6 | not alter the actual content of the line. This behavior is called 7 | "visual wrapping". 8 | 9 | The simplest way to enable visual wrapping for all buffers is to add 10 | the following line to your .jedrc file: 11 | 12 | VISUAL_WRAP_DEFAULT = 1; 13 | 14 | Visual wrapping may be enabled or disabled on a per-buffer basis via 15 | the set_visual_wrap or toggle_visual_wrap functions, e.g., 16 | 17 | define text_mode_hook () 18 | { 19 | . 20 | . 21 | set_visual_wrap (1); % Enable visual wrapping 22 | } 23 | define c_mode_hook () 24 | { 25 | . 26 | . 27 | set_visual_wrap (0); % Disable visual wrapping 28 | } 29 | 30 | When a long line becomes visually wrapped, a backslash character is 31 | displayed in the far right column to indicate that the line was 32 | visually wrapped. This character may be changed to any single-width 33 | unicode character (supported by the terminal's font) via the 34 | set_visual_wrap_indicator function, e.g., 35 | 36 | set_visual_wrap_indicator ('\\'); % default 37 | set_visual_wrap_indicator ('+'); % plus-sign 38 | set_visual_wrap_indicator (0x21b5); % Unicode down-left arrow ("↵") 39 | 40 | Please be aware that functions like go_up, go_down, eol, and others 41 | are unaware of the visual wrapping of a line, as this is solely a 42 | visual effect. In contrast, the internal functions "previous_line_cmd" 43 | and "next_line_cmd", which are used for keybindings, do consider visual 44 | wrapping. As a result, they will move the editing point up or down a 45 | window row, which may not align with moving to the previous or next 46 | buffer line. 47 | 48 | 49 | -------------------------------------------------------------------------------- /lib/colors/black1.sl: -------------------------------------------------------------------------------- 1 | $1 = "white"; $2 = "black"; 2 | set_color("normal", $1, $2); % default fg/bg 3 | set_color("status", "yellow", "blue"); % status or mode line 4 | set_color("region", "yellow", "blue"); % for marking regions 5 | set_color("operator", $1, $2); % +, -, etc.. 6 | set_color("number", "yellow", $2); % 10, 2.71,... TeX formulas 7 | set_color("comment", "yellow", $2); % /* comment */ 8 | set_color("string", "magenta", $2); % "string" or 'char' 9 | set_color("keyword", "brightred", $2); % if, while, unsigned, ... 10 | set_color("keyword1", "green", $2); % malloc, exit, etc... 11 | set_color("delimiter", $1, $2); % {}[](),.;... 12 | set_color("preprocess", "magenta", $2);% #ifdef .... 13 | set_color("message", "brightblue", $2);% color for messages 14 | set_color("error", "brightred", $2); % color for errors 15 | set_color("dollar", "magenta", $2); % color dollar sign continuat$ 16 | set_color("...", "red", $2); % folding indicator 17 | 18 | set_color ("menu_char", "yellow", "blue"); 19 | set_color ("menu", "lightgray", "blue"); 20 | set_color ("menu_popup", "lightgray", "blue"); 21 | set_color ("menu_shadow", "blue", "black"); 22 | set_color ("menu_selection", "green", "red"); 23 | set_color ("menu_selection_char", "yellow", "red"); 24 | 25 | set_color ("cursor", "black", "red"); 26 | set_color ("cursorovr", "black", "red"); 27 | 28 | %% The following have been automatically generated: 29 | set_color("linenum", "yellow", "blue"); 30 | set_color("trailing_whitespace", "yellow", $2); 31 | set_color("tab", "yellow", $2); 32 | set_color("url", "magenta", $2); 33 | set_color("italic", $1, $2); 34 | set_color("underline", "green", $2); 35 | set_color("bold", "brightred", $2); 36 | set_color("html", "brightred", $2); 37 | set_color("keyword2", $1, $2); 38 | set_color("keyword3", $1, $2); 39 | set_color("keyword4", $1, $2); 40 | set_color("keyword5", $1, $2); 41 | set_color("keyword6", $1, $2); 42 | set_color("keyword7", $1, $2); 43 | set_color("keyword8", $1, $2); 44 | set_color("keyword9", $1, $2); 45 | -------------------------------------------------------------------------------- /lib/colors/black2.sl: -------------------------------------------------------------------------------- 1 | $1 = "white"; $2 = "black"; 2 | set_color("normal", $1, $2); % default fg/bg 3 | set_color("status", "yellow", "blue"); % status or mode line 4 | set_color("region", "yellow", "blue"); % for marking regions 5 | set_color("operator", $1, $2); % +, -, etc.. 6 | set_color("number", "yellow", $2); % 10, 2.71,... TeX formulas 7 | set_color("comment", "yellow", $2); % /* comment */ 8 | set_color("string", "brightgreen", $2); % "string" or 'char' 9 | set_color("keyword", "brightred", $2); % if, while, unsigned, ... 10 | set_color("keyword1", "green", $2); % malloc, exit, etc... 11 | set_color("delimiter", $1, $2); % {}[](),.;... 12 | set_color("preprocess", "magenta", $2);% #ifdef .... 13 | set_color("message", "brightblue", $2); % color for messages 14 | set_color("error", "brightred", $2); % color for errors 15 | set_color("dollar", "magenta", $2); % color dollar sign continuat$ 16 | set_color("...", "red", $2); % folding indicator 17 | 18 | set_color ("menu_char", "yellow", "blue"); 19 | set_color ("menu", "lightgray", "blue"); 20 | set_color ("menu_popup", "lightgray", "blue"); 21 | set_color ("menu_shadow", "blue", "black"); 22 | set_color ("menu_selection", "green", "red"); 23 | set_color ("menu_selection_char", "yellow", "red"); 24 | 25 | set_color ("cursor", "black", "red"); 26 | set_color ("cursorovr", "black", "red"); 27 | 28 | %% The following have been automatically generated: 29 | set_color("linenum", "yellow", "blue"); 30 | set_color("trailing_whitespace", "yellow", $2); 31 | set_color("tab", "yellow", $2); 32 | set_color("url", "brightgreen", $2); 33 | set_color("italic", $1, $2); 34 | set_color("underline", "green", $2); 35 | set_color("bold", "brightred", $2); 36 | set_color("html", "brightred", $2); 37 | set_color("keyword2", $1, $2); 38 | set_color("keyword3", $1, $2); 39 | set_color("keyword4", $1, $2); 40 | set_color("keyword5", $1, $2); 41 | set_color("keyword6", $1, $2); 42 | set_color("keyword7", $1, $2); 43 | set_color("keyword8", $1, $2); 44 | set_color("keyword9", $1, $2); 45 | -------------------------------------------------------------------------------- /src/colors.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2007-2023 John E. Davis 2 | * This file is part of JED editor library source. 3 | * 4 | * You may distribute this file under the terms the GNU General Public 5 | * License. See the file COPYING for more information. 6 | */ 7 | #ifndef _JED_COLORS_H_ 8 | #define _JED_COLORS_H_ 9 | 10 | /* These numbers should not be changed. They are hard-coded in the 11 | * dfa cache files. 12 | */ 13 | #define JNORMAL_COLOR 0 14 | #define JCURSOR_COLOR 1 15 | #define JSTATUS_COLOR 2 16 | #define JREGION_COLOR 3 17 | #define JMENU_COLOR 4 18 | #define JOP_COLOR 5 19 | #define JNUM_COLOR 6 20 | #define JSTR_COLOR 7 21 | #define JCOM_COLOR 8 22 | #define JDELIM_COLOR 9 23 | #define JPREPROC_COLOR 10 24 | #define JMESSAGE_COLOR 11 25 | #define JERROR_COLOR 12 26 | #define JDOLLAR_COLOR 13 27 | #define JDOTS_COLOR 14 28 | #define JMENU_CHAR_COLOR 15 29 | #define JMENU_SHADOW_COLOR 16 30 | #define JMENU_SELECTION_COLOR 17 31 | #define JMENU_POPUP_COLOR 18 32 | #define JMENU_SELECTED_CHAR_COLOR 19 33 | #define JCURSOROVR_COLOR 20 34 | #define JLINENUM_COLOR 21 35 | #define JTWS_COLOR 22 36 | #define JTAB_COLOR 23 37 | #define JURL_COLOR 24 38 | #define JITALIC_COLOR 25 39 | #define JUNDERLINE_COLOR 26 40 | #define JBOLD_COLOR 27 41 | #define JHTML_KEY_COLOR 28 42 | #define JKEY_COLOR 29 43 | #define JKEY1_COLOR (JKEY_COLOR+1) 44 | #define JKEY2_COLOR (JKEY_COLOR+2) 45 | #define JKEY3_COLOR (JKEY_COLOR+3) 46 | #define JKEY4_COLOR (JKEY_COLOR+4) 47 | #define JKEY5_COLOR (JKEY_COLOR+5) 48 | #define JKEY6_COLOR (JKEY_COLOR+6) 49 | #define JKEY7_COLOR (JKEY_COLOR+7) 50 | #define JKEY8_COLOR (JKEY_COLOR+8) 51 | #define JKEY9_COLOR (JKEY_COLOR+9) /* 38 */ 52 | 53 | #define FIRST_USER_COLOR 64 54 | 55 | #define JMAX_COLORS 256 /* Do NOT increase this number */ 56 | 57 | extern int jed_init_color_intrinsics (void); 58 | extern int jed_get_color_obj (char *name); 59 | extern int jed_set_color (int, char *, char *); 60 | 61 | #endif /* _JED_COLORS_H_ */ 62 | -------------------------------------------------------------------------------- /lib/colors/Xjed/elegant.sl: -------------------------------------------------------------------------------- 1 | % elegant.sl 2 | 3 | $1 = "black"; 4 | $2 = "#E0E0E0"; % light gray 5 | $3 = "white"; 6 | $4 = "#606060"; % medium gray 7 | $5 = "#B4FFB4"; % pale green 8 | $6 = "#1010A0"; % dark blue 9 | $7 = "#B40A78"; % dark purple 10 | 11 | set_color("normal", $1, $2); % default fg/bg 12 | set_color("status", $1, $3); % status line 13 | set_color("operator", $1, $2); % +, -, etc... 14 | set_color("number", $6, $2); % 10, 2.71, etc.. 15 | set_color("comment", $1, $5); % /* comment */ 16 | set_color("region", $3, $4); % region 17 | set_color("string", $6, $2); % "string" or 'char' 18 | set_color("keyword", $7, $2); % if, while, unsigned, ... 19 | set_color("keyword1", $7, $2); % malloc, exit, etc... 20 | set_color("delimiter", "red", $2); % {}[](),.;... 21 | set_color("preprocess", "magenta", $2); % #ifdef etc... 22 | set_color("message", $6, $2); 23 | set_color("error", "red", $2); 24 | set_color("dollar", "red", $2); 25 | set_color("...", "red", $2); % folding indicator 26 | 27 | set_color ("menu_char", "red", $3); 28 | set_color ("menu", $1, "white"); 29 | set_color ("menu_popup", $1, $3); 30 | set_color ("menu_shadow", $1, $4); 31 | set_color ("menu_selection", $1, "cyan"); 32 | set_color ("menu_selection_char", "red", $3); 33 | 34 | set_color ("mouse", "blue", "blue"); 35 | set_color ("cursor", $1, "red"); 36 | set_color ("cursorovr", $1, "red"); 37 | 38 | %% The following have been automatically generated: 39 | set_color("linenum", $1, $3); 40 | set_color("trailing_whitespace", $1, $5); 41 | set_color("tab", $1, $5); 42 | set_color("url", $6, $2); 43 | set_color("italic", $1, $2); 44 | set_color("underline", $7, $2); 45 | set_color("bold", $7, $2); 46 | set_color("html", $7, $2); 47 | set_color("keyword2", $1, $2); 48 | set_color("keyword3", $1, $2); 49 | set_color("keyword4", $1, $2); 50 | set_color("keyword5", $1, $2); 51 | set_color("keyword6", $1, $2); 52 | set_color("keyword7", $1, $2); 53 | set_color("keyword8", $1, $2); 54 | set_color("keyword9", $1, $2); 55 | -------------------------------------------------------------------------------- /lib/colors/blue2.sl: -------------------------------------------------------------------------------- 1 | $1 = "yellow"; $2 = "blue"; $3 = "white"; 2 | set_color("normal", $1, $2); % default fg/bg 3 | set_color("status", "black", $3); % status or mode line 4 | set_color("region", "black", $3); % for marking regions 5 | set_color("operator", "white", $2); % +, -, etc.. 6 | set_color("number", "brightmagenta", $2); % 10, 2.71,... TeX formulas 7 | set_color("comment", "brightcyan", $2); % /* comment */ 8 | set_color("string", "brightcyan", $2); % "string" or 'char' 9 | set_color("keyword", "white", $2); % if, while, unsigned, ... 10 | set_color("keyword1", "yellow", $2); % malloc, exit, etc... 11 | set_color("delimiter", "white", $2); % {}[](),.;... 12 | set_color("preprocess", "brightgreen", $2); % #ifdef .... 13 | set_color("message", "white", $2); % color for messages 14 | set_color("error", "brightred", $2); % color for errors 15 | set_color("dollar", "white", $2); % color dollar sign continuation 16 | set_color("...", "red", $2); % folding indicator 17 | 18 | set_color ("menu_char", "red", $3); 19 | set_color ("menu", "black", $3); 20 | set_color ("menu_popup", "black", $3); 21 | set_color ("menu_shadow", "blue", "black"); 22 | set_color ("menu_selection", "black", "cyan"); 23 | set_color ("menu_selection_char", "red", "cyan"); 24 | 25 | set_color ("cursor", "black", "red"); 26 | set_color ("cursorovr", "black", "red"); 27 | 28 | %% The following have been automatically generated: 29 | set_color("linenum", "black", $3); 30 | set_color("trailing_whitespace", "brightcyan", $2); 31 | set_color("tab", "brightcyan", $2); 32 | set_color("url", "brightcyan", $2); 33 | set_color("italic", $1, $2); 34 | set_color("underline", "yellow", $2); 35 | set_color("bold", "white", $2); 36 | set_color("html", "white", $2); 37 | set_color("keyword2", $1, $2); 38 | set_color("keyword3", $1, $2); 39 | set_color("keyword4", $1, $2); 40 | set_color("keyword5", $1, $2); 41 | set_color("keyword6", $1, $2); 42 | set_color("keyword7", $1, $2); 43 | set_color("keyword8", $1, $2); 44 | set_color("keyword9", $1, $2); 45 | -------------------------------------------------------------------------------- /lib/preparse.sl: -------------------------------------------------------------------------------- 1 | variable Preprocess_Only = 1; 2 | () = evalfile ("bytecomp.sl"); 3 | 4 | #ifdef HAS_DFA_SYNTAX 5 | define preparse_enable_highlight_cache (file, name) 6 | { 7 | create_syntax_table (name); 8 | 9 | % Make sure existing cached files are removed 10 | forever 11 | { 12 | variable dirfile = search_path_for_file (Jed_Highlight_Cache_Path, file, ','); 13 | if (dirfile == NULL) 14 | break; 15 | 16 | if (-1 == remove (dirfile)) 17 | break; 18 | } 19 | dirfile = dircat (Jed_Highlight_Cache_Dir, file); 20 | () = remove (dirfile); 21 | 22 | _dfa_enable_highlight_cache (dirfile, name); 23 | } 24 | 25 | private define create_dfa_cache (file) 26 | { 27 | file = expand_jedlib_file (file); 28 | ifnot (strlen (file)) 29 | return; 30 | setbuf ("*dfa-cache*"); 31 | erase_buffer (); 32 | if (-1 == insert_file_region (file, 33 | "%%% DFA_CACHE_BEGIN %%%", 34 | "%%% DFA_CACHE_END %%%")) 35 | return; 36 | 37 | bob (); 38 | ifnot (fsearch ("dfa_enable_highlight_cache")) 39 | return; 40 | 41 | replace ("dfa_enable_highlight_cache", "preparse_enable_highlight_cache"); 42 | eob (); 43 | ifnot (re_bsearch ("[ \t]*dfa_set_init_callback[ \t]*([ \t]*&[ \t]*\\([^,]+\\),[ \t]*\"\\([^\"]+\\)\"")) 44 | return; 45 | 46 | variable fun = regexp_nth_match (1); 47 | variable mode = regexp_nth_match (2); 48 | delete_line (); 49 | % Note that $1 has been unitialized because the use of $1 here is not 50 | % supported. 51 | vinsert ("()=__tmp($1); %s(\"%s\");", fun, mode); 52 | 53 | evalbuffer (); 54 | } 55 | 56 | flush ("creating DFA syntax tables..."); 57 | 58 | % List of modes for which dfa cache tables should be constructed 59 | foreach ([ 60 | "cmode.sl", 61 | "html.sl", 62 | "javamode.sl", 63 | "perl.sl", 64 | "php.sl", 65 | "preparse.sl", 66 | "pscript.sl", 67 | "pymode.sl", 68 | "shmode.sl", 69 | "slmode.sl", 70 | "tclmode.sl", 71 | "texcom.sl", 72 | "tpascal.sl" 73 | ]) 74 | { 75 | create_dfa_cache (); 76 | } 77 | #endif 78 | 79 | exit_jed(); 80 | -------------------------------------------------------------------------------- /lib/colors/blue1.sl: -------------------------------------------------------------------------------- 1 | $1 = "yellow"; $2 = "blue"; 2 | set_color("normal", $1, $2); % default fg/bg 3 | set_color("status", "black", "white"); % status or mode line 4 | set_color("region", "black", "white"); % for marking regions 5 | set_color("operator", "white", $2); % +, -, etc.. 6 | set_color("number", "brightmagenta", $2); % 10, 2.71,... TeX formulas 7 | set_color("comment", "brightcyan", $2); % /* comment */ 8 | set_color("string", "brightcyan", $2); % "string" or 'char' 9 | set_color("keyword", "white", $2); % if, while, unsigned, ... 10 | set_color("keyword1", "yellow", $2); % malloc, exit, etc... 11 | set_color("delimiter", "white", $2); % {}[](),.;... 12 | set_color("preprocess", "brightgreen", $2); % #ifdef .... 13 | set_color("message", "brown", $2); % color for messages 14 | set_color("error", "brightred", $2); % color for errors 15 | set_color("dollar", "white", $2); % color dollar sign continuation 16 | set_color("...", "red", $2); % folding indicator 17 | 18 | set_color ("menu_char", "black", "white"); 19 | set_color ("menu", "blue", "white"); 20 | set_color ("menu_popup", "blue", "white"); 21 | set_color ("menu_shadow", "blue", "black"); 22 | set_color ("menu_selection", "green", "red"); 23 | set_color ("menu_selection_char", "black", "red"); 24 | 25 | set_color ("cursor", "black", "red"); 26 | set_color ("cursorovr", "black", "red"); 27 | 28 | %% The following have been automatically generated: 29 | set_color("linenum", "black", "white"); 30 | set_color("trailing_whitespace", "brightcyan", $2); 31 | set_color("tab", "brightcyan", $2); 32 | set_color("url", "brightcyan", $2); 33 | set_color("italic", $1, $2); 34 | set_color("underline", "yellow", $2); 35 | set_color("bold", "white", $2); 36 | set_color("html", "white", $2); 37 | set_color("keyword2", $1, $2); 38 | set_color("keyword3", $1, $2); 39 | set_color("keyword4", $1, $2); 40 | set_color("keyword5", $1, $2); 41 | set_color("keyword6", $1, $2); 42 | set_color("keyword7", $1, $2); 43 | set_color("keyword8", $1, $2); 44 | set_color("keyword9", $1, $2); 45 | -------------------------------------------------------------------------------- /doc/tm/rtl/message.tm: -------------------------------------------------------------------------------- 1 | \variable{MESSAGE_BUFFER} 2 | \synopsis{The Contents of the Message Buffer} 3 | \usage{String_Type MESSAGE_BUFFER} 4 | \description 5 | The \var{MESSAGE_BUFFER} variable is a read-only string variable 6 | whose value indicates the text to be displayed or is currently 7 | displayed in the message buffer. 8 | \seealso{message, vmessage, error, verror} 9 | \done 10 | 11 | \function{beep} 12 | \synopsis{Beep (according to the value of \var{IGNORE_BEEP})} 13 | \usage{Void beep ();} 14 | \description 15 | The \var{beep} function causes the terminal to beep according to the value 16 | of the variable \var{IGNORE_BEEP}. 17 | \seealso{tt_send} 18 | \seealso{IGNORE_BEEP} 19 | \done 20 | 21 | \function{clear_message} 22 | \synopsis{Clear the message line of the display} 23 | \usage{Void clear_message ();} 24 | \description 25 | This function may be used to clear the message line of the display. 26 | \seealso{message, update, error, flush} 27 | \done 28 | 29 | \function{flush} 30 | \synopsis{Immediately display "msg" as a message in the mini-buffer} 31 | \usage{Void flush (String msg);} 32 | \description 33 | The \var{flush} function behaves like \var{message} except that it immediately 34 | displays its argument \var{msg} as a message in the mini-buffer. That is, 35 | it is not necessary to call \var{update} to see the message appear. 36 | \seealso{message, error} 37 | \done 38 | 39 | \function{tt_send} 40 | \synopsis{Send "s" directly to the terminal} 41 | \usage{Void tt_send (String s);} 42 | \description 43 | This function may be used to send a string specified by \var{s} directly 44 | to the terminal with no interference by the editor. One should 45 | exercise caution when using this routine since it may interfere with 46 | JED's screen management routines forcing one to redraw the screen. 47 | Nevertheless, it can serve a useful purpose. For example, when run in 48 | an XTerm window, using 49 | #v+ 50 | tt_send ("\e[?9h"); 51 | #v- 52 | will enable sending mouse click information to JED encoded as 53 | keypresses. 54 | \seealso{beep} 55 | \done 56 | 57 | -------------------------------------------------------------------------------- /lib/colors/black3.sl: -------------------------------------------------------------------------------- 1 | $1 = "white"; $2 = "black"; 2 | set_color("menu", "white", "blue"); % menu bar 3 | set_color("normal", $1, $2); % default fg/bg 4 | set_color("status", "yellow", "blue"); % status or mode line 5 | set_color("region", "yellow", "blue"); % for marking regions 6 | set_color("operator", $1, $2); % +, -, etc.. 7 | set_color("number", "yellow", $2); % 10, 2.71,... TeX formulas 8 | set_color("comment", "brightcyan", $2); % /* comment */ 9 | set_color("string", "brightgreen", $2); % "string" or 'char' 10 | set_color("keyword", "brightred", $2); % if, while, unsigned, ... 11 | set_color("keyword1", "green", $2); % malloc, exit, etc... 12 | set_color("delimiter", $1, $2); % {}[](),.;... 13 | set_color("preprocess", "magenta", $2);% #ifdef .... 14 | set_color("message", "yellow", $2); % color for messages 15 | set_color("error", "brightred", $2); % color for errors 16 | set_color("dollar", "magenta", $2); % color dollar sign continuat$ 17 | set_color("...", "red", $2); % folding indicator 18 | 19 | set_color ("menu_char", "yellow", "blue"); 20 | set_color ("menu", "lightgray", "blue"); 21 | set_color ("menu_popup", "lightgray", "blue"); 22 | set_color ("menu_shadow", "blue", "black"); 23 | set_color ("menu_selection", "white", "cyan"); 24 | set_color ("menu_selection_char", "yellow", "cyan"); 25 | 26 | set_color ("cursor", "black", "red"); 27 | set_color ("cursorovr", "black", "red"); 28 | 29 | %% The following have been automatically generated: 30 | set_color("linenum", "yellow", "blue"); 31 | set_color("trailing_whitespace", "brightcyan", $2); 32 | set_color("tab", "brightcyan", $2); 33 | set_color("url", "brightgreen", $2); 34 | set_color("italic", $1, $2); 35 | set_color("underline", "green", $2); 36 | set_color("bold", "brightred", $2); 37 | set_color("html", "brightred", $2); 38 | set_color("keyword2", $1, $2); 39 | set_color("keyword3", $1, $2); 40 | set_color("keyword4", $1, $2); 41 | set_color("keyword5", $1, $2); 42 | set_color("keyword6", $1, $2); 43 | set_color("keyword7", $1, $2); 44 | set_color("keyword8", $1, $2); 45 | set_color("keyword9", $1, $2); 46 | -------------------------------------------------------------------------------- /lib/xformreg.sl: -------------------------------------------------------------------------------- 1 | private define skip_chars_to_mark (chars, mark) 2 | { 3 | skip_chars (chars); 4 | if (create_user_mark () >= mark) 5 | { 6 | goto_user_mark (mark); 7 | return 1; 8 | } 9 | return 0; 10 | } 11 | 12 | private define skip_word_chars_to_mark (mark) 13 | { 14 | skip_word_chars (); 15 | if (create_user_mark () > mark) 16 | goto_user_mark (mark); 17 | } 18 | 19 | private define chgcase_reg () 20 | { 21 | check_region (0); 22 | variable end = create_user_mark (); 23 | pop_mark_1 (); 24 | while (create_user_mark () < end) 25 | { 26 | push_mark (); 27 | variable at_end = skip_chars_to_mark ("^\\u", end); 28 | insert (strup (bufsubstr_delete ())); 29 | if (at_end) break; 30 | push_mark (); 31 | at_end = skip_chars_to_mark ("^\\l", end); 32 | insert (strlow (bufsubstr_delete ())); 33 | if (at_end) break; 34 | } 35 | } 36 | 37 | private define cap_region () 38 | { 39 | check_region (0); 40 | variable end = create_user_mark (); 41 | pop_mark_1 (); 42 | while (create_user_mark () < end) 43 | { 44 | skip_non_word_chars (); 45 | if (create_user_mark () >= end) 46 | break; 47 | variable wch = what_char (); 48 | % The insertion must be done before the deletion to handle a single 49 | % character word. This is because the "end" mark follows the character 50 | % and if the deletion took place first, the insertion would happen 51 | % AFTER the mark, which is not what is wanted. 52 | insert (strup (char (wch))); 53 | del (); 54 | push_mark (); 55 | skip_word_chars_to_mark (end); 56 | insert (strlow (bufsubstr_delete ())); 57 | } 58 | } 59 | 60 | public define xform_region (how) 61 | { 62 | check_region (0); 63 | variable f; 64 | 65 | switch (how) 66 | { 67 | case 'u': 68 | f = &strup; 69 | } 70 | { 71 | case 'd': 72 | f = &strlow; 73 | } 74 | { 75 | case 'c': 76 | return cap_region (); 77 | } 78 | { 79 | % default 80 | return chgcase_reg (); 81 | } 82 | () = dupmark (); 83 | variable reg = (@f)(bufsubstr ()); 84 | del_region (); 85 | insert (reg); 86 | } 87 | -------------------------------------------------------------------------------- /doc/txt/menus.txt: -------------------------------------------------------------------------------- 1 | This file documents the drop-down menu support in non-Windows versions 2 | of jed. 3 | 4 | Menu Activation and Navigation 5 | ------------------------------ 6 | 7 | The menus may be activated via the mouse, or by pressing the F10 key 8 | or the ESC-m key. Also, ESC + accelerator character may be used to 9 | activate a particular menu-bar item, e.g. `ESC-f' to select the `File' 10 | menu, provided that the particular editor emulation does not bind the 11 | key to something else. For example, Emacs uses ESC-f to move by 12 | words. See the discussion about `enable_menu_keys' below to work 13 | around this problem. 14 | 15 | The arrow keys or the mouse may be used to navigate the menus. Use the 16 | ENTER key to select a menu item. To go back to a previous menu, press 17 | either the ESC key or the backspace key. 18 | 19 | Menu Colors 20 | ----------- 21 | 22 | The colors of the menus may be controlled by the `set_color' strings: 23 | 24 | "menu" Color of the menu bar 25 | "menu_popup" Color of the popped-up menu window 26 | "menu_char" Color of the keyboard-accelerator character 27 | "menu_selection" Color of the current selection 28 | "menu_shadow" Color of the popup-box shadow 29 | 30 | Special Hints 31 | ------------- 32 | 33 | To enable the mouse when running jed in an xterm, put the line 34 | 35 | enable_xmouse (); 36 | 37 | in your .jedrc file. 38 | 39 | To hide the menu bar, put 40 | 41 | enable_top_status_line (0); 42 | 43 | in your .jedrc file. This will hide the menu bar until it is 44 | activated via a key such as F10. 45 | 46 | Some terminals map the ALT key modifier to ESC + key. For such 47 | terminals, an item on the menu bar may be activated via the ALT key + 48 | the accelerator key, e.g., `ALT-f' to select the file menu. 49 | 50 | The main problem with hot-keys such as ESC-f is that certain modes 51 | rebind these keys to other function. To rebind these keys to the 52 | menubar functions, put the line: 53 | 54 | enable_menu_keys (); 55 | 56 | in your .jedrc file AFTER loading the appropriate editor emulation, 57 | e.g., emacs. 58 | 59 | -------------------------------------------------------------------------------- /lib/colors/blue3.sl: -------------------------------------------------------------------------------- 1 | $1 = "yellow"; $2 = "blue"; 2 | set_color("normal", $1, $2); % default fg/bg 3 | set_color("status", "black", "lightgray"); % status or mode line 4 | set_color("region", "black", "lightgray"); % for marking regions 5 | set_color("operator", "white", $2); % +, -, etc.. 6 | set_color("number", "brightcyan", $2); % 10, 2.71,... TeX formulas 7 | set_color("comment", "lightgray", $2); % /* comment */ 8 | set_color("string", "brightcyan", $2); % "string" or 'char' 9 | set_color("keyword", "white", $2); % if, while, unsigned, ... 10 | set_color("keyword1", "yellow", $2); % malloc, exit, etc... 11 | set_color("delimiter", "white", $2); % {}[](),.;... 12 | set_color("preprocess", "brightgreen", $2); % #ifdef .... 13 | set_color("message", "lightgray", $2); % color for messages 14 | set_color("error", "brightred", $2); % color for errors 15 | set_color("dollar", "brightmagenta", $2); % color dollar sign continuation 16 | set_color("...", "brightred", $2); % folding indicator 17 | 18 | set_color ("menu_char", "black", "white"); 19 | set_color ("menu", "black", "lightgray"); % menu bar 20 | set_color ("menu_popup", "blue", "white"); 21 | set_color ("menu_shadow", "blue", "black"); 22 | set_color ("menu_selection", "green", "red"); 23 | set_color ("menu_selection_char", "black", "red"); 24 | 25 | set_color ("cursor", "white", "red"); 26 | set_color ("cursorovr", "black", "brightred"); 27 | 28 | %% The following have been automatically generated: 29 | set_color("linenum", "black", "lightgray"); 30 | set_color("trailing_whitespace", "lightgray", $2); 31 | set_color("tab", "lightgray", $2); 32 | set_color("url", "brightcyan", $2); 33 | set_color("italic", $1, $2); 34 | set_color("underline", "yellow", $2); 35 | set_color("bold", "white", $2); 36 | set_color("html", "white", $2); 37 | set_color("keyword2", $1, $2); 38 | set_color("keyword3", $1, $2); 39 | set_color("keyword4", $1, $2); 40 | set_color("keyword5", $1, $2); 41 | set_color("keyword6", $1, $2); 42 | set_color("keyword7", $1, $2); 43 | set_color("keyword8", $1, $2); 44 | set_color("keyword9", $1, $2); 45 | -------------------------------------------------------------------------------- /lib/man.sl: -------------------------------------------------------------------------------- 1 | %% 2 | %% execute man then remove backspaces 3 | %% 4 | 5 | %!%+ 6 | %\function{man_clean_manpage} 7 | %\synopsis{man_clean_manpage} 8 | %\description 9 | % remove _^H and ^H combinations and multiple blank lines (man page) 10 | %!%- 11 | define man_clean_manpage () 12 | { 13 | variable clean = "Cleaning man page..."; 14 | push_spot_bob (); 15 | 16 | flush (clean); 17 | % I do not know what man on debian etch or lenny is doing, but it 18 | % is producing this combination: \xE2\x88\x{2212} for a -. Note that 19 | % \xE2\x88 are the leading bytes of \u{2212}. For some reason, 20 | % these are getting doubled. So replace the entire combination 21 | replace ("\xE2\x88\x{2212}", "-"); 22 | replace ("\xE2\x80\x{2010}", "-"); 23 | 24 | % Convert other unicode versions of - to ascii -. 25 | replace ("\x{2212}", "-"); 26 | replace ("\x{2010}", "-"); 27 | replace ("\x{00AD}", "-"); 28 | 29 | replace ("_\010", ""); % remove _^H underscores 30 | while ( fsearch ("\010") ) 31 | { 32 | del (); 33 | del (); 34 | } % remove overstrike 35 | 36 | % Now removed SGR sequences such as ESC[1m, ESC[m, etc.... 37 | bob (); 38 | while (re_fsearch ("\e\\[\\d*m")) 39 | () = replace_match ("", 0); 40 | 41 | trim_buffer (); % remove multiple blank lines 42 | pop_spot (); 43 | 44 | flush (strcat (clean, "done")); 45 | } 46 | 47 | %!%+ 48 | %\function{unix_man} 49 | %\synopsis{unix_man} 50 | %\description 51 | % retrieve a man page entry and use clean_manpage to clean it up 52 | %!%- 53 | define unix_man () 54 | { 55 | variable subj, buf = "*manual-entry*", msg = "Getting man page..."; 56 | 57 | subj = read_mini ("man", Null_String, Null_String); 58 | ifnot ( strlen (subj) ) return; 59 | 60 | pop2buf (buf); 61 | set_readonly (0); 62 | erase_buffer (); 63 | flush (msg); 64 | #ifdef OS2 65 | () = run_shell_cmd (sprintf ("man %s 2> nul", subj)); 66 | #else 67 | () = run_shell_cmd (sprintf ("man %s 2> /dev/null", subj)); 68 | #endif 69 | man_clean_manpage (); 70 | bob (); 71 | set_buffer_modified_flag (0); 72 | most_mode (); 73 | set_readonly (1); 74 | } 75 | 76 | -------------------------------------------------------------------------------- /lib/bookmark.sl: -------------------------------------------------------------------------------- 1 | % These routines user 'user_marks' to implement book marks. A book mark 2 | % may be placed in any buffer and returning to the mark may cause a change 3 | % of buffer. 4 | 5 | % The only functions that are considered external are 'bkmrk_set_mark' 6 | % and 'bkmrk_goto_mark'. These functions prompt for a a key '0' - '9' 7 | % or a SPACE. 8 | 9 | private variable Book_Marks = Mark_Type [10]; 10 | private variable Bkmrk_Last_Position = NULL; 11 | 12 | private define bkmrk_get_or_set_mark (get) 13 | { 14 | variable n; 15 | variable prompt; 16 | variable m; 17 | 18 | if ((Bkmrk_Last_Position != NULL) && get) 19 | get = 2; 20 | 21 | prompt = "Bookmark number:"; 22 | if (get == 2) 23 | prompt = "Bookmark number or SPACE for last position:"; 24 | 25 | n = get_mini_response (prompt); 26 | 27 | if ((get == 2) && (n == ' ')) 28 | return Bkmrk_Last_Position; 29 | 30 | if ((n == ' ') && (get == 0)) 31 | { 32 | vmessage ("Bookmark set"); 33 | Bkmrk_Last_Position = create_user_mark (); 34 | return; 35 | } 36 | n -= '0'; 37 | 38 | if ((n < 0) || (n > 9)) error ("Number must be less than 10"); 39 | 40 | if (get) 41 | return Book_Marks[n]; 42 | 43 | Book_Marks[n] = create_user_mark (); 44 | vmessage ("Bookmark %d set.", n); 45 | } 46 | 47 | define bkmrk_set_mark () 48 | { 49 | bkmrk_get_or_set_mark (0); 50 | Bkmrk_Last_Position = create_user_mark (); 51 | } 52 | 53 | define bkmrk_goto_mark () 54 | { 55 | variable mrk = bkmrk_get_or_set_mark (1); 56 | 57 | if (mrk == NULL) 58 | error ("Bookmark has not been set"); 59 | 60 | Bkmrk_Last_Position = create_user_mark (); 61 | 62 | sw2buf (mrk.buffer_name); 63 | ifnot (is_user_mark_in_narrow (mrk)) 64 | { 65 | #ifdef HAS_BLOCAL_VAR 66 | variable fun; 67 | try 68 | { 69 | fun = get_blocal_var ("bookmark_narrow_hook"); 70 | mrk; eval (fun); 71 | } 72 | catch AnyError: 73 | throw UsageError, "Mark lies outside visible part of buffer."; 74 | #else 75 | error ("Mark lies outside visible part of buffer."); 76 | #endif 77 | } 78 | 79 | goto_user_mark (mrk); 80 | message ("done"); 81 | } 82 | -------------------------------------------------------------------------------- /doc/tm/rtl/userinfo.tm: -------------------------------------------------------------------------------- 1 | \function{get_hostname} 2 | \synopsis{Get the name of the host computer} 3 | \usage{String_Type get_hostname ()} 4 | \description 5 | The \var{get_hostname} function returns the name of the host 6 | computer. If the editor is unable to determine the name, and the 7 | user has not specified a name, then \exmp{"localhost"} is returned. 8 | \seealso{set_hostname, get_realname, get_username} 9 | \done 10 | 11 | \function{get_realname} 12 | \synopsis{Get the user's real name} 13 | \usage{String_Type get_realname} 14 | \description 15 | The \var{get_realname} returns the user's real name. If the editor 16 | is unable to determine this value, an empty string is returned. 17 | \seealso{set_realname, get_username, get_hostname} 18 | \done 19 | 20 | \function{get_username} 21 | \synopsis{Get the username} 22 | \usage{String_Type get_username ()} 23 | \description 24 | The \var{get_username} function returns the username associated with 25 | the current process. If is is unable to determine this value, 26 | \exmp{"unknown"} will be returned. 27 | \seealso{set_username, get_realname, get_hostname} 28 | \done 29 | 30 | \function{set_hostname} 31 | \synopsis{Set the name of the host} 32 | \usage{set_hostname (String_Type hostname)} 33 | \description 34 | \var{set_hostname} may be used to set set the name of the host that 35 | the editor will associate with the current process. 36 | \seealso{get_hostname, set_username, set_realname} 37 | \done 38 | 39 | \function{set_realname} 40 | \synopsis{Set the user's realname} 41 | \usage{set_realname (String_Type realname)} 42 | \description 43 | The \var{set_realname} function sets the editor's notion of what the 44 | user's real name is such that subsequent calls to \var{get_realname} 45 | will return the specified value. 46 | \seealso{get_realname, get_username, set_username, set_hostname} 47 | \done 48 | 49 | \function{set_username} 50 | \synopsis{Set the username of the editor process} 51 | \usage{set_username (String_Type username)} 52 | \description 53 | This function may be used to specify the username associated with the 54 | editor process. 55 | \seealso{get_username, set_realname, set_hostname} 56 | \done 57 | 58 | -------------------------------------------------------------------------------- /lib/colors/Xjed/modern.sl: -------------------------------------------------------------------------------- 1 | % modern.sl 2 | % By Guido Gonzato 3 | 4 | $1 = "black"; 5 | $2 = "white"; 6 | $3 = "#E8E8E8"; % light gray 7 | $4 = "#B0B0B0"; % mid gray 8 | $5 = "#007000"; % dark green 9 | $6 = "#1010A0"; % dark blue 10 | $7 = "#B40A78"; % dark purple 11 | $8 = "#D717E7"; % purple 12 | $9 = "#606060"; % dark gray 13 | 14 | set_color ("normal", $1, $2); % default fg/bg 15 | set_color ("status", $1, $3); % status line 16 | set_color ("operator", $1, $2); % +, -, etc... 17 | set_color ("number", "brightred", $2); % numbers 18 | set_color ("comment", $9, $2); % /* comment */ 19 | set_color ("region", $1, $4); % region 20 | set_color ("string", $6, $3); % "string" or 'char' 21 | set_color ("keyword", $7, $2); % if, while, unsigned, ... 22 | set_color ("keyword1", $6, $2); % malloc, exit, etc... 23 | set_color ("keyword2", $5, $2); % other keywords 24 | set_color ("delimiter", "red", $2); % {}[](),.;... 25 | set_color ("preprocess", "magenta", $2); % #ifdef etc... 26 | set_color ("message", $6, $2); 27 | set_color ("error", $8, $2); 28 | set_color ("dollar", $8, $2); 29 | set_color ("...", $8, $2); % folding indicator 30 | 31 | set_color ("menu_char", "red", $3); 32 | set_color ("menu", $1, $3); 33 | set_color ("menu_popup", $1, $3); 34 | set_color ("menu_shadow", $1, $4); 35 | set_color ("menu_selection", $1, "cyan"); 36 | set_color ("menu_selection_char", "red", $3); 37 | 38 | set_color ("mouse", "blue", "blue"); 39 | set_color ("cursor", $1, $8); 40 | set_color ("cursorovr", $1, $8); 41 | 42 | %% The following have been automatically generated: 43 | set_color("linenum", $1, $3); 44 | set_color("trailing_whitespace", $9, $2); 45 | set_color("tab", $9, $2); 46 | set_color("url", $6, $3); 47 | set_color("italic", $5, $2); 48 | set_color("underline", $6, $2); 49 | set_color("bold", $7, $2); 50 | set_color("html", $7, $2); 51 | set_color("keyword3", $1, $2); 52 | set_color("keyword4", $1, $2); 53 | set_color("keyword5", $1, $2); 54 | set_color("keyword6", $1, $2); 55 | set_color("keyword7", $1, $2); 56 | set_color("keyword8", $1, $2); 57 | set_color("keyword9", $1, $2); 58 | -------------------------------------------------------------------------------- /lib/pushmode.sl: -------------------------------------------------------------------------------- 1 | % The functions push_mode and pop_mode are designed to allow one to temporarily 2 | % switch buffer modes and then restore the original mode. 3 | % It requires a version of jed with buffer local variables. 4 | % To use it, add: 5 | % 6 | % autoload ("push_mode", "pushmode"); 7 | % 8 | % to you .jedrc file. 9 | 10 | define push_mode () 11 | { 12 | variable mode, old_mode, keymap; 13 | variable var_name, try_mode; 14 | 15 | var_name = "push-mode-stack"; 16 | ifnot (blocal_var_exists (var_name)) 17 | define_blocal_var (var_name, ""); 18 | 19 | if (_NARGS) 20 | mode = (); 21 | else 22 | mode = strtrim (read_mini ("Push to mode:", Null_String, Null_String)); 23 | 24 | ifnot (strlen (mode)) 25 | return; 26 | 27 | if (is_defined (mode) <= 0) 28 | { 29 | mode += "_mode"; 30 | if (is_defined (mode) <= 0) 31 | error ("Mode is not defined."); 32 | } 33 | 34 | (old_mode,) = what_mode (); 35 | ifnot (strlen (old_mode)) 36 | old_mode = "no"; 37 | 38 | old_mode = str_replace_all (old_mode, "-", "_"); 39 | % Some modes may set modeline to two words. 40 | try_mode = strlow (str_replace_all (old_mode, " ", "_") + "_mode"); 41 | if (2 != is_defined (try_mode)) 42 | { 43 | try_mode = strlow (extract_element (old_mode, 0, ' ') + "_mode"); 44 | if (2 != is_defined (try_mode)) 45 | verror ("Unable to get mode. Tried %s.", try_mode); 46 | } 47 | 48 | keymap = what_keymap (); 49 | 50 | no_mode (); 51 | eval (". " + mode); % RPN form 52 | 53 | set_blocal_var (sprintf (". %s|%s,%s", try_mode, keymap, 54 | get_blocal_var (var_name)), 55 | var_name); 56 | } 57 | 58 | define pop_mode () 59 | { 60 | variable var_name = "push-mode-stack"; 61 | variable modes, keymap, mode; 62 | 63 | modes = get_blocal_var (var_name); 64 | ifnot (strlen (modes)) 65 | error ("mode stack is empty."); 66 | 67 | mode = extract_element (modes, 0, ','); 68 | keymap = extract_element (mode, 1, '|'); 69 | mode = extract_element (mode, 0, '|'); 70 | 71 | no_mode (); 72 | eval (mode); 73 | use_keymap (keymap); 74 | set_blocal_var (extract_element (modes, 1, ','), var_name); 75 | } 76 | 77 | -------------------------------------------------------------------------------- /lib/colors/black4.sl: -------------------------------------------------------------------------------- 1 | % Contributed by Mark Olesen 2 | $1 = "white"; 3 | $2 = "black"; 4 | $3 = "brightcyan"; 5 | $4 = "brightred"; 6 | $5 = "brightmagenta"; 7 | $6 = "lightgray"; 8 | 9 | set_color("normal", $1, $2); 10 | % use white/gray status for Xjed color scheme 11 | set_color("status", $1, "blue"); 12 | set_color("region", "yellow", "blue"); 13 | set_color("operator", $3, $2); 14 | set_color("delimiter", $3, $2); 15 | set_color("number", $4, $2); 16 | set_color("string", $6, $2); 17 | set_color("keyword", "yellow", $2); 18 | set_color("keyword1", "green", $2); 19 | set_color("comment", $3, "gray"); 20 | set_color("preprocess", $5, $2); 21 | set_color("dollar", "yellow", "gray"); 22 | set_color("...", $5, $2); 23 | set_color("message", $3, $2); 24 | set_color("error", $4, $2); 25 | 26 | #iftrue 27 | % blue menu 28 | set_color("menu", $6, "blue"); 29 | set_color("menu_char", "yellow", "blue"); 30 | set_color("menu_popup", $6, "blue"); 31 | set_color("menu_shadow", $4, "gray"); 32 | set_color("menu_selection", $1, $2); 33 | set_color("menu_selection_char", "yellow", $2); 34 | #else 35 | % gray menu - ok except the shadow looks a bit odd 36 | % set_color("menu", $1, "gray"); 37 | % set_color("menu_char", "yellow", "gray"); 38 | % set_color("menu_popup", $1, "gray"); 39 | % set_color("menu_shadow", $4, "black"); 40 | % set_color("menu_selection", $1, $2); 41 | % set_color("menu_selection_char", "yellow", $2); 42 | #endif 43 | 44 | set_color("cursor", "black", "yellow"); 45 | set_color("cursorovr", "black", "red"); 46 | set_color("mouse", "green", $2); 47 | 48 | %% some of the following have been automatically generated: 49 | set_color("linenum", $4, $2); 50 | set_color("trailing_whitespace", $1, "brown"); 51 | set_color("tab", $1, "cyan"); 52 | set_color("url", $6, $2); 53 | set_color("italic", $1, $2); 54 | set_color("underline", "green", $2); 55 | set_color("bold", $1, $2); 56 | set_color("html", "yellow", $2); 57 | set_color("keyword2", $1, $2); 58 | set_color("keyword3", $1, $2); 59 | set_color("keyword4", $1, $2); 60 | set_color("keyword5", $1, $2); 61 | set_color("keyword6", $1, $2); 62 | set_color("keyword7", $1, $2); 63 | set_color("keyword8", $1, $2); 64 | set_color("keyword9", $1, $2); 65 | 66 | % end 67 | -------------------------------------------------------------------------------- /src/line.c: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; mode: fold; -*- */ 2 | /* Copyright (c) 1992-2023 John E. Davis 3 | * This file is part of JED editor library source. 4 | * 5 | * You may distribute this file under the terms the GNU General Public 6 | * License. See the file COPYING for more information. 7 | */ 8 | #include "config.h" 9 | #include "jed-feat.h" 10 | 11 | #include 12 | #include 13 | #include "buffer.h" 14 | #include "ins.h" 15 | #include "misc.h" 16 | #include "paste.h" 17 | #include "undo.h" 18 | #include "line.h" 19 | 20 | /* breaks line at current point leaving point at end of current line */ 21 | 22 | int split_line (void) /*{{{*/ 23 | { 24 | int size; 25 | 26 | if (CLine == NULL) 27 | { 28 | exit_error("split_line: Null Line", 1); 29 | } 30 | size = CLine->len - Point; 31 | 32 | if (NULL == make_line(size + 1)) 33 | { 34 | exit_error("Allocation Failure in split_line", 0); 35 | } 36 | 37 | SLMEMCPY((char *) CLine->data, (char *) (CLine->prev->data + Point), size); 38 | CLine->len = size; 39 | CLine = CLine->prev; LineNum--; 40 | CLine->len = Point; 41 | remake_line(Point + 1); 42 | /* now update the marks */ 43 | jed_update_marks(NLINSERT, 1); 44 | record_newline_insertion(); 45 | return(0); 46 | } 47 | 48 | /*}}}*/ 49 | 50 | void splice_line (void) /*{{{*/ 51 | { 52 | int n1, n2; 53 | int save_point; 54 | #if JED_HAS_LINE_ATTRIBUTES 55 | unsigned int flags; 56 | #endif 57 | 58 | if (CLine->next == NULL) 59 | { 60 | exit_error("splice line: next line is Null", 1); 61 | } 62 | push_spot(); 63 | n1 = CLine->len; 64 | n2 = CLine->next->len; 65 | 66 | #ifdef KEEP_SPACE_INFO 67 | if (n1 + n2 > CLine->space) 68 | #endif 69 | remake_line(n1 + n2 + 1); 70 | 71 | SLMEMCPY((char *) (CLine->data + Point), (char *) CLine->next->data, n2); 72 | CLine->len = n1 + n2; 73 | 74 | save_point = Point; 75 | (void) jed_down (1); 76 | Point = save_point; 77 | 78 | jed_update_marks(NLDELETE, 1); 79 | #if JED_HAS_LINE_ATTRIBUTES 80 | flags = CLine->flags; 81 | #endif 82 | delete_line(); 83 | pop_spot(); 84 | 85 | #if JED_HAS_LINE_ATTRIBUTES 86 | if (n1 == 0) 87 | CLine->flags = flags; 88 | #endif 89 | } 90 | 91 | /*}}}*/ 92 | 93 | -------------------------------------------------------------------------------- /src/paste.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1992-2023 John E. Davis 2 | * This file is part of JED editor library source. 3 | * 4 | * You may distribute this file under the terms the GNU General Public 5 | * License. See the file COPYING for more information. 6 | */ 7 | 8 | extern int set_mark_cmd(void); 9 | extern int push_spot(void); 10 | extern int jed_push_mark (void); 11 | extern int jed_goto_mark(Mark *); 12 | extern int jed_pop_mark (int); 13 | extern int mark_spot(void); 14 | extern int pop_spot(void); 15 | extern int widen_buffer(Buffer *); 16 | extern int widen(void); 17 | extern int widen_region (void); 18 | extern int narrow_to_region (void); 19 | extern int narrow_to_lines (void); 20 | extern void jed_widen_whole_buffer (Buffer *); 21 | extern void jed_init_mark (Mark *, unsigned int); 22 | extern void jed_init_mark_for_buffer (Mark *, Buffer *, unsigned int); 23 | extern int jed_init_mark_for_line (Mark *, Line *, unsigned int); 24 | extern void jed_copy_mark (Mark *dest, Mark *src); 25 | 26 | #if JED_HAS_SAVE_NARROW 27 | extern void jed_free_saved_narrow (Buffer *); 28 | extern void jed_push_narrow (void); 29 | extern void jed_pop_narrow (void); 30 | #endif 31 | extern int jed_count_narrows (void); 32 | extern int exchange_point_mark(void); 33 | extern int yank(void); 34 | extern int check_region(int *); 35 | extern int copy_region_to_buffer(Buffer *); 36 | extern int delete_region(void); 37 | extern int copy_to_pastebuffer(void); 38 | extern int kill_region(void); 39 | extern int insert_rectangle(void); 40 | extern int kill_rectangle(void); 41 | extern int blank_rectangle(void); 42 | extern int open_rectangle(void); 43 | extern int copy_rectangle(void); 44 | 45 | extern void goto_user_mark (void); 46 | extern void create_user_mark (void); 47 | extern void free_user_marks (Buffer *); 48 | extern void move_user_mark (void); 49 | extern int jed_is_user_mark_in_narrow (void); 50 | extern int jed_move_user_object_mark (SLang_MMT_Type *); 51 | extern SLang_MMT_Type *jed_make_user_object_mark (void); 52 | extern char *user_mark_buffer (void); 53 | extern int register_jed_classes (void); 54 | 55 | #if JED_HAS_LINE_MARKS 56 | extern void jed_create_line_mark (int *); 57 | #endif 58 | 59 | extern unsigned int jed_count_lines_in_region (void); 60 | extern Buffer *Paste_Buffer; 61 | 62 | -------------------------------------------------------------------------------- /doc/txt/sessions.txt: -------------------------------------------------------------------------------- 1 | JED save/restore editor sessions 2 | ================================= 3 | 4 | The session.sl file contains functions that may be used to save and 5 | restore the partial state of a jed session. By partial, it is meant 6 | that only the names of the files that are associated with buffers, the 7 | positions within those buffers, and some of the buffer flags are 8 | saved. Other state information such as undo information, 9 | paste-buffers, etc are not saved. 10 | 11 | To enable this feature, add the following near the end of your .jedrc file: 12 | 13 | require ("session"); 14 | 15 | Then when jed starts up with no filenames specified on the command 16 | line, it will attempt to load a session file from the current 17 | directory. The files specified in the session file will be 18 | subsequently read. If jed is started with one or more files given on 19 | the command-line, the previous session will not be loaded, nor will 20 | the current one be automatically saved. 21 | 22 | By default, no session will be loaded or saved unless the startup 23 | directory contains a session file. To initiate the saving of a 24 | session, you can either execute the save_session function, or create 25 | an empty session file in the startup directory. To create an empty 26 | session file, simply execute the shell command: 27 | 28 | touch .jedsession 29 | 30 | If the save_session function is used, then the directory associated 31 | with the *scratch* buffer will be used for the session file. 32 | 33 | The name of the session file may be set using 34 | the Session_Filename variable. The default value is ".jedsession". 35 | 36 | The Session_Exclude_Patterns variable is a list of slang regular 37 | expressions that are matched against a filename. If a filename 38 | matches one of the patterns in the list, that filename will not be 39 | saved to the session file. The function session_add_exclude_pattern 40 | may be used to add patterns to this variable. Also, buffers that 41 | have the buffer-local variable save_session defined and set to 0 42 | will not be saved, as well as any buffer whose name begins with a 43 | space or '*' character. 44 | 45 | The format of the session file is very simple. It consists of zero 46 | or more lines formatted as: 47 | 48 | filename|linenumber|column|flags 49 | -------------------------------------------------------------------------------- /src/DESCRIP.MMS: -------------------------------------------------------------------------------- 1 | # 2 | # MMS file to build Jed (Thanks to Hunter Goatley) 3 | # 4 | .IFDEF __MATTS_MMS__ 5 | .ELSE 6 | EXE = .EXE 7 | OBJ = .OBJ 8 | .ENDIF 9 | 10 | .IFDEF __ALPHA__ 11 | CC = CC/STANDARD=VAXC 12 | OPTFILE = 13 | OPTIONS = 14 | .ELSE 15 | OPTFILE = ,VAXCRTL.OPT 16 | OPTIONS = $(OPTFILE)/OPTIONS 17 | .ENDIF 18 | 19 | .IFDEF __DEBUG__ 20 | CFLAGS = $(CFLAGS)/DEBUG/NOOPTIMIZE 21 | LINKFLAGS = $(LINKFLAGS)/DEBUG 22 | .ELSE 23 | LINKFLAGS = $(LINKFLAGS)/NOTRACE 24 | .ENDIF 25 | 26 | .IFDEF SLANG_OLB 27 | .ELSE 28 | SLANG_DIR = [-.-.SLANG.SRC] 29 | SLANG_OLB = $(SLANG_DIR)SLANG$(OLB) 30 | .ENDIF 31 | 32 | CFLAGS = $(CFLAGS)/DEFINE=(JED)/INCLUDE=([],$(SLANG_DIR)) 33 | 34 | OBJS = ABBREV$(OBJ), - 35 | BUFFER$(OBJ), - 36 | CMDS$(OBJ), - 37 | FILE$(OBJ), - 38 | INDENT$(OBJ), - 39 | INS$(OBJ), - 40 | INTRIN$(OBJ), - 41 | KEYMAP$(OBJ), - 42 | LEDIT$(OBJ), - 43 | LOCK$(OBJ), - 44 | LINE$(OBJ), - 45 | LINEATTR$(OBJ), - 46 | MAIN$(OBJ), - 47 | MISC$(OBJ), - 48 | PASTE$(OBJ), - 49 | REPLACE$(OBJ), - 50 | SCREEN$(OBJ), - 51 | COLORS$(OBJ), - 52 | SEARCH$(OBJ), - 53 | SIG$(OBJ), - 54 | SYNTAX$(OBJ), - 55 | SYSDEP$(OBJ), - 56 | TEXT$(OBJ), - 57 | UNDO$(OBJ), - 58 | VFILE$(OBJ), - 59 | VMSHELP$(OBJ), - 60 | VMSMAIL$(OBJ), - 61 | VTERM$(OBJ), - 62 | BLOCAL$(OBJ), - 63 | MENU$(OBJ), - 64 | JEDWIN$(OBJ), - 65 | MOUSE$(OBJ), - 66 | WINDOW$(OBJ), - 67 | VERSION$(OBJ), - 68 | HOOKS$(OBJ), - 69 | USERINFO$(OBJ) 70 | 71 | JEDOBJS = $(OBJS) DISPLAY$(OBJ) 72 | 73 | HFILES = BUFFER.H,CMDS.H,DISPLAY.H,FILE.H,INS.H,KEYMAP.H,LEDIT.H,LINE.H,- 74 | MISC.H,PASTE.H,SCREEN.H,SEARCH.H,SIG.H,SYSDEP.H,TEXT.H,VTERM.H,- 75 | REPLACE.H,WINDOW.H,UNDO.H,COLORS.H 76 | 77 | JED$(EXE) : JED$(OLB)($(JEDOBJS))$(OPTFILE),$(SLANG_OLB) 78 | $(LINK)$(LINKFLAGS) JED$(OLB)/INCLUDE=main/LIBRARY$(OPTIONS),- 79 | $(SLANG_OLB)/LIBRARY 80 | 81 | # 82 | # Most modules depend on most of the .H files, so I'm going to be lazy 83 | # and just make them all depend on all of them. 84 | # 85 | SYSDEP$(OBJ) : SYSDEP.C,VMS.C 86 | 87 | $(OBJS),DISPLAY$(OBJ) : $(HFILES) 88 | 89 | 90 | # 91 | # Build the linker options file for OpenVMS VAX and VAX C. 92 | # 93 | VAXCRTL.OPT : 94 | @ open/write tmp vaxcrtl.opt 95 | @ write tmp "SYS$SHARE:VAXCRTL.EXE/SHARE" 96 | @ close tmp 97 | 98 | -------------------------------------------------------------------------------- /doc/tm/rtl/rect.tm: -------------------------------------------------------------------------------- 1 | \function{Replace all text in the rectangle by spaces} 2 | \synopsis{Replace the rectangle defined by point and mark with spaces} 3 | \usage{Void blank_rect ()} 4 | \description 5 | The \var{blank_rect} function replaces all text in the rectangle defined by 6 | the current editing point and the mark by spaces. 7 | \seealso{push_mark, kill_rect, insert_rect, copy_rect} 8 | \done 9 | 10 | \function{copy_rect} 11 | \synopsis{Copy the contents of the rectangle to the rectangle buffer} 12 | \usage{Void copy_rect ()} 13 | \description 14 | The \var{copy_rect} function is used to copy the contents of the 15 | currently defined rectangle to the rectangle buffer. It overwrites 16 | the previous contents of the rectangle buffer. A rectangle is defined 17 | by the diagonal formed by the mark and the current point. 18 | \seealso{insert_rect, kill_rect, blank_rect} 19 | \done 20 | 21 | \function{insert_rect} 22 | \synopsis{Insert the contents of the rectangle buffer} 23 | \usage{insert_rect ()} 24 | \description 25 | The \var{insert_rect} function inserts the contents of the rectangle buffer 26 | at the current editing point. The rectangle buffer is not modified. 27 | Any text that the rectangle would overwrite is moved to the right by an 28 | amount that is equal to the width of the rectangle. 29 | \seealso{kill_rect, blank_rect, copy_rect} 30 | \done 31 | 32 | \function{kill_rect} 33 | \synopsis{Delete the rectangle and place a copy in the rectangle buffer} 34 | \usage{Void kill_rect ()} 35 | \description 36 | This function deletes the rectangle defined by the mark and the current 37 | point. The contents of the rectangle are saved in the rectangle buffer 38 | for later retrieval via the \var{insert_rect} function. The previous 39 | contents of the rectangle buffer will be lost. 40 | \seealso{insert_rect, blank_rect, copy_rect} 41 | \done 42 | 43 | \function{open_rect} 44 | \synopsis{Insert a blank rectangle determined by mark and point} 45 | \usage{Void open_rect ()} 46 | \description 47 | The \var{open_rect} function may be used to insert a blank rectangle whose 48 | size is determined by the mark and the current editing point. Any text 49 | that lies in the region of the rectangle will be pushed to the right. 50 | \seealso{insert_rect, kill_rect, copy_rect} 51 | \done 52 | 53 | -------------------------------------------------------------------------------- /src/cmds.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1992-2023 John E. Davis 2 | * This file is part of JED editor library source. 3 | * 4 | * You may distribute this file under the terms the GNU General Public 5 | * License. See the file COPYING for more information. 6 | */ 7 | extern int jed_buffer_visible (char *b); 8 | extern int newline(void); 9 | extern int newline_cmd(void); 10 | extern int previous_char_cmd(void); 11 | extern int delete_char_cmd(void); 12 | extern int backward_delete_char_cmd(void); 13 | extern int backward_delete_char_untabify(void); 14 | extern int previous_line_cmd(void); 15 | extern int next_line_cmd(void); 16 | extern int next_char_cmd(void); 17 | extern int kill_line(void); 18 | extern void insert_line(Line *line); 19 | extern int double_line(void); 20 | extern int kill_eol_cmd(void); 21 | extern int kill_line_cmd(void); 22 | extern int jed_trim_whitespace(void); 23 | extern int indent_line(void); 24 | extern int transpose_lines(void); 25 | extern int newline_and_indent(void); 26 | extern int bol_cmd(void); 27 | extern int eol_cmd(void); 28 | extern int sys_spawn_cmd(void); 29 | extern int jed_spawn_fg_process (int (*)(VOID_STAR), VOID_STAR); 30 | extern int ins_char_cmd(void); 31 | extern int jed_exit_jed(int); 32 | extern int jed_quit_jed(int); 33 | extern int jed_exit_jed_cmd(void); 34 | extern int save_some_buffers(void); 35 | extern int pagedown_cmd(void); 36 | extern int pageup_cmd(void); 37 | extern int jed_scroll_left_cmd (void); 38 | extern int jed_scroll_right_cmd (void); 39 | extern int quoted_insert(void); 40 | extern void indent_to(int); 41 | extern int goto_column1(int *); 42 | extern void goto_column(int *); 43 | extern void goto_top_of_window (void); 44 | extern int goto_bottom_of_window (void); 45 | extern void insert_whitespace(int *); 46 | extern unsigned char *get_current_indent(int *); 47 | extern unsigned char *jed_skip_whitespace (void); 48 | extern unsigned char *jed_bskip_whitespace (void); 49 | extern int jed_looking_at(char *); 50 | 51 | extern int Blink_Flag; 52 | extern int Indented_Text_Mode; 53 | extern int Kill_Line_Feature; 54 | extern int Jed_Secure_Mode; 55 | extern int Goal_Column; 56 | extern int Jed_Tab_Default; 57 | extern int Jed_Wrap_Default; 58 | extern int Jed_Case_Search_Default; 59 | extern int Jed_Suspension_Not_Allowed; 60 | extern int Jed_Use_Tabs_Default; 61 | 62 | #if 0 63 | extern int new_find_matching (int *, int *); 64 | #endif 65 | 66 | -------------------------------------------------------------------------------- /src/file.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1992-2023 John E. Davis 2 | * This file is part of JED editor library source. 3 | * 4 | * You may distribute this file under the terms the GNU General Public 5 | * License. See the file COPYING for more information. 6 | */ 7 | #ifndef _JED_FILE_H_ 8 | #define _JED_FILE_H_ 9 | #include 10 | #ifdef VMS 11 | # include 12 | #endif 13 | 14 | #include "buffer.h" 15 | #include "vfile.h" 16 | 17 | extern int Require_Final_Newline; 18 | extern int read_file(char *); 19 | extern int insert_file(char *); 20 | extern void set_file_modes(void); 21 | extern void auto_save_buffer(Buffer *); 22 | extern void auto_save_all(void); 23 | extern void auto_save(void); 24 | extern int write_region_to_fp(int); 25 | extern int write_region(char *); 26 | extern int read_file_pointer(int); 27 | extern int insert_file_pointer(VFILE *); 28 | extern int append_to_file(char *); 29 | extern int write_file_with_backup(char *); 30 | extern void visit_file(char *, char *); 31 | extern void fixup_dir(char *); 32 | extern char *dir_file_merge(char *, char *); 33 | extern int file_status(SLFUTURE_CONST char *); 34 | extern int file_changed_on_disk (Buffer *, char *); 35 | extern int file_time_cmp(char *, char *); 36 | extern char *file_type(SLFUTURE_CONST char *); 37 | extern void check_buffer(Buffer *); 38 | extern void set_file_trans(int *); 39 | 40 | extern char *jed_expand_link(char *); 41 | 42 | #ifdef REAL_UNIX_SYSTEM 43 | extern int jed_get_inode_info (char *, dev_t *, ino_t *); 44 | extern int Jed_Backup_By_Copying; 45 | #endif 46 | #ifndef VMS 47 | extern int jed_copy_file (char *, char *); 48 | #endif 49 | extern void jed_set_umask (int); 50 | extern void jed_set_buffer_ctime (Buffer *); 51 | 52 | extern int jed_unlock_buffer_files (void); 53 | extern int jed_unlock_buffer_file (Buffer *); 54 | extern int jed_lock_buffer_file (Buffer *); 55 | extern int jed_lock_file (char *); 56 | extern int jed_unlock_file (char *); 57 | extern int jed_dirfile_to_dir_file (char *dirfile, char **dirp, char **filep); 58 | extern char *jed_standardize_filename (SLFUTURE_CONST char *file); 59 | extern char *jed_dir_file_merge (SLFUTURE_CONST char *dir, SLFUTURE_CONST char *file); 60 | extern char *jed_get_canonical_pathname (char *); 61 | extern int jed_buffer_file_is_readonly (Buffer *); 62 | extern int jed_file_is_readonly (char *file, int respect_perms); 63 | #endif /* _JED_FILE_H_ */ 64 | -------------------------------------------------------------------------------- /doc/txt/compile.txt: -------------------------------------------------------------------------------- 1 | This document describes the Jed's compiler interface. 2 | 3 | Jed has the ability to run a compiler asynchronously in a separate 4 | buffer and parse the output for errors. This greatly facilitates 5 | program development by reducing the time spent in the compile-edit 6 | cycle. 7 | 8 | By default, jed assumes that the GNU C compiler is used. If another 9 | compiler is used instead, then put a line such as 10 | 11 | variable Compile_Default_Compiler = "bcc"; 12 | 13 | in your jedrc startup file. This is important because different 14 | compilers produce different looking error messages and jed needs to 15 | know what compiler is producing the error messages in order to parse 16 | them properly. The currently supported compilers include: 17 | 18 | gcc (GNU C Compiler) 19 | bcc (Borland C Compiler) 20 | tcc (Turbo C Compiler) 21 | ultrix_cc (Ultrix C Compiler) 22 | hp_cc (HP C compiler) 23 | sun_acc (SunOS ANSI C compiler) 24 | aix, xlc, xlf (Various AIX C compilers) 25 | wcc (Watcom C compiler) 26 | javac (Java Compiler) 27 | vc (Microsoft Visual C) 28 | 29 | To run a compiler from within the editor, type `ESC-x compile'. You 30 | will then be prompted for the command to run in a sub-shell. 31 | Usually, this will be something like `make', or `make -k', assuming of 32 | course that you are using makefiles. If not, then just give some 33 | other command that has the desired effect, e.g., `cc -g myfile.c'. 34 | 35 | Once the compile command has been given, jed will run the command 36 | asynchronously in a buffer named `*compile*'. However, some systems 37 | (e.g., msdos) do not support asynchronous processes and jed will have 38 | wait for the process to complete before returning to the user. 39 | However, on Unix, Win32, and OS/2 systems, the process will run 40 | asynchronously allowing the user to continue editing while the 41 | compile process is running. 42 | 43 | To go from one error message to another, use the "Ctrl-X '" key 44 | sequence (Ctrl-X apostrophe), which is bound to the 45 | `compile_parse_errors' function. Assuming that you have specified the 46 | compiler properly as described above, jed will find the file causing 47 | the error and put the cursor on the guilty line. After correcting the 48 | errors, run the compile process again. 49 | 50 | -------------------------------------------------------------------------------- /lib/krconv.sl: -------------------------------------------------------------------------------- 1 | %enable_profiling (); 2 | private define fixup_line () 3 | { 4 | variable col; 5 | 6 | ifnot (parse_to_point ()) 7 | { 8 | col = what_column (); 9 | bol_skip_white (); 10 | if (col != what_column ()) 11 | { 12 | goto_column (col); 13 | indent_line (); 14 | if (C_BRA_NEWLINE) newline (); 15 | } 16 | go_right_1 (); 17 | trim (); 18 | ifnot (eolp () or looking_at_char (',') or looking_at_char (';')) 19 | { 20 | indent_line (); 21 | newline (); 22 | } 23 | } 24 | go_right_1 (); 25 | } 26 | 27 | define c_indent_buffer () 28 | { 29 | variable line = -50, max_line; 30 | push_spot (); 31 | eob (); 32 | max_line = what_line (); 33 | bob (); 34 | do 35 | { 36 | bol_skip_white (); 37 | if (looking_at ("/*")) 38 | { 39 | % skip the comment 40 | () = fsearch ("*/"); 41 | continue; 42 | } 43 | 44 | eol (); 45 | if (blooking_at ("\\")) 46 | { 47 | indent_line (); 48 | % skip all continuation lines. 49 | while (down (1)) 50 | { 51 | eol (); 52 | ifnot (blooking_at ("\\")) break; 53 | } 54 | continue; 55 | } 56 | trim (); 57 | bol_skip_white (); 58 | ifnot (looking_at_char ('{')) 59 | { 60 | variable this_line = what_line (); 61 | % I do not want to touch constructs such as x = {1, 3}; 62 | while (ffind_char ('{') 63 | and parse_to_point ()) 64 | go_right_1 (); 65 | 66 | if (looking_at_char ('{')) 67 | { 68 | variable m = create_user_mark (); 69 | if (find_matching_delimiter ('{') 70 | and (this_line == what_line ())) 71 | { 72 | eol (); 73 | indent_line (); 74 | continue; 75 | } 76 | goto_user_mark (m); 77 | } 78 | bol (); 79 | while (ffind_char ('}')) 80 | fixup_line (); 81 | bol (); 82 | while (ffind_char ('{')) 83 | fixup_line (); 84 | } 85 | 86 | indent_line (); 87 | if (line + 50 < what_line ()) 88 | { 89 | line = what_line (); 90 | flush (sprintf ("processed %d/%d lines.", line, max_line)); 91 | } 92 | 93 | %update_sans_update_hook (1); 94 | } 95 | while (down_1 ()); 96 | trim_buffer (); 97 | flush (sprintf ("processed %d/%d lines.", what_line (), max_line)); 98 | pop_spot (); 99 | } 100 | 101 | -------------------------------------------------------------------------------- /src/misc.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1992-2023 John E. Davis 2 | * This file is part of JED editor library source. 3 | * 4 | * You may distribute this file under the terms the GNU General Public 5 | * License. See the file COPYING for more information. 6 | */ 7 | #ifndef JED_MISC_H_ 8 | #define JED_MISC_H_ 9 | #include "window.h" 10 | 11 | extern void exit_error(char *, int); 12 | extern void jed_error_hook (SLFUTURE_CONST char *); 13 | extern void msg_error(char *); 14 | extern void jed_verror (char *, ...) SLATTRIBUTE_PRINTF(1,2); 15 | extern void jed_vmessage (int, char *, ...); 16 | extern void read_string(char *, int *); 17 | extern void clear_error(void); 18 | extern int jed_getkey(void); 19 | extern int jed_check_string_key_buffer (void); 20 | extern int jed_getkey_wchar (SLwchar_Type *); 21 | extern void jed_ungetkey_wchar (SLwchar_Type); 22 | 23 | extern char *jed_malloc0 (unsigned int); 24 | 25 | extern int begin_keyboard_macro(void); 26 | extern int macro_query(void); 27 | extern int end_keyboard_macro(void); 28 | extern void jed_abort_keyboard_macro (void); 29 | extern int execute_keyboard_macro(void); 30 | extern void get_last_macro(void); 31 | extern int Defining_Keyboard_Macro; 32 | extern int Executing_Keyboard_Macro; 33 | extern void jed_suspend_macro_state (void); 34 | extern void jed_resume_macro_state (void); 35 | 36 | extern char Error_Buffer[256]; 37 | 38 | /* information needed by minibuffer and display routines */ 39 | typedef struct MiniInfo_Type 40 | { 41 | Window_Type *action_window; /* buffer for minibuffer action */ 42 | #define JED_PROMPT_BUF_SIZE 256 43 | unsigned char prompt[JED_PROMPT_BUF_SIZE]; 44 | int prompt_len; 45 | int effective_prompt_len; /* length when tabs/etc are expanded */ 46 | } 47 | MiniInfo_Type; 48 | 49 | extern MiniInfo_Type Mini_Info; 50 | 51 | extern Buffer *jed_get_mini_action_buffer (void); 52 | 53 | extern int get_macro(void); 54 | extern int Exit_From_MiniBuffer; 55 | extern unsigned char *Macro_Buffer_Ptr; 56 | extern char *read_from_minibuffer(char *, char *, char *, int *); 57 | extern char *safe_strcat (char *, SLFUTURE_CONST char *, unsigned int); 58 | extern char *safe_strcpy (char *, SLFUTURE_CONST char *, unsigned int); 59 | 60 | extern int jed_case_strncmp (char *, char *, unsigned int); 61 | extern int jed_case_strcmp (char *, char *); 62 | 63 | extern char **_Jed_Startup_Argv; 64 | extern int _Jed_Startup_Argc; 65 | 66 | #endif /* JED_MISC_H_ */ 67 | 68 | -------------------------------------------------------------------------------- /lib/tmmode.sl: -------------------------------------------------------------------------------- 1 | % This is a text-macro mode designed to edit text using user defined macros. 2 | % Create a syntax table. Basically \ is a quote and {} are matching delimiters. 3 | $1 = "tm"; 4 | create_syntax_table ($1); 5 | 6 | define_syntax ("#%+", "#%-", '%', $1); % Comment Syntax 7 | define_syntax ("#%", "", '%', $1); % Comment Syntax 8 | define_syntax ('\\', '\\', $1); % Quote character 9 | define_syntax ("{", "}", '(', $1); % nothing else matches 10 | define_syntax ("-+a-zA-Z_0-9#", 'w', $1); 11 | %define_syntax ('#', '#', $1); 12 | set_syntax_flags ($1, 8); 13 | () = define_keywords_n ($1, "#d#i#p#v", 2, 1); 14 | () = define_keywords_n ($1, "#p+#p-#s+#s-#v+#v-", 3, 1); 15 | 16 | define textmac_paragraph_separator () 17 | { 18 | bol (); 19 | if (looking_at ("#") or looking_at ("\\")) 20 | return 1; 21 | skip_white (); 22 | eolp (); 23 | } 24 | 25 | define textmac_wrap_hook () 26 | { 27 | push_spot (); 28 | EXIT_BLOCK 29 | { 30 | pop_spot (); 31 | } 32 | go_up_1 (); % at eol 33 | trim (); 34 | bol (); 35 | 36 | if (looking_at ("#% ")) 37 | { 38 | go_down_1 (); 39 | insert ("#% "); 40 | return; 41 | } 42 | if (looking_at_char ('#')) 43 | { 44 | eol (); 45 | ifnot (blooking_at ("\\")) 46 | { 47 | insert_single_space (); 48 | insert_char ('\\'); 49 | } 50 | } 51 | go_down_1 (); 52 | indent_line (); 53 | } 54 | 55 | private define in_verbatim () 56 | { 57 | variable m = create_user_mark (); 58 | EXIT_BLOCK 59 | { 60 | goto_user_mark (m); 61 | } 62 | ifnot (bol_bsearch ("#v+")) 63 | return 0; 64 | ifnot (bol_fsearch ("#v-")) 65 | return 1; 66 | return (create_user_mark () >= m); 67 | } 68 | 69 | define tm_insert_quote () 70 | { 71 | if (in_verbatim ()) 72 | { 73 | insert ("\""); 74 | return; 75 | } 76 | call ("text_smart_quote"); 77 | } 78 | 79 | $1 = "tm"; 80 | ifnot (keymap_p ($1)) make_keymap ($1); 81 | definekey ("tm_insert_quote", "\"", $1); 82 | 83 | define tm_mode () 84 | { 85 | no_mode (); % reset 86 | variable mode = "tm"; 87 | use_keymap (mode); 88 | set_mode (mode, 0x1 | 0x20); 89 | set_buffer_hook ("par_sep", "textmac_paragraph_separator"); 90 | set_buffer_hook ("wrap_hook", "textmac_wrap_hook"); 91 | use_syntax_table (mode); 92 | 93 | mode_set_mode_info (mode, "fold_info", "#%{{{\r#%}}}\r\r"); 94 | TAB = 0; 95 | run_mode_hooks ("tm_mode_hook"); 96 | } 97 | -------------------------------------------------------------------------------- /lib/colors/Xjed/night.sl: -------------------------------------------------------------------------------- 1 | % night.sl 2 | % By Guido Gonzato 3 | 4 | $1 = "#EDFF00"; % flash yellow 5 | $2 = "#000050"; % very dark blue 6 | $3 = "#FF4242"; % bright red 7 | $4 = "#90FF90"; % bright green 8 | $5 = "#4FFF4F"; % green 9 | $6 = "#D1D1D1"; % whitish 10 | $7 = "#040FDD"; % blue 11 | $8 = "#400070"; % dark purple 12 | $9 = "#20b0f0"; % mid cyan 13 | 14 | set_color ("normal", $1, $2); % default fg/bg 15 | set_color ("status", "black", "white"); % status or mode line 16 | set_color ("region", "black", "white"); % for marking regions 17 | set_color ("operator", "white", $2); % +, -, etc.. 18 | set_color ("number", "red", $2); % 10, 2.71,... TeX formulas 19 | set_color ("comment", $4, $2); % /* comment */ 20 | set_color ("string", "cyan", $7); % "string" or 'char' 21 | set_color ("keyword", "white", $8); % if, while, unsigned, ... 22 | set_color ("keyword1", "cyan", $8); % malloc, exit, etc... 23 | set_color ("keyword2", $3, $8); % other keywords 24 | set_color ("delimiter", $3, $2); % {}[](),.;... 25 | set_color ("preprocess", "magenta", $2); % #ifdef .... 26 | set_color ("message", "white", $2); % color for messages 27 | set_color ("error", $2, $3); % color for errors 28 | set_color ("dollar", "white", $2); % color dollar sign continuation 29 | set_color ("...", "red", $2); % folding indicator 30 | 31 | set_color ("menu_char", "red", $6); 32 | set_color ("menu", "black", $6); 33 | set_color ("menu_popup", "black", $6); 34 | set_color ("menu_shadow", $2, "black"); 35 | set_color ("menu_selection", "black", $9); 36 | set_color ("menu_selection_char", $3, $6); 37 | 38 | set_color("cursor", "red", $5); 39 | set_color("cursorovr", "red", "green"); 40 | 41 | % End of file night.sl 42 | 43 | %% The following have been automatically generated: 44 | set_color("linenum", "black", "white"); 45 | set_color("trailing_whitespace", $4, $2); 46 | set_color("tab", $4, $2); 47 | set_color("url", "cyan", $7); 48 | set_color("italic", $3, $8); 49 | set_color("underline", "cyan", $8); 50 | set_color("bold", "white", $8); 51 | set_color("html", "white", $8); 52 | set_color("keyword3", $1, $2); 53 | set_color("keyword4", $1, $2); 54 | set_color("keyword5", $1, $2); 55 | set_color("keyword6", $1, $2); 56 | set_color("keyword7", $1, $2); 57 | set_color("keyword8", $1, $2); 58 | set_color("keyword9", $1, $2); 59 | -------------------------------------------------------------------------------- /lib/textmode.sl: -------------------------------------------------------------------------------- 1 | %!%+ 2 | %\function{text_indent_relative} 3 | %\synopsis{Indent to next indentation point} 4 | %\description 5 | % The \var{text_indent_relative} function inserts enough whitespace to move 6 | % the editing point to the next indentation level defined by the whitespace 7 | % pattern of the previous non-blank line. If the current point is beyond 8 | % the last indentation level of the reference line, then a literal TAB will 9 | % be inserted into the buffer. 10 | %\seealso{set_buffer_hook, newline_and_indent} 11 | %!%- 12 | public define text_indent_relative () 13 | { 14 | variable c0, c; 15 | 16 | push_spot (); 17 | c0 = what_column (); 18 | bol (); 19 | bskip_chars ("\n\t "); 20 | if (bobp ()) 21 | { 22 | pop_spot (); 23 | insert ("\t"); 24 | return; 25 | } 26 | 27 | c = goto_column_best_try (c0); 28 | skip_white (); 29 | 30 | if (c == what_column ()) 31 | { 32 | skip_chars ("^ \t\n"); 33 | skip_white (); 34 | } 35 | 36 | c = what_column (); 37 | pop_spot (); 38 | if (c <= c0) 39 | { 40 | insert ("\t"); 41 | return; 42 | } 43 | whitespace (c - c0); 44 | } 45 | 46 | define text_newline_and_indent_relative () 47 | { 48 | push_spot (); 49 | bol_skip_white (); 50 | variable skip_indent = bolp (); 51 | pop_spot (); 52 | newline (); 53 | if (skip_indent) 54 | return; 55 | indent_line (); 56 | } 57 | 58 | $1 = "Text"; 59 | ifnot (keymap_p ($1)) make_keymap ($1); 60 | definekey ("indent_line", "\t", $1); 61 | 62 | %!%+ 63 | %\function{text_mode} 64 | %\synopsis{text_mode} 65 | %\description 66 | % Mode for indenting and wrapping text 67 | % Functions that affect this mode include: 68 | % 69 | %#v+ 70 | % Function: Default Binding: 71 | % text_indent_relative TAB 72 | % newline_and_indent RETURN 73 | % format_paragraph ESC Q 74 | % narrow_paragraph ESC N 75 | %#v- 76 | % 77 | %\seealso{no_mode, c_mode, set_buffer_hook} 78 | %\seealso{WRAP_INDENTS, WRAP, TAB, TAB_DEFAULT} 79 | %!%- 80 | public define text_mode() 81 | { 82 | variable mode = "Text"; 83 | no_mode (); 84 | set_mode(mode, 1); 85 | use_keymap (mode); 86 | %set_buffer_hook ("indent_hook", "text_indent_relative"); 87 | %set_buffer_hook ("newline_indent_hook", "text_newline_and_indent_relative"); 88 | unset_buffer_hook ("indent_hook"); 89 | unset_buffer_hook ("newline_indent_hook"); 90 | run_mode_hooks ("text_mode_hook"); 91 | } 92 | -------------------------------------------------------------------------------- /lib/colors/Xjed/pastel0.sl: -------------------------------------------------------------------------------- 1 | set_color("normal", "#000000", "#E0E0E0"); 2 | set_color("status", "#FFFF00", "#0000AA"); % status bar near the bottom 3 | set_color("operator", "#000000", "#E0E0E0"); % +, -, etc.. 4 | set_color("number", "#000000", "#E0E0E0"); % 10, 2.71, etc.. 5 | set_color("comment", "#008000", "#E8E8E0"); % /* comment */ 6 | set_color("region", "#FFFF99", "#666655"); % Cut & Paste 7 | set_color("string", "#000000", "#E8DCE0"); % "string" or 'char' 8 | set_color("keyword", "#0000FF", "#E0E0E0"); % basic language keywords: if, while, unsigned, ... 9 | set_color("keyword1", "#F00000", "#E0E0E0"); % extended language keywords: int, long, void, static 10 | set_color("keyword2", "#005599", "#E0E0E0"); % user defined keywords 11 | set_color("delimiter", "#000000", "#E0E0E0"); % {}[](),.; ... 12 | set_color("preprocess", "#CC00CC", "#E0E0E0"); % the C/C++ preprocessor 13 | set_color("message", "#C00000", "#E8E0E0"); % messages like "Loading ..." 14 | set_color("error", "#FFFF55", "#FF0000"); % error messages 15 | set_color("dollar", "#FFFF00", "#E8E8D8"); % line overflow 16 | set_color("...", "#FFFF00", "#FF0000"); % folding indicator 17 | 18 | set_color ("menu_char", "#FF5555", "#0000AA"); 19 | set_color ("menu", "#FFFFFF", "#0000AA"); 20 | set_color ("menu_popup", "#FFFFFF", "#0000AA"); 21 | set_color ("menu_shadow", "#000000", "#A0A0A0"); 22 | set_color ("menu_selection","#000000", "#E0E0E0"); 23 | set_color ("menu_selection_char","#FF5555", "#0000AA"); 24 | 25 | set_color ("mouse", "blue", "blue"); 26 | 27 | set_color ("cursor", "black", "red"); 28 | set_color ("cursorovr", "black", "red"); 29 | 30 | %% The following have been automatically generated: 31 | set_color("linenum", "#FFFF00", "#0000AA"); 32 | set_color("trailing_whitespace", "#008000", "#E8E8E0"); 33 | set_color("tab", "#008000", "#E8E8E0"); 34 | set_color("url", "#000000", "#E8DCE0"); 35 | set_color("italic", "#005599", "#E0E0E0"); 36 | set_color("underline", "#F00000", "#E0E0E0"); 37 | set_color("bold", "#0000FF", "#E0E0E0"); 38 | set_color("html", "#0000FF", "#E0E0E0"); 39 | set_color("keyword3", "#000000", "#E0E0E0"); 40 | set_color("keyword4", "#000000", "#E0E0E0"); 41 | set_color("keyword5", "#000000", "#E0E0E0"); 42 | set_color("keyword6", "#000000", "#E0E0E0"); 43 | set_color("keyword7", "#000000", "#E0E0E0"); 44 | set_color("keyword8", "#000000", "#E0E0E0"); 45 | set_color("keyword9", "#000000", "#E0E0E0"); 46 | --------------------------------------------------------------------------------