/-1 d
9 | then i
10 | try %s/<\/\?blockquote>//g
11 | try %s/HREF="\/cgi-bin\/whois.pl?queryinput=/HREF="whois:/g
12 | set bufdisplay=html nomodified noedited locked
13 | }
14 | alias whois sp whois:!1
15 |
--------------------------------------------------------------------------------
/debian/elvis-tools.postinst:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | case "$1" in
6 | configure)
7 | update-alternatives --quiet \
8 | --install /usr/bin/ctags ctags /usr/bin/elvtags 40 \
9 | --slave /usr/share/man/man1/ctags.1.gz ctags.1.gz \
10 | /usr/share/man/man1/elvtags.1.gz
11 | ;;
12 | abort-upgrade|abort-remove|abort-deconfigure)
13 | ;;
14 | *)
15 | echo "postinst called with unknown argument \`$1'" >&2
16 | exit 1
17 | ;;
18 | esac
19 |
20 | #DEBHELPER#
21 |
22 | exit 0
23 |
--------------------------------------------------------------------------------
/data/icons/mini.xpm:
--------------------------------------------------------------------------------
1 | /* XPM */
2 | static char * mini_xpm[] = {
3 | "16 14 6 1",
4 | " c #000000000000",
5 | ". c #FFFF0000FFFF",
6 | "X c #208128A25144",
7 | "o c #CF3CD34CCF3C",
8 | "O c #FFFFFFFF0000",
9 | "+ c #FFFFFFFFFFFF",
10 | " ",
11 | " . .. ..X ",
12 | " . . ... ",
13 | " . . oo .X ",
14 | " .... o oo .. ",
15 | " .... oXoXo ... ",
16 | " OOOO ooooo ... ",
17 | " OOOOooXXoo ... ",
18 | " OOOO+ooooOO... ",
19 | " OOOOO+o+OOO.XX ",
20 | " O+++OOOXOX ",
21 | " + + O++OOOXOXX ",
22 | " + + O++OOX XXX ",
23 | " "};
24 |
--------------------------------------------------------------------------------
/data/scripts/mail.ex:
--------------------------------------------------------------------------------
1 | "This defines a :Mail alias. This is intended mostly to be used when elvis
2 | "is invoked as an external editor by a mail program such as Kmail or Sylpheed.
3 | "The idea is that you'd configure the mail editor to run "elvis -cMail" as the
4 | "external editor. To make that work, you'd need to run ":load mail" and
5 | " ":mkexrc" first though.
6 | alias Mail {
7 | set bufdisplay="syntax email" equalprg="elvfmt -M"
8 | display syntax email
9 | if color("signature") == ""
10 | then color signature italic red on gray
11 | try $;?^-- *$?,$ region signature
12 | }
13 |
--------------------------------------------------------------------------------
/data/elvis.bro:
--------------------------------------------------------------------------------
1 |
2 | Tag Browser
3 |
4 |
5 | $1 ($2 matches)
6 | .----------------.----------------.------------------------------------------.
7 | | TAG NAME | SOURCE FILE | SOURCE LINE |
8 | |----------------|----------------|------------------------------------------|
9 |
10 | | (((strlen($1)<=15 ? $1 : $1<<15);"")<<19)|((" ";$2)>>15) | (htmlsafe($3)<<41)|
11 |
12 | ^----------------^----------------^------------------------------------------^
13 |
14 |
15 |
--------------------------------------------------------------------------------
/data/scripts/dict.ex:
--------------------------------------------------------------------------------
1 | " Use the "dict" program to fetch the definition of a word
2 | alias readDICT {
3 | local nolock
4 | r !dict --html "!2"
5 | try %s/{\([^,}]*\), \([^}]*\)}/{\1}, {\2}/g
6 | try %s/{\([^,}]*\), \([^}]*\)}/{\1}, {\2}/g
7 | try %s/{\([^,}]*\), \([^}]*\)}/{\1}, {\2}/g
8 | try %s/{\(\w[[:alpha:] .]*\)}/\1<\/a>/g
9 | try %s/[Hh][Tt][Tt][Pp]:\/\/[^ ,>")&]*/&<\/a>/g
10 | set bufdisplay=html
11 | }
12 | alias dict {
13 | " Show the definition of a term in a new window
14 | local w="!*"
15 | let w =~ s/ /\\ /ge
16 | eval sp dict:(w)
17 | }
18 |
--------------------------------------------------------------------------------
/osos2/debug.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | #include "debug.h"
5 |
6 | /**
7 | * Routine to print messages to stdout.
8 | *
9 | * This routine behaves just like {\em printf ()}.
10 | *
11 | */
12 | /*@printflike@*/ int /*@alt void@*/
13 | debug_printf (const char *template, ...)
14 | /*@globals stderr@*/
15 | /*@modifies fileSystem, *stderr@*/
16 | {
17 | va_list ap;
18 | int result;
19 |
20 | va_start (ap, template);
21 | result = vfprintf (stderr, template, ap);
22 | va_end (ap);
23 | return result;
24 | }
25 |
--------------------------------------------------------------------------------
/data/scripts/decode.ex:
--------------------------------------------------------------------------------
1 | "This script defines a :decode alias, which handles simple letter<->number
2 | "ciphers. You tell it a starting letter and number, and it fills in the
3 | "rest of the alphabet.
4 | alias decode {
5 | "secret decoder ring
6 | local i=1 l=-1 n=!2
7 | try let l='!1'
8 | if l < 'a' || l > 'z' || n < 1 || n > 26
9 | then error usage: [lines] decode letter number
10 | while i <= 26
11 | do {
12 | try eval !% s/\<(n)\>/(char(l))/g
13 | let i=i+1
14 | let n=n+1
15 | if n > 26
16 | then set n=1
17 | if l == 'z'
18 | then let l='a'
19 | else let l=l+1
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/need.h:
--------------------------------------------------------------------------------
1 | /* need.h */
2 | /* Copyright 1995 by Steve Kirkendall */
3 |
4 | #ifdef NEED_ABORT
5 | # define abort() (*"x" = 0)
6 | #endif
7 |
8 | #ifdef NEED_ASSERT
9 | # ifdef NDEBUG
10 | # define assert(x)
11 | # else
12 | # define assert(x) if (!(x)) abort(); else (void)(0)
13 | # endif
14 | #else
15 | # include
16 | #endif
17 |
18 | #ifdef NEED_STRDUP
19 | BEGIN_EXTERNC
20 | extern char *strdup P_((const char *str));
21 | END_EXTERNC
22 | #endif
23 |
24 | #ifdef NEED_MEMMOVE
25 | BEGIN_EXTERNC
26 | extern void *memmove P_((void *, const void *, size_t));
27 | END_EXTERNC
28 | #endif
29 |
30 |
31 |
--------------------------------------------------------------------------------
/data/scripts/cursor.ex:
--------------------------------------------------------------------------------
1 | " This file defines a :cursor alias, which moves the cursor to a given line
2 | " of a given file. This is handy if you want some external program to move
3 | " elvis' cursor -- you can (under X-windows at least) say...
4 | "
5 | " elvis -client -c "cursor $line $file"
6 |
7 | alias cursor {
8 | "Move the cursor to a given line, in a given file
9 | if !isnumber("!1") || !exists("!2")
10 | then error Usage: cursor linenumber filename
11 | if filename != "!2"
12 | then {
13 | if buffer("!2")
14 | then (!2)!1
15 | else e +!1 !2
16 | }
17 | else !1
18 | }
19 |
--------------------------------------------------------------------------------
/data/scripts/isearch.ex:
--------------------------------------------------------------------------------
1 | " This script defines :ilist and :isearch aliases, and some vim-compatible
2 | " maps that use them. They search for the first usage of an identifier name
3 | " in the current file.
4 |
5 | alias ilist {
6 | " list all lines containing a given word
7 | push
8 | !%g/\/
9 | pop
10 | }
11 |
12 | alias isearch {
13 | " search for a word within a range (default whole file)
14 | local l=""
15 | push
16 | !%g/\/ {
17 | if l == ""
18 | then let l = current("line")
19 | }
20 | eval (l)p
21 | pop
22 | }
23 |
24 | map [i yiw:isearch
25 | map ]i yiw:+,$isearch
26 | map [I yiw:ilist
27 | map ]I yiw:+,$ilist
28 |
--------------------------------------------------------------------------------
/data/scripts/define.ex:
--------------------------------------------------------------------------------
1 | "A macro for accessing the TechEncyclopaedia easily, without clutter.
2 |
3 | alias define {
4 | "fetch a definition from TechEncyclopaedia
5 | local u="define:!1"
6 | if "!1" == ""
7 | then error usage: define TERM
8 | if "!2" != ""
9 | then let u=u;"+!2"
10 | if "!3" != ""
11 | then let t=u;"+!3"
12 | split (u)
13 | }
14 |
15 | alias readDEFINE {
16 | local report=0
17 | r http://www.techweb.com/encyclopedia/defineterm?term=!2
18 | set nolocked
19 | try 1,/termDefined/-1d
20 | try /^/,$d
21 | try g/
/d
22 | try %s/href="\/encyclopedia\/defineterm?term=/href="define:/g
23 | set bufdisplay=html
24 | set nomod locked
25 | try set nospell
26 | }
27 |
--------------------------------------------------------------------------------
/guiwin32/wintags.h:
--------------------------------------------------------------------------------
1 | //{{NO_DEPENDENCIES}}
2 | // Microsoft Developer Studio generated include file.
3 | // Used by wintags.rc
4 | //
5 | #define IDD_TAGS 101
6 | #define ID_CUR_FILE 1000
7 | #define ID_CUR_TAGS 1001
8 | #define ID_TOTAL_TAGS 1002
9 | #define IDC_STATIC -1
10 |
11 | // Next default values for new objects
12 | //
13 | #ifdef APSTUDIO_INVOKED
14 | #ifndef APSTUDIO_READONLY_SYMBOLS
15 | #define _APS_NEXT_RESOURCE_VALUE 102
16 | #define _APS_NEXT_COMMAND_VALUE 40001
17 | #define _APS_NEXT_CONTROL_VALUE 1003
18 | #define _APS_NEXT_SYMED_VALUE 101
19 | #endif
20 | #endif
21 |
--------------------------------------------------------------------------------
/message.h:
--------------------------------------------------------------------------------
1 | /* message.h */
2 | /* Copyright 1995 by Steve Kirkendall */
3 |
4 | /* This data type is used to denote the importance and class of a message. */
5 | typedef enum
6 | {
7 | MSG_STATUS, /* e.g., "Reading file..." */
8 | MSG_INFO, /* e.g., "Read file, 20 lines, 187 characters" */
9 | MSG_WARNING, /* e.g., "More files to edit" */
10 | MSG_ERROR, /* e.g., "Unknown command" */
11 | MSG_FATAL /* e.g., "Error writing to session file" */
12 | } MSGIMP;
13 |
14 |
15 | BEGIN_EXTERNC
16 | extern void msglog P_((char *filename));
17 | extern void msg P_((MSGIMP imp, char *terse, ...));
18 | extern void msgflush P_((void));
19 | extern CHAR *msgtranslate P_((char *word));
20 | extern ELVBOOL msghide P_((ELVBOOL hide));
21 | END_EXTERNC
22 |
--------------------------------------------------------------------------------
/guiwin32/winelvis.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 | WinElvis
9 |
10 |
11 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/data/scripts/fontsize.ex:
--------------------------------------------------------------------------------
1 | "For the 'x11' user interface only, this script adds a FontSize button to the
2 | "toolbar which allows you to choose the font size used by elvis.
3 | gui FontSize;"fontsize"(oneof tiny small medium large huge current)s=s?s:"current"
4 | gui FontSize:eval fontsize (s)
5 | alias fontsize {
6 | local n
7 | switch "!(large)1"
8 | case huge
9 | case 20 set n=20 s=huge
10 | case large
11 | case 15 set n=15 s=large
12 | case medium
13 | case 13 set n=13 s=medium
14 | case small
15 | case 10 set n=10 s=small
16 | case tiny
17 | case 7 set n=7 s=tiny
18 | case current set n=0 s=current
19 | default {
20 | if isnumber("!1")
21 | then set n="!1" s=current
22 | else error Invalid size
23 | }
24 | if n > 0
25 | then let font="*-fixed-medium-r-normal--";n;"-*-iso8859-1"
26 | }
27 |
--------------------------------------------------------------------------------
/draw2.h:
--------------------------------------------------------------------------------
1 | /* draw2.h */
2 | /* Copyright 1995 by Steve Kirkendall */
3 |
4 |
5 | #define drawscratch(di) ((di)->mustredraw = True)
6 |
7 | BEGIN_EXTERNC
8 | extern DRAWINFO *drawalloc P_((int rows, int columns, MARK top));
9 | extern void drawfree P_((DRAWINFO *di));
10 | extern void drawimage P_((WINDOW win));
11 | extern void drawexpose P_((WINDOW win, int top, int left, int bottom, int right));
12 | extern void drawmsg P_((WINDOW win, MSGIMP imp, CHAR *verbose, int len));
13 | extern void drawex P_((WINDOW win, CHAR *text, int len));
14 | extern void drawfinish P_((WINDOW win));
15 | extern void drawopenedit P_((WINDOW win));
16 | extern void drawopencomplete P_((WINDOW win));
17 | extern void drawextext P_((WINDOW win, CHAR *text, int len));
18 | extern void drawexlist P_((WINDOW win, CHAR *text, int len));
19 | END_EXTERNC
20 |
--------------------------------------------------------------------------------
/version.h:
--------------------------------------------------------------------------------
1 | /* version.h */
2 | /* Copyright 1996-2001 by Steve Kirkendall */
3 |
4 | /* Some other places where the version number resides:
5 | * Makefile.in, search for "VERSION="
6 | * README.html, search for the actual version number
7 | */
8 |
9 | #define VERSION "2.2.1-prerelease"
10 | #define COPY1 "Copyright (c) 1995-2003 by Steve Kirkendall"
11 | #if 1
12 | # define COPY2 "Permission is granted to redistribute the source or binaries under the terms of"
13 | # define COPY3 "of the Perl `Clarified Artistic License', as described in the doc/license.html"
14 | # define COPY4 "file. In particular, unmodified versions can be freely redistributed."
15 | # define COPY5 "Elvis is offered with no warranty, to the extent permitted by law."
16 | #else
17 | # define COPY2 "This version of elvis is intended to be used only by its developers"
18 | #endif
19 |
--------------------------------------------------------------------------------
/tagelvis.h:
--------------------------------------------------------------------------------
1 | /* tagelvis.h */
2 |
3 | extern ELVBOOL tenewtag;
4 |
5 | BEGIN_EXTERNC
6 |
7 | #ifdef FEATURE_SHOWTAG
8 | typedef struct tedef_s
9 | {
10 | MARK where; /* where a tag is defined */
11 | CHAR *label; /* tag name, and maybe other info */
12 | } TEDEF;
13 | extern void tebuilddef P_((BUFFER buf));
14 | extern void tefreedef P_((BUFFER buf));
15 | extern CHAR *telabel P_((MARK cursor));
16 | #endif
17 |
18 | #ifdef DISPLAY_SYNTAX
19 | spell_t *telibrary P_((char *tagfile, spell_t *dict, ELVBOOL ignorecase, CHAR *prefix));
20 | #endif
21 |
22 | #ifdef FEATURE_COMPLETE
23 | CHAR *tagcomplete P_((WINDOW win, MARK m));
24 | #endif
25 |
26 | extern void tesametag P_((void));
27 | extern TAG *tetag P_((CHAR *select));
28 | extern BUFFER tebrowse P_((ELVBOOL all, CHAR *select));
29 | extern void tepush P_((WINDOW win, CHAR *label));
30 |
31 | END_EXTERNC
32 |
--------------------------------------------------------------------------------
/debian/elvis-console.postinst:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | case "$1" in
6 | configure)
7 | update-alternatives --quiet \
8 | --install /usr/bin/editor editor /usr/bin/elvis 90 \
9 | --slave /usr/share/man/man1/editor.1.gz editor.1.gz \
10 | /usr/share/man/man1/elvis.1.gz
11 | for app in editor ex input vi view; do
12 | update-alternatives --quiet \
13 | --install /usr/bin/"$app" "$app" /usr/bin/elvis 120 \
14 | --slave /usr/share/man/man1/"$app".1.gz "$app".1.gz \
15 | /usr/share/man/man1/elvis.1.gz
16 | done
17 | ;;
18 | abort-upgrade|abort-remove|abort-deconfigure)
19 | ;;
20 | *)
21 | echo "postinst called with unknown argument \`$1'" >&2
22 | exit 1
23 | ;;
24 | esac
25 |
26 | #DEBHELPER#
27 |
28 | exit 0
29 |
--------------------------------------------------------------------------------
/data/elvis.rc:
--------------------------------------------------------------------------------
1 | " Here are some typical settings that you might want to try. The simplest
2 | " way to use this file is to :source this file, and then run ":mkexrc" to
3 | " save the settings where they can be automatically loaded.
4 | set undolevels=12
5 | set autoindent
6 | try set spell
7 | try set smartargs
8 | set taglibrary
9 | set wrapscan
10 | set incsearch
11 | set spellautoload
12 | map gw lbygS:word
13 | try {
14 | alias wc {
15 | "Count words in the buffer, or a range of lines
16 | local w=0
17 | !(%)%s/\w\+/let w=w+1/gx
18 | calc w "words"
19 | }
20 | }
21 | try check +other
22 | try check -link
23 | try aug END
24 | then {
25 | au!
26 | au BgChanged light color x11.spell on pink
27 | au BgChanged dark color x11.spell on maroon
28 | au BgChanged light color windows.spell on pink
29 | au BgChanged dark color windows.spell on maroon
30 | }
31 | try aug END
32 |
--------------------------------------------------------------------------------
/debian/elvis.postinst:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | case "$1" in
6 | configure)
7 | update-alternatives --quiet \
8 | --install /usr/bin/editor editor /usr/bin/elvisnox 90 \
9 | --slave /usr/share/man/man1/editor.1.gz editor.1.gz \
10 | /usr/share/man/man1/elvisnox.1.gz
11 | for app in editor ex input vi view; do
12 | update-alternatives --quiet \
13 | --install /usr/bin/"$app" "$app" /usr/bin/elvisnox 120 \
14 | --slave /usr/share/man/man1/"$app".1.gz "$app".1.gz \
15 | /usr/share/man/man1/elvisnox.1.gz
16 | done
17 | ;;
18 | abort-upgrade|abort-remove|abort-deconfigure)
19 | ;;
20 | *)
21 | echo "postinst called with unknown argument \`$1'" >&2
22 | exit 1
23 | ;;
24 | esac
25 |
26 | #DEBHELPER#
27 |
28 | exit 0
29 |
--------------------------------------------------------------------------------
/misc.h:
--------------------------------------------------------------------------------
1 | /* misc.h */
2 | /* Copyright 1995 by Steve Kirkendall */
3 |
4 | extern CHAR empty[];
5 | extern CHAR blanks[80];
6 | extern char **arglist;
7 | extern int argnext;
8 | BEGIN_EXTERNC
9 | #ifdef DEBUG_ALLOC
10 | # define buildCHAR(ref,ch) _buildCHAR(__FILE__, __LINE__, (ref), (ch))
11 | # define buildstr(ref,str) _buildstr(__FILE__, __LINE__, (ref), (str))
12 | extern int _buildCHAR P_((char *file, int line, CHAR **refstr, _CHAR_ ch));
13 | extern int _buildstr P_((char *file, int line, CHAR **refstr, char *add));
14 | #else
15 | extern int buildCHAR P_((CHAR **refstr, _CHAR_ ch));
16 | extern int buildstr P_((CHAR **refstr, char *add));
17 | #endif
18 | extern MARK wordatcursor P_((MARK cursor, ELVBOOL apostrophe));
19 | extern CHAR *addquotes P_((CHAR *chars, CHAR *str));
20 | extern CHAR *removequotes P_((CHAR *chars, CHAR *str));
21 | extern int CHARncasecmp P_((CHAR *s1, CHAR *s2, int len));
22 | END_EXTERNC
23 |
--------------------------------------------------------------------------------
/guix11/foo.xbm:
--------------------------------------------------------------------------------
1 | #define foo_width 32
2 | #define foo_height 32
3 | static char foo_bits[] = {
4 | 0xff, 0x1f, 0xc2, 0xff, 0xff, 0x3f, 0x67, 0xff, 0xff, 0x79, 0x72, 0xfc,
5 | 0x7f, 0x01, 0x00, 0xff, 0x3f, 0x00, 0x30, 0xe0, 0x1f, 0x90, 0x89, 0xd0,
6 | 0x0f, 0xc3, 0xbd, 0xe3, 0x07, 0xfc, 0xfd, 0xc2, 0x47, 0xfc, 0xc7, 0xc8,
7 | 0x87, 0xf2, 0x83, 0xcb, 0x47, 0xfd, 0x83, 0xce, 0xa7, 0xfa, 0x83, 0xca,
8 | 0x07, 0x7c, 0xa3, 0xc4, 0xa7, 0x7e, 0x43, 0xca, 0x47, 0x7d, 0x66, 0xc5,
9 | 0x87, 0xd2, 0x02, 0xc3, 0x4f, 0xfb, 0x03, 0xe5, 0x0f, 0x2d, 0x83, 0xe3,
10 | 0x8f, 0x72, 0x48, 0xe4, 0x9f, 0x5a, 0xc3, 0xf2, 0x9f, 0xe3, 0x62, 0xf3,
11 | 0x1f, 0xb5, 0x93, 0xf1, 0x3f, 0xca, 0xbf, 0xf8, 0x7f, 0xee, 0xeb, 0xf8,
12 | 0x7f, 0xd4, 0xd6, 0xfc, 0xff, 0x28, 0x6a, 0xfc, 0xff, 0xa9, 0x25, 0xfe,
13 | 0xff, 0x53, 0x1c, 0xff, 0xff, 0x47, 0x82, 0xff, 0xff, 0x0f, 0xc3, 0xff,
14 | 0xff, 0x1f, 0xe0, 0xff, 0xff, 0x3f, 0xf0, 0xff, };
15 |
--------------------------------------------------------------------------------
/guix11/xtool.h:
--------------------------------------------------------------------------------
1 | /* xtool.h */
2 |
3 | #define MAXTOOLS 50
4 |
5 | typedef struct
6 | {
7 | Window win; /* toolbar subwindow */
8 | int x, y; /* position of toolbar within window */
9 | unsigned int w, h; /* overall size of the toolbar */
10 | ELVBOOL recolored; /* have colors been changed lately? */
11 | struct
12 | {
13 | int x, y; /* position of a button within toolbar*/
14 | int bevel; /* bevel height of a button */
15 | } state[MAXTOOLS];/* info about each button */
16 | } X_TOOLBAR;
17 |
18 | CHAR *x_tb_dump P_((char *label));
19 | void x_tb_predict P_((X11WIN *xw, unsigned w, unsigned h));
20 | void x_tb_create P_((X11WIN *xw, int x, int y));
21 | void x_tb_destroy P_((X11WIN *xw));
22 | void x_tb_draw P_((X11WIN *xw, ELVBOOL fromscratch));
23 | void x_tb_event P_((X11WIN *xw, XEvent *event));
24 | ELVBOOL x_tb_config P_((ELVBOOL gap, char *label, _char_ op, char *value));
25 | void x_tb_recolor P_((X11WIN *xw));
26 |
--------------------------------------------------------------------------------
/data/scripts/gzip.ex:
--------------------------------------------------------------------------------
1 | " This file contains a set of autocmds which allow elvis to read & write
2 | " files that are compressed via gzip.
3 | augroup gzip
4 | au!
5 | au BufReadPre,FileReadPre *.gz set reol=binary
6 | au BufReadPost *.gz %!gunzip
7 | au FileReadPost *.gz '[,']!gunzip
8 | au BufReadPost,FileReadPost *.gz set reol=text nomodified bufdisplay=normal
9 | au BufReadPost *.gz {
10 | local s
11 | let s = knownsyntax(basename(filename))
12 | if s
13 | then eval set bufdisplay="syntax (s)"
14 | }
15 | au BufWritePost,FileWritePost *.gz eval !mv (afile) (basename(afile))
16 | au BufWritePost,FileWritePost *.gz eval !gzip (basename(afile))
17 | au FileAppendPre *.gz eval !gunzip (afile)
18 | au FileAppendPre *.gz eval !mv (basename(afile)) (afile)
19 | au FileAppendPost *.gz eval !mv (afile) (basename(afile))
20 | au FileAppendPost *.gz eval !gzip (basename(afile))
21 | augroup END
22 |
--------------------------------------------------------------------------------
/debian/patches/doc-man-location:
--------------------------------------------------------------------------------
1 | Index: elvis-2.2.0/doc/elvis.html
2 | ===================================================================
3 | --- elvis-2.2.0.orig/doc/elvis.html 2009-03-03 20:44:08.000000000 +0530
4 | +++ elvis-2.2.0/doc/elvis.html 2009-03-03 21:10:43.000000000 +0530
5 | @@ -30,9 +30,9 @@
6 | B. Quick Reference
7 | C. How To...
8 | elvis(1) Man-page for elvis
9 | - ctags(1) Man-page for ctags (or elvtags)
10 | + elvtags(1) Man-page for ctags (or elvtags)
11 | ref(1) Man-page for ref
12 | - fmt(1) Man-page for fmt (or elvfmt)
13 | + fmt(1) Man-page for fmt (or elvfmt)
14 | elvgdb(1) Man-page for elvgdb
15 |
16 |
17 |
--------------------------------------------------------------------------------
/calc.h:
--------------------------------------------------------------------------------
1 | /* calc.h */
2 | /* Copyright 1995 by Steve Kirkendall */
3 |
4 | /* This is used for storing information about subscripts */
5 | typedef struct
6 | {
7 | CHAR *ptr; /* start of a chunk of text */
8 | int len; /* length of the chunk */
9 | } CHUNK;
10 |
11 | typedef enum {CALC_DOLLAR=1, CALC_PAREN=2, CALC_MSG=3, CALC_OUTER=4, CALC_ALL=7} CALCRULE;
12 |
13 | BEGIN_EXTERNC
14 | extern ELVBOOL calcnumber P_((CHAR *value));
15 | extern ELVBOOL calctrue P_((CHAR *value));
16 | extern CHAR *calculate P_((CHAR *expr, CHAR **arg, CALCRULE rule));
17 | #ifdef FEATURE_CALC
18 | # ifdef FEATURE_ARRAY
19 | extern _CHAR_ calcsubscript P_((CHAR *array, CHAR *sub, int max, CHUNK *chunks));
20 | # endif
21 | extern ELVBOOL calcbase10 P_((CHAR *value));
22 | extern ELVBOOL calcsel P_((MARK from, MARK to));
23 | extern CHAR *calcelement P_((CHAR *set, CHAR *element));
24 | extern CHAR *calcset P_((CHAR *left, _CHAR_ oper, CHAR *right));
25 | #endif
26 | END_EXTERNC
27 |
--------------------------------------------------------------------------------
/data/scripts/ellipse.ex:
--------------------------------------------------------------------------------
1 | "This script defines an :ellipse alias. If invoked with two arguments,
2 | "they are assumed to be width & height. If invoked with one argument,
3 | "it is assumed to be width, and the height is computed as half the width
4 | "(since in most fonts, characters are twice as high as they are wide).
5 | "With no arguments, it uses either textwidth or columns as the width.
6 | alias ellipse {
7 | " draw an ellipse using * characters, of a given width and height.
8 | local h w x y r s
9 | let w = !(textwidth ? textwidth : columns)1
10 | let h = !(w / 2)2
11 | let y = h / 2
12 | let r = (h * h * w * w) / 4
13 | let x = 0
14 | while y > 0
15 | do {
16 | while x * x * h * h + y * y * w * w <= r
17 | do let x = x + 1
18 | let s = (" " * (w/2 - x)); ("*" * (x * 2))
19 | "let s = "i\n";s;"\n";s;"\n.\n"
20 | "eval (s)
21 | eval a ,(s)
22 | eval i ,(s)
23 | let y = y - 1
24 | }
25 | %s/^,
26 | }
27 |
--------------------------------------------------------------------------------
/data/elvis.spe:
--------------------------------------------------------------------------------
1 | "Try to find a word list to use as a spelling dictionary
2 | local elvispath locale i
3 | if !locale
4 | then set locale=gibberish
5 | let! spelldict = elvispath("words")
6 | if !spelldict
7 | then {
8 | for i in ("/usr/dict/";locale) /usr/dict /usr/share/dict
9 | do {
10 | if !spelldict && exists(i/"words")
11 | then let! spelldict = i/"words"
12 | }
13 | }
14 |
15 | "some common English suffixes
16 | set! spellsuffix="'ve 'll 'd 's n't 're s ed"
17 |
18 | "some valid English words which aren't in most /usr/dict/words files, and
19 | "which can't be derived via the above suffixes.
20 | words! won't can't I'm pragma etc
21 | words! a b c d e f g h i j k l m n o p q r s t u v w x y z
22 |
23 | "disable spell checking in parts of source code where it wouldn't be useful.
24 | check! -string char regexp regsub prep prepquote variable keyword other number
25 | check! -docindent docmarkup markup fold fixed libc libd libf libt libv
26 |
--------------------------------------------------------------------------------
/debian/elvis.preinst:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | case "$1" in
6 | upgrade)
7 | if dpkg --compare-versions "$2" '<<' "2.2.1-1"; then
8 | update-alternatives --quiet --remove ctags /usr/bin/elvtags
9 | for app in editor ex input vi view; do
10 | update-alternatives --quiet --remove "$app" /usr/bin/elvisnox
11 | done
12 |
13 | if dpkg --compare-versions "$2" '<<' "2.2.1-1"; then
14 | update-alternatives --quiet --remove ref /usr/bin/ref-elvis
15 | else
16 | update-alternatives --quiet --remove ref /usr/bin/elvref
17 | fi
18 |
19 | [ ! -d /usr/share/doc/elvis ] || rm -rf /usr/share/doc/elvis
20 | fi
21 | ;;
22 | install|abort-upgrade)
23 | ;;
24 | *)
25 | echo "preinst called with unknown argument \`$1'" >&2
26 | exit 1
27 | ;;
28 | esac
29 |
30 | #DEBHELPER#
31 |
32 | exit 0
33 |
--------------------------------------------------------------------------------
/data/scripts/mailto.ex:
--------------------------------------------------------------------------------
1 | " This script attempts to define the mailto: protocol. This
2 | " feature of elvis is still changing rapidly, so this might not work.
3 | " Also, the mailto: alias only works on Unix-like systems.
4 |
5 | alias readMAILTO {
6 | "initialize a mailto: message
7 | se noro reol=text
8 | if exists($HOME/".signature")
9 | then {
10 | read ~/.signature
11 | 1 i --
12 | }
13 | }
14 | alias writeMAILTO {
15 | "send a mailto: message
16 |
17 | " This is a lot more complex that one would think. The mail program forks
18 | " off a spooler, and the spooler inherits the stdout/stderr file descriptors.
19 | " This has the unfortunate side-effect of making elvis wait until the mail
20 | " queue is emptied, after this message and any other pending messages have
21 | " been uploaded to the mailserver. Yuck! To avoid that, we redirect the
22 | " mail program's stdout/stderr to /dev/null.
23 | w !!mail -s"!(no subject)subject=" !2 >/dev/null 2>&1
24 | se nomod
25 | }
26 |
--------------------------------------------------------------------------------
/vicmd.h:
--------------------------------------------------------------------------------
1 | /* vicmd.h */
2 | /* Copyright 1995 by Steve Kirkendall */
3 |
4 |
5 | BEGIN_EXTERNC
6 | extern RESULT v_ascii P_((WINDOW win, VIINFO *vinf));
7 | extern RESULT v_at P_((WINDOW win, VIINFO *vinf));
8 | extern RESULT v_delchar P_((WINDOW win, VIINFO *vinf));
9 | extern RESULT v_ex P_((WINDOW win, VIINFO *vinf));
10 | extern RESULT v_expose P_((WINDOW win, VIINFO *vinf));
11 | extern RESULT v_input P_((WINDOW win, VIINFO *vinf));
12 | extern RESULT v_notex P_((WINDOW win, VIINFO *vinf));
13 | extern RESULT v_notop P_((WINDOW win, VIINFO *vinf));
14 | extern RESULT v_number P_((WINDOW win, VIINFO *vinf));
15 | extern RESULT v_paste P_((WINDOW win, VIINFO *vinf));
16 | extern RESULT v_quit P_((WINDOW win, VIINFO *vinf));
17 | extern RESULT v_setmark P_((WINDOW win, VIINFO *vinf));
18 | extern RESULT v_tag P_((WINDOW win, VIINFO *vinf));
19 | extern RESULT v_undo P_((WINDOW win, VIINFO *vinf));
20 | extern RESULT v_visible P_((WINDOW win, VIINFO *vinf));
21 | extern RESULT v_window P_((WINDOW win, VIINFO *vinf));
22 | END_EXTERNC
23 |
--------------------------------------------------------------------------------
/debian/elvis-common.menu:
--------------------------------------------------------------------------------
1 | ?package(elvis-common,elvis-console): \
2 | needs="text" \
3 | hints="Small,Expert" \
4 | section="Applications/Editors" \
5 | title="Elvis (console)" \
6 | command="/usr/bin/elvis -Gtermcap" \
7 | icon="/usr/share/pixmaps/elvis_32x32.xpm"
8 |
9 | ?package(elvis-common,elvis): \
10 | needs="text" \
11 | hints="Small,Expert" \
12 | section="Applications/Editors" \
13 | title="Elvis (console)" \
14 | command="/usr/bin/elvis -Gtermcap" \
15 | icon="/usr/share/pixmaps/elvis_32x32.xpm"
16 |
17 | ?package(elvis-common,elvis): \
18 | needs="X11" \
19 | hints="Small,Expert" \
20 | section="Applications/Editors" \
21 | title="Elvis (X11)" \
22 | command="/usr/bin/elvis -Gx11" \
23 | icon="/usr/share/pixmaps/elvis_32x32.xpm"
24 |
--------------------------------------------------------------------------------
/lowbuf.h:
--------------------------------------------------------------------------------
1 | /* lowbuf.h */
2 | /* Copyright 1995 by Steve Kirkendall */
3 |
4 |
5 | /* Create a new buffer in the session file */
6 | BEGIN_EXTERNC
7 | extern void lowinit P_((void (*bufproc)(_BLKNO_ bufinfo, long nchars, long nlines, long changes, long prevloc, CHAR *name)));
8 | extern BLKNO lowalloc P_((char *name));
9 | extern BLKNO lowdup P_((_BLKNO_ originfo));
10 | extern void lowfree P_((_BLKNO_ bufinfo));
11 | extern void lowtitle P_((_BLKNO_ bufinfo, CHAR *title));
12 | extern long lowline P_((_BLKNO_ bufinfo, long lineno));
13 | extern BLKNO lowoffset P_((_BLKNO_ bufinfo, long offset, COUNT *left, COUNT *right, LBLKNO *lptr, long *linenum));
14 | extern long lowdelete P_((_BLKNO_ dst, long dsttop, long dstbottom));
15 | extern long lowinsert P_((_BLKNO_ dst, long dsttop, CHAR *newp, long newlen));
16 | extern long lowreplace P_((_BLKNO_ dst, long dsttop, long dstbottom, CHAR *newp, long newlen));
17 | extern long lowpaste P_((_BLKNO_ dst, long dsttop, _BLKNO_ src, long srctop, long srcbottom));
18 | extern void lowflush P_((_BLKNO_ bufinfo));
19 | END_EXTERNC
20 |
--------------------------------------------------------------------------------
/guix11/xscroll.h:
--------------------------------------------------------------------------------
1 | /* xscroll.h */
2 |
3 | typedef enum { X_SB_REDRAW, X_SB_NORMAL, X_SB_BLANK, X_SB_STOP } X_SCROLLSTATE;
4 |
5 | typedef struct
6 | {
7 | Window win; /* scrollbar subwindow */
8 | int x, y; /* position of scrollbar within app window */
9 | unsigned w, h; /* total size of the scrollbar */
10 | unsigned width; /* width of the page/thumb area */
11 | unsigned height; /* height of page/thumb area */
12 | unsigned offset; /* top of page/thumb area */
13 | unsigned top; /* top of thumb */
14 | unsigned bottom; /* bottom of thumb */
15 | ELVBOOL recolored; /* have colors changed lately? */
16 | X_SCROLLSTATE state; /* scrollbar state */
17 | } X_SCROLLBAR;
18 |
19 | void x_sb_predict P_((X11WIN *xw, unsigned w, unsigned h));
20 | void x_sb_create P_((X11WIN *xw, int x, int y));
21 | void x_sb_destroy P_((X11WIN *xw));
22 | void x_sb_setstate P_((X11WIN *xw, X_SCROLLSTATE newstate));
23 | void x_sb_thumb P_((X11WIN *xw, long top, long bottom, long total));
24 | void x_sb_event P_((X11WIN *xw, XEvent *event));
25 | void x_sb_recolor P_((X11WIN *xw));
26 |
--------------------------------------------------------------------------------
/lp.h:
--------------------------------------------------------------------------------
1 | /* lp.h */
2 | /* Copyright 1995 by Steve Kirkendall */
3 |
4 | #ifdef FEATURE_LPR
5 |
6 | typedef struct
7 | {
8 | char *name; /* printer type, e.g. "epson" */
9 | int minorno; /* value to pass to `before' */
10 | ELVBOOL spooled; /* uses lpout spooler */
11 | void (*before) P_((int minorno, void (*draw)(_CHAR_ ch)));/* called before print job */
12 | void (*fontch) P_((_char_ font, _CHAR_ ch)); /* output a single char */
13 | void (*page) P_((int linesleft)); /* called at end of each page */
14 | void (*after) P_((int linesleft)); /* called at end of print job */
15 | } LPTYPE;
16 |
17 | BEGIN_EXTERNC
18 | extern unsigned char *lpfg P_((_char_ fontcode));
19 | extern char *lpoptfield P_((char *field, char *dflt));
20 | extern RESULT lp P_((WINDOW win, MARK top, MARK bottom, ELVBOOL force));
21 | END_EXTERNC
22 | extern LPTYPE lpepson, lppana, lpibm, lphp, lpdumb, lpansi, lphtml;
23 | extern LPTYPE lpcr, lpbs;
24 | extern LPTYPE lpps, lpps2;
25 | #ifdef GUI_WIN32
26 | extern LPTYPE lpwindows;
27 | #endif
28 |
29 | #endif /* FEATURE_LPR */
30 |
--------------------------------------------------------------------------------
/elvis.lsm:
--------------------------------------------------------------------------------
1 | Begin3
2 | Title: elvis, a clone of the vi text editor
3 | Version: 2.1
4 | Release: 4
5 | Entered-date: 15OCT99
6 | Description: Clone of vi editor, with added support for multiple edit
7 | buffers, multiple windows, a variety of user interfaces
8 | (including X-windows), several display modes (including
9 | HTML-preview and generic syntax coloring), and online help.
10 | Compared to elvis 2.0, 2.1 adds HTTP and FTP network support,
11 | improvements to the X-windows interface, a new graphical
12 | interface for Win32, OS/2 ports, enhanced tags, and an
13 | :alias command. Many other small changes, and bug fixes.
14 | Keywords: vi editor HTML FTP HTTP syntax-coloring X11
15 | Author: kirkenda@cs.pdx.edu (Steve Kirkendall)
16 | Maintained-by:
17 | Primary-site: ftp.cs.pdx.edu /pub/elvis
18 | 1012k elvis-2.1_4.tar.gz
19 | 999 elvis.lsm
20 | Alternate-site: sunsite.unc.edu /pub/Linux/apps/editors
21 | ftp.false.com /pub/elvis
22 | Original-site:
23 | Platforms:
24 | Copying-policy: artistic
25 | End
26 |
--------------------------------------------------------------------------------
/data/scripts/sfb.ex:
--------------------------------------------------------------------------------
1 | "Visual directory display a.k.a split file browse
2 | "Written by Dan Fandrich
3 | switch os
4 | case unix alias sfbrowse split +"fbrowsetweak !*" !ls !*
5 | case win32 alias sfbrowse split +"fbrowsetweak !*" !dir /b /a-d !*
6 | "What are the equivalent commands for OS/2 and whatever other OSes are valid?
7 | default alias sfbrowse split +"fbrowsetweak !*" !dir !*
8 |
9 | alias sfb sfbrowse
10 | alias fbrowsetweak {
11 | "Turn a directory listing into a browsable HTML page
12 | local report=0 nosaveregexp magicchar=.*
13 | 1,$s/.*/&<\/A>/
14 | local d="!*"
15 | if d=="" || d=="."
16 | then eval set d=(getcwd())
17 | 1
18 | eval insert (d) (d)
20 | "The directory name must end with an OS-dependent slash
21 | if file[,-1] != ""/""
22 | then eval file (d/"")
23 | if userprotocol
24 | then 1i
25 | "Move to the first file so that will move to the second
26 | 1
27 | /HREF
28 | set bufdisplay=html nomod locked
29 | display html
30 | }
31 |
--------------------------------------------------------------------------------
/buffer2.h:
--------------------------------------------------------------------------------
1 | /* buffer2.h */
2 | /* Copyright 1995 by Steve Kirkendall */
3 |
4 | /* Ideally, these function would have been declared in buffer.h, but since
5 | * their arguments are MARKs, they had to be declared after the MARK data type
6 | * is declared in mark.h, but mark.h can only be included after buffer.h...
7 | * so these functions' declarations had to go into their own separate file.
8 | */
9 | BEGIN_EXTERNC
10 | extern ELVBOOL bufread P_((MARK mark, char *rname));
11 | extern ELVBOOL bufwrite P_((MARK from, MARK to, char *wname, ELVBOOL force));
12 | extern void bufwilldo P_((MARK cursor, ELVBOOL will));
13 | extern long bufundo P_((MARK cursor, long back));
14 | extern void bufreplace P_((MARK from, MARK to, CHAR *newp, long newlen));
15 | extern void bufpaste P_((MARK dst, MARK from, MARK to));
16 | extern CHAR *bufmemory P_((MARK from, MARK to));
17 | END_EXTERNC
18 |
19 | /* This is used to store information needed to restore MARKs for an "undo" */
20 | struct umark_s
21 | {
22 | MARK mark; /* pointer to POSSIBLY FREED mark */
23 | long offset; /* offset of that mark, before a change */
24 | };
25 |
26 |
--------------------------------------------------------------------------------
/guix11/xstatus.h:
--------------------------------------------------------------------------------
1 | /* xstatus.h */
2 |
3 | #define MAXTOOLS 50
4 |
5 | typedef struct
6 | {
7 | Window win; /* toolbar subwindow */
8 | int x, y; /* position of status within window */
9 | unsigned int w, h; /* size of the status bar */
10 | char info[80]; /* info string */
11 | long line, column; /* cursor position */
12 | char learn; /* learn character */
13 | char *mode; /* e.g., "Command" or "Input" */
14 | unsigned int rulerwidth; /* widest ruler ever seen */
15 | unsigned int learnwidth; /* widest learn ever seen */
16 | unsigned int modewidth; /* widest mode ever seen */
17 | int rulerpos;
18 | int learnpos;
19 | int modepos;
20 | ELVBOOL recolored; /* have colors changed lately? */
21 | } X_STATUSBAR;
22 |
23 | void x_st_predict P_((X11WIN *xw, unsigned w, unsigned h));
24 | void x_st_create P_((X11WIN *xw, int x, int y));
25 | void x_st_destroy P_((X11WIN *xw));
26 | void x_st_status P_((X11WIN *xw, CHAR *info, long line, long column, _char_ learn, char *mode));
27 | void x_st_info P_((X11WIN *xw, CHAR *info));
28 | void x_st_event P_((X11WIN *xw, XEvent *event));
29 | void x_st_recolor P_((X11WIN *xw));
30 |
--------------------------------------------------------------------------------
/safe.h:
--------------------------------------------------------------------------------
1 | /* safe.h */
2 | /* Copyright 1995 by Steve Kirkendall */
3 |
4 |
5 | #ifndef DEBUG_ALLOC
6 |
7 | BEGIN_EXTERNC
8 | extern void *safealloc P_((int qty, size_t size));
9 | extern void safefree P_((void *ptr));
10 | extern char *safedup P_((char *str));
11 | END_EXTERNC
12 | # define safekept safealloc
13 | #define safekdup safedup
14 | # define safeterm()
15 | # define safeinspect()
16 |
17 | #else
18 |
19 | # define safealloc(qty, size) _safealloc(__FILE__, __LINE__, ElvFalse, qty, size)
20 | # define safekept(qty, size) _safealloc(__FILE__, __LINE__, ElvTrue, qty, size)
21 | # define safefree(ptr) _safefree(__FILE__, __LINE__, ptr)
22 | # define safedup(str) _safedup(__FILE__, __LINE__, ElvFalse, str)
23 | # define safekdup(str) _safedup(__FILE__, __LINE__, ElvTrue, str)
24 | BEGIN_EXTERNC
25 | extern void *_safealloc P_((char *file, int line, ELVBOOL kept, int qty, size_t size));
26 | extern void _safefree P_((char *file, int line, void *ptr));
27 | extern char *_safedup P_((char *file, int line, ELVBOOL kept, char *str));
28 | extern void safeterm P_((void));
29 | extern void safeinspect P_((void));
30 | END_EXTERNC
31 |
32 | #endif
33 |
--------------------------------------------------------------------------------
/makmsdos.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | REM We need to set the PATH and a few other environment variables, but
4 | REM only once!
5 | if %INCLUDE%X==X call \msvc\bin\msvcvars
6 | if %TMP%X==X set TMP=C:\
7 |
8 | REM Copy the MS-DOS versions of the configuration files into the main
9 | REM elvis source directory.
10 | echo Configuring...
11 | if not exist elvis.mak copy osmsdos\elvis.mak
12 | if not exist ctags.mak copy osmsdos\ctags.mak
13 | if not exist ref.mak copy osmsdos\ref.mak
14 | if not exist fmt.mak copy osmsdos\fmt.mak
15 | if not exist vi.mak copy osmsdos\vi.mak
16 | if not exist config.h copy osmsdos\osconfig.h config.h
17 |
18 | REM And one more for convenience!
19 | if not exist make.bat copy makmsdos.bat make.bat
20 |
21 | REM Make the programs
22 | echo Compiling...
23 | nmake /nologo /s /f elvis.mak DEBUG=0
24 | if errorlevel 1 goto Fail
25 | nmake /nologo /s /f ctags.mak DEBUG=0
26 | if errorlevel 1 goto Fail
27 | nmake /nologo /s /f ref.mak DEBUG=0
28 | if errorlevel 1 goto Fail
29 | nmake /nologo /s /f fmt.mak DEBUG=0
30 | if errorlevel 1 goto Fail
31 | nmake /nologo /s /f vi.mak DEBUG=0
32 | copy vi.exe ex.exe
33 | copy vi.exe view.exe
34 |
35 | :Fail
36 |
--------------------------------------------------------------------------------
/osmsdos/mouse.h:
--------------------------------------------------------------------------------
1 | /* Include file for mouse calls. */
2 |
3 | /* Mouse events */
4 | #define LEFT_DOWN 0x01 /* 0000 0010 Left button pressed */
5 | #define RIGHT_DOWN 0x02 /* 0000 1000 Right button pressed */
6 | #define MIDDLE_DOWN 0x04 /* 0010 0000 Middle button pressed */
7 |
8 | /* Mouse event structure */
9 | typedef struct _EVENT
10 | {
11 | short x, y;
12 | unsigned fsBtn;
13 | } EVENT;
14 |
15 | /* Mouse pointer shape union containing structures for graphics and text */
16 | typedef union _PTRSHAPE
17 | {
18 | struct
19 | {
20 | unsigned char atScreen;
21 | unsigned char chScreen;
22 | unsigned char atCursor;
23 | unsigned char chCursor;
24 | } t;
25 | struct
26 | {
27 | unsigned xHot, yHot;
28 | unsigned afsPtr[32];
29 | } g;
30 | } PTRSHAPE;
31 |
32 | /* Values for SetPtrVis function */
33 | typedef enum _PTRVIS { SHOW = 1, HIDE } PTRVIS;
34 |
35 | /* Public mouse functions */
36 | int MouseInit( void );
37 | int GetMouseEvent( EVENT __far *pEvent );
38 | int GetPtrPos( EVENT __far *pEvent );
39 | int SetPtrPos( short x, short y );
40 | int SetPtrVis( PTRVIS pv );
41 | int SetPtrShape( PTRSHAPE __far *ps );
42 |
--------------------------------------------------------------------------------
/tag.h:
--------------------------------------------------------------------------------
1 | /* tag.h */
2 |
3 | /* maximum number of attributes */
4 | #define MAXATTR 10
5 |
6 | /* The indicies of the standard fields */
7 | #define TAGNAME attr[0]
8 | #define TAGFILE attr[1]
9 | #define TAGADDR attr[2]
10 |
11 | /* values of a single tag */
12 | typedef struct tag_s
13 | {
14 | struct tag_s *next; /* next tag in sorted order, or NULL */
15 | struct tag_s *bighop;/* some other tag, or NULL */
16 | long match; /* likelyhood that this is desired tag */
17 | char *attr[MAXATTR]; /* other attribute values; see tagattrname[] for names */
18 | } TAG;
19 |
20 | #if 0
21 | /* Stuff normally defined in elvis.h, but elvis.h might not be included */
22 | # ifndef QTY
23 | # include
24 | typedef enum {ElvFalse, ElvTrue} ELVBOOL;
25 | # define P_(args) args
26 | # endif
27 | #endif
28 |
29 | extern char *tagattrname[MAXATTR];
30 | extern TAG *taglist;
31 | extern ELVBOOL tagforward;
32 |
33 | BEGIN_EXTERNC
34 |
35 | extern void tagnamereset P_((void));
36 | extern TAG *tagdup P_((TAG *tag));
37 | extern ELVBOOL tagattr P_((TAG *tag, char *name, char *value));
38 | extern TAG *tagfree P_((TAG *tag));
39 | extern void tagdelete P_((ELVBOOL all));
40 | extern void tagadd P_((TAG *tag));
41 | extern TAG *tagparse P_((char *line));
42 |
43 | END_EXTERNC
44 |
--------------------------------------------------------------------------------
/guix11/xmisc.h:
--------------------------------------------------------------------------------
1 | /* xmisc.h */
2 |
3 | typedef struct x_loadedfont_s
4 | {
5 | struct x_loadedfont_s *next; /* next font in linked list */
6 | int links; /* number of windows using this font */
7 | XFontStruct *fontinfo; /* X font structure */
8 | char *name; /* name of the font */
9 | #ifdef FEATURE_XFT
10 | XftFont *xftfont; /* Xft version of the font */
11 | #endif
12 | } X_LOADEDFONT;
13 |
14 | typedef struct x_loadedcolor_s
15 | {
16 | struct x_loadedcolor_s *next; /* next color in linked list */
17 | unsigned long pixel; /* the color code */
18 | unsigned char rgb[3]; /* the color, broken down into RGB */
19 | CHAR *name; /* name of the color */
20 | #ifdef FEATURE_XFT
21 | XftColor xftcolor; /* Xft version of the color */
22 | #endif
23 | } X_LOADEDCOLOR;
24 |
25 | #ifdef FEATURE_XFT
26 | XftColor *x_xftpixel P_((long pixel));
27 | #endif
28 | X_LOADEDFONT *x_loadfont P_((char *name));
29 | void x_unloadfont P_((X_LOADEDFONT *font));
30 | unsigned long x_loadcolor P_((CHAR *name, unsigned long def, unsigned char rgb[3]));
31 | void x_unloadcolor P_((unsigned long pixel));
32 | void x_drawbevel P_((X11WIN *xw, Window win, int x, int y, unsigned w, unsigned h, _char_ dir, int height));
33 | void x_drawstring P_((Display *display, Window win, GC gc, int x, int y, char *str, int len));
34 |
--------------------------------------------------------------------------------
/data/icons/small.xpm:
--------------------------------------------------------------------------------
1 | /* XPM */
2 | static char * small_xpm[] = {
3 | "21 18 29 1",
4 | " c #DF7DDF7DDF7D",
5 | ". c #CF3CD34CCF3C",
6 | "X c #D34CD34CD34C",
7 | "o c #965892489658",
8 | "O c #CF3CCF3CCF3C",
9 | "+ c #B6DAB2CAB6DA",
10 | "@ c #BAEABAEABAEA",
11 | "# c #CF3CC71BCF3C",
12 | "$ c #71C675D671C6",
13 | "% c #000000000000",
14 | "& c #FFFF0000FFFF",
15 | "* c #69A669A671C6",
16 | "= c #C71BC71BC71B",
17 | "- c #208128A25144",
18 | "; c #FFFFFFFF0000",
19 | ": c #BEFBBEFBBEFB",
20 | "> c #FFFFFFFFFFFF",
21 | ", c #BEFBBAEABEFB",
22 | "< c #C71BBAEAC71B",
23 | "1 c #BEFBB6DABEFB",
24 | "2 c #659565956595",
25 | "3 c #9E799A699E79",
26 | "4 c #96589658AEBA",
27 | "5 c #B2CAB2CAB2CA",
28 | "6 c #618561856185",
29 | "7 c #AEBAA699AEBA",
30 | "8 c #B6DAAEBAB6DA",
31 | "9 c #8E388A288E38",
32 | "0 c #5D755D755D75",
33 | " ..................Xo",
34 | "O+@++@++@++@++@++@+#$",
35 | "O%%%%%%%%%%%%%%%%%%#$",
36 | "O%%%&%&&%%%%%%&&&%%#$",
37 | "O%&%&%&%%%%%%%&&&%%O*",
38 | "O%%%&%&%%..%%%%&&&%O*",
39 | "=%&&&&&%%.%%.%%&&%%=*",
40 | "=%&&&&&%.-.-.%&&&&%=*",
41 | "=%;;;;;%.....%&&&&%=*",
42 | "=%;;;;;..--..%&&&&%:*",
43 | "=%;;;;;>>...;;&&&&%,*",
44 | "<%;;;;;;>.>;;;&---%,*",
45 | ",%%%%%%;>>>;;;-;--%12",
46 | ",%%>%>%;>>;;;-;--&%@2",
47 | "@%%%%%%%%%%%%%%%%%%+2",
48 | "@o3333433433433333356",
49 | ",788878878878888888<6",
50 | "90000000000000000006-"};
51 |
--------------------------------------------------------------------------------
/guix11/elvis.xbm:
--------------------------------------------------------------------------------
1 | #define elvis_width 48
2 | #define elvis_height 32
3 | static unsigned char elvis_bits[] = {
4 | 0x54, 0x55, 0x55, 0x55, 0x55, 0x15, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x3f,
5 | 0x04, 0x00, 0xfc, 0xff, 0x03, 0x60, 0x26, 0x08, 0xfe, 0xff, 0x07, 0x2e,
6 | 0x54, 0x14, 0xfe, 0xff, 0x07, 0x65, 0x46, 0x10, 0xfe, 0xff, 0x07, 0x2e,
7 | 0x24, 0x08, 0xfe, 0xff, 0x07, 0x60, 0x16, 0x04, 0x3f, 0xb0, 0x07, 0x2d,
8 | 0x14, 0x04, 0x1f, 0x20, 0x03, 0x6b, 0x76, 0x1d, 0x0d, 0x20, 0x03, 0x20,
9 | 0x04, 0x00, 0x0d, 0x10, 0x02, 0x6f, 0x06, 0x00, 0x8d, 0x01, 0x01, 0x28,
10 | 0x04, 0x00, 0x0d, 0x21, 0x05, 0x6f, 0x06, 0x00, 0x0b, 0xa4, 0x00, 0x20,
11 | 0xfc, 0xff, 0x0f, 0x88, 0x00, 0x60, 0x26, 0xc2, 0x02, 0x8c, 0x00, 0x20,
12 | 0x8c, 0xb8, 0x02, 0x40, 0x00, 0x60, 0x26, 0xba, 0x02, 0x4f, 0x02, 0x20,
13 | 0x8c, 0x8c, 0x04, 0x46, 0x80, 0x60, 0x26, 0xe6, 0x04, 0x20, 0x00, 0x20,
14 | 0x8c, 0x4a, 0x4c, 0x30, 0x0f, 0x60, 0x26, 0xe2, 0x9f, 0x29, 0x3f, 0x20,
15 | 0x8c, 0x4a, 0x1c, 0xce, 0x3f, 0x60, 0xfe, 0xff, 0xeb, 0x93, 0x7f, 0x20,
16 | 0x4c, 0x55, 0x12, 0x46, 0x7d, 0x60, 0x6e, 0x55, 0x1b, 0xd3, 0x7e, 0x20,
17 | 0x4c, 0x55, 0x1a, 0x65, 0x7d, 0x60, 0x6e, 0xdb, 0x9a, 0xb1, 0x7e, 0x20,
18 | 0x4c, 0x5a, 0x9a, 0x54, 0x3f, 0x60, 0xfe, 0xff, 0x9b, 0xa1, 0x5f, 0x20,
19 | 0xfc, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xa8, 0xaa, 0xaa, 0xaa, 0xaa, 0x2a};
20 |
--------------------------------------------------------------------------------
/fold.h:
--------------------------------------------------------------------------------
1 | /* fold.h */
2 | /* Copyright 2000 by Steve Kirkendall */
3 |
4 | #ifdef FEATURE_FOLD
5 |
6 | typedef struct fold_s
7 | {
8 | struct fold_s *next;
9 | MARK from; /* start of first line */
10 | MARK to; /* end of last line, inclusive */
11 | CHAR *name; /* displayed name of the fold */
12 | } *FOLD;
13 |
14 | /* These are used as the "flags" parameter of foldbyrange(). You can OR these
15 | * together in any combination.
16 | */
17 | #define FOLD_NOEXTRA 0x00 /* just exact & overlapping folds */
18 | #define FOLD_INSIDE 0x01 /* also folds wholly inside the range */
19 | #define FOLD_OUTSIDE 0x02 /* also folds which wholly include the range */
20 | #define FOLD_NESTED 0x04 /* also folds nested inside other folds */
21 | #define FOLD_TOGGLE 0x10 /* action: unfold/refold the found FOLDs */
22 | #define FOLD_DESTROY 0x20 /* action: delete the found FOLDs */
23 | #define FOLD_TEST 0x40 /* action: do nothing, just detect the FOLDs */
24 |
25 | extern FOLD foldalloc P_((MARK from, MARK to, CHAR *name));
26 | extern void foldadd P_((FOLD fold, ELVBOOL infold));
27 | extern RESULT foldbyname P_((BUFFER buf, CHAR *name, ELVBOOL infold));
28 | extern RESULT foldbyrange P_((MARK from, MARK to, ELVBOOL infold, int flags));
29 | extern FOLD foldmark P_((MARK mark, ELVBOOL infold));
30 | extern void foldedit P_((MARK from, MARK to, MARK dest));
31 |
32 | #endif /* defined(FEATURE_FOLD) */
33 |
--------------------------------------------------------------------------------
/doc/printdoc.bat:
--------------------------------------------------------------------------------
1 | REM () { :; }
2 | REM This little script will print the documentation. It does this by invoking
3 | REM elvis on each documentation file in turn, telling elvis to print the file
4 | REM via its :lpr command and then quit. The complete manual should be about
5 | REM 200 pages long.
6 | REM
7 | REM THIS ASSUMES YOU HAVE ALREADY SET UP THE PRINTING OPTIONS!
8 | REM
9 | REM This script should work under DOS, Windows/NT, and the UNIX "ksh" shell or
10 | REM clones such as "bash". The first line of this file allows "sh" to accept
11 | REM these REM lines without complaint, by defining it as a do-nothing function.
12 |
13 | elvis -Gquit -clp elvis.html
14 | elvis -Gquit -clp elvisvi.html
15 | elvis -Gquit -clp elvisinp.html
16 | elvis -Gquit -clp elvisex.html
17 | elvis -Gquit -clp elvisre.html
18 | elvis -Gquit -clp elvisopt.html
19 | elvis -Gquit -clp elvisdm.html
20 | elvis -Gquit -clp elvisgui.html
21 | elvis -Gquit -clp elvisos.html
22 | elvis -Gquit -clp elvisses.html
23 | elvis -Gquit -clp elviscut.html
24 | elvis -Gquit -clp elvismsg.html
25 | elvis -Gquit -clp elvisexp.html
26 | elvis -Gquit -clp elvistag.html
27 | elvis -Gquit -clp elvisnet.html
28 | elvis -Gquit -clp elvistip.html
29 | elvis -Gquit -clp elvistrs.msg
30 | elvis -Gquit -clp elvisqr.html
31 | elvis -Gquit -clp elvis.man
32 | elvis -Gquit -clp ctags.man
33 | elvis -Gquit -clp ref.man
34 | elvis -Gquit -clp fmt.man
35 |
--------------------------------------------------------------------------------
/data/icons/vi.xpm:
--------------------------------------------------------------------------------
1 | /* XPM */
2 | static char * vi_xpm[] = {
3 | "32 32 3 1",
4 | " c None",
5 | ". c white",
6 | "X c black",
7 | " ",
8 | " ",
9 | " ",
10 | "...... ........ ",
11 | "XXXXX. .XXXXXX. ",
12 | ".XXX. ..XXXX.. ",
13 | "..XX. .XXX.. ",
14 | " .XX. .XXX. ",
15 | " .XX. ..XX.. ",
16 | " .XX.. .XXX. .... ",
17 | " .XXX. ..XX.. .XX. ",
18 | " ..XX. .XXX. .XX. ",
19 | " .XX. ..XXX. .... ",
20 | " .XX.. .XXX.. ...... ",
21 | " .XXX. .XXX. .XXXX. ",
22 | " ..XX. ..XX.. ..XXX. ",
23 | " .XX. .XXX. ..XX. ",
24 | " .XX.. ..XXX. .XX. ",
25 | " .XXX. .XXX.. .XX. ",
26 | " ..XX. ..XXX. .XX. ",
27 | " .XX. .XXX.. .XX. ",
28 | " .XX....XXX. .XX. ",
29 | " .XXX..XXX.. .XX. ",
30 | " ..XX..XXX. .XX. ",
31 | " .XX.XXXX. .XX. ",
32 | " .XX.XXX.. .XX. ",
33 | " .XXXXXX. ....XX.... ",
34 | " ..XXXX.. ..XXXXXXXX.. ",
35 | " .XXXX. .XXXXXXXXXX. ",
36 | " ...... ............ ",
37 | " ",
38 | " "};
39 |
--------------------------------------------------------------------------------
/need.c:
--------------------------------------------------------------------------------
1 | /* need.c */
2 | /* Copyright 1995 by Steve Kirkendall */
3 |
4 |
5 | #include "elvis.h"
6 | #ifdef FEATURE_RCSID
7 | char id_need[] = "$Id: need.c,v 2.5 2001/10/23 01:37:09 steve Exp $";
8 | #endif
9 |
10 |
11 | #ifdef NEED_STRDUP
12 | # if USE_PROTOTYPES
13 | char *strdup(const char *str)
14 | {
15 | # else /* don't USE_PROTOTYPES */
16 | char *strdup(str)
17 | char *str;
18 | {
19 | # endif /* don't USE_PROTOTYPES */
20 |
21 | char *ret;
22 |
23 | ret = (char *)safealloc(strlen(str) + 1, sizeof(char));
24 | strcpy(ret, str);
25 | return ret;
26 | }
27 | #endif /* NEED_STRDUP */
28 |
29 | #ifdef NEED_MEMMOVE
30 | # if USE_PROTOTYPES
31 | void *memmove(void *dest, const void *src, size_t size)
32 | # else /* don't USE_PROTOTYPES */
33 | void *memmove(dest, src, size)
34 | void *dest;
35 | void *src;
36 | size_t size;
37 | # endif /* don't USE_PROTOTYPES */
38 | {
39 | register char *d, *s;
40 |
41 | d = (char *)dest;
42 | s = (char *)src;
43 | if (d <= s)
44 | {
45 | for (; size > 0; size--)
46 | *d++ = *s++;
47 | }
48 | else
49 | {
50 | for (d += size, s += size; size > 0; size--)
51 | *--d = *--s;
52 | }
53 | return dest;
54 | }
55 | #endif
56 |
57 | #ifdef NEED_XRMCOMBINEFILEDATABASE
58 | /* The XrmCombineFileDatabase() function is defined in guix11/xmisc.c */
59 | #endif
60 |
61 | #ifdef NEED_INET_ATON
62 | /* The inet_aton() function is defined in osunix/osnet.c */
63 | #endif
64 |
--------------------------------------------------------------------------------
/data/scripts/info.ex:
--------------------------------------------------------------------------------
1 | " This file tries to implement an "info:" protocol, for viewing info pages
2 | " inside elvis. It doesn't quite succeed, but it comes close.
3 | "
4 | " This assumes your info pages are stored in /usr/share/info. If they're
5 | " stored someplace else, then you'll need to edit the "local d=..." line below.
6 |
7 | alias readINFO {
8 | local d=/usr/share/info
9 | local report=0
10 | local magic magicchar=^$.[* noignorecase
11 | local m
12 | let m=display
13 | display normal
14 | if "!(/)2" == "/"
15 | then {
16 | eval r !!cd (d); ls *.info.gz
17 | try {
18 | %s/\(.*\)\.info\.gz/\1<\/a>/
19 | se bufdisplay=html noinitialsyntax
20 | }
21 | se nomod
22 | }
23 | else {
24 | eval r !!gzip -d -c (d)/!2.info.gz (d)/!2.info-*.gz
25 | try {
26 | 1,/^File: .* Node: !(Top)3,/-1 d
27 | try %s/&/\&/g
28 | try %s/\</g
29 | try %s/>/\>/g
30 | %s/^$/
/
31 | %s/^\(File: .* Node: \)\([^:,]*\)/+2s,.*,\&<\/a>,/x
32 | g/^File: /s/\(Prev\|Next\|Up\): \([^:,]*\)/\1: \2<\/a>/g
33 | try %s///g
34 | %s/^\* \(.*\)::/* \1<\/a>::/
35 | 1i
36 | $a
37 | se bufdisplay=html noinitialsyntax
38 | }
39 | se nomod
40 | }
41 | eval display (m)
42 | }
43 |
44 | alias info sp info:!1
45 |
--------------------------------------------------------------------------------
/guix11/elvispin.xbm:
--------------------------------------------------------------------------------
1 | #define elvispin_width 48
2 | #define elvispin_height 32
3 | #define elvispin_x_hot 25
4 | #define elvispin_y_hot 25
5 | static unsigned char elvispin_bits[] = {
6 | 0x54, 0x55, 0x55, 0x55, 0x55, 0x15, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x3f,
7 | 0x04, 0x00, 0xfc, 0xff, 0x03, 0x60, 0x26, 0x08, 0xfe, 0x0f, 0x06, 0x2e,
8 | 0x54, 0x14, 0xfe, 0x07, 0x08, 0x65, 0x46, 0x10, 0xfe, 0x03, 0x10, 0x2e,
9 | 0x24, 0x08, 0xfe, 0x03, 0x10, 0x60, 0x16, 0x04, 0x3f, 0x04, 0x18, 0x2d,
10 | 0x14, 0x04, 0x1f, 0x1c, 0x0c, 0x6b, 0x76, 0x1d, 0x0d, 0xe2, 0x07, 0x20,
11 | 0x04, 0x00, 0x0d, 0x02, 0x04, 0x6f, 0x06, 0x00, 0x8d, 0x02, 0x04, 0x28,
12 | 0x04, 0x00, 0x0d, 0x03, 0x02, 0x6f, 0x06, 0x00, 0x8b, 0x01, 0x02, 0x20,
13 | 0xfc, 0xff, 0x4f, 0x01, 0x06, 0x60, 0x26, 0xc2, 0x42, 0x01, 0x05, 0x20,
14 | 0x8c, 0xb8, 0x42, 0x86, 0x04, 0x60, 0x26, 0xba, 0x82, 0x78, 0x02, 0x20,
15 | 0x8c, 0x8c, 0x04, 0x01, 0x81, 0x60, 0x26, 0xe6, 0x04, 0xfe, 0x00, 0x20,
16 | 0x8c, 0x4a, 0x4c, 0x0c, 0x0f, 0x60, 0x26, 0xe2, 0x9f, 0x2c, 0x3f, 0x20,
17 | 0x8c, 0x4a, 0x1c, 0xc6, 0x3f, 0x60, 0xfe, 0xff, 0xeb, 0x96, 0x7f, 0x20,
18 | 0x4c, 0x55, 0x12, 0x42, 0x7d, 0x60, 0x6e, 0x55, 0x1b, 0xd2, 0x7e, 0x20,
19 | 0x4c, 0x55, 0x1a, 0x60, 0x7d, 0x60, 0x6e, 0xdb, 0x9a, 0xb1, 0x7e, 0x20,
20 | 0x4c, 0x5a, 0x9a, 0x54, 0x3f, 0x60, 0xfe, 0xff, 0x9b, 0xa1, 0x5f, 0x20,
21 | 0xfc, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xa8, 0xaa, 0xaa, 0xaa, 0xaa, 0x2a};
22 |
--------------------------------------------------------------------------------
/debian/NEWS:
--------------------------------------------------------------------------------
1 | elvis (2.2.0-2) unstable; urgency=low
2 |
3 | The elvis package has been split into elvis-common, elvis,
4 | elvis-console and elvis-tools.
5 |
6 | elvis-common:
7 | This package provides the common files (manual, ex scripts,
8 | digraph files, etc.) that are needed by the packages elvis,
9 | elvis-console and elvis-tools.
10 |
11 | elvis:
12 | This package contains Elvis compiled with support for X11, Xft
13 | and background images. If you don't need the X11 interface,
14 | install elvis-console instead.
15 |
16 | elvis-console:
17 | This package contains Elvis compiled without X11 support. If
18 | you want to use Elvis' X11 interface then install the package
19 | elvis instead.
20 |
21 | elvis-tools:
22 | This package contains elvtags (for generating tags and refs
23 | files), ref (for quickly locating/displaying the header of a
24 | function) and elvfmt (for adjusting paragraphs of text).
25 | These tools actually belong to the Elvis editor but can be used
26 | without it.
27 |
28 | As a consequence of this, elvfmt, elvref and elvtags will be removed
29 | if you're upgrading from an earlier version of the elvis package.
30 | In this case, just install elvis-tools afterwards if you need them.
31 | Also note that elvref is now again installed as ref.
32 |
33 | -- Georg Neis Tue, 04 Aug 2004 13:12:55 +0200
34 |
--------------------------------------------------------------------------------
/ctypetbl.h:
--------------------------------------------------------------------------------
1 | /* ctypetbl.h */
2 |
3 | /* This file contains a definition (not just declaration!) for the variable
4 | * "elvct_class" which is used by ctags.c, fmt.c, and oswin32/ls.c to support
5 | * elvis' own ctype macros. Elvis itself uses a more complete version of
6 | * this variable which is declared in digraph.c; this file is not #included
7 | * in elvis.
8 | */
9 |
10 | #ifdef ELVCT_DIGIT
11 | CHAR elvct_class[256] = {
12 | 0,0,0,0,0,0,0,0,0,ELVCT_SPACE,ELVCT_SPACE,0,0,ELVCT_SPACE,0,0,
13 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
14 | ELVCT_SPACE,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
15 | ELVCT_DIGIT,ELVCT_DIGIT,ELVCT_DIGIT,ELVCT_DIGIT,ELVCT_DIGIT,
16 | ELVCT_DIGIT,ELVCT_DIGIT,ELVCT_DIGIT,ELVCT_DIGIT,ELVCT_DIGIT,
17 | 0,0,0,0,0,0,0,
18 | ELVCT_UPPER,ELVCT_UPPER,ELVCT_UPPER,ELVCT_UPPER,ELVCT_UPPER,
19 | ELVCT_UPPER,ELVCT_UPPER,ELVCT_UPPER,ELVCT_UPPER,ELVCT_UPPER,
20 | ELVCT_UPPER,ELVCT_UPPER,ELVCT_UPPER,ELVCT_UPPER,ELVCT_UPPER,
21 | ELVCT_UPPER,ELVCT_UPPER,ELVCT_UPPER,ELVCT_UPPER,ELVCT_UPPER,
22 | ELVCT_UPPER,ELVCT_UPPER,ELVCT_UPPER,ELVCT_UPPER,ELVCT_UPPER,
23 | ELVCT_UPPER,
24 | 0,0,0,0,0,0,
25 | ELVCT_LOWER,ELVCT_LOWER,ELVCT_LOWER,ELVCT_LOWER,ELVCT_LOWER,
26 | ELVCT_LOWER,ELVCT_LOWER,ELVCT_LOWER,ELVCT_LOWER,ELVCT_LOWER,
27 | ELVCT_LOWER,ELVCT_LOWER,ELVCT_LOWER,ELVCT_LOWER,ELVCT_LOWER,
28 | ELVCT_LOWER,ELVCT_LOWER,ELVCT_LOWER,ELVCT_LOWER,ELVCT_LOWER,
29 | ELVCT_LOWER,ELVCT_LOWER,ELVCT_LOWER,ELVCT_LOWER,ELVCT_LOWER,
30 | ELVCT_LOWER
31 | };
32 | #endif
33 |
--------------------------------------------------------------------------------
/data/scripts/info2.ex:
--------------------------------------------------------------------------------
1 | " This file tries to implement an "info:" protocol, for viewing info pages
2 | " inside elvis. It doesn't quite succeed, but it comes close.
3 | "
4 | " This assumes your info pages are stored in /usr/share/info. If they're
5 | " stored someplace else, then you'll need to edit the "local d=..." line below.
6 |
7 | alias readINFO {
8 | local d=/usr/share/info
9 | local report=0
10 | local magic magicchar=^$.[* noignorecase
11 | local m
12 | if "!(/)2" == "/"
13 | then {
14 | r (d/"dir")
15 | try %s/&/\&/g
16 | try %s/\</g
17 | try %s/>/\>/g
18 | try %s/^\* \([^:]*\): (\([^)]*\))\(.*\)\.$/* \1<\/a>: (\2)\3/
19 | try %s/^\* \([^:]*\): (\([^)]*\))\(.*\)/* \1<\/a>: (\2)\3/
20 | }
21 | else {
22 | if exists(d/"!2.info")
23 | then r !!cat (d)/!2.info (d)/!2.info-* 2>/dev/null
24 | eval r !!gzip -d -c (d)/!2.info*.gz (d)/!2.info-*.gz 2>/dev/null
25 | try 1,/^File: .* Node: !(Top)3,/-1 d
26 | try %s/&/\&/g
27 | try %s/\</g
28 | try %s/>/\>/g
29 | }
30 | try %s/^$/
/
31 | try %s/^\(File: .* Node: \)\([^:,]*\)/+2s,.*,\&<\/a>,/x
32 | try g/^File: /s/\(Prev\|Next\|Up\): \([^:,]*\)/\1: \2<\/a>/g
33 | try %s///g
34 | try %s/^\* \(.*\)::/* \1<\/a>::/
35 | 1i
36 | $a
37 | se bufdisplay=html noinitialsyntax nomod
38 | }
39 |
40 | alias info sp info:!1
41 |
--------------------------------------------------------------------------------
/data/scripts/cb.ex:
--------------------------------------------------------------------------------
1 | " cut buffer operations: cbsave, cbload, cbshow
2 | alias cbload {
3 | "Load cut-buffers from a file
4 | local b report=0 magic magicchar=^$.[* noignorecase
5 | let b=buffer
6 | if "!1" == ""
7 | then error cbload requires a file name
8 | e !1
9 | try %s:^--CBS-- \([a-z]\)$:+;/^--CBS--/-1 y \1:x
10 | eval buffer (b)
11 | }
12 |
13 | alias cbsave {
14 | "Save cut-buffers to a file
15 | local a b report=0
16 | let b = buffer
17 | if "!1" == ""
18 | then error cbsave requires a file name
19 | e !1
20 | %d
21 | let a = 'a'
22 | while a <= 'z'
23 | do {
24 | if buffer("Elvis cut buffer ";char(a))
25 | then {
26 | eval $ a --CBS-- (char(a))
27 | eval $ put (char(a))
28 | }
29 | let a = a + 1
30 | }
31 | $ a --CBS--
32 | w!?
33 | eval buffer (b)
34 | }
35 |
36 | alias cbshow {
37 | "Show contents of cut-buffers
38 | local b c d i l="!*" q u s
39 | if l == ""
40 | then let l = "abcdefghijklmnopqrstuvwxyz123456789"
41 | echo Buf\| Size & Type \| Contents
42 | echo ---+-------------+-----------------------------------------------------
43 | for i (1 .. strlen(l))
44 | do {
45 | let c = l[,i]
46 | let b = "Elvis cut buffer ";c
47 | if buffer(b)
48 | then {
49 | (=b) let u = putstyle << 4;
50 | (=b) let q = u=="char" ? bufchars - 1 : buflines
51 | if q > 0
52 | then let d = line(b,1) " "
53 | else let d = " "
54 | let s = q; " "; u; (q == 1 ? " " : "s")
55 | (=b) calc " "; c; " |"; s >> 12; " | "; d << 52
56 | }
57 | let i = i + 1
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/gui2.h:
--------------------------------------------------------------------------------
1 | /* gui2.h */
2 | /* Copyright 1995 by Steve Kirkendall */
3 |
4 | /* Herbert:
5 | * two more GUI's (by Lee).
6 | */
7 |
8 | #define guiscrollbar(w,t,b,n) if (gui->scrollbar != NULL) \
9 | (*scrollbar)((w)->gw, t, b, n); else (void)0
10 | #define guiflush() if (gui->flush) (*gui->flush)()
11 |
12 | BEGIN_EXTERNC
13 | extern ELVBOOL guicolorsync P_((WINDOW win));
14 | extern void guimoveto P_((WINDOW win, int column, int row));
15 | extern DRAWATTR *guidraw P_((WINDOW win, _char_ font, CHAR *text, int len, int forcebits));
16 | extern ELVBOOL guishift P_((WINDOW win, int qty, int rows));
17 | extern ELVBOOL guiscroll P_((WINDOW win, int qty, ELVBOOL notlast));
18 | extern void guiclrtoeol P_((WINDOW win));
19 | extern void guireset P_((void));
20 | extern ELVBOOL guipoll P_((ELVBOOL reset));
21 | extern void guibeep P_((WINDOW win));
22 | extern int guikeylabel P_((CHAR *given, int givenlen, CHAR **labelptr, CHAR **rawptr));
23 | END_EXTERNC
24 |
25 | extern GUI *gui;
26 |
27 | #ifdef GUI_X11
28 | extern GUI guix11;
29 | #endif
30 |
31 | #ifdef GUI_PM
32 | extern GUI guipm;
33 | #endif
34 |
35 | #ifdef GUI_CURSES
36 | extern GUI guicurses;
37 | #endif
38 |
39 | #ifdef GUI_BIOS
40 | extern GUI guibios;
41 | #endif
42 |
43 | #ifdef GUI_VIO
44 | extern GUI guivio;
45 | #endif
46 |
47 | #ifdef GUI_TERMCAP
48 | extern GUI guitermcap;
49 | #endif
50 |
51 | #ifdef GUI_OPEN
52 | extern GUI guiopen;
53 | extern GUI guiquit;
54 | extern GUI guiscript;
55 | #endif
56 |
57 | #ifdef GUI_WIN32
58 | extern GUI guiwin32;
59 | #endif
60 |
--------------------------------------------------------------------------------
/data/scripts/note.ex:
--------------------------------------------------------------------------------
1 | " This file contains a simple :note alias and some commands that use it.
2 |
3 | alias note {
4 | "Add/change/remove a note for a given range of lines
5 | if "!*" = ""
6 | then !%unr note
7 | else !%reg note !*
8 | }
9 | alias nextnote {
10 | "Search forward for the next line with a note
11 | local l
12 | let l = current("line")
13 | try +
14 | else error no more notes
15 | while current("line") < buflines && current("region") != "note"
16 | do +
17 | if current("region") != "note"
18 | then {
19 | =l
20 | error no notes below
21 | }
22 | }
23 | alias prevnote {
24 | "Search backward for the previous line with a note
25 | local l
26 | let l = current("line")
27 | try -
28 | else error no more notes
29 | while current("line") > 1 && current("region") != "note"
30 | do -
31 | if current("region") != "note"
32 | then {
33 | =l
34 | error no notes above
35 | }
36 | }
37 |
38 | "Some maps to make searching easier
39 | map gn :nextnote
40 | map gN :prevnote
41 |
42 | "Notes are only useful if persistfile stores regions
43 | if persistfile=""
44 | then warning You should set persistfile to make notes be permanent
45 | if !persist.region
46 | then {
47 | warning You should run :mkexrc to add "regions" to the persist option.
48 | let persist |= "regions"
49 | }
50 |
51 | "I deliberately don't define any attribute for the "note" face. You can if
52 | "you want, outside of this file, but my personal opinion is that coloring
53 | "lines with notes would make them too distracting.
54 |
--------------------------------------------------------------------------------
/data/icons/elvis2.xpm:
--------------------------------------------------------------------------------
1 | /* XPM */
2 | static char * elvis2_xpm[] = {
3 | "32 32 9 1",
4 | " c #2081618530C2",
5 | ". c #000000000000",
6 | "X c #965861850000",
7 | "o c #C71B92484103",
8 | "O c #F7DEB2CA0000",
9 | "+ c #F7DEB2CA2081",
10 | "@ c #F7DEB2CA1040",
11 | "# c #C71B71C630C2",
12 | "$ c #E79DB2CA4103",
13 | " ",
14 | " ",
15 | " ....... ",
16 | " ......... ",
17 | " .............. ",
18 | " ............... ",
19 | " ................. ",
20 | " ................. ",
21 | " .....Xo.......... ",
22 | " .....OOOOO......... ",
23 | " ....OOOOOOOOOOO.... ",
24 | " ....OOOOOOOOOOOO... ",
25 | " ...OOOOOOOOOOO+.. ",
26 | " ...OOOOOOOOOOOO.. ",
27 | " ....OOOOOOOOOO... ",
28 | " ......OOOO@O.oX.. ",
29 | " ................. ",
30 | " O..#oXX$..ooX.X.## ",
31 | " #X.OOOOOX.OOOOO.O ",
32 | " #O.#OOOOOOOOOOXO# ",
33 | " O...X..OOo.Oo.O# ",
34 | " .......#Oo#OOOOO...## ",
35 | ".............##....O#.....X ",
36 | ".............#@O.oOO.X......XX ",
37 | ".............#..#.#@#.........XX",
38 | "..............#oOO#O............",
39 | "..............XXXXXX............",
40 | "..............#oooo.............",
41 | "................................",
42 | "................................",
43 | "................................",
44 | "................................"};
45 |
--------------------------------------------------------------------------------
/debian/patches/getline:
--------------------------------------------------------------------------------
1 | --- elvis-2.2.0.orig/ref.c
2 | +++ elvis-2.2.0/ref.c
3 | @@ -42,7 +42,7 @@
4 |
5 | #if USE_PROTOTYPES
6 | static void usage(char *argv0);
7 | -static char *getline(FILE *fp);
8 | +static char *mygetline(FILE *fp);
9 | static void store(char *line, char **list);
10 | static LINECLS classify(char *line, LINECLS prev);
11 | static void lookup(TAG *tag);
12 | @@ -171,7 +171,7 @@
13 | /* This function reads a single line, and replaces the terminating newline with
14 | * a '\0' byte. The string will be in a static buffer. Returns NULL at EOF.
15 | */
16 | -static char *getline(fp)
17 | +static char *mygetline(fp)
18 | FILE *fp;
19 | {
20 | int ch;
21 | @@ -348,7 +348,7 @@
22 | }
23 |
24 | /* for each line... */
25 | - for (lnum = 1, lc = LC_COMPLETE; (line = getline(fp)) != NULL; lnum++)
26 | + for (lnum = 1, lc = LC_COMPLETE; (line = mygetline(fp)) != NULL; lnum++)
27 | {
28 | /* is this the tag definition? */
29 | if (taglnum > 0 ? taglnum == lnum : !strncmp(tagline, line, len))
30 | @@ -377,7 +377,7 @@
31 | {
32 | if (strchr(line, '(') != NULL)
33 | {
34 | - while ((line = getline(fp)) != NULL
35 | + while ((line = mygetline(fp)) != NULL
36 | && *line
37 | && ((*line != '#' && *line != '{')
38 | || line[strlen(line) - 1] == '\\'))
39 | @@ -387,7 +387,7 @@
40 | }
41 | else if ((lc = classify(line, lc)) == LC_PARTIAL)
42 | {
43 | - while ((line = getline(fp)) != NULL
44 | + while ((line = mygetline(fp)) != NULL
45 | && (lc = classify(line, lc)) == LC_PARTIAL)
46 | {
47 | puts(line);
48 |
--------------------------------------------------------------------------------
/guix11/xtext.h:
--------------------------------------------------------------------------------
1 | /* xtext.h */
2 |
3 | typedef struct
4 | {
5 | Window win;
6 | int x, y; /* position of text area within shell */
7 | unsigned w, h; /* size of text area, in pixels */
8 | Pixmap undercurs; /* image of character under cursor */
9 | int cursx, cursy; /* cursor position */
10 | unsigned cellw, cellh; /* size of a character cell, in pixels */
11 | int cellbase; /* baseline of characters */
12 | unsigned rows, columns; /* size of the window, in cells */
13 | ELVCURSOR cursor; /* current state of cursor */
14 | ELVCURSOR nextcursor; /* next state of cursor */
15 | long bg; /* background color of normal text */
16 | #ifdef FEATURE_IMAGE
17 | int scrollpixels; /* number of pixels scrolled */
18 | Pixmap pixmap; /* background image, with scrolling */
19 | #endif
20 | #ifdef FEATURE_XFT
21 | XftDraw *xftdraw; /* Xft version of the window */
22 | #endif
23 | } X_TEXTAREA;
24 |
25 | void x_ta_predict P_((X11WIN *xw, unsigned columns, unsigned rows));
26 | void x_ta_create P_((X11WIN *xw, int x, int y));
27 | void x_ta_destroy P_((X11WIN *xw));
28 | void x_ta_drawcursor P_((X11WIN *xw));
29 | void x_ta_erasecursor P_((X11WIN *xw));
30 | void x_ta_moveto P_((X11WIN *xw, int column, int row));
31 | void x_ta_draw P_((X11WIN *xw, long fg, long bg, int bits, CHAR *text, int len));
32 | void x_ta_shift P_((X11WIN *xw, int qty, int rows));
33 | void x_ta_scroll P_((X11WIN *xw, int qty, ELVBOOL notlast));
34 | void x_ta_clrtoeol P_((X11WIN *xw));
35 | void x_ta_event P_((X11WIN *xw, XEvent *event));
36 | void x_ta_recolor P_((X11WIN *xw, _char_ font));
37 | void x_ta_setbg P_((X11WIN *xw, long bg));
38 |
--------------------------------------------------------------------------------
/regexp.h:
--------------------------------------------------------------------------------
1 | /* regexp.h */
2 |
3 | #define NSUBEXP 10 /* max # of subexpressions, plus 1 for whole expr */
4 |
5 | /* DAG - hack to diff this from system regexp which this is incompatible with */
6 | #define regexp regexp_elvis
7 | #define regbuild regbuild_elvis
8 | #define regcomp regcomp_elvis
9 | #define regdup regdup_elvis
10 | #define regexec regexec_elvis
11 | #define regtilde regtilde_elvis
12 | #define regsub regsub_elvis
13 | #define regerror regerror_elvis
14 |
15 | typedef struct regexp {
16 | long startp[NSUBEXP];/* start of text matching a subexpr */
17 | long endp[NSUBEXP]; /* end of a text matching a subexpr */
18 | long leavep; /* offset of text matching \= */
19 | long nextlinep; /* offset of start of following line */
20 | BUFFER buffer; /* buffer that the above offsets refer to */
21 | int minlen; /* length of shortest possible match */
22 | CHAR first; /* first character, if known; else \0 */
23 | ELVBOOL bol; /* must start at beginning of line? */
24 | ELVBOOL literal; /* contains no metacharacters? */
25 | ELVBOOL upper; /* contains some uppercase letters? */
26 | CHAR program[1]; /* Unwarranted chumminess with compiler. */
27 | } regexp;
28 |
29 | BEGIN_EXTERNC
30 | extern CHAR *regbuild P_((_CHAR_ delim, CHAR **refp, ELVBOOL reg));
31 | extern regexp *regcomp P_((CHAR *retext, MARK cursor));
32 | extern regexp *regdup P_((regexp *re));
33 | extern int regexec P_((regexp *re, MARK from, ELVBOOL bol));
34 | extern CHAR *regtilde P_((CHAR *newp));
35 | extern CHAR *regsub P_((regexp *re, CHAR *newp, ELVBOOL doit));
36 | extern void regerror P_((char *errmsg));
37 | END_EXTERNC
38 |
39 | #ifndef REG
40 | # define REG /* as nothing */
41 | #endif
42 |
--------------------------------------------------------------------------------
/elvis.spec.in:
--------------------------------------------------------------------------------
1 | %define name elvis
2 | %define version VERSION
3 | %define release 1
4 | %define serial 1
5 | %define prefix /usr
6 |
7 | Summary: Elvis text editor
8 | Name: %{name}
9 | Version: %{version}
10 | Release: %{release}
11 | License: Artistic
12 | Group: Applications/Editors
13 | Vendor: Steve Kirkendall
14 | Url: https://www.github.com/mbert/elvis/
15 | Source: %{name}-%{version}.tar.gz
16 |
17 | %description
18 | Elvis is a text editor, compatible with vi. It has all the usual
19 | extensions (multiple buffers, multiple windows, syntax coloring,
20 | etc.) plus a variety of display modes including "html" and "man".
21 |
22 |
23 | %prep
24 | %setup -q
25 |
26 | %build
27 | export CFLAGS="$RPM_OPT_FLAGS" CPPFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS";
28 |
29 | ./configure --prefix=%{prefix}
30 | make -j `nproc`
31 |
32 | %install
33 | rm -rf $RPM_BUILD_ROOT
34 | mkdir -p $RPM_BUILD_ROOT/usr/share/man/man1 $RPM_BUILD_ROOT/etc/elvis
35 | sed -i "s|>/etc/elvis|>$RPM_BUILD_ROOT/etc/elvis|g" Makefile
36 |
37 | echo "Running 'make install'..."
38 | make PREFIX=$RPM_BUILD_ROOT/usr install
39 |
40 | echo "Fixing /etc/elvis/README..."
41 | sed -i "s|$RPM_BUILD_ROOT||" $RPM_BUILD_ROOT/etc/elvis/README
42 |
43 | %clean
44 |
45 | %files
46 | %defattr(-, root, root)
47 | %doc COPYING README.html
48 | %{prefix}/bin/elvis
49 | %{prefix}/bin/elvgdb
50 | %{prefix}/bin/elvtags
51 | %{prefix}/bin/elvfmt
52 | %{prefix}/bin/ref
53 | MANDIR/elvis.1.gz
54 | MANDIR/elvgdb.1.gz
55 | MANDIR/elvtags.1.gz
56 | MANDIR/elvfmt.1.gz
57 | MANDIR/ref.1.gz
58 | %{prefix}/share/elvis/
59 | %dir /etc/elvis
60 | /etc/elvis/README
61 |
--------------------------------------------------------------------------------
/move.h:
--------------------------------------------------------------------------------
1 | /* move.h */
2 | /* Copyright 1995 by Steve Kirkendall */
3 |
4 |
5 | BEGIN_EXTERNC
6 | extern RESULT m_left P_((WINDOW win, VIINFO *vinf));
7 | extern RESULT m_right P_((WINDOW win, VIINFO *vinf));
8 | extern RESULT m_updown P_((WINDOW win, VIINFO *vinf));
9 | extern RESULT m_front P_((WINDOW win, VIINFO *vinf));
10 | extern RESULT m_absolute P_((WINDOW win, VIINFO *vinf));
11 | extern RESULT m_mark P_((WINDOW win, VIINFO *vinf));
12 | extern RESULT m_bigword P_((WINDOW win, VIINFO *vinf));
13 | extern RESULT m_word P_((WINDOW win, VIINFO *vinf));
14 | extern RESULT m_scroll P_((WINDOW win, VIINFO *vinf));
15 | extern RESULT m_column P_((WINDOW win, VIINFO *vinf));
16 | extern RESULT m_csearch P_((WINDOW win, VIINFO *vinf));
17 | extern RESULT m_tag P_((WINDOW win, VIINFO *vinf));
18 | extern RESULT m_bsection P_((WINDOW win, VIINFO *vinf));
19 | extern RESULT m_fsection P_((WINDOW win, VIINFO *vinf));
20 | extern RESULT m_scrnrel P_((WINDOW win, VIINFO *vinf));
21 | extern RESULT m_z P_((WINDOW win, VIINFO *vinf));
22 | extern RESULT m_fsentence P_((WINDOW win, VIINFO *vinf));
23 | extern RESULT m_bsentence P_((WINDOW win, VIINFO *vinf));
24 | extern RESULT m_spell P_((WINDOW win, VIINFO *vinf));
25 | extern RESULT m_endspell P_((WINDOW win, VIINFO *vinf));
26 | extern RESULT m_g P_((WINDOW win, VIINFO *vinf));
27 | extern RESULT m_gupdown P_((WINDOW win, VIINFO *vinf));
28 |
29 | /* in search.c */
30 | extern RESULT m_search P_((WINDOW win, VIINFO *vinf));
31 | extern char searchfont;
32 | extern regexp *searchre;
33 | extern ELVBOOL searchforward;
34 | extern ELVBOOL searchhasdelta;
35 | extern long searchdelta;
36 | extern void searchhighlight P_((WINDOW win, int linesshown, long end));
37 | END_EXTERNC
38 |
--------------------------------------------------------------------------------
/makwin32.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | if "%1"=="clean" goto Clean
4 | echo Checking environment...
5 | if "%INCLUDE%"=="" goto EnvNeeded
6 | echo Environment variables already set
7 | goto EnvDone
8 | :EnvNeeded
9 | if exist \msdev\bin\vcvars32.bat call \msdev\bin\vcvars32
10 | if exist "C:\Program Files\Microsoft Visual Studio\VC98\Bin\vcvars32.bat" call "C:\Program Files\Microsoft Visual Studio\VC98\Bin\vcvars32"
11 | if "%INCLUDE%"=="" call vcvars32
12 | :EnvDone
13 |
14 | echo Configuring...
15 | if not exist make.bat copy makwin32.bat make.bat
16 | if not exist elvis.mak copy oswin32\elvis.mak
17 | if not exist elvisutl.mak copy oswin32\elvisutl.mak
18 | if not exist winelvis.mak copy oswin32\winelvis.mak
19 | if not exist wintags.mak copy oswin32\wintags.mak
20 | if not exist config.h copy oswin32\osconfig.h config.h
21 |
22 | echo Compiling text-mode utilities...
23 | nmake /nologo /s /f elvis.mak "CFG=elvis - Win32 Release"
24 | if errorlevel 1 goto Fail
25 | nmake /nologo /s /f elvisutl.mak
26 | if errorlevel 1 goto Fail
27 |
28 | echo Compiling graphical utilities...
29 | nmake /nologo /s /f winelvis.mak CFG="WinElvis - Win32 Release"
30 | if errorlevel 1 goto Fail
31 | nmake /nologo /s /f wintags.mak CFG="WinTags - Win32 Release"
32 | if errorlevel 1 goto Fail
33 | goto Done
34 |
35 | :Clean
36 | if "%OS%"=="Windows_NT" goto Clean_NT
37 | deltree /y winrel
38 | deltree /y guirel
39 | goto Done
40 |
41 | :Clean_NT
42 | for %%i in (WinRel WinDebug GuiRel GuiDebug) do if exist %%i rd /s/q %%i
43 | for %%i in (WinElvis.exe WinTags.exe ctags.exe elvis.exe ex.exe fmt.exe ls.exe ref.exe vi.exe view.exe) do if exist %%i erase %%i
44 | if exist *.pdb erase *.pdb
45 | if exist *.ilk erase *.ilk
46 |
47 | :Fail
48 | :Done
49 |
--------------------------------------------------------------------------------
/debian/elvis-common.README.Debian:
--------------------------------------------------------------------------------
1 | Elvis for Debian
2 | ----------------
3 |
4 | This package contains Elvis 2.2_1.
5 |
6 |
7 | This version of Elvis is inofficial. It is based on the last package
8 | released by Steve Kirkendall in 2004 found on:
9 |
10 | ftp://ftp.cs.pdx.edu/pub/elvis/unreleased/almost-2.2_1.tar.gz
11 |
12 | It contains bugfixes to that version plus numerous patches contribued
13 | by third parties, first of all the Debian maintainers. The code from
14 | which this build was created can be found on this inofficial git
15 | repository at github:
16 |
17 | https://github.com/mbert/elvis
18 |
19 |
20 | Elvis' manual is located in /usr/share/elvis/manual (elvis.html) and you
21 | can read it as well with your browser as with Elvis itself (start Elvis,
22 | type :h and hit Return).
23 |
24 |
25 | If you want to bypass Elvis' global configuration then put your own
26 | setup files into ~/.elvis - see chapter 10 in the manual for further
27 | information. The elvis.ali file includes an alias for this purpose, see
28 | :h customize.
29 | If you just want to change some default settings then creating .elvisrc
30 | in your home directory should suffice (:mkexrc can do this for you).
31 |
32 |
33 | If you use Elvis (the termcap interface) within a dark xterm, you'll
34 | probably get "wrong" colors (e.g. normal text will appear black, so
35 | you can't read it).
36 | You can solve this problem either by setting the background
37 | option to "dark" in your configuration file or by setting the
38 | environment variable ELVISBG to "dark".
39 | Further information: http://georg.f-451.net/elvis/index.html#color
40 |
41 |
42 | This package brings along some icons:
43 | /usr/share/pixmaps/elvis_32x32.xpm (used by the menu system)
44 | /usr/share/elvis/icons/*
45 |
--------------------------------------------------------------------------------
/screen.h:
--------------------------------------------------------------------------------
1 | /* screen.h */
2 |
3 | /* This structure stores information about a strip of rectangles within a
4 | * screen. Each STRIP is either horizontal or vertical. Horizontal STRIPS
5 | * contain either a single WINDOW, or an array of vertical STRIPs; Vertical
6 | * strips contain either a single WINDOW or an array of horizontal STRIPs.
7 | *
8 | * Each screen contains a single top-level strip. A flag in the SCREEN
9 | * structure indicates whether that strip is horizontal or vertical.
10 | * The orientation of any subSTRIPs is implied from this.
11 | */
12 | typedef struct strip_s
13 | {
14 | long width, height; /* size of the strip, as a whole */
15 | long x, y; /* position of the strip within screen */
16 | WINDOW window; /* window, or NULL if strip of windows */
17 | struct strip_s *sub[1]; /* array of subwindows */
18 | } *STRIP;
19 |
20 | /* This is the structure of a SCREEN */
21 | typedef struct screen_s
22 | {
23 | struct screen_s *next; /* some other screen, or NULL */
24 |
25 | GUISCR *guiscr; /* GUI's screen identifier */
26 | STRIP contents; /* list of windows in the screen */
27 | ELVBOOL horizontal; /* is "contents" horizontally tiled? */
28 |
29 | WINDOW active; /* most recent active window in screen */
30 | OPTVAL screenwidth; /* in pixels */
31 | OPTVAL screenheight; /* in pixels */
32 |
33 | } *SCREEN;
34 |
35 | #define o_screenwidth(scr) (scr)->screenwidth.value.number
36 | #define o_screenheight(scr) (scr)->screenheight.value.number
37 |
38 | extern void screencreate P_((GUISCR *guiscr, int width, int height));
39 | extern void screendestroy P_((GUISCR *guiscr));
40 | extern void screenfocus P_((GUISCR *guiscr));
41 | extern void screenkey P_((GUISCR *guiscr, _CHAR_ key));
42 | extern void screenmouse P_((GUISCR *guiscr, int x, int y, int what));
43 |
--------------------------------------------------------------------------------
/data/elvis.clr:
--------------------------------------------------------------------------------
1 | switch gui
2 | case windows
3 | case x11 {
4 | color normal black on gray90
5 | color argument like keyword green or dark green
6 | color bottom like normal
7 | color comment italic dark green or light green
8 | color cursor blue on navyblue
9 | color fixed gray35 or gray80
10 | color function Red4 or pink
11 | color guide white
12 | color hexheading gray70
13 | color hlsearch boxed
14 | color keyword bold
15 | color libt like keyword italic
16 | color lnum gray
17 | color link like formatted underlined blue or light blue
18 | color number Blue4 or light blue
19 | color other like keyword
20 | color prep bold Blue4 or light blue
21 | color prepquote like string
22 | color scroll like tool
23 | color scrollbar like toolbar
24 | color selection on tan
25 | color spell on pink
26 | color status like tool
27 | color statusbar like toolbar
28 | color string tan4 or tan1
29 | color tool black on gray75
30 | color toolbar white on gray40
31 | color variable Gray15 or palegoldenrod
32 | }
33 | case vio
34 | case termcap {
35 | color normal yellow or black
36 | color char like string
37 | color comment italic light green or green
38 | color fixed white or gray
39 | color function light cyan or cyan
40 | color hexheading gray
41 | color hlsearch bold
42 | color keyword bold white or black
43 | color libt like keyword
44 | color lnum gray
45 | color link underlined blue or light cyan
46 | color number light cyan or blue
47 | color other like keyword
48 | color prep bold magenta or blue
49 | color prepquote like string
50 | color regexp like string
51 | color ruler blue or light cyan
52 | color showmode green boxed
53 | color spell red or light magenta
54 | color string white or brown
55 | color variable like normal
56 | }
57 |
--------------------------------------------------------------------------------
/mark.h:
--------------------------------------------------------------------------------
1 | /* mark.h */
2 | /* Copyright 1995 by Steve Kirkendall */
3 |
4 |
5 | typedef struct mark_s
6 | {
7 | struct mark_s *next; /* another mark in the same buffer */
8 | BUFFER buffer; /* the buffer that the mark refers to */
9 | long offset; /* the offset of the char within that buffer */
10 | } *MARK, MARKBUF;
11 |
12 | #define markbuffer(mark) ((mark)->buffer)
13 | #define markoffset(mark) ((mark)->offset)
14 | #define marksetoffset(mark,o) ((mark)->offset = (o))
15 | #define markaddoffset(mark,o) ((mark)->offset += (o))
16 | #define markdup(mark) markalloc(markbuffer(mark), markoffset(mark))
17 | #define marktmp(mbuf, buf, off) ((mbuf).buffer = (buf), (mbuf).offset = (off), &(mbuf))
18 | #define markset(mark,newmark) (marksetbuffer(mark, markbuffer(newmark)), marksetoffset(mark, markoffset(newmark)))
19 |
20 | extern MARK namedmark[26];
21 |
22 | BEGIN_EXTERNC
23 | extern void markadjust P_((MARK from, MARK to, long delta));
24 | extern long markline P_((MARK mark));
25 | extern MARK marksetline P_((MARK mark, long linenum));
26 | #ifdef DEBUG_MARK
27 | #define marksetbuffer(m,b) _marksetbuffer(__FILE__, __LINE__, (m), (b))
28 | extern void _marksetbuffer P_((char *file, int line, MARK mark, BUFFER buffer));
29 | #else
30 | extern void marksetbuffer P_((MARK mark, BUFFER buffer));
31 | #endif
32 | END_EXTERNC
33 |
34 | #ifndef DEBUG_ALLOC
35 | BEGIN_EXTERNC
36 | extern MARK markalloc P_((BUFFER buffer, long offset));
37 | extern void markfree P_((MARK mark));
38 | END_EXTERNC
39 | #else
40 | BEGIN_EXTERNC
41 | extern MARK _markalloc P_((char *file, int line, BUFFER buffer, long offset));
42 | extern void _markfree P_((char *file, int line, MARK mark));
43 | END_EXTERNC
44 | #define markalloc(b,o) _markalloc(__FILE__, __LINE__, b, o)
45 | #define markfree(m) _markfree(__FILE__, __LINE__, m)
46 | #endif
47 |
--------------------------------------------------------------------------------
/data/icons/kde.xpm:
--------------------------------------------------------------------------------
1 | /* XPM */
2 | static char *kde[] = {
3 | /* width height num_colors chars_per_pixel */
4 | " 32 32 18 1",
5 | /* colors */
6 | ". c #000000",
7 | "a c #400040",
8 | "b c #404000",
9 | "c c #404040",
10 | "i c #800080",
11 | "j c #808000",
12 | "k c #808080",
13 | "p c #c000c0",
14 | "q c #c0c000",
15 | "r c #c0c0c0",
16 | "v c #ff00ff",
17 | "y c #ff40c0",
18 | "z c #ffc040",
19 | "B c #ffff00",
20 | "D c #ffff40",
21 | "F c #ffff80",
22 | "G c #ffffc0",
23 | "H c #ffffff",
24 | /* pixels */
25 | "rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr.",
26 | "rkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk.",
27 | "rkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk.",
28 | "rkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk.",
29 | "rkkcckkcckkcckkcckkcckkcckkcckk.",
30 | "................................",
31 | "cpvvvvvvvvva..........vvvvvvvac.",
32 | "cpaivvapvvv............vvvaapac.",
33 | ".pvavvvpvvv............vvvv..a..",
34 | ".pvpvvvpvvv............vvvvvva..",
35 | "cp.vvvvpvv...jBGD.rqq.pvvv.i.ac.",
36 | "cp..vp..vv.c.BBHaHHqB.vvvvvvvac.",
37 | ".pvvvvvvvv.b.HHGHH.HBbBvvv...a..",
38 | ".pvvvvvvvv.b.FHcHHHrHqGzvvaa.a..",
39 | "cpvvvvvvvv.q.HBHHrHq.zByvvvvvac.",
40 | "c............DBGHbHH.vBvvvvvvac.",
41 | ".bBBbqBbbbBrHFGHHrHjpBzvvzvvva..",
42 | ".qBqBbB..bBqHHBc..HbBGByvBBvva..",
43 | "c.BB.B.qBbBbBHHH.qHbvBBvBGByvac.",
44 | "cbBBbbqqqjBbbDcHHDbpvbapvzyvvac.",
45 | ".qBqBbBB.....qB.BbBpv....zvvva..",
46 | "..BB.bBqBrHc.qBB..Bb.....vvvva..",
47 | "c.rcrk.crkrrrkrr.qqjrk...pvvvac.",
48 | "c.H.Hr.cHr.r.rHc.B.b.c...pvvvac.",
49 | "..HcHr.cHrHr.rHcBqB.Hr...pvvva..",
50 | "..HcHcH.HkHr.rHjBq.kr....vvvva..",
51 | "c..........r.rH.BBBr....Bpvvvac.",
52 | "c.............................c."
53 | "rkkcckkcckkcckkcckkcckkcckkcckk.",
54 | "rkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk.",
55 | "rkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk.",
56 | "r...............................",
57 | };
58 |
--------------------------------------------------------------------------------
/osos2/manual-scripts/h2i-guide.cmd:
--------------------------------------------------------------------------------
1 | @echo off
2 | rem *********************************************************************
3 | rem Automatically convert the LCLint documentation from HTML to IPF and
4 | rem then produce an OS/2 INF file.
5 | rem *********************************************************************
6 |
7 | if "%1"=="--no-ed" goto noed
8 | if "%1"=="" goto withed
9 | goto help
10 |
11 | :withed
12 | rem *********************************************************************
13 | rem First fix all HTML files by removing any HREF we don't want to
14 | rem follow.
15 | rem *********************************************************************
16 | if exist ..\..\lib copy ..\..\lib\*
17 |
18 | echo fixing elvis.html...
19 | ed elvis.html nul
23 |
24 | echo fixing the rest (messages disabled)...
25 | for %%i in (*.html) do call fixhtml %%i
26 |
27 | :noed
28 | rem *********************************************************************
29 | rem Now start the converter and produce a (preliminary) IPF file.
30 | rem *********************************************************************
31 | echo creating ipf file...
32 | call html2ipf -SORT- elvis.html elvis.ipf
33 |
34 | rem *********************************************************************
35 | rem Fix the IPF file by removing some stuff that should not be there
36 | rem and then sort the sections. At last run ipfc to produce the INF
37 | rem output.
38 | rem *********************************************************************
39 | echo fixing elvis.ipf...
40 | ed -s elvis.ipf c #71C645144103",
21 | ", c #514455554103",
22 | "< c #410345144103",
23 | "1 c #30C2451430C2",
24 | "2 c #514465955144",
25 | "3 c #30C230C230C2",
26 | " ..... ..X X.. X X.. ....X ....X",
27 | "X.. X X.. X ..X X ..X ..X ..X . ",
28 | " ....X ..X X ..X ..X X.. XX..X X",
29 | "X.. X X.. X X.. X.. X ..X X ..X ",
30 | " ..X X ..X X X.... X X.. X.X ..X",
31 | "X.....X.....X X.. X X.... ....X ",
32 | " X X X XooooooooO+oooooo X X X X",
33 | "X X X X ooooooo@##$oooooX X X X ",
34 | " X X X Xooooooo@o%+ooooo X X X X",
35 | "X X X X oooooooOOOooooooX X X X ",
36 | " X X X Xoooooo#&*=Oooooo X X X X",
37 | "X X X X oooooo&&-=;;ooooX X X X ",
38 | " X X X Xoooooo:#-=;;oooo X X X X",
39 | "X X X X oooooo###-;=ooooX X X X ",
40 | " X X X Xoooooo@@&->>,,+o X X X X",
41 | "X X X X ooooo+#-&-->+O+oX X X X ",
42 | " X X X Xooooo@##&&-;oooo X X X X",
43 | "X X X X ooooo<&:;ooooX X X X ",
44 | " X X X Xooooo$&&-==>oooo X X X X",
45 | "X X X X oooooO:&O--OooooX X X X ",
46 | " X X X Xooooo1:$o,:,oooo X X X X",
47 | "X X X X oooo2:NUL @<<$(PROJ).CRF
61 | ALIAS.OBJ +
62 | $(OBJS_EXT)
63 | $(PROJ).EXE
64 | $(MAPFILE)
65 | d:\msvc15\lib\+
66 | d:\msvc15\mfc\lib\+
67 | $(LIBS)
68 | $(DEFFILE);
69 | <<
70 | link $(LFLAGS) @$(PROJ).CRF
71 |
72 | run: $(PROJ).EXE
73 | $(PROJ) $(RUNFLAGS)
74 |
75 |
76 | $(PROJ).BSC: $(SBRS)
77 | bscmake @<<
78 | /o$@ $(SBRS)
79 | <<
80 |
--------------------------------------------------------------------------------
/data/icons/elvis.xpm:
--------------------------------------------------------------------------------
1 | /* XPM */
2 | static char * elvis_xpm[] = {
3 | "48 32 4 1",
4 | " c #000000000000",
5 | ". c #FFFF0000FFFF",
6 | "X c #FFFFFFFF0000",
7 | "o c #FFFFFFFFFFFF",
8 | " ",
9 | " ",
10 | " ............... ........... ",
11 | " .. ..... ..... ...... . ",
12 | " . . ... . .... ..... . .. ",
13 | " ... ..... .... ...... . ",
14 | " .. ..... ..... .......... ",
15 | " . ..... ..... XXXooo X ..... . . ",
16 | " . ..... ..... XXooXooo XX ...... . . ",
17 | " . . . ... o XXXoooooo XX ........... ",
18 | " ............. X oooXoooo ooXX X..... . ",
19 | " ............. o Xoo ooooooo XXX....... . ",
20 | " ............. X oXoo oooo oo XoXX... . ",
21 | " ............. X ooXooo oo X .XXX......... ",
22 | " oXXXooX ooo ..X.......... ",
23 | " XX XXX XXXX X ooXoXooo ooX .X.....X..... ",
24 | " XXX XXX X X oooXoooooooX .XXX....X..... ",
25 | " XX XXX X X X XoooXo oX XXoXX..XXX.... ",
26 | " XXX XX XXX XX Xooooo XoX .XXX..XXoXX... ",
27 | " XX XXX XX XX XXoooooooX ...X....XXX.... ",
28 | " XXX X X XX XXX XX oooXX .. ...X..... ",
29 | " XX XXX XXX XX XX X .. .X..... ",
30 | " XXX X X XX ooo XXXX XX ....... ",
31 | " o o XX XX ...... ",
32 | " oo o o o o oo oo oooo XXX o o ...... ",
33 | " o o o o o o o ooo XX X o ...... ",
34 | " oo o o o o oo o ooo X XX o o ...... ",
35 | " o o o o o o oo XXX o o ...... ",
36 | " oo oo o o oo o oo XX X o o ....... ",
37 | " o oo XXXX o X ...... ",
38 | " ",
39 | " "};
40 |
--------------------------------------------------------------------------------
/data/icons/elvis1.xpm:
--------------------------------------------------------------------------------
1 | /* XPM */
2 | static char * elvis1_xpm[] = {
3 | "32 32 25 1",
4 | " c #000000000000",
5 | ". c #0000FFFF0000",
6 | "X c #BEFBA6999658",
7 | "o c #082008200000",
8 | "O c #28A230C228A2",
9 | "+ c #00000000FFFF",
10 | "@ c #186110401040",
11 | "# c #104008200820",
12 | "$ c #38E320812081",
13 | "% c #0000FFFFFFFF",
14 | "& c #28A228A21861",
15 | "* c #28A21C711861",
16 | "= c #38E328A22081",
17 | "- c #86177DF78617",
18 | "; c #410338E34103",
19 | ": c #BEFBBEFBCF3C",
20 | "> c #28A2249230C2",
21 | ", c #71C66DB679E7",
22 | "< c #38E330C238E3",
23 | "1 c #4924514438E3",
24 | "2 c #410338E328A2",
25 | "3 c #38E330C228A2",
26 | "4 c #FFFF00000000",
27 | "5 c #30C230C228A2",
28 | "6 c #38E334D330C2",
29 | " .... .... ",
30 | " .. .. . ",
31 | " .. .. .. ... ",
32 | " . X.XXXX..X..XXX. ",
33 | " .XXX..XXX..X..oO.XXXX.. ",
34 | " ..X.XX.+.. ...o...@XX.. . ",
35 | " XX..++....o .o#oo.o++..X ",
36 | " XXXX...++ o@@$.@###oo.+..XX ",
37 | " XX%+%.%++ o@o#&*=--*#-..+XX ",
38 | " XX+%+%+%+ o##@ ;:::-#>+%+XX ",
39 | " XX%+%+%++ #o#@ :::::#-+++XX ",
40 | " XX+%+%+%+ @# ::::,@-+%+XX ",
41 | " XX%+%+%++ #*: ::- --,%+%XX ",
42 | " XX+%+%+++ @@- *----<--+%+XX ",
43 | " XXX+%+%++ @@:: 1---&-+%+XXX ",
44 | " XXX%+%++%+<@>;@::----++%XXX ",
45 | " XX+%++%++ @>*2-:::-%+%+XX ",
46 | " XX+%+%++% 3:3 -::--+++%XX ",
47 | " XX%++++%++;:::44:-+%+%+XX ",
48 | " XX+%+%++% 5 :::-++%+XX ",
49 | " XX+++%+%++ 6 :--++%++XX ",
50 | " XXX+%+%++%+ -++%+++XXX ",
51 | " XX++%++%++++++++%+%XX ",
52 | " XX+++%+++++%+%+++XXX ",
53 | " XX%+%+%++%++++%++XX ",
54 | " XX%+++%+%+%+%++XXX ",
55 | " XX+%+%++%+%++XXX ",
56 | " XX+%+%+%+++XXX ",
57 | " XXX++%+%XXXX ",
58 | " XXX%++XXXX ",
59 | " XXXXXXXX ",
60 | " XXXXXX "};
61 |
--------------------------------------------------------------------------------
/data/icons/presley.xpm:
--------------------------------------------------------------------------------
1 | /* XPM */
2 | static char *presley[] = {
3 | /* width height num_colors chars_per_pixel */
4 | " 32 32 33 1",
5 | /* colors */
6 | ". c #101010",
7 | "# c #202020",
8 | "a c #303030",
9 | "b c #383838",
10 | "c c #424242",
11 | "d c #4b4b4b",
12 | "e c #535353",
13 | "f c #5f5f5f",
14 | "g c #636363",
15 | "h c #707070",
16 | "i c #747474",
17 | "j c #7c7c7c",
18 | "k c #808080",
19 | "l c #9a9a9a",
20 | "m c #a2a2a2",
21 | "n c #a2a2a2",
22 | "o c #a6a6a6",
23 | "p c #aaaaaa",
24 | "q c #afafaf",
25 | "r c #c3c3c3",
26 | "s c #cdcdcd",
27 | "t c #cbcbcb",
28 | "u c #cfcfcf",
29 | "v c #d5d5d5",
30 | "w c #d6d6d6",
31 | "x c #dadada",
32 | "y c #dcdcdc",
33 | "z c #dedede",
34 | "A c #e6e6e6",
35 | "B c #eaeaea",
36 | "C c #fbfbfb",
37 | "D c #fcfcfc",
38 | "E c #ffffff",
39 | /* pixels */
40 | "yxyvyxyvyxyvyxyvyxyvyxyvyxyvyxyv",
41 | "vEEEEECpe.#.#.#.#.#.ajzEzBEEmEsa",
42 | "ychmusd##a######...#.#bABDEEorqa",
43 | "viiee##aa##########.#.#csEEBmEma",
44 | "ymomh###.#.#...#.a##.#.#fDEEqDEa",
45 | "vnlnca#.##a##.#.##a##.#.aBEEmEEa",
46 | "ylkl#a...###.#.#.###.#.##mEEqEEa",
47 | "vnlja#######a#a#a####.#.#clpmEEa",
48 | "yioi###a#a##b#aa#ec#...#.cqlfefa",
49 | "veeg##epsumga##c##mia.###arplnma",
50 | "yedg#cqDEEEtka.afakwk#.#.cqmkmqa",
51 | "veeeagzEEEEEzneamnlEsc###erplnma",
52 | "yece#gBEEEEEBDEABAxEEm##.ghmklqa",
53 | "vgaa#csEEEEEEEEECxzuCEi##gagiaca",
54 | "ymdcacqDEEEEEEEDxroefsqa#g.gh#.a",
55 | "vpeglamBEBzxzxrpeaaaagscei#gi.#a",
56 | "ymciqeqAumkikmqe#iccfmBihl.gh#.a",
57 | "vpeimjrgc###cuzprBrprusimj#gg.#a",
58 | "ymhlqmqmfiqtuDEwBDxwxrqgqg.if#.a",
59 | "vplpmusECuzEEEExzBCBsplgmg#je##a",
60 | "ymqrqmuAEEEEEDEsuABAumkefe#lf#.a",
61 | "vprpmpmuCEEECEExruCxrnic##ane.#a",
62 | "ymqmqmomxABAxEEwqmxtqifc.##lc#.a",
63 | "vnmpmplnsxzxmigcguspmgea#.#ee.#a",
64 | "ymqmqmolqturBAqrxwqmkea#.#.#d#.a",
65 | "vnmnmpmigpsxspmpiginiea.####a.#a",
66 | "yrumqmfcfmutklqtqlumhc.#.#####.a",
67 | "vpspmecegcmpsuljlpmpe##.#######a",
68 | "ymumfeca##cmuwBDBwqlb..#.#.#.##a",
69 | "vnlegnicca#emxzBzulc#.#.#.####aa",
70 | "ygfgklhghe.#alomkgb#.#.#.######a",
71 | "vaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
72 | };
73 |
--------------------------------------------------------------------------------
/data/scripts/match.ex:
--------------------------------------------------------------------------------
1 | " Defines a "match" alias, which moves the cursor to a matching word. The
2 | " lists of matching words can be easily changed.
3 | " Contributed by Ian Utley (iu@apertus.uk.com)
4 |
5 | alias match {
6 | "Move to the line where the pairing keyword is located
7 | local a b d x y i nowrapscan magic magicchar=^$.[* noignorecase
8 | "x and y are lists of matching words -- we'll seek forward from x words
9 | "and backward from y words. The words listed here are appropriate for
10 | "Unix shell scripts.
11 | set x="if/then/case/do/begin/repeat" y="fi/else/esac/done/end/until"
12 | let a=current("word")
13 | if (a == "")
14 | then error Cursor is not on a word
15 | set b=""
16 | while b=="" && x!="."
17 | do {
18 | if a==dirfile(x)
19 | then {
20 | let b=dirfile(y)
21 | set d=forward
22 | }
23 | if a==dirfile(y)
24 | then {
25 | let b=dirfile(x)
26 | set d=backward
27 | }
28 | let x=dirdir(x)
29 | let y=dirdir(y)
30 | }
31 | if ( b=="" )
32 | then error (a) is not a matchable keyword
33 | mark c
34 | set i=1
35 | if (d=="forward")
36 | then {
37 | while ( i != 0 )
38 | do {
39 | set i=0
40 | try eval /\<(b)\>
41 | else {
42 | " Failed to locate a match
43 | 'c
44 | error No matching (b) located
45 | }
46 | mark d
47 | eval 'c,'d global /\<(a)\>/ let i=i+1
48 | eval 'c,'d global /\<(b)\>/ let i=i-1
49 | }
50 | }
51 | if (d=="backward")
52 | then {
53 | while ( i != 0 )
54 | do {
55 | set i=0
56 | try eval ?\<(b)\>
57 | else {
58 | " Failed to find a match
59 | 'c
60 | error No matching (b) located
61 | }
62 | mark d
63 | eval 'd,'c global /\<(a)\>/ let i=i+1
64 | eval 'd,'c global /\<(b)\>/ let i=i-1
65 | " global command has moved cursor back to 'c
66 | 'd
67 | }
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/debian/patches/ft2-nameclash-fix:
--------------------------------------------------------------------------------
1 | Index: elvis-2.2.0/guix11/xdialog.c
2 | ===================================================================
3 | --- elvis-2.2.0.orig/guix11/xdialog.c 2009-03-03 20:44:07.000000000 +0530
4 | +++ elvis-2.2.0/guix11/xdialog.c 2009-03-03 21:10:51.000000000 +0530
5 | @@ -387,7 +387,7 @@
6 | case 'o': ft = FT_ONEOF, limit = scan; break;
7 | case 'n': ft = FT_NUMBER, limit = scan; break;
8 | case 's': ft = FT_STRING; break;
9 | - case 'f': ft = FT_FILE; break;
10 | + case 'f': ft = FT_FILE_; break;
11 | case 'l': ft = FT_LOCKED; break;
12 | }
13 |
14 | @@ -556,7 +556,7 @@
15 | break;
16 |
17 | case FT_STRING:
18 | - case FT_FILE:
19 | + case FT_FILE_:
20 | button = addbutton(dia, "<", 'l', ELVCTRL('L'));
21 | button->y = dia->y0 + dia->rowh * i;
22 | button->x = dia->x0 + 3;
23 | @@ -1111,7 +1111,7 @@
24 | newvalue = keystring(dia, key);
25 | break;
26 |
27 | - case FT_FILE:
28 | + case FT_FILE_:
29 | #ifdef FEATURE_COMPLETE
30 | if (key == '\t')
31 | {
32 | @@ -1179,7 +1179,7 @@
33 | switch (dia->field[row].ft)
34 | {
35 | case FT_STRING:
36 | - case FT_FILE:
37 | + case FT_FILE_:
38 | case FT_NUMBER:
39 | case FT_LOCKED:
40 | drawtext(dia, row);
41 | @@ -1207,7 +1207,7 @@
42 | break;
43 |
44 | case FT_STRING:
45 | - case FT_FILE:
46 | + case FT_FILE_:
47 | if (button->shape == 'l')
48 | if (row == dia->current
49 | ? dia->shift > 0
50 | Index: elvis-2.2.0/guix11/xdialog.h
51 | ===================================================================
52 | --- elvis-2.2.0.orig/guix11/xdialog.h 2009-03-03 20:44:07.000000000 +0530
53 | +++ elvis-2.2.0/guix11/xdialog.h 2009-03-03 21:10:51.000000000 +0530
54 | @@ -5,7 +5,7 @@
55 | FT_ONEOF, /* one of a preset list; includes boolean */
56 | FT_NUMBER, /* numeric field */
57 | FT_STRING, /* string field */
58 | - FT_FILE, /* string field where does filename completion */
59 | + FT_FILE_, /* string field where does filename completion */
60 | FT_LOCKED /* non-editable field */
61 | } X_FIELDTYPE;
62 | typedef struct
63 |
--------------------------------------------------------------------------------
/data/elvis.msg:
--------------------------------------------------------------------------------
1 | # This is a sample "elvis.msg" file, for translating messages. Each line
2 | # contains a terse message followed by a colon, some optional whitespace, and
3 | # whatever text you want to use as the verbose form of that message. Lines
4 | # that start with '#' are ignored simply because no terse messages happen to
5 | # start with '#'. Blank lines are also allowed. The terse forms of most
6 | # messages are listed in the "elvistrs.msg" file.
7 | #------------------------------------------------------------------------------
8 | no match above: Hit top of file without finding a match
9 | no match below: Hit bottom of file without finding a match
10 | $1 is a boolean option: Use "set $1" or "set no$1" to enable or disable $1
11 | termcap needs $1: This termcap entry lacks the :$1: capability
12 | read $1, $2 lines, $3 chars: Read $1(readonly?" [READONLY]"), $2 lines, $3 chars
13 | nothing to fold there: To create a new folded region, you must give a name
14 |
15 | # Some words that are stored as options: True False Submit Cancel Help
16 | Submit:Okay
17 |
18 | # This demonstrates how to cause specific messages to beep, regardless of the
19 | # settings of the "errorbells" and "warningbells" options. This example is
20 | # commented out; delete the initial '#' to activate it.
21 | #------------------------------------------------------------------------------
22 | #wrapped: Wrapped
23 |
24 | # The following shows how to silence a typical error message -- just don't
25 | # have any text after the colon character.
26 | #------------------------------------------------------------------------------
27 | not while in open mode:
28 |
29 | # The following line is used to control the output of the :file command and
30 | # visual ^G command. This is by far the most complex message used by elvis.
31 | #------------------------------------------------------------------------------
32 | (filename)(readonly?" [READONLY]")(modified?" [MODIFIED]")(!edited?" [NOT EDITED]")(newfile?" [NEW FILE]") ($1 * 100 / $2)%:(filename)(readonly?" [READONLY]")(modified?" [MODIFIED]")(!edited?" [NOT EDITED]")(newfile?" [NEW FILE]") line $1 of $2 \(($1*100 / $2)%\)
33 |
--------------------------------------------------------------------------------
/map.h:
--------------------------------------------------------------------------------
1 | /* map.h */
2 | /* Copyright 1995 by Steve Kirkendall */
3 |
4 |
5 | /* The current state of the keystroke mapping queue */
6 | typedef enum
7 | {
8 | MAP_CLEAR, /* not in the middle of any map */
9 | MAP_USER, /* at least 1 unresolved user map */
10 | MAP_KEY /* at least 1 unresolved key map, but no user maps */
11 | } MAPSTATE;
12 |
13 | /* This data type is a bitmap of the following flags. It is used to describe
14 | * when a map takes effect, and how it is interpreted.
15 | */
16 | typedef unsigned int MAPFLAGS;
17 | #define MAP_INPUT 0x0001 /* map when in input mode */
18 | #define MAP_HISTORY 0x0002 /* map when in input on history buffer */
19 | #define MAP_COMMAND 0x0004 /* map when in visual command mode */
20 | #define MAP_MOTION 0x0008 /* map in command mode when motion expected */
21 | #define MAP_SELECT 0x0010 /* map when visible selection is pending */
22 | #define MAP_WHEN 0x00ff /* mask for all of the "map when" bits */
23 | #define MAP_ASCMD 0x0100 /* always execute map as visual commands */
24 | #define MAP_ALL 0x011f /* all of the above */
25 | #define MAP_ABBR 0x0200 /* this is an abbr, not a map */
26 | #define MAP_DISABLE 0x0400 /* disable all maps for next keystroke */
27 | #define MAP_BREAK 0x0800 /* switch from "run" to "step" trace mode */
28 | #define MAP_NOREMAP 0x1000 /* disable remaps for rhs of this map */
29 | #define MAP_NOSAVE 0x2000 /* prevent :mkexrc from saving this map */
30 |
31 | BEGIN_EXTERNC
32 | extern void mapinsert P_((CHAR *rawin, int rawlen, CHAR *cooked, int cooklen, CHAR *label, MAPFLAGS flags, CHAR *mode));
33 | extern ELVBOOL mapdelete P_((CHAR *rawin, int rawlen, MAPFLAGS flags, CHAR *mode, ELVBOOL del, ELVBOOL brk));
34 | extern MAPSTATE mapdo P_((CHAR *keys, int nkeys));
35 | extern void mapunget P_((CHAR *keys, int nkeys, ELVBOOL remap));
36 | extern CHAR *maplist P_((MAPFLAGS flags, CHAR *mode, int *reflen));
37 | extern RESULT maplearn P_((_CHAR_ buf, ELVBOOL starting));
38 | extern CHAR maplrnchar P_((_CHAR_ dflt));
39 | extern ELVBOOL mapbusy P_((void));
40 | extern void mapalert P_((void));
41 | extern CHAR *mapabbr P_((CHAR *bkwd, long *oldptr, long *newptr, ELVBOOL exline));
42 | #ifdef FEATURE_MKEXRC
43 | extern void mapsave P_((BUFFER buf));
44 | #endif
45 | END_EXTERNC
46 |
--------------------------------------------------------------------------------
/event.h:
--------------------------------------------------------------------------------
1 | /* event.h */
2 | /* Copyright 1995 by Steve Kirkendall */
3 |
4 |
5 | typedef enum
6 | {
7 | CLICK_NONE, /* return the clicked cell's offset, but don't move */
8 | CLICK_MOVE, /* move the cursor; if selecting, adjust selection endpoint */
9 | CLICK_SSCHAR, /* don't move, start selecting chars if no sel yet */
10 | CLICK_SSLINE, /* don't move, start selecting lines if no sel yet */
11 | CLICK_SELCHAR, /* move & start selecting characters */
12 | CLICK_SELLINE, /* move & start selecting whole lines */
13 | CLICK_SELRECT, /* move & start selecting a rectangle */
14 | CLICK_CANCEL, /* cancel the selection; don't move cursor */
15 | CLICK_YANK, /* copy selected text to GUI's clipboard; don't move */
16 | CLICK_PASTE, /* copy text from GUI's clipboard; don't move */
17 | CLICK_TAG, /* simulate a keystroke */
18 | CLICK_UNTAG /* simulate a keystroke */
19 | } CLICK;
20 |
21 | typedef enum
22 | {
23 | SCROLL_FWDSCR, /* scroll forward one screen */
24 | SCROLL_BACKSCR, /* scroll backward one screen */
25 | SCROLL_FWDLN, /* scroll forward one line */
26 | SCROLL_BACKLN, /* scroll backward one line */
27 | SCROLL_COLUMN, /* scroll sideways to reveal a column */
28 | SCROLL_PERCENT, /* move cursor to a given percent of the file */
29 | SCROLL_LINE /* move cursor to a given line */
30 | } SCROLL;
31 |
32 | extern long eventcounter;
33 |
34 | BEGIN_EXTERNC
35 | extern void eventupdatecustom P_((ELVBOOL later));
36 | extern ELVBOOL eventcreate P_((GUIWIN *gw, OPTVAL *guivals, char *name, int rows, int columns));
37 | extern void eventdestroy P_((GUIWIN *gw));
38 | extern void eventresize P_((GUIWIN *gw, int rows, int columns));
39 | extern void eventreplace P_((GUIWIN *gw, ELVBOOL freeold, char *name));
40 | extern void eventexpose P_((GUIWIN *gw, int top, int left, int bottom, int right));
41 | extern ELVCURSOR eventdraw P_((GUIWIN *gw));
42 | extern ELVCURSOR eventfocus P_((GUIWIN *gw, ELVBOOL change));
43 | extern long eventclick P_((GUIWIN *gw, int row, int column, CLICK what));
44 | extern MAPSTATE eventkeys P_((GUIWIN *gw, CHAR *key, int nkeys));
45 | extern ELVBOOL eventscroll P_((GUIWIN *gw, SCROLL scroll, long count, long denom));
46 | extern void eventsuspend P_((void));
47 | extern void eventex P_((GUIWIN *gw, char *excmd, ELVBOOL safer));
48 | END_EXTERNC
49 |
--------------------------------------------------------------------------------
/spell.h:
--------------------------------------------------------------------------------
1 | /* spell.h */
2 |
3 | typedef struct spells
4 | {
5 | long flags; /* bitmap of flags for this word */
6 | unsigned short min, max; /* range of legal indicies into link[]*/
7 | struct spells *link[1]; /* array of ptrs to succeeding nodes */
8 | } spell_t;
9 |
10 | typedef enum
11 | {
12 | SPELL_GOOD, SPELL_BAD, SPELL_UNKNOWN, SPELL_INCOMPLETE
13 | } spellresult_t;
14 |
15 | /* These are the possible restrictions on spellchecking. Note that the
16 | * least restrictive comes first, and the most restrictive comes last.
17 | */
18 | typedef enum
19 | {
20 | SPELL_CHECK_ALL, SPELL_CHECK_TAGONLY, SPELL_CHECK_NONE
21 | } spellcheck_t;
22 |
23 | /* some standard flags */
24 | #define SPELL_FLAG_COMPLETE 0x40000000 /* whole word */
25 | #define SPELL_FLAG_BAD 0x20000000 /* bad word */
26 | #define SPELL_FLAG_PERSONAL 0x10000000 /* added via :spell */
27 |
28 | /* a macro for determining whether a given node represents a valid word */
29 | #define SPELL_IS_GOOD(node) ((node) && ((node)->flags & (SPELL_FLAG_COMPLETE|SPELL_FLAG_BAD)) == SPELL_FLAG_COMPLETE)
30 |
31 | /* Functions for managing dictionaries. These are used by descr.c as well as
32 | * the spell-checking feature.
33 | */
34 | spell_t *spellletter P_((spell_t *node, _CHAR_ letter));
35 | spell_t *spellfindword P_((spell_t *node, CHAR *word, int len));
36 | spell_t *spelladdword P_((spell_t *node, CHAR *word, long flags));
37 | void spellfree P_((spell_t *node));
38 |
39 | /* These functions are used only by the spell-checker */
40 | spellresult_t spellcheck P_((MARK mark, ELVBOOL tagonly, long cursoff));
41 | void spellbegin P_((void));
42 | ELVBOOL spellsearch P_((CHAR *word));
43 | void spellend P_((void));
44 | void spellhighlight P_((WINDOW win));
45 | void spellsave P_((BUFFER custom));
46 | void spellfix P_((CHAR *word, CHAR *result, int resultlen, ELVBOOL tagonly));
47 | CHAR *spellshow P_((MARK cursor, _char_ font));
48 | ELVBOOL spellcount P_((MARK cursor, long count));
49 | void spellcheckfont P_((CHAR *fontname, spellcheck_t check, ELVBOOL bang));
50 | void spelltmp P_((int oldfont, int newfont, int combofont));
51 | void spellload P_((char *filename, ELVBOOL personal));
52 | MARK spellnext P_((WINDOW win, MARK curs));
53 |
54 | /* some global variables */
55 | extern spell_t *spelltags;
56 | extern spell_t *spellwords;
57 |
--------------------------------------------------------------------------------
/oswin32/wintags.mak:
--------------------------------------------------------------------------------
1 | # hand-made NMAKE File.
2 |
3 | # Check if the compiler supports single threaded statically linked CRT (-ML),
4 | # and if so, use it. Newer compilers don't, so fall back to -MT (statically
5 | # linked multithreaded.)
6 | !IF [$(CC) -ML 2>&1 | find "D9002" >NUL]==0
7 | CRTFLAG_RELEASE=/MT
8 | !ELSE
9 | CRTFLAG_RELEASE=/ML
10 | !ENDIF
11 |
12 | RC=rc.exe
13 | LD=link.exe
14 | INTDIR=.\GuiRel
15 | INCL=/I "." /I ".." /I "oswin32" /I "..\oswin32" /I "guiwin32"
16 | C_DEFINES=/D _CRT_SECURE_NO_WARNINGS=1 /D _CRT_NONSTDC_NO_WARNINGS=1 /D WIN32
17 | CFLAGS=/nologo $(CRTFLAG_RELEASE) /W3 /O2 /D "NDEBUG" $(C_DEFINES) \
18 | /D "_WINDOWS" /D "GUI_WIN32" /Fo"$(INTDIR)/" $(INCL)
19 | LDFLAGS=kernel32.lib user32.lib /nologo /subsystem:windows /incremental:no
20 | RCFLAGS=/l 0x409 /fo"$(INTDIR)/wintags.res" /d "NDEBUG"
21 | OBJS=$(INTDIR)\wintags.obj $(INTDIR)\wintools.obj $(INTDIR)\ctags.obj \
22 | $(INTDIR)\tag.obj $(INTDIR)\safe.obj $(INTDIR)\wintags.res
23 | HDRS=elvis.h guiwin32\wintools.h config.h elvctype.h version.h oswin32\osdef.h \
24 | safe.h options.h optglob.h session.h lowbuf.h buffer.h mark.h \
25 | buffer2.h options2.h scan.h message.h opsys.h gui.h display.h draw.h \
26 | state.h window.h gui2.h display2.h draw2.h state2.h event.h input.h \
27 | vi.h regexp.h ex.h move.h vicmd.h operator.h cut.h elvisio.h lp.h \
28 | calc.h more.h digraph.h need.h misc.h
29 |
30 | ################################################################################
31 |
32 | all: $(INTDIR) WinTags.exe
33 |
34 | $(INTDIR) :
35 | if not exist $(INTDIR)/nul mkdir $(INTDIR)
36 |
37 | WinTags.exe: $(OBJS)
38 | $(LD) @<<
39 | $(LDFLAGS) /out:WinTags.exe $(OBJS)
40 | <<
41 |
42 | $(INTDIR)\ctags.obj: ctags.c $(HDRS) $(INTDIR)
43 | $(CC) $(CFLAGS) /c ctags.c
44 |
45 | $(INTDIR)\tag.obj: tag.c $(HDRS) $(INTDIR)
46 | $(CC) $(CFLAGS) /c tag.c
47 |
48 | $(INTDIR)\safe.obj: safe.c $(HDRS) $(INTDIR)
49 | $(CC) $(CFLAGS) /c safe.c
50 |
51 | $(INTDIR)\wintags.obj: guiwin32\wintags.c $(HDRS) $(INTDIR)
52 | $(CC) $(CFLAGS) /c guiwin32\wintags.c
53 |
54 | $(INTDIR)\wintools.obj: guiwin32\wintools.c guiwin32\wintools.h $(INTDIR)
55 | $(CC) $(CFLAGS) /c guiwin32\wintools.c
56 |
57 | $(INTDIR)\wintags.res: guiwin32\wintags.rc $(INTDIR)
58 | $(RC) $(RCFLAGS) guiwin32\wintags.rc
59 |
--------------------------------------------------------------------------------
/doc/fmt.man:
--------------------------------------------------------------------------------
1 | .TH FMT 1 "" "" "User commands"
2 | .SH NAME
3 | fmt \- adjust line-length for paragraphs of text
4 | .SH SYNOPSIS
5 | .ad l
6 | .B fmt
7 | .RB [ \-w
8 | .I width
9 | |
10 | .BR \-\fIwidth ]
11 | .RB [ \-s ]
12 | .RB [ \-c ]
13 | .RB [ \-i
14 | .IR chars ]
15 | .RB [ \-C ]
16 | .RB [ \-M ]
17 | .RI [ file ]...
18 | .ad b
19 | .SH VERSION
20 | This page describes the
21 | .B Elvis 2.2_1
22 | version of
23 | .BR fmt .
24 | See
25 | .BR elvis (1).
26 | .SH DESCRIPTION
27 | .B fmt
28 | is a simple text formatter.
29 | It inserts or deletes newlines, as necessary, to make all lines in a
30 | paragraph be approximately the same width.
31 | It preserves indentation and word spacing.
32 | .PP
33 | If you don't name any files on the command line,
34 | then
35 | .B fmt
36 | will read from stdin.
37 | .PP
38 | It is typically used from within
39 | .BR vi (1)
40 | or
41 | .BR elvis (1)
42 | to adjust the line breaks
43 | in a single paragraph.
44 | To do this, move the cursor to the top of the paragraph,
45 | type "!}fmt", and
46 | hit .
47 | .SH OPTIONS
48 | .IP "\fB\-w\fP \fIwidth\fP or \fB\-\fP\fIwidth\fP"
49 | Use a line width of \fIwidth\fP characters instead of the default
50 | of 72 characters.
51 | .IP \fB\-s\fP
52 | Don't join lines shorter than the line width to fill paragraphs.
53 | .IP \fB\-c\fP
54 | Try to be smarter about crown margins.
55 | Specifically, this tells
56 | .B fmt
57 | to expect the first line of each paragraph to have a different
58 | indentation than subsequent lines.
59 | If text from the first input line is wrapped onto the second output line, then
60 | .B fmt
61 | will scan ahead to figure out what indentation it should use for the second
62 | output line, instead of reusing the first line's indentation.
63 | .IP "\fB\-i\fP \fIchars\fP"
64 | Allow the indentation text to include any character from
65 | .IR chars ,
66 | in addition to spaces and tabs.
67 | You should quote the
68 | .I chars
69 | list to protect it from the shell.
70 | .IP "\fB\-C\fP and \fB\-M\fP"
71 | These are shortcuts for combinations of other flags.
72 | .B \-C
73 | is short for
74 | .B "\-c \-i'/*'"
75 | and is useful for reformatting C/C++ comments.
76 | .B \-M
77 | is short for
78 | .B \-i'>'
79 | and is useful for reformatting email messages.
80 | .SH "SEE ALSO"
81 | .BR vi (1),
82 | .BR elvis (1)
83 | .SH AUTHOR
84 | Steve Kirkendall
85 | .br
86 | kirkenda@cs.pdx.edu
87 |
--------------------------------------------------------------------------------
/elvctype.h:
--------------------------------------------------------------------------------
1 | /* elvctype.h */
2 |
3 | #ifdef NEED_CTYPE
4 | # ifndef elvupper
5 | # define ELVCT_UPPER 0x01
6 | # define ELVCT_LOWER 0x02
7 | # define ELVCT_DIGIT 0x04
8 | # define ELVCT_XDIGIT 0x08
9 | # define ELVCT_SPACE 0x10
10 | # define ELVCT_PUNCT 0x20
11 | # define ELVCT_CNTRL 0x40
12 |
13 | # define ELVCT_ALPHA (ELVCT_UPPER|ELVCT_LOWER)
14 | # define ELVCT_ALNUM (ELVCT_ALPHA|ELVCT_DIGIT)
15 | # define ELVCT_GRAPH (ELVCT_ALNUM|ELVCT_PUNCT)
16 |
17 | # define elvupper(c) ((elvct_class[(CHAR)(c)] & ELVCT_UPPER) != 0)
18 | # define elvlower(c) ((elvct_class[(CHAR)(c)] & ELVCT_LOWER) != 0)
19 | # define elvdigit(c) ((elvct_class[(CHAR)(c)] & ELVCT_DIGIT) != 0)
20 | # define elvxdigit(c) ((elvct_class[(CHAR)(c)] & ELVCT_XDIGIT) != 0)
21 | # define elvspace(c) ((elvct_class[(CHAR)(c)] & ELVCT_SPACE) != 0)
22 | # define elvpunct(c) ((elvct_class[(CHAR)(c)] & ELVCT_PUNCT) != 0)
23 | # define elvgraph(c) ((elvct_class[(CHAR)(c)] & ELVCT_GRAPH) != 0)
24 | # define elvcntrl(c) ((elvct_class[(CHAR)(c)] & ELVCT_CNTRL) != 0)
25 | # define elvalpha(c) ((elvct_class[(CHAR)(c)] & ELVCT_ALPHA) != 0)
26 | # define elvalnum(c) ((elvct_class[(CHAR)(c)] & ELVCT_ALNUM) != 0)
27 |
28 | # define setupper(c) (elvct_class[(CHAR)(c)] |= ELVCT_UPPER)
29 | # define setlower(c) (elvct_class[(CHAR)(c)] |= ELVCT_LOWER)
30 | # define setpunct(c) (elvct_class[(CHAR)(c)] |= ELVCT_PUNCT)
31 |
32 | # define clrupper(c) (elvct_class[(CHAR)(c)] &= ~ELVCT_UPPER)
33 | # define clrlower(c) (elvct_class[(CHAR)(c)] &= ~ELVCT_LOWER)
34 | # define clrpunct(c) (elvct_class[(CHAR)(c)] &= ~ELVCT_PUNCT)
35 |
36 | # define elvtoupper(c) elvct_upper[(CHAR)(c)]
37 | # define elvtolower(c) elvct_lower[(CHAR)(c)]
38 |
39 | extern CHAR elvct_upper[256];
40 | extern CHAR elvct_lower[256];
41 | extern CHAR elvct_class[256];
42 |
43 | # endif /* ndef isupper */
44 |
45 | #else /* use the standard macros */
46 | # include
47 | # define elvupper(c) isupper(c)
48 | # define elvlower(c) islower(c)
49 | # define elvdigit(c) isdigit(c)
50 | # define elvxdigit(c) isxdigit(c)
51 | # define elvspace(c) isspace(c)
52 | # define elvpunct(c) ispunct(c)
53 | # define elvgraph(c) isgraph(c)
54 | # define elvcntrl(c) iscntrl(c)
55 | # define elvalpha(c) isalpha(c)
56 | # define elvalnum(c) isalnum(c)
57 | # define elvtoupper(c) toupper(c)
58 | # define elvtolower(c) tolower(c)
59 | #endif /* not NEED_CTYPE */
60 |
--------------------------------------------------------------------------------
/data/elvgdb.ini:
--------------------------------------------------------------------------------
1 | # General pseudo-annotations
2 | elvgdb-default: trace
3 | elvgdb-init: brown fromgdb toelvis
4 | elvgdb-term: fromgdb toelvis
5 | elvgdb-trace: magenta
6 | #elvgdb-trace: fromgdb toelvis table server
7 | #elvgdb-all: trace
8 |
9 | # Prompts
10 | pre-prompt pre-prompt-for-continue pre-query: bold blue
11 | prompt: blue
12 | prompt commands overload-choice query prompt-for-continue: flush server
13 | post-prompt post-prompt-for-continue post-query:
14 |
15 | # Errors
16 | pre-error error-begin: bold red
17 | error:
18 |
19 | # Moving the cursor to the current execution point
20 | source: fromgdb args toelvis
21 |
22 | # Adjusting breakpoints. This is tricky because GDB simply sends us a
23 | # "breakpoints-invalid" message when something changes. To find out what
24 | # changed, we need to force gdb to run an "info breakpoints" command and
25 | # then parse the table that it generates. The result of this parsing will
26 | # be a series of "breakpoints-table" messages, each describing one breakpoint.
27 | # Note that the table may also contain other things like watchpoints.
28 | breakpoints-invalid: fromgdb toelvis limit
29 | breakpoints-table: table
30 | record: record
31 | breakpoints-table-end: toelvis
32 | field0 field1 field3 field5: text bold
33 | breakpoints-headers field2 field4:
34 | field6 field7 field8 field9: red
35 |
36 | # Running state
37 | starting: fromgdb toelvis
38 | stopped:
39 | breakpoint watchpoint: fromgdb args toelvis
40 | signalled signal: fromgdb
41 | signal-name: text
42 | signal-name-end: toelvis
43 | signal-string signal-string-end:
44 | exited: fromgdb args toelvis
45 |
46 | # Listing stack frames
47 | frames-invalid:
48 | frame-begin frame-end:
49 | function-call:
50 | signal-handler-caller:
51 | frame-address frame-address-end:
52 | frame-function-name frame-args arg-end: bold red
53 | frame-source-begin:
54 | frame-source-file frame-source-file-end:
55 | frame-source-line frame-source-end:
56 | frame-where:
57 |
58 | # Displays
59 | display-begin display-number-end display-format:
60 | display-expression display-expression-end display-value: red
61 | display-end:
62 |
63 | # Printed values
64 | value-history-begin value-history-value value-history-end:
65 | value-begin: fromgdb args text
66 | value-end: toelvis
67 | arg-begin arg-name-end arg-value: red
68 | field-begin field-name-end field-value field-end:
69 | array-section-begin elt elt-rep elt-rep-end array-section-end:
70 |
--------------------------------------------------------------------------------
/oswin32/ostext.c:
--------------------------------------------------------------------------------
1 | /* oswin32/ostext.c */
2 |
3 | #include "elvis.h"
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 |
10 | /* the following is defined in oswin32\osdir.c */
11 | extern char *dirnormalize(char *path);
12 |
13 | #ifdef GUI_WIN32
14 | #ifndef O_BINARY
15 | #define O_BINARY _O_BINARY
16 | #endif
17 | #ifndef O_TEXT
18 | #define O_TEXT _O_TEXT
19 | #endif
20 | #endif
21 |
22 | /* This is the fd of the open file */
23 | static int fd;
24 |
25 |
26 | /* Open a text file for reading (if rwa is 'r') or create/overwrite
27 | * a file for writing (if rwa is 'w') or appending (if rwa is 'a').
28 | * When overwriting an existing file, the file's original permissions
29 | * should be preserved. Returns 0 if successful, -1 if no permission,
30 | * -2 if not a regular file (e.g., a directory), or -3 for other errors.
31 | */
32 | int txtopen(char *filename, _char_ rwa, ELVBOOL binary)
33 | {
34 | int flags;
35 |
36 | /* try to open the file */
37 | flags = (binary ? O_BINARY : O_TEXT);
38 | switch (rwa)
39 | {
40 | case 'r': flags |= _O_RDONLY; break;
41 | case 'w': flags |= _O_WRONLY|_O_CREAT|_O_TRUNC; break;
42 | case 'a': flags |= _O_WRONLY|_O_APPEND; break;
43 | }
44 | fd = _open(dirnormalize(filename), flags, 0666);
45 |
46 | /* return a code indicating the success or reason for failure */
47 | if (fd >= 0)
48 | return 0;
49 | else if (errno == EACCES)
50 | return -1;
51 | else if (errno == EISDIR)
52 | return -2;
53 | else
54 | return -3;
55 |
56 | #if 0
57 | /* if supposed to append, then seek to the end of the file */
58 | if (rwa == 'a')
59 | _lseek(fd, 0L, 2);
60 | #endif
61 | }
62 |
63 | /* Close the file that was opened by txtopen(). */
64 | void txtclose(void)
65 | {
66 | _close(fd);
67 | }
68 |
69 | /* Append text to a file which has been opened for writing.
70 | * Returns nbytes if successful, or 0 if the disk is full.
71 | * Should perform any necessary translations for converting
72 | * elvis' idea of text into the local OS's idea of text.
73 | */
74 | int txtwrite(CHAR *buf, int nbytes)
75 | {
76 | return _write(fd, buf, nbytes);
77 | }
78 |
79 | /* Read the next chunk of text from a file. nbytes is the maximum
80 | * number to read. Returns the number of characters actually read
81 | * after any conversions such as CRLF->LF translation.
82 | */
83 | int txtread(CHAR *buf, int nbytes)
84 | {
85 | return _read(fd, buf, nbytes);
86 | }
87 |
--------------------------------------------------------------------------------
/osmsdos/ostext.c:
--------------------------------------------------------------------------------
1 | /* osmsdos/ostext.c */
2 |
3 | #include "elvis.h"
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 |
10 | /* Microsoft has an annoying habit of adding underscores to the front of
11 | * conventional names.
12 | */
13 | #ifndef O_WRONLY
14 | # define O_WRONLY _O_WRONLY
15 | # define O_RDONLY _O_RDONLY
16 | # define O_RDWR _O_RDWR
17 | # define O_CREAT _O_CREAT
18 | # define O_EXCL _O_EXCL
19 | # define O_TRUNC _O_TRUNC
20 | # define O_APPEND _O_APPEND
21 | # define O_BINARY _O_BINARY
22 | # define O_TEXT _O_TEXT
23 | #endif
24 |
25 | /* This is the fd of the open file */
26 | static int fd;
27 |
28 |
29 | /* Open a text file for reading (if rwa is 'r') or create/overwrite
30 | * a file for writing (if rwa is 'w') or appending (if rwa is 'a').
31 | * When overwriting an existing file, the file's original permissions
32 | * should be preserved. Returns 0 if successful, -1 if no permission,
33 | * -2 if not a regular file (e.g., a directory), or -3 for other errors.
34 | */
35 | int txtopen(char *filename, _char_ rwa, ELVBOOL binary)
36 | {
37 | int flags;
38 |
39 | /* try to open the file */
40 | flags = (binary ? O_BINARY : O_TEXT);
41 | switch (rwa)
42 | {
43 | case 'r': flags |= O_RDONLY; break;
44 | case 'w': flags |= O_WRONLY|O_CREAT|O_TRUNC; break;
45 | case 'a': flags |= O_WRONLY|O_APPEND; break;
46 | }
47 | fd = open(filename, flags, 0666);
48 |
49 | /* return a code indicating the success or reason for failure */
50 | if (fd >= 0)
51 | return 0;
52 | else if (errno == EACCES)
53 | return -1;
54 | else if (errno == EISDIR)
55 | return -2;
56 | else
57 | return -3;
58 | #if 0
59 | /* if supposed to append, then seek to the end of the file */
60 | if (rwa == 'a')
61 | lseek(fd, 0L, 2);
62 | #endif
63 | }
64 |
65 | /* Close the file that was opened by txtopen(). */
66 | void txtclose(void)
67 | {
68 | close(fd);
69 | }
70 |
71 | /* Append text to a file which has been opened for writing.
72 | * Returns nbytes if successful, or 0 if the disk is full.
73 | * Should perform any necessary translations for converting
74 | * elvis' idea of text into the local OS's idea of text.
75 | */
76 | int txtwrite(CHAR *buf, int nbytes)
77 | {
78 | return write(fd, buf, nbytes);
79 | }
80 |
81 | /* Read the next chunk of text from a file. nbytes is the maximum
82 | * number to read. Returns the number of characters actually read
83 | * after any conversions such as CRLF->LF translation.
84 | */
85 | int txtread(CHAR *buf, int nbytes)
86 | {
87 | return read(fd, buf, nbytes);
88 | }
89 |
--------------------------------------------------------------------------------
/osunix/ostext.c:
--------------------------------------------------------------------------------
1 | /* unix/ostext.c */
2 |
3 | #include
4 | #include
5 | #include
6 | #include
7 | #include "elvis.h"
8 | #ifdef FEATURE_RCSID
9 | char id_ostext[] = "$Id: ostext.c,v 2.9 2003/10/17 17:41:23 steve Exp $";
10 | #endif
11 |
12 |
13 | /* This is the filedescriptor of the file being read */
14 | static int fd;
15 |
16 | /* Open a text file for reading (if rwa is 'r') or create/overwrite
17 | * a file for writing (if rwa is 'w') or appending (if rwa is 'a').
18 | * When overwriting an existing file, the file's original permissions
19 | * should be preserved. Returns 0 if successful, -1 if no permission,
20 | * -2 if not a regular file (e.g., a directory), or -3 for other errors.
21 | */
22 | int txtopen(filename, rwa, binary)
23 | char *filename; /* name of file */
24 | _char_ rwa; /* 'r'=read, 'w'=write, 'a'=append */
25 | ELVBOOL binary; /* (ignored, except under Cygwin) */
26 | {
27 | int mode = 0;
28 |
29 | assert(rwa == 'r' || rwa == 'w' || rwa == 'a');
30 | switch (rwa)
31 | {
32 | case 'r': mode = O_RDONLY; break;
33 | case 'w': mode = O_WRONLY|O_TRUNC|O_CREAT; break;
34 | case 'a': mode = O_WRONLY|O_APPEND; break;
35 | }
36 | #ifdef O_BINARY
37 | if (binary)
38 | mode |= O_BINARY;
39 | #else
40 | # ifdef _O_BINARY
41 | if (binary)
42 | mode |= _O_BINARY;
43 | # endif
44 | #endif
45 |
46 | fd = open(filename, mode, 0666);
47 | if (fd < 0)
48 | {
49 | if (errno == EPERM || errno == EACCES)
50 | return -1;
51 | else if (errno == EISDIR)
52 | return -2;
53 | else
54 | return -3;
55 | }
56 | return 0;
57 | }
58 |
59 | /* Close the file that was opened by txtopen(). */
60 | void txtclose()
61 | {
62 | close(fd);
63 | }
64 |
65 | /* Append text to a file which has been opened for writing.
66 | * Returns nbytes if successful, or 0 if the disk is full.
67 | * Should perform any necessary translations for converting
68 | * elvis' idea of text into the local OS's idea of text.
69 | */
70 | int txtwrite(buf, nbytes)
71 | CHAR *buf; /* buffer, holds text to be written */
72 | int nbytes; /* number of characters to bewritten */
73 | {
74 | return write(fd, buf, (size_t)nbytes);
75 | }
76 |
77 | /* Read the next chunk of text from a file. nbytes is the maximum
78 | * number to read. Returns the number of characters actually read
79 | * after any conversions such as CRLF->LF translation.
80 | */
81 | int txtread(buf, nbytes)
82 | CHAR *buf; /* buffer where text should be read into */
83 | int nbytes; /* maximum number of bytes to read */
84 | {
85 | return read(fd, buf, (size_t)nbytes);
86 | }
87 |
--------------------------------------------------------------------------------
/data/scripts/likevim.ex:
--------------------------------------------------------------------------------
1 | " This file creates some aliases and maps that make elvis work more like vim
2 |
3 | " Some variations of the :map and :unmap commands
4 | alias nmap map command
5 | alias nm map command
6 | alias vmap map select
7 | alias vm map select
8 | alias omap map motion
9 | alias om map motion
10 | alias imap map input
11 | alias im map input
12 | alias cmap map history
13 | alias cm map history
14 | alias noremap map!? noremap
15 | alias nore map!? noremap
16 | alias nnoremap map noremap command
17 | alias nn map noremap command
18 | alias vnoremap map noremap select
19 | alias vn map noremap select
20 | alias inoremap map noremap input
21 | alias ino map noremap input
22 | alias cnoremap map noremap history
23 | alias cno map noremap history
24 | alias nunmap unmap command
25 | alias nun unmap command
26 | alias vunmap unmap select
27 | alias vu unmap select
28 | alias ounmap unmap motion
29 | alias ou unmap motion
30 | alias iunmap unmap input
31 | alias iu unmap unput
32 | alias cunmap unmap history
33 | alias cu unmap history
34 |
35 | " Some redundant commands that work on visibly selected text
36 | map noremap select r g=
37 | map noremap select x d
38 | map noremap select U noremap gU
39 | map noremap select u noremap gu
40 | map noremap select ~ noremap g~
41 | map noremap select J :j
42 | map noremap select gJ :j!
43 | map noremap select y:ta
44 | map noremap select o g%
45 | map noremap select O g
46 | "map noremap select R S ... except that "vS" isn't implemented yet
47 |
48 | " Some 'g' commands that aren't built in to elvis
49 | map g# yiw??w
50 | map g* yiw//w
51 | map gf :eval find (current(/[^[:space:]<>"]*/))
52 | map gm :eval normal (columns/2+1;char(124))
53 | map go
54 |
55 | " Some '^W" commands that aren't built in to elvis
56 | map f :eval sfind (current(/[^[:space:]<>"]*/))
57 |
58 | " A few miscellaneous vim commands
59 | alias find {
60 | " Locate a file in 'includepath', and then edit it
61 | local elvispath f
62 | if "!*" == ""
63 | then error cursor not on file name
64 | let elvispath=includepath
65 | let f=elvispath("!*")
66 | if f == ""
67 | then error "!*" not found in includepath
68 | else e!? (f)
69 | }
70 | alias fin find
71 | alias sfind {
72 | " Locate a file in 'includepath', and then split it
73 | local elvispath f
74 | if "!*" == ""
75 | then error cursor not on file name
76 | let elvispath=includepath
77 | let f=elvispath("!*")
78 | if f == ""
79 | then error "!*" not found in includepath
80 | else sp (f)
81 | }
82 | alias sf sfind
83 | alias sview split +"se ro"
84 | alias sv sview
85 | alias update {
86 | " Write a file, but only if modified
87 | if modified
88 | then !%write!? !*
89 | }
90 | alias up !%update!?
91 |
--------------------------------------------------------------------------------
/data/scripts/makehtml.ex:
--------------------------------------------------------------------------------
1 | " Defines makehtml alias to convert plain text to HTLM source
2 |
3 | alias makehtml {
4 | "Convert plain text to HTML source
5 | local report=0 m=text n=text b=false magic magicchar=^$.[* noignorecase
6 | "
7 | " m is current line mode -- one of "text", "pre", "ol", or "ul"
8 | " n is next line mode
9 | " b is a flag for detecting series of blank lines.
10 | "
11 | " For each line...
12 | !%g /^/ {
13 | " Protect characters which are special to HTML
14 | try s/&/\&/g
15 | try s/\</g
16 | try s/>/\>/g
17 | "
18 | " Convert uppercase lines into headings
19 | try s/^[A-Z0-9][A-Z0-9-.) ]*$/&<\/h1>/
20 | then set n=text
21 | "
22 | " Convert horizontal lines into
tags
23 | try s/^\s*[-=]\{10,}\s*$/
/
24 | then set n=text
25 | "
26 | " Try to be clever about finding links
27 | try s/http:[^">, )]\+/&<\/a>/g
28 | try s/ftp:[^">, )]\+/&<\/a>/g
29 | try s/[a-zA-Z]\w*@[a-zA-Z][[:alnum:].-]\+/&<\/a>/g
30 | "
31 | " Convert asterisked lines into "ul" list items.
32 | try s/^\s*\* */
33 | then set n=ul
34 | else {
35 | if m=="ul"
36 | then try s/^[^* ]/set n=text/x
37 | }
38 | "
39 | " Convert numbered lines (other than headings) into "ol" list items.
40 | try s/^\s*\d\+[.)] */
41 | then set n=ol
42 | else {
43 | if m=="ol"
44 | then try s/^[^0-9 ]/set n=text/x
45 | }
46 | "
47 | " if in normal text, then assume indented text is preformatted.
48 | if n=="text"
49 | then try s/^\s/set n=pre/x
50 | "
51 | " if in preformatted mode, then unindented lines revert to text mode
52 | if m=="pre" && n=="pre"
53 | then try s/^\S/set n=text/x
54 | "
55 | " Any non-blank line turns off the "b" flag.
56 | try s/./set b=false/x
57 | "
58 | " if not in preformatted text, then blank lines are paragraph breaks.
59 | " Avoid consecutive tags, though.
60 | if m!="pre" && b=="false"
61 | then {
62 | try s/^$/
/
63 | then set b=true
64 | }
65 | "
66 | " if mode switched, then add tags for that.
67 | if m!=n
68 | then {
69 | if m!="text"
70 | then eval i (m)>
71 | if n!="text"
72 | then eval i <(n)>
73 | let m=n
74 | set b=false
75 | }
76 | }
77 | "
78 | " if not in text mode, then terminate the mode
79 | if m != "text"
80 | then eval !> a (m)>
81 | "
82 | " If converting the whole file, then add ...
83 | if "!%" == ""
84 | then {
85 | $a
86 | eval 1i
(htmlsafe(filename))
87 | "
88 | " minor conveniences...
89 | set bufdisplay=html mapmode=html
90 | display html
91 | if filename != "" && tolower(dirext(filename) << 4) != ".htm"
92 | then eval file (dirdir(filename)/basename(filename)).html
93 | }
94 | }
95 |
--------------------------------------------------------------------------------
/opsys.h:
--------------------------------------------------------------------------------
1 | /* opsys.h */
2 | /* Copyright 1995 by Steve Kirkendall */
3 |
4 |
5 |
6 | typedef enum
7 | {
8 | DIR_INVALID, /* malformed filename (can't happen with UNIX) */
9 | DIR_BADPATH, /* unable to check file */
10 | DIR_NOTFILE, /* file exists but is neither normal nor directory */
11 | DIR_DIRECTORY, /* file is a directory */
12 | DIR_NEW, /* file doesn't exist yet */
13 | DIR_UNREADABLE, /* file exists but is unreadable */
14 | DIR_READONLY, /* file is readable but not writable */
15 | DIR_READWRITE /* file is readable and writable. */
16 | } DIRPERM;
17 |
18 | BEGIN_EXTERNC
19 | extern ELVBOOL blkopen P_((ELVBOOL force, BLK *buf));
20 | extern void blkclose P_((BLK *buf));
21 | extern void blkwrite P_((BLK *buf, _BLKNO_ blkno));
22 | extern void blkread P_((BLK *buf, _BLKNO_ blkno));
23 | extern void blksync P_((void));
24 |
25 | extern char *dirfirst P_((char *wildexpr, ELVBOOL ispartial));
26 | extern char *dirnext P_((void));
27 | extern ELVBOOL diriswild P_((char *wildexpr));
28 | extern ELVBOOL dirwildcmp P_((char *fname, char *wild));
29 | extern DIRPERM dirperm P_((char *filename));
30 | extern char *dirdir P_((char *pathname));
31 | extern char *dirfile P_((char *pathname));
32 | extern char *dirtime P_((char *filename));
33 | extern char *dirpath P_((char *dir, char *file));
34 | extern char *dircwd P_((void));
35 | extern ELVBOOL dirchdir P_((char *pathname));
36 |
37 | extern ELVBOOL prgopen P_((char *command, ELVBOOL willwrite, ELVBOOL willread));
38 | extern int prgwrite P_((CHAR *buf, int nbytes));
39 | extern ELVBOOL prggo P_((void));
40 | extern int prgread P_((CHAR *buf, int nbytes));
41 | extern int prgclose P_((void));
42 |
43 | extern int txtopen P_((char *filename, _char_ rwa, ELVBOOL binary));
44 | extern void txtclose P_((void));
45 | extern int txtwrite P_((CHAR *buf, int nbytes));
46 | extern int txtread P_((CHAR *buf, int nbytes));
47 |
48 | #if defined(PROTOCOL_HTTP) || defined(PROTOCOL_FTP)
49 | typedef struct
50 | {
51 | int fd; /* file descriptor of a socket to read from */
52 | int left; /* number of chars used from buf */
53 | int right; /* total number of chars in buf */
54 | char buf[4096]; /* buffer */
55 | } sockbuf_t;
56 |
57 | #define netbuffer(sb) ((sb)->buf + (sb)->left)
58 | #define netbytes(sb) ((sb)->right - (sb)->left)
59 | #define netconsume(sb, n) ((sb)->left += (n))
60 |
61 | sockbuf_t *netconnect P_((char *site_port, unsigned int defport));
62 | void netdisconnect P_((sockbuf_t *sb));
63 | ELVBOOL netread P_((sockbuf_t *sb));
64 | char *netgetline P_((sockbuf_t *sb));
65 | ELVBOOL netwrite P_((sockbuf_t *sb, char *data, int len));
66 | ELVBOOL netputline P_((sockbuf_t *sb, char *command, char *arg1, char *arg2));
67 | char *netself P_((void));
68 | #endif
69 |
70 | #ifdef OSINIT
71 | extern void osinit P_((char *argv0));
72 | #endif
73 |
74 | #if ANY_UNIX
75 | extern char *expanduserhome P_((char *pathname, char *dest));
76 | #endif
77 |
78 | END_EXTERNC
79 |
--------------------------------------------------------------------------------
/osmsdos/fmt.mak:
--------------------------------------------------------------------------------
1 | # Microsoft Visual C++ generated build script - Do not modify
2 |
3 | PROJ = FMT
4 | DEBUG = 0
5 | PROGTYPE = 6
6 | CALLER =
7 | ARGS =
8 | DLLS =
9 | D_RCDEFINES = -d_DEBUG
10 | R_RCDEFINES = -dNDEBUG
11 | ORIGIN = MSVC
12 | ORIGIN_VER = 1.00
13 | PROJPATH = .\
14 | USEMFC = 0
15 | CC = cl
16 | CPP = cl
17 | CXX = cl
18 | CCREATEPCHFLAG =
19 | CPPCREATEPCHFLAG =
20 | CUSEPCHFLAG =
21 | CPPUSEPCHFLAG =
22 | FIRSTC = FMT.C
23 | FIRSTCPP =
24 | RC = rc
25 | CFLAGS_D_DEXE = /nologo /G2 /Zi /Od /D "_DEBUG" /D "_DOS" /I "osmsdos" /I "." /FR /Fd"FMT.PDB"
26 | CFLAGS_R_DEXE = /nologo /Gs /G2 /Ox /D "NDEBUG" /D "_DOS" /I "osmsdos" /I "."
27 | LFLAGS_D_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /CO /STACK:5120
28 | LFLAGS_R_DEXE = /NOLOGO /ONERROR:NOEXE /NOI /STACK:5120
29 | LIBS_D_DEXE = oldnames slibce
30 | LIBS_R_DEXE = oldnames slibce
31 | RCFLAGS = /nologo
32 | RESFLAGS = /nologo
33 | RUNFLAGS =
34 | OBJS_EXT =
35 | LIBS_EXT =
36 | !if "$(DEBUG)" == "1"
37 | CFLAGS = $(CFLAGS_D_DEXE)
38 | LFLAGS = $(LFLAGS_D_DEXE)
39 | LIBS = $(LIBS_D_DEXE)
40 | MAPFILE = nul
41 | RCDEFINES = $(D_RCDEFINES)
42 | !else
43 | CFLAGS = $(CFLAGS_R_DEXE)
44 | LFLAGS = $(LFLAGS_R_DEXE)
45 | LIBS = $(LIBS_R_DEXE)
46 | MAPFILE = nul
47 | RCDEFINES = $(R_RCDEFINES)
48 | !endif
49 | !if [if exist MSVC.BND del MSVC.BND]
50 | !endif
51 | SBRS = FMT.SBR
52 |
53 |
54 | FMT_DEP = .\config.h \
55 | .\elvis.h \
56 | .\elvctype.h \
57 | .\version.h \
58 | .\safe.h \
59 | .\options.h \
60 | .\optglob.h \
61 | .\session.h \
62 | .\lowbuf.h \
63 | .\message.h \
64 | .\buffer.h \
65 | .\mark.h \
66 | .\buffer2.h \
67 | .\options2.h \
68 | .\scan.h \
69 | .\opsys.h \
70 | .\map.h \
71 | .\gui.h \
72 | .\display.h \
73 | .\draw.h \
74 | .\state.h \
75 | .\window.h \
76 | .\gui2.h \
77 | .\display2.h \
78 | .\draw2.h \
79 | .\state2.h \
80 | .\event.h \
81 | .\input.h \
82 | .\vi.h \
83 | .\regexp.h \
84 | .\ex.h \
85 | .\move.h \
86 | .\vicmd.h \
87 | .\operator.h \
88 | .\cut.h \
89 | .\elvisio.h \
90 | .\lp.h \
91 | .\calc.h \
92 | .\more.h \
93 | .\digraph.h \
94 | .\tag.h \
95 | .\tagsrch.h \
96 | .\tagelvis.h \
97 | .\need.h \
98 | .\misc.h
99 |
100 |
101 | all: $(PROJ).EXE
102 |
103 | FMT.OBJ: FMT.C $(FMT_DEP)
104 | $(CC) $(CFLAGS) $(CCREATEPCHFLAG) /c FMT.C
105 |
106 | $(PROJ).EXE:: FMT.OBJ $(OBJS_EXT) $(DEFFILE)
107 | echo >NUL @<<$(PROJ).CRF
108 | FMT.OBJ +
109 | $(OBJS_EXT)
110 | $(PROJ).EXE
111 | $(MAPFILE)
112 | d:\msvc15\lib\+
113 | d:\msvc15\mfc\lib\+
114 | $(LIBS)
115 | $(DEFFILE);
116 | <<
117 | link $(LFLAGS) @$(PROJ).CRF
118 |
119 | run: $(PROJ).EXE
120 | $(PROJ) $(RUNFLAGS)
121 |
122 |
123 | $(PROJ).BSC: $(SBRS)
124 | bscmake @<<
125 | /o$@ $(SBRS)
126 | <<
127 |
--------------------------------------------------------------------------------
/display2.h:
--------------------------------------------------------------------------------
1 | /* display2.h */
2 | /* Copyright 1995 by Steve Kirkendall */
3 |
4 | /* Define DISPLAY_ANYMARKUP if any markup modes are used */
5 | #ifndef DISPLAY_ANYMARKUP
6 | # if defined(DISPLAY_HTML) || defined(DISPLAY_MAN) || defined(DISPLAY_TEX)
7 | # define DISPLAY_ANYMARKUP
8 | # endif
9 | #endif
10 |
11 | /* Define DISPLAY_ANYDESCR if any markup or syntax modes are used */
12 | #ifndef DISPLAY_ANYDESCR
13 | # if defined(DISPLAY_SYNTAX) || defined(DISPLAY_ANYMARKUP)
14 | # define DISPLAY_ANYDESCR
15 | # endif
16 | #endif
17 |
18 | struct dispmode_s
19 | {
20 | char *name;
21 | char *desc;
22 | ELVBOOL canopt;
23 | ELVBOOL wordwrap;
24 | int nwinopts;
25 | OPTDESC *winoptd;
26 | int nglobopts;
27 | OPTDESC *globoptd;
28 | OPTVAL *globoptv;
29 | DMINFO *(*init) P_((WINDOW win));
30 | void (*term) P_((DMINFO *info));
31 | long (*mark2col) P_((WINDOW w, MARK mark, ELVBOOL cmd));
32 | MARK (*move) P_((WINDOW w, MARK from, long linedelta, long column, ELVBOOL cmd));
33 | MARK (*wordmove) P_((MARK from, long count, ELVBOOL backward, ELVBOOL whitespace));
34 | MARK (*setup) P_((WINDOW w, MARK top, long cursor, MARK bottom, DMINFO *info));
35 | MARK (*image) P_((WINDOW w, MARK line, DMINFO *info,
36 | void (*draw)(CHAR *p, long qty, _char_ font, long offset)));
37 | void (*header) P_((WINDOW w, int pagenum, DMINFO *info,
38 | void (*draw)(CHAR *p, long qty, _char_ font, long offset)));
39 | void (*indent) P_((WINDOW w, MARK line, long linedelta));
40 | CHAR *(*tagatcursor) P_((WINDOW win, MARK cursor));
41 | MARK (*tagload) P_((CHAR *tagname, MARK from));
42 | MARK (*tagnext) P_((MARK cursor));
43 | };
44 |
45 | extern DISPMODE dmnormal;
46 | #ifdef DISPLAY_HEX
47 | extern DISPMODE dmhex;
48 | #endif
49 | #ifdef DISPLAY_HTML
50 | extern DISPMODE dmhtml;
51 | #endif
52 | #ifdef DISPLAY_MAN
53 | extern DISPMODE dmman;
54 | #endif
55 | #ifdef DISPLAY_TEX
56 | extern DISPMODE dmtex;
57 | #endif
58 | #ifdef DISPLAY_SYNTAX
59 | extern DISPMODE dmsyntax;
60 | #endif
61 | extern DISPMODE *allmodes[];
62 |
63 | BEGIN_EXTERNC
64 | extern void displist P_((WINDOW win));
65 | extern ELVBOOL dispset P_((WINDOW win, char *newmode));
66 | extern void dispinit P_((ELVBOOL before));
67 | extern void dispoptions P_((DISPMODE *mode, DMINFO *info));
68 | extern MARK dispmove P_((WINDOW win, long linedelta, long wantcol));
69 | extern long dispmark2col P_((WINDOW win));
70 | extern void dispindent P_((WINDOW w, MARK line, long linedelta));
71 |
72 | #ifdef DISPLAY_ANYMARKUP
73 | extern void dmmuadjust P_((MARK from, MARK to, long delta));
74 | #endif
75 | #ifdef DISPLAY_SYNTAX
76 | extern CHAR dmspreprocessor P_((WINDOW win));
77 | extern ELVBOOL dmskeyword P_((WINDOW win, CHAR *word));
78 | # ifdef FEATURE_SMARTARGS
79 | extern void dmssmartargs P_((WINDOW win));
80 | # endif
81 | #endif
82 | extern int dmnlistchars P_((_CHAR_ ch, long offset, long col, short *tabstop, void(*draw)(CHAR *p, long qty, _char_ font, long offset)));
83 |
84 |
85 | END_EXTERNC
86 |
--------------------------------------------------------------------------------
/autocmd.h:
--------------------------------------------------------------------------------
1 | /* autocmd.h */
2 |
3 | #ifdef FEATURE_AUTOCMD
4 |
5 | /* The following symbolic constants may be passed to auperform() to trigger
6 | * auto-commands. The values here correspond to indicies into the nametbl[]
7 | * array in autocmd.c -- if you change one, then you should change the other
8 | * to keep them in sync.
9 | */
10 | typedef enum {
11 | AU_ALL_EVENTS = 0,
12 | AU_NONOPTION_EVENTS,
13 | AU_BUFCREATE,
14 | AU_BUFDELETE,
15 | AU_BUFENTER,
16 | AU_BUFFILEPOST,
17 | AU_BUFFILEPRE,
18 | AU_BUFHIDDEN,
19 | AU_BUFLEAVE,
20 | AU_BUFNEWFILE,
21 | AU_BUFREAD, /* same as AU_BUFREADPOST */
22 | AU_BUFREADPOST,
23 | AU_BUFREADPRE,
24 | AU_BUFUNLOAD,
25 | AU_BUFWRITE, /* same as AU_BUFWRITEPRE */
26 | AU_BUFWRITEPOST,
27 | AU_BUFWRITEPRE,
28 | AU_FILEAPPENDPOST,
29 | AU_FILEAPPENDPRE,
30 | AU_FILECHANGEDSHELL,
31 | AU_FILEREADPOST,
32 | AU_FILEREADPRE,
33 | AU_FILEWRITEPOST,
34 | AU_FILEWRITEPRE,
35 | AU_FILTERREADPOST,
36 | AU_FILTERREADPRE,
37 | AU_FILTERWRITEPOST,
38 | AU_FILTERWRITEPRE,
39 | AU_STDINREADPOST,
40 | AU_STDINREADPRE,
41 | AU_ALIASENTER,
42 | AU_ALIASLEAVE,
43 | AU_BGCHANGED,
44 | AU_CURSORHOLD,
45 | AU_DISPLAYENTER,
46 | AU_DISPLAYLEAVE,
47 | AU_DISPMAPENTER,
48 | AU_DISPMAPLEAVE,
49 | AU_EDIT,
50 | AU_FILEENCODING,
51 | AU_FILETYPE,
52 | AU_FOCUSGAINED,
53 | AU_FOCUSLOST,
54 | AU_GUIENTER,
55 | AU_OPTCHANGED,
56 | AU_OPTSET,
57 | AU_SCRIPTENTER,
58 | AU_SCRIPTLEAVE,
59 | AU_SYNTAX,
60 | AU_TERMCHANGED,
61 | AU_USER,
62 | AU_VIMENTER,
63 | AU_VIMLEAVE,
64 | AU_VIMLEAVEPRE,
65 | AU_WINENTER,
66 | AU_WINLEAVE,
67 | AU_USER01,
68 | AU_USER02,
69 | AU_USER03,
70 | AU_USER04,
71 | AU_USER05,
72 | AU_USER06,
73 | AU_USER07,
74 | AU_USER08,
75 | AU_USER09,
76 | AU_USER10,
77 | AU_USER11,
78 | AU_USER12,
79 | AU_USER13,
80 | AU_USER14,
81 | AU_USER15,
82 | AU_USER16,
83 | AU_USER17,
84 | AU_USER18,
85 | AU_USER19,
86 | AU_USER20,
87 | AU_USER21,
88 | AU_USER22,
89 | AU_USER23,
90 | AU_USER24,
91 | AU_USER25,
92 | AU_USER26,
93 | AU_USER27,
94 | AU_USER28,
95 | AU_USER29,
96 | AU_USER30,
97 | AU_QTY_EVENTS, /* number of events in nametbl[] */
98 | AU_NO_EVENT /* not a valid event code */
99 | } auevent_t;
100 |
101 | extern MARK autop, aubottom;
102 | extern ELVBOOL aubusy;
103 |
104 | extern RESULT ex_auevent P_((EXINFO *xinf));
105 | extern RESULT ex_augroup P_((EXINFO *xinf));
106 | extern RESULT ex_autocmd P_((EXINFO *xinf));
107 | extern RESULT ex_doautocmd P_((EXINFO *xinf));
108 | extern RESULT auperform P_((WINDOW win, ELVBOOL bang, CHAR *groupname, auevent_t event, CHAR *filename));
109 | extern void audispmap P_((void));
110 | extern CHAR *auname P_((CHAR *name));
111 |
112 | # ifdef FEATURE_MKEXRC
113 | extern void ausave P_((BUFFER custom));
114 | # endif
115 |
116 | # ifdef FEATURE_COMPLETE
117 | extern CHAR *aucomplete P_((WINDOW win, MARK from, MARK to));
118 | # endif
119 |
120 |
121 | #endif /* not FEATURE_AUTOCMD */
122 |
--------------------------------------------------------------------------------
/scan.h:
--------------------------------------------------------------------------------
1 | /* scan.h */
2 | /* Copyright 1995 by Steve Kirkendall */
3 |
4 |
5 |
6 | /* The following linked list of structs is used to store scan contexts.
7 | * It is declared publicly only for the sake of the macros; no other modules
8 | * are expected to access it directly.
9 | */
10 | extern struct scan_s
11 | {
12 | struct scan_s *next;
13 | BUFFER buffer; /* the buffer being scanned */
14 | _BLKNO_ bufinfo; /* the blkinfo block of the buffer being scanned */
15 | _BLKNO_ blkno; /* block number of currently locked CHARS block, or 0 */
16 | CHAR *leftedge; /* pointer to leftmost locked char */
17 | CHAR *rightedge; /* pointer to char after rightmost locked char */
18 | CHAR **ptr; /* the pointer associated with this scan context */
19 | long leoffset; /* offset of left edge */
20 | #ifdef DEBUG_SCAN
21 | char *file;
22 | int line;
23 | #endif
24 | } *scan__top;
25 | extern MARKBUF scan__markbuf;
26 |
27 |
28 |
29 | #ifndef DEBUG_SCAN
30 | BEGIN_EXTERNC
31 | extern CHAR *scanalloc P_((CHAR **cp, MARK start));
32 | extern CHAR *scanstring P_((CHAR **cp, CHAR *str));
33 | extern CHAR *scandup P_((CHAR **cp, CHAR **oldp));
34 | END_EXTERNC
35 | #else
36 | # define scanalloc(cp, start) _scanalloc(__FILE__, __LINE__, (cp), (start))
37 | # define scanstring(cp, str) _scanstring(__FILE__, __LINE__, (cp), (str))
38 | # define scandup(cp, oldp) _scandup(__FILE__, __LINE__, (cp), (oldp))
39 | BEGIN_EXTERNC
40 | extern CHAR *_scanalloc P_((char *file, int line, CHAR **cp, MARK start));
41 | extern CHAR *_scanstring P_((char *file, int line, CHAR **cp, CHAR *str));
42 | extern CHAR *_scandup P_((char *file, int line, CHAR **cp, CHAR **oldp));
43 | END_EXTERNC
44 | #endif
45 |
46 |
47 |
48 | #ifndef DEBUG_SCAN
49 |
50 | # define scanprev(cp) (scan__top->leftedge < *(cp) ? --*(cp) : scan__prev(cp))
51 | # define scannext(cp) (scan__top->rightedge > *(cp) + 1 ? ++*(cp) : scan__next(cp))
52 | # define scanleft(cp) ((COUNT)(*(cp) - scan__top->leftedge))
53 | # define scanright(cp) ((COUNT)(scan__top->rightedge - *(cp)))
54 | # define scanmark(cp) marktmp(scan__markbuf, scan__top->buffer, scan__top->leoffset + (int)((*cp) - scan__top->leftedge))
55 |
56 | #else
57 |
58 | # define scanprev(cp) (scan__top->ptr == (cp) && scan__top->leftedge < *(cp) ? --*(cp) : scan__prev(cp))
59 | # define scannext(cp) (scan__top->ptr == (cp) && scan__top->rightedge > *(cp) + 1 && *(cp) ? ++*(cp) : scan__next(cp))
60 | # define scanleft(cp) (scan__top->ptr == (cp) ? (COUNT)(*(cp) - scan__top->leftedge) : scan__left(cp))
61 | # define scanright(cp) (scan__top->ptr == (cp) ? (COUNT)(scan__top->rightedge - *(cp)) : scan__right(cp))
62 | extern MARK scanmark P_((CHAR **cp));
63 | extern COUNT scan__left P_((CHAR **cp));
64 | extern COUNT scan__right P_((CHAR **cp));
65 | extern void scan__nobuf P_((void));
66 |
67 | #endif
68 |
69 |
70 |
71 | extern void scanfree P_((CHAR **cp));
72 | extern CHAR *scanseek P_((CHAR **cp, MARK restart));
73 | extern CHAR *scan__next P_((CHAR **cp));
74 | extern CHAR *scan__prev P_((CHAR **cp));
75 | extern CHAR scanchar P_((MARK mark));
76 |
--------------------------------------------------------------------------------
/guix11/xdialog.h:
--------------------------------------------------------------------------------
1 | /* xdialog.h */
2 |
3 | typedef enum {
4 | EFT_DEFAULT, /* dummy value, for fields with no explicit type */
5 | EFT_ONEOF, /* one of a preset list; includes boolean */
6 | EFT_NUMBER, /* numeric field */
7 | EFT_STRING, /* string field */
8 | EFT_FILE, /* string field where does filename completion */
9 | EFT_LOCKED /* non-editable field */
10 | } X_FIELDTYPE;
11 | typedef struct
12 | {
13 | CHAR *label; /* displayed name of the option */
14 | char *name; /* actual name of the option */
15 | CHAR *value; /* option's current value */
16 | char *limit; /* legal values, for EFT_ONEOF or EFT_NUMBER */
17 | X_FIELDTYPE ft; /* input type */
18 | unsigned lwidth;/* width of the label */
19 | unsigned twidth;/* width of the text field, if there is one */
20 | } X_FIELD;
21 | typedef struct button_s
22 | {
23 | struct button_s *next;
24 | int x, y; /* position of the button */
25 | int w, h; /* size of the button */
26 | int textx; /* horizontal offset of text (lbearing) */
27 | int texty; /* vertical offset of text (ascent) */
28 | _char_ shape; /* button shape -- usually 'b' for "button" */
29 | int key; /* keystroke to simulate if mouse released on button */
30 | char *label; /* label of the button */
31 | int lablen; /* length of label */
32 | int state; /* height of the button -- usually 2 */
33 | } X_BUTTON;
34 | typedef struct dialog_s
35 | {
36 | struct dialog_s *next; /* another, unrelated dialog in list */
37 | X11WIN *xw; /* window where command should be run */
38 | char *name; /* name of the dialog, from toolbar button */
39 | char *desc; /* one-line description of what "submit" does */
40 | CHAR *vicmd; /* chars to push into input queue if "submit" pressed */
41 | char *excmd; /* the command to execute if "submit" pressed */
42 | char *spec; /* descriptions of the fields */
43 | X_FIELD *field; /* details about each field */
44 | int nfields;/* number of fields */
45 | X_BUTTON *button;/* list of buttons */
46 |
47 | ELVBOOL pinned; /* is this dialog pinned (persistent) ? */
48 | int current;/* currently highlighted field -- -1 to start */
49 | int cursor; /* cursor position within the current field */
50 | int shift; /* shift amount of the current text field */
51 | X_BUTTON *click;/* button being clicked */
52 |
53 | unsigned w,h; /* overall width & height of dialog */
54 | int x0,y0; /* offsets to corner of first field's input */
55 | int rowh; /* height of each option row */
56 | int cellw; /* width of an input cell */
57 | int base; /* where to draw the label positions (ascent) */
58 | X_BUTTON *submit;/* the submit button -- also in "button" list, above */
59 | X_BUTTON *cancel;/* the cancel button -- also in "button" list, above */
60 |
61 | Window win; /* X11 window of the dialog */
62 | GC gc; /* X11 graphic context */
63 | } dialog_t;
64 |
65 |
66 | extern void x_dl_add P_((X11WIN *xw, char *name, char *desc, CHAR *vicmd, char *excmd, char *spec));
67 | extern void x_dl_delete P_((dialog_t *dia));
68 | extern void x_dl_destroy P_((X11WIN *xw));
69 | extern void x_dl_event P_((Window w, XEvent *event));
70 | extern void x_dl_docolor P_((X11WIN *xw));
71 |
--------------------------------------------------------------------------------
/http.c:
--------------------------------------------------------------------------------
1 | /* http.c */
2 |
3 | #include "elvis.h"
4 | #ifdef FEATURE_RCSID
5 | char id_http[] = "$Id: http.c,v 2.12 2003/12/28 20:29:02 steve Exp $";
6 | #endif
7 | #ifdef PROTOCOL_HTTP
8 |
9 | static sockbuf_t *sb;
10 |
11 | /* Open an HTTP resource for reading. Returns ElvTrue if successful, or False
12 | * for error (after giving an error message).
13 | */
14 | ELVBOOL httpopen(site_port, resource)
15 | char *site_port; /* host name and optional port number */
16 | char *resource; /* name of file at remote host */
17 | {
18 | char *line, *p;
19 |
20 | /* Open a connection to the server */
21 | sb = netconnect(site_port, 80);
22 | if (!sb)
23 | {
24 | /* error message already given */
25 | return ElvFalse;
26 | }
27 |
28 | /* Send the "GET" request to the HTTP server. Note that netputline()
29 | * will add a second CRLF pair after the "HTTP/1.0" string. This is
30 | * important, because when an HTTP server sees "HTTP/1.0" it expects
31 | * supplemental information to appear on following lines, up to the
32 | * next blank line. It won't process the request until it sees that
33 | * blank line.
34 | */
35 | msg(MSG_STATUS, "[s]requesting $1", resource);
36 | if (!netputline(sb, "GET", resource, "HTTP/1.0")
37 | || !netputline(sb, "Host:", site_port, NULL)
38 | || !netputline(sb, "User-Agent:", "Elvis", VERSION)
39 | || !netputline(sb, "", NULL, NULL))
40 | {
41 | /* error message already given */
42 | return ElvFalse;
43 | }
44 |
45 | /* Success, so far. Now ready to begin reading data. */
46 | msg(MSG_STATUS, "receiving...");
47 |
48 | /* Fill the receive buffer. */
49 | if (!netread(sb))
50 | return ElvFalse;
51 |
52 | /* If the response starts with "HTTP", then assume it is in MIME
53 | * format. Skip the header, and watch for a "Content-Length:" line.
54 | */
55 | if (netbytes(sb) >= 4 && !strncmp(netbuffer(sb), "HTTP", 4))
56 | {
57 | while ((line = netgetline(sb)) != NULL && *line)
58 | {
59 | /* Convert the header label to lowercase */
60 | for (p = line; *p && *p != ':'; p++)
61 | {
62 | *p = elvtolower(*p);
63 | }
64 |
65 | /* If "Content-Length:" then allow url.c to display
66 | * the size.
67 | */
68 | if (!strncmp(line, "content-length: ", 16))
69 | {
70 | urlbytes(atol(&line[16]));
71 | }
72 | }
73 | }
74 |
75 | return ElvTrue;
76 | }
77 |
78 |
79 | /* Read some data from the remote server */
80 | int httpread(buf, nbytes)
81 | CHAR *buf;
82 | int nbytes;
83 | {
84 | /* try to fill sb's buffer */
85 | if (sb->left > 0 && !netread(sb))
86 | return -1;
87 |
88 | /* never read more data than there is in sb's buffer */
89 | if (netbytes(sb) < nbytes)
90 | nbytes = netbytes(sb);
91 |
92 | /* copy bytes from sb's buffer to buf */
93 | if (nbytes > 0)
94 | {
95 | memcpy(buf, netbuffer(sb), nbytes);
96 | netconsume(sb, nbytes);
97 | }
98 | return nbytes;
99 | }
100 |
101 | /* close the socket */
102 | void httpclose()
103 | {
104 | netdisconnect(sb);
105 | }
106 |
107 |
108 | #endif /* PROTOCOL_HTTP */
109 |
--------------------------------------------------------------------------------
/state2.h:
--------------------------------------------------------------------------------
1 | /* state2.h */
2 | /* Copyright 1995 by Steve Kirkendall */
3 |
4 |
5 |
6 | typedef enum
7 | {
8 | CURSOR_NONE, /* no visible cursor (may be handy inside gui module) */
9 | CURSOR_INSERT, /* next character will be inserted */
10 | CURSOR_REPLACE, /* next character will replace a existing text */
11 | CURSOR_COMMAND, /* next character will be part of a visual command */
12 | CURSOR_QUOTE /* next character should be quoted; will replace '^' */
13 | } ELVCURSOR;
14 |
15 | struct state_s
16 | {
17 | struct state_s *pop; /* next state on stack */
18 | struct state_s *acton; /* state that enter() acts on */
19 | RESULT (*enter) P_((WINDOW win)); /* perform line processing */
20 | RESULT (*perform) P_((WINDOW win)); /* execute command */
21 | RESULT (*parse) P_((_CHAR_ key, void *info)); /* parse a keystroke */
22 | ELVCURSOR (*shape) P_((WINDOW win)); /* decide on cursor shape */
23 | MARK cursor; /* the cursor & buffer to use */
24 | MARK top, bottom; /* extent being edited */
25 | void *info; /* extra info, for parser */
26 | ELVISSTATE flags; /* flags of current state */
27 | char *modename; /* mode name, for "showmode" */
28 | CHAR morekey; /* special key for [More] */
29 | CHAR prompt; /* prompt char, or '\0' */
30 | MAPFLAGS mapflags; /* keystroke mapping state */
31 | long wantcol; /* stratum's desired column */
32 | };
33 |
34 | #define ELVIS_USERMAP 0x0001 /* in the middle of a user's map */
35 | #define ELVIS_KEYMAP 0x0002 /* in the middle of a function key map */
36 | #define ELVIS_BOTTOM 0x0010 /* open mode; use bottom row only */
37 | #define ELVIS_REGION 0x0020 /* editing a region; clean up if cursor moves */
38 | #define ELVIS_POP 0x0100 /* pop after completing current keystroke */
39 | #define ELVIS_ONCE 0x0200 /* pop after completing next keystroke */
40 | #define ELVIS_1LINE 0x0400 /* pop after completing current line */
41 | #define ELVIS_ALERT 0x0800 /* pop to this state if alerted */
42 | #define ELVIS_FREE 0x1000 /* free(info) when freeing state */
43 | #define ELVIS_MORE 0x2000 /* call perform() after popping */
44 |
45 | BEGIN_EXTERNC
46 | extern void statepush P_((WINDOW win, ELVISSTATE flags));
47 | extern void statestratum P_((WINDOW win, CHAR *bufname, _CHAR_ prompt, RESULT (*enter)(WINDOW win)));
48 | extern void statepop P_((WINDOW win));
49 | extern RESULT statekey P_((_CHAR_ key));
50 | END_EXTERNC
51 |
52 | /* This macro returns the buffer that keystrokes act on. */
53 | #define statecmdbuf(win) (markbuffer((win)->state->cursor))
54 |
55 | /* This macro returns the cursor that ex commands and search commands should
56 | * act on. This is generally the stratum under the keystroke's stratum.
57 | */
58 | #define statedatacursor(win) ((win)->state->acton->cursor)
59 |
60 | /* These macros return the top & bottom of the range affected by a command. */
61 | #define statedatatop(win) ((win)->state->acton->top)
62 | #define statedatabottom(win) ((win)->state->acton->bottom)
63 |
64 | /* This macro returns the buffer that ex commands and search commands should
65 | * act on. This is generally the stratum under the keystroke's stratum.
66 | */
67 | #define statedatabuf(win) (markbuffer(statedatacursor(win)))
68 |
--------------------------------------------------------------------------------
/data/elvis.x11:
--------------------------------------------------------------------------------
1 | " DEFAULT CONFIGURATION FOR THE "X11" USER INTERFACE
2 | color! statusbar like toolbar
3 | color! status like tool
4 | color! scrollbar like toolbar
5 | color! scroll like tool
6 | gui Quit:q
7 | gui Quit?!modified
8 | gui Quit"Close this window, and maybe exit elvis
9 | gui Edit;"File to load:" (file) f = filename
10 | gui Edit:e (f)
11 | gui Edit"Open a file in this window
12 | gui Split;"File to load:" (file) f = filename
13 | gui Split:sp (f)
14 | gui Split"Open a file in a new window
15 | gui Save:w
16 | gui Save?modified && edited && !readonly
17 | gui Save"Write this buffer out to its file
18 | gui Save as;"File to write:"(file)f=dirfile(filename);="The default is in the current directory!"
19 | gui Save as:w (f)
20 | gui Save as"Write this buffer out to a different file
21 | gui Reload:e!%
22 | gui Reload"Re-read this file, discarding all changes
23 | gui Reload;="Are you sure you want to do this?"
24 | gui gap
25 | gui Prev:N
26 | gui Prev?!modified && current("previous")
27 | gui Prev"Switch to the previous file in the args list
28 | gui Next:n
29 | gui Next?!modified && current("next")
30 | gui Next"Switch to the next file in the args list
31 | gui Alt:e#
32 | gui Alt?!modified && previousfile
33 | gui Alt"Switch to the alternate file
34 | gui Back:pop
35 | gui Back?current("tagstack")
36 | gui Back"Return to previous position via the tagstack
37 | gui gap
38 | gui Make:make
39 | gui Make?!modified
40 | gui Make"Compile the program, and collect error messages
41 | gui Err:errlist
42 | gui Err?buffer("Elvis error list")
43 | gui Err"Move to the next error
44 | gui Search;"plain text to find"s;"direction"(oneof forward backward)d=(d=="backward")?"backward":"forward";ignorecase;wrapscan;autoselect;hlsearch
45 | if feature("normal")
46 | then gui Search:eval normal (d=="backward" ? ("?";quote(("?"; magic?magicchar:"^$"), s); "\r") : ("/";quote(("/"; magic?magicchar:"^$"), s); "\r"))
47 | else gui Search:eval (d=="backward"?"?":"/")(quote((magic?".*/[^$":"/^$"),s))
48 | gui Search"Search for plain text -- not a regular expression
49 | gui gap
50 | gui Normal:no
51 | gui Normal=display=="normal"
52 | gui Normal"Select the normal display mode
53 | gui Hex:dis hex
54 | gui Hex=display=="hex"
55 | gui Hex"Select the hex display mode
56 | gui Syntax:dis syntax
57 | gui Syntax=display<<6=="syntax"
58 | gui Syntax"Select the syntax display mode (syntax-coloring)
59 | gui Other:eval dis (bufdisplay)
60 | gui Other=display!="normal" && display!="hex" && display<<6!="syntax"
61 | gui Other?bufdisplay!="normal" && bufdisplay!="hex" && bufdisplay<<6!="syntax"
62 | gui Other"Select the appropriate text-formatting display mode
63 | gui Display Options;"display"(oneof normal hex syntax HTML man tex)d=(display=="html"?"HTML":display);wrap;sidescroll;list;showmarkups;number;tabstop;showmatch;nonascii;prefersyntax;spell
64 | gui Display Options:eval dis (tolower(d))
65 | gui Display Options"Configure the display options
66 | gui gap
67 | gui XV:w !sh -c "cat >tmp$$; (xv tmp$$; rm tmp$$) >/dev/null 2>&1 &"
68 | gui XV"Send this buffer to the XV image viewer
69 | if alias("man")
70 | then gui Man:man \@
71 | else gui Man:sp !man \@| col -b
72 | gui Man"Create a new window, showing the man-page for this word
73 | gui Help:help
74 | gui Help"Create a new window, showing elvis' manual
75 |
--------------------------------------------------------------------------------
/debian/rules:
--------------------------------------------------------------------------------
1 | #!/usr/bin/make -f
2 |
3 | #export DH_VERBOSE=1
4 |
5 | DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
6 | DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
7 |
8 | CC = gcc -Wall -g -I/usr/include/freetype2 -I/usr/X11R6/include
9 | ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
10 | CC += -O0
11 | else
12 | CC += -O2
13 | endif
14 |
15 | CFGEXTS = ali arf awf brf bwf clr ini msg ps spe syn
16 | CONFBOTH = --bindir=/usr/bin --datadir=/usr/share/elvis \
17 | --docdir=/usr/share/elvis/manual --libs=-lncurses
18 | CONFCONSOLE = $(CONFBOTH) --without-x
19 | CONFX11 = $(CONFBOTH) --with-x --with-xft
20 | EDIR = $(CURDIR)/debian/elvis
21 | MDIR = $(CURDIR)/debian/elvis-common
22 | NDIR = $(CURDIR)/debian/elvis-console
23 | TDIR = $(CURDIR)/debian/elvis-tools
24 | MTRASH = *.txt ctags.man fmt.man
25 | MPAGES = elvis elvfmt elvtags ref
26 |
27 | patch:
28 | dh_testdir
29 |
30 | QUILT_PATCHES=debian/patches quilt push -a || test $$? = 2
31 |
32 | touch patch
33 |
34 | unpatch:
35 | dh_testdir
36 |
37 | QUILT_PATCHES=debian/patches quilt pop -a -R || test $$? = 2
38 |
39 | rm -rf .pc
40 | rm -f patch
41 |
42 | build: patch
43 | dh_testdir
44 | ./configure $(CONFCONSOLE)
45 | $(MAKE) CC="$(CC)"
46 | mv elvis elvis-console
47 | $(MAKE) clean
48 | ./configure $(CONFX11)
49 | $(MAKE) CC="$(CC)"
50 | touch build
51 |
52 | install: build
53 | dh_testdir
54 | dh_installdirs -a
55 | dh_installdirs -i
56 | $(MAKE) BINDIR="$(TDIR)"/usr/bin \
57 | DATADIR="$(MDIR)"/usr/share/elvis \
58 | DOCDIR="$(MDIR)"/usr/share/elvis/manual \
59 | install
60 | touch install
61 |
62 | binary-arch: install
63 | dh_testdir
64 | dh_testroot
65 | dh_link -a
66 | cd "$(MDIR)"/usr/share/elvis; \
67 | for i in $(CFGEXTS); do \
68 | cp elvis."$$i" "$(EDIR)"/etc/elvis; \
69 | mv elvis."$$i" "$(NDIR)"/etc/elvis; \
70 | done; \
71 | mv elvis.x11 "$(EDIR)"/etc/elvis; \
72 | rm elvis.rc
73 | mv "$(TDIR)"/usr/bin/elvis "$(EDIR)"/usr/bin
74 | mv elvis-console "$(NDIR)"/usr/bin/elvis
75 | dh_install -a
76 | dh_strip -a
77 | dh_compress -a
78 | dh_fixperms -a
79 | dh_shlibdeps -a
80 | dh_gencontrol -a
81 | dh_installdeb -a
82 | dh_md5sums -a
83 | dh_builddeb -a
84 |
85 | binary-indep: install
86 | dh_testdir
87 | dh_testroot
88 | dh_link -i
89 | cd "$(MDIR)"/usr/share/elvis/manual; \
90 | rm $(MTRASH); \
91 | mv printdoc.bat printdoc.sh; \
92 | chmod +x printdoc.sh; \
93 | for i in $(MPAGES); do \
94 | cp "$$i".man ../../man/man1/"$$i".1; \
95 | done
96 | dh_install -i
97 | dh_installdocs -i
98 | dh_installchangelogs -i
99 | dh_installexamples -i
100 | dh_installmenu -i
101 | dh_compress -i
102 | dh_fixperms -i
103 | dh_gencontrol -i
104 | dh_installdeb -i
105 | dh_md5sums -i
106 | dh_builddeb -i
107 |
108 | binary: binary-arch binary-indep
109 |
110 | clean: unpatch
111 | dh_testdir
112 | dh_testroot
113 | rm -f build install elvis-console
114 | -[ -f Makefile ] && $(MAKE) clobber
115 | dh_clean Makefile config.h config.stat ctags fmt
116 |
117 | .PHONY: binary binary-arch binary-indep clean unpatch
118 |
--------------------------------------------------------------------------------
/data/scripts/align.ex:
--------------------------------------------------------------------------------
1 | " Defines an :align alias for aligning = signs, or some other delimiter. This
2 | " can be handy when you're trying to make a Makefile look pretty.
3 | " Contributed by Ian Utley (iu@apertus.uk.com)
4 |
5 | alias align {
6 | "Align any = signs (or other given text) in selected line
7 | local f=0 i=0 k report=0 nosaveregexp magic magicchar=^$.[* noignorecase
8 | "
9 | " The following if tests to see if we have visually highlighted lines.
10 | "
11 | if ( !> !!= "" )
12 | then {
13 | !< mark a
14 | !> mark b
15 | let f=1
16 | }
17 | if ( f == 1)
18 | then {
19 | "
20 | " Initialise i which will store the alignment column.
21 | " Mark the current line to return the cursor at the end.
22 | "
23 | set i=0
24 | mark z
25 | "
26 | " Remove any whitespace before the alignment character.
27 | "
28 | 'a,'b s/[ ]*!(=)\$/!(=)\$/
29 | "
30 | " We could be aligning != <= or >= so we want to keep this letter
31 | " near. Of course we may not be aligning an equals but we commonly do.
32 | "
33 | if ( "!(=)\$" == "=" )
34 | then {
35 | 'a,'b s/[ ]*\([!!<>]*\)!(=)\$[ ]*/ \1!(=)\$ /
36 | }
37 | "
38 | "
39 | let f=0
40 | 'a,'bglobal /!(=)\$/ {
41 | "
42 | " Special case for the top line as -1 will not work.
43 | "
44 | if ( current("line") == 1 )
45 | then {
46 | 1 insert ""
47 | let f=1
48 | }
49 | else -1
50 | /!(=)\$
51 | "
52 | "
53 | " Remember the largest column number for alignment.
54 | "
55 | if (current("column")>i)
56 | then let i=current("column")
57 | "
58 | " Special case removal
59 | "
60 | if ( current("line") > 1 && f == 1)
61 | then {
62 | 1 delete
63 | let f=0
64 | }
65 | }
66 | "
67 | " Do the alignment.
68 | "
69 | let f=0
70 | 'a,'bglobal /!(=)\$/ {
71 | "
72 | " Special case for the top line as -1 will not work.
73 | "
74 | if ( current("line") == 1 )
75 | then {
76 | 1i ""
77 | let f=1
78 | }
79 | else -1
80 | /!(=)\$
81 | "
82 | " Not sure why I need to add +1
83 | "
84 | let k=i-current("column")+1
85 | s/\([!!<>]*\)!(=)\$/ \1!(=)\$/
86 | eval s/ *\\\( \{(k)\}[!!<>]*!(=)\$\\\)/\1
87 | "
88 | " Special case removal
89 | "
90 | if ( current("line") > 1 && f == 1 )
91 | then {
92 | 1 delete
93 | let f=0
94 | }
95 | }
96 | "
97 | " Return the cursor to the line it was previously on.
98 | "
99 | 'z
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/oswin32/elvisutl.mak:
--------------------------------------------------------------------------------
1 | # Check if the compiler supports single threaded statically linked CRT (-ML),
2 | # and if so, use it. Newer compilers don't, so fall back to -MT (statically
3 | # linked multithreaded.)
4 | !IF [$(CC) -ML 2>&1 | find "D9002" >NUL]==0
5 | CRTFLAG_RELEASE=/MT
6 | !ELSE
7 | CRTFLAG_RELEASE=/ML
8 | !ENDIF
9 |
10 | RSC=rc.exe
11 | OUTDIR=.
12 | INTDIR=.\WinRel
13 |
14 | C_DEFINES=/D _CRT_SECURE_NO_WARNINGS=1 /D _CRT_NONSTDC_NO_WARNINGS=1 /D WIN32
15 |
16 | ALL : $(INTDIR) $(OUTDIR)\ctags.exe $(OUTDIR)\fmt.exe $(OUTDIR)\ref.exe\
17 | $(OUTDIR)\ls.exe $(OUTDIR)\vi.exe $(OUTDIR)\ex.exe $(OUTDIR)\view.exe
18 |
19 | $(INTDIR) :
20 | if not exist $(INTDIR)\nul mkdir $(INTDIR)
21 |
22 | $(OUTDIR) :
23 | if not exist $(OUTDIR)\nul mkdir $(OUTDIR)
24 |
25 | CPP_PROJ=/nologo $(CRTFLAG_RELEASE) /W3 /O2 /I "oswin32" /I "." $(C_DEFINES) \
26 | /D "NDEBUG" /D "_CONSOLE" /FR$(INTDIR)/ /Fo$(INTDIR)/ /c
27 | CPP_OBJS=.\WinRel/
28 |
29 | LINK32=link.exe
30 | LINK32_FLAGS=kernel32.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:no
31 | DEF_FILE=oswin32\osdir.c
32 |
33 | ###############################################################################
34 |
35 | $(OUTDIR)/ctags.exe : $(OUTDIR) $(DEF_FILE) \
36 | $(INTDIR)\tag.obj \
37 | $(INTDIR)\safe.obj \
38 | $(INTDIR)\ctags.obj
39 | $(LINK32) @<<
40 | $(LINK32_FLAGS) /OUT:$(OUTDIR)/ctags.exe
41 | $(INTDIR)\tag.obj
42 | $(INTDIR)\safe.obj
43 | $(INTDIR)\ctags.obj
44 | <<
45 |
46 | $(OUTDIR)/fmt.exe : $(OUTDIR) $(DEF_FILE) $(INTDIR)/fmt.obj
47 | $(LINK32) @<<
48 | $(LINK32_FLAGS) /OUT:$(OUTDIR)/fmt.exe $(INTDIR)/fmt.obj
49 | <<
50 |
51 | $(OUTDIR)/ref.exe : $(OUTDIR) $(DEF_FILE) \
52 | $(INTDIR)\tag.obj \
53 | $(INTDIR)\tagsrch.obj \
54 | $(INTDIR)\safe.obj \
55 | $(INTDIR)\ref.obj
56 | $(LINK32) @<<
57 | $(LINK32_FLAGS) /OUT:$(OUTDIR)/ref.exe
58 | $(INTDIR)\tag.obj
59 | $(INTDIR)\tagsrch.obj
60 | $(INTDIR)\safe.obj
61 | $(INTDIR)\ref.obj
62 | <<
63 |
64 | $(OUTDIR)/ls.exe : $(OUTDIR) $(DEF_FILE) \
65 | $(INTDIR)\ls.obj \
66 | $(INTDIR)\safe.obj
67 | $(LINK32) @<<
68 | $(LINK32_FLAGS) /OUT:$(OUTDIR)/ls.exe
69 | $(INTDIR)\ls.obj
70 | $(INTDIR)\safe.obj
71 | <<
72 |
73 | $(OUTDIR)\vi.exe : $(OUTDIR)
74 | $(CC) /nologo /DARGV0=VI /Fe$(OUTDIR)\vi.exe /Fo$(INTDIR)\vi.obj /Ioswin32 alias.c
75 |
76 | $(OUTDIR)\ex.exe : $(OUTDIR)
77 | $(CC) /nologo /DARGV0=EX /Fe$(OUTDIR)\ex.exe /Fo$(INTDIR)\ex.obj /Ioswin32 alias.c
78 |
79 | $(OUTDIR)\view.exe : $(OUTDIR)
80 | $(CC) /nologo /DARGV0=VIEW /Fe$(OUTDIR)\view.exe /Fo$(INTDIR)\view.obj /Ioswin32 alias.c
81 |
82 |
83 | ###############################################################################
84 |
85 | .c{$(CPP_OBJS)}.obj:
86 | $(CC) $(CPP_PROJ) $<
87 |
88 | {oswin32/}.c{$(CPP_OBJS)}.obj:
89 | $(CC) $(CPP_PROJ) $<
90 |
91 | ################################################################################
92 |
93 | $(INTDIR)\ctags.obj : ctags.c
94 |
95 | $(INTDIR)\fmt.obj : fmt.c
96 |
97 | $(INTDIR)\ref.obj : ref.c $(DEF_FILE)
98 |
99 | $(INTDIR)\tag.obj : tag.c
100 |
101 | $(INTDIR)\tagsrch.obj : tagsrch.c
102 |
103 | $(INTDIR)\safe.obj : safe.c
104 |
105 | $(INTDIR)\ls.obj : oswin32\ls.c
106 |
107 |
--------------------------------------------------------------------------------
/data/elvis.arf:
--------------------------------------------------------------------------------
1 | """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2 | " SAVE THE CURRENT STATE OF THE "saveregexp" OPTION
3 | local nosaveregexp
4 | """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
5 | " TAKE A GUESS AT THE BUFFER'S PREFERRED DISPLAY MODE
6 | if !userprotocol
7 | then {
8 | if knownsyntax(filename)
9 | then set! bufdisplay=syntax
10 | if os=="unix" && buflines >= 1
11 | then {
12 | try 1s/\V^#! *[^ ]*\/\([^ ]\+\).*/set! bufdisplay="syntax \1"/x
13 | if bufdisplay=="syntax env"
14 | then try 1s/\V^#! *[^ ]*\/[^ ]\+ \([^ ]\+\).*/set! bufdisplay="syntax \1"/x
15 | if bufdisplay<<11=="syntax perl"
16 | then set! bufdisplay="syntax perl"
17 | if bufdisplay<<12=="syntax tclsh"
18 | then set! bufdisplay="syntax tcl"
19 | }
20 | if !newfile
21 | then {
22 | if readeol=="binary" && bufdisplay=="normal" && (partiallastline || !binary)
23 | then set! bufdisplay=hex
24 | switch tolower(dirext(filename))
25 | case .man set! bufdisplay=man
26 | case .tex set! bufdisplay=tex
27 | case .htm
28 | case .html
29 | case .shtml
30 | case .dhtml set! bufdisplay=html
31 | if buflines >= 2 && bufdisplay=="hex"
32 | then try 1,2s/\V^\s*<[HIThit!]/set! bufdisplay=html/x
33 | if (filename<<5=="http:" || filename<<4=="ftp:") && strlen(dirext(filename))<4 && bd=="hex"
34 | then set! bufdisplay=normal
35 | if bufdisplay=="normal" && buflines >= 1
36 | then try 1s/\V^From .*/set! bufdisplay="syntax email"/x
37 | if strlen(dirext(filename))==2 && isnumber(filename>>1) && buflines>=1
38 | then try 1s/\V^\./set! bufdisplay=man/x
39 | }
40 | if bufdisplay=="html" && readonly
41 | then set locked
42 | if bufdisplay=="html"
43 | then set nosmartargs
44 | if readonly && (bufdisplay=="html" || bufdisplay=="man")
45 | then try set nospell
46 | """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
47 | " Set the buffer's "initialsyntax" option, based on "prefersyntax"
48 | if (bufdisplay=="html" || bufdisplay=="man" || bufdisplay=="tex")
49 | then {
50 | try {
51 | switch prefersyntax
52 | case always set isyn
53 | case local let isyn = !readonly && dirdir(filename) == "."
54 | case writable let isyn = !readonly
55 | case never set noisyn
56 | }
57 | }
58 | """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
59 | " Some messages
60 | if tolower(basename(program))!="elvis" && !ro && (bd=="html" || bd=="man" || bd="tex")
61 | then message To toggle the display mode, hit ^Wd
62 | if partiallastline && readeol!="binary"
63 | then warning Partial last line
64 | }
65 | """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
66 | " Set mapmode to the bufdisplay, if appropriate
67 | switch bufdisplay
68 | case html
69 | case man
70 | case tex let! mapmode=bufdisplay
71 | """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
72 | " Store the file's timestamp
73 | if security != "restricted"
74 | then let timestamp = time(filename)
75 | """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
76 | " EXECUTE MODELINES, IF "modeline" OPTION IS SET
77 | if modeline && buflines >= 1 && buflines <= modelines * 2
78 | then try %s/\V[ev][xi]:\([^!]*\):/\1/x
79 | if modeline && buflines > modelines * 2
80 | then {
81 | eval try 1,(modelines)s/\V[ev][xi]:\\\([^!]*\\\):/\1/x
82 | eval try (buflines - modelines + 1),(buflines)s/\\V[ev][xi]:\\\([^!]*\\\):/\1/x
83 | }
84 |
--------------------------------------------------------------------------------
/data/icons/normal.xpm:
--------------------------------------------------------------------------------
1 | /* XPM */
2 | static char * normal_xpm[] = {
3 | "56 46 19 1",
4 | " c #FFFFFFFFFFFF",
5 | ". c #BEFBBAEABEFB",
6 | "X c #000000001040",
7 | "o c #BEFBB6DABEFB",
8 | "O c #AEBAAAAAAEBA",
9 | "+ c #AEBAA699AEBA",
10 | "@ c #C71BBAEAC71B",
11 | "# c #000000000000",
12 | "$ c #FFFF0000FFFF",
13 | "% c #FFFFFFFF0000",
14 | "& c #9E799A699E79",
15 | "* c #96589658AEBA",
16 | "= c #FFFFFBEEFFFF",
17 | "- c #FFFFF3CEFFFF",
18 | "; c #965896589658",
19 | ": c #A6999E79A699",
20 | "> c #A69979E78E38",
21 | ", c #B6DAAEBAB6DA",
22 | "< c #000000001861",
23 | " .",
24 | " ......................................................X",
25 | " ......................................................X",
26 | " ...o..o..o..o..o..o..o..o..o..o..o..o..o..o..o..o..o..X",
27 | " O...O...+...O...O...+...O...O...+...O...O...+...O...O.X",
28 | " ..o..@o...@o..@o.@o...@o..@o.@o...@o..@o.@o..@o.@o.@o.X",
29 | " O.OOO##OO##OO##OO##OO##OO##OO##OO##OO##OO##OO##OO##.O.X",
30 | " ...OO##############################################..OX",
31 | " O.+###$$$$$$$$$$$$$$$################$$$$$$$$$$$##O.O.X",
32 | " ...###$$#$$$$$#$$$$$##################$$$$$$###$##O+..X",
33 | " O.+O##$#$#$$$#$#$$$$##################$$$$$#$#$$###.O.X",
34 | " .O.O##$$$#$$$$$#$$$$##################$$$$$$###$###..OX",
35 | " O.+###$$#$$$$$#$$$$$##################$$$$$$$$$$##O.+.X",
36 | " .O.###$#$$$$$#$$$$$######%%%...##%####$$$$$#$##$##OO.OX",
37 | " O.OO##$#$$$$$#$$$$$#####%%..%...#%%##$$$$$$##$#$###.O.X",
38 | " OO.O##$###$#$###$$$#.##%%%......#%%##$$$$$$$$$$$###OOOX",
39 | " O.O###$$$$$$$$$$$$$#%##...%....#..%%#%$$$$$####$##O.O.X",
40 | " OOO###$$$$$$$$$$$$$#.##%..##.......#%%%$$$$$$$#$##OOOOX",
41 | " O.OO##$$$$$$$$$$$$$#%##.%..#....#..#% %%$$$####$###.O.X",
42 | " OOOO##$$$$$$$$$$$$$##%#..%...#..#%#$%%%$$$$$$$$$###OOOX",
43 | " OOO####################.%%%..%#...#$$%$$$$$$$$$$##O.+OX",
44 | " OOO###%%#%%%#%%%%##%#..%.%...##..%#$%$$$$$%$$$$$##OOOOX",
45 | " OOOO###%%%#%%%###%#%#...%.......%#$%%%$$$$%$$$$$###OOOX",
46 | " OOOO##%%#%%%#%###%#%#%...%.####.%#%% %%$$%%%$$$$###OOOX",
47 | " &OO####%%%#%%##%%%#%%#%.....##%.%#$%%%$$%% %%$$$##OO&OX",
48 | " OOO###%%#%%%##%%###%%#%%.......%#$$$%$$$$%%%$$$$##OOOOX",
49 | " OO&O###%%%#%#%#%%#%%%##%%#...%%##$$****$$$%$$$$$###+&+X",
50 | " OOOO##%%#%%%#%%%########%%##%%#%#$$*#*#*#$%$$$$$###OOOX",
51 | " &O###%%%#%#%#%%#OOO###%%%%###%%**#*#*#*#$$$$$$##O+&OX",
52 | " O+O##################O#O#####%%#%%#*#*#*#*$$$$$$##OOOOX",
53 | " &O&O### # # # # # #OO#OOOO##%%%# # #*#*#$$$$$$###+&OX",
54 | " +&+O### ## # # # # ##O##OOO##%%#%## #*#*#*$$$$$$###O+&X",
55 | " &O### # # # # # #O##OOO#%#%%## # #*#*#$$$$$$##OO&+X",
56 | " +&+#### ## ## ## ## #O##OO##%%%## # #*#*#*$$$$$$##O&+&X",
57 | " &+&O### # # ## # #O##OO#%%#%# # #*#*#*$$$$$$$###+&+X",
58 | " &&+O#################O##OO##%%%%# #*#*#*%#$$$$$$###&&&X",
59 | " &+##############################################O+&+X",
60 | "=&&&OO##OO##OO##OO##OO##OO##OO##OO##OO##OO##OO##OO#O&&&X",
61 | " &+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+O+&+&+&OO+&+&+&+&+&+&+X",
62 | "-&&&&&;&;&;&&;&&;&&;&&;&&;&&;&&;&&;&&;&&;&;&;&;&;&;&&&&X",
63 | " &&;+&&&+&&&+&&&+&&&+&&&+&&&+&&&+&&&+&&&+&&&+&&&+&&&:&&X",
64 | "=;&&*>&&&*>&&*>&&*>&&*>&&*>&&*>&&*>&&*>&&&*>&&&&*>&&&&&X",
65 | " &+&&:&&&&+:&&:&&&+:&&:&&&+:&&:&&&+:&&:&&>,&:>*&&:+&&&;<",
66 | "-&&&&;&*>&&;&&*>&&&;&&*>&&&;&&*>&&&*>&;&&*&&*:&&&&*>&&&X",
67 | " &&&>*&&:&&&>*&&&&>*&&&&*&&>*&&&*&&&&&&>*&&&;&&>*&&:&&&X",
68 | ".XX<
7 | unmap input mode=html >
8 |
9 | " Protect some characters when inserting in html display mode
10 | map input mode=html noremap & &
11 | map input mode=html noremap < <
12 | map input mode=html noremap > >
13 |
14 | " No tag highlighting -- let tags do their own highlighting
15 | set hlobject=""
16 | }
17 | alias htmlunmap {
18 | " Load maps for "syntax html" display mode
19 |
20 | " Remove maps that protect some special HTML characters
21 | unmap input mode=html &
22 | unmap input mode=html <
23 | unmap input mode=html >
24 |
25 | " When a > is input at the end of a tag, automatically add the closing tag
26 | map input mode=html > noremap >Fpa>bi/hi
27 |
28 | " Highlight the innermost tag */
29 | set hlobject="ix,ax"
30 | }
31 | aug edithtml
32 | au DispMapEnter html htmlmap
33 | au DispMapLeave html htmlunmap
34 | aug END
35 | if display == "html"
36 | then htmlmap
37 | else htmlunmap
38 |
39 | " Add ax to matchchar -- lets you use % to find matching tag pairs
40 | set matchchar="{}()[]ax"
41 |
42 | " Arrange for innermost tag to be highlighted later, when hlobject is set */
43 | if hllayers == 0
44 | then {
45 | set hllayers=2
46 | if color("hlobject1") == ""
47 | then color hlobject1 boxed
48 | if color("hlobject2") == ""
49 | then color hlobject2 bold
50 | }
51 |
52 | " For X11, set up some buttons
53 | if gui == "x11"
54 | then {
55 | gui gap
56 | gui Heading: htmlblock pair h1
57 | gui Heading?current("selection")=="line"
58 | gui Subheading: htmlblock pair h2
59 | gui Subheading?current("selection")=="line"
60 | gui Left: htmlblock div left
61 | gui Left?current("selection")=="line"
62 | gui Right: htmlblock div right
63 | gui Right?current("selection")=="line"
64 | gui Center: htmlblock div center
65 | gui Center?current("selection")=="line"
66 | gui Bullet: htmlblock list ul
67 | gui Bullet?current("selection")=="line"
68 | gui Number: htmlblock list ol
69 | gui Number?current("selection")=="line"
70 | gui Preformat: htmlblock pair pre
71 | gui Preformat?current("selection")=="line"
72 | gui Other: eval htmlblock pair (t)
73 | gui Other?current("selection")=="line"
74 | gui Other;"HTML tag to add" t
75 | gui gap
76 | gui [Bold]
77 | gui Bold?current("selection")=="line" || current("selection")=="character"
78 | gui [Italic]
79 | gui Italic?current("selection")=="line" || current("selection")=="character"
80 | gui [Code]
81 | gui Code?current("selection")=="line" || current("selection")=="character"
82 | gui gap
83 | gui Undo: u
84 | alias htmlblock {
85 | switch "!1"
86 | case pair {
87 | !> a !2>
88 | !< i
89 | }
90 | case div {
91 | !> a
92 | !< i
93 | if "!2" != "left"
94 | then warning Elvis doesn't display text aligned to the !2
95 | }
96 | case list {
97 | !% s/^//
98 | !> a !2>
99 | !< i
100 | }
101 | }
102 | map select mode=html noremap [Bold] c> >
103 | map select mode=html noremap [Italic] c> >
104 | map select mode=html noremap [Code] c>>
105 | }
106 |
--------------------------------------------------------------------------------
/osunix/tcapsysv.h:
--------------------------------------------------------------------------------
1 | /* tcapsysv.h */
2 |
3 | #ifdef FEATURE_RCSID
4 | char id_tcapsysv[] = "$Id: tcapsysv.h,v 2.12 2003/01/26 19:41:36 steve Exp $";
5 | #endif
6 |
7 | #include
8 | #include
9 | #include
10 |
11 | /* HPUX does a "#define ttysize winsize". Elvis doesn't like that. */
12 | #undef ttysize
13 |
14 | static struct termio oldtermio; /* original tty mode */
15 | static struct termio newtermio; /* cbreak/noecho tty mode */
16 |
17 | /* signal catching function */
18 | static void catchsig(signo)
19 | int signo;
20 | {
21 | caught |= (1<