diff --git a/ChangeLog b/ChangeLog index 4ff053b..7e1d10f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2021-04-03 Mike Small + + * src/parse.c (keytable): remove function keyword form parse table + + * src/menus.cc (ExecuteFunction): don't look for custom functions to run + + * src/gram.y: remove function token and grammar production + + * man/twmruined.man: remove mention of user-defined functions + 2021-02-15 Mike Small * man/twmruined.man: replace a reference to move-or-lower, diff --git a/README b/README index e564ed7..cd955e2 100644 --- a/README +++ b/README @@ -9,7 +9,8 @@ Features removed... Zoom, MoveDelta 2. builtin functions: DeltaStop 3. default user defined functions: move-or-lower, move-or-raise, - and move-or-iconify (changed to builtins). + and move-or-iconify (changed to builtins) and the ability to define + user defined functions. Changes ... diff --git a/man/twmruined.man b/man/twmruined.man index 49814c9..956ea63 100644 --- a/man/twmruined.man +++ b/man/twmruined.man @@ -46,7 +46,7 @@ twmruined \- No longer quite the Tab Window Manager .SH DESCRIPTION \fITwmruined\fP is a window manager for the X Window System based on twm. It provides titlebars, shaped windows, -several forms of icon management, user-defined macro functions, +several forms of icon management, click-to-type and pointer-driven keyboard focus, and user-specified key and pointer button bindings. .PP @@ -666,19 +666,9 @@ conveniently stored in a titlebar, menu, or set of key bindings. Although a small set of defaults are supplied (unless the \fBNoDefaults\fP is specified), most users will want to have their most common operations bound to key and button strokes. To do this, \fItwmruined\fP associates names -with each of the primitives and provides \fIuser-defined functions\fP for -building higher level primitives and \fImenus\fP for interactively selecting +with each of the builtin functions and \fImenus\fP for interactively selecting among groups of functions. .PP -User-defined functions contain the name by which they are referenced in -calls to \fBf.function\fP and a list of other functions to execute. For -example: -.EX 0 -Function "restore-colormap" { f.colormap "default" f.lower } -.EE -The function name must be used in \fBf.function\fP exactly as it appears in -the function specification. -.PP In the descriptions below, if the function is said to operate on the selected window, but is invoked from a root menu, the cursor will be changed to the \fBSelect\fP cursor and the next window to receive a button press will diff --git a/src/gram.h b/src/gram.h index c1c0e69..ccbe001 100644 --- a/src/gram.h +++ b/src/gram.h @@ -62,7 +62,6 @@ extern int yydebug; COLOR = 272, SAVECOLOR = 273, MONOCHROME = 274, - FUNCTION = 275, WINDOW_FUNCTION = 276, MAKE_TITLE = 277, GRAYSCALE = 278, @@ -122,7 +121,6 @@ extern int yydebug; #define COLOR 272 #define SAVECOLOR 273 #define MONOCHROME 274 -#define FUNCTION 275 #define WINDOW_FUNCTION 276 #define MAKE_TITLE 277 #define GRAYSCALE 278 diff --git a/src/gram.y b/src/gram.y index 9ad6807..b10801f 100644 --- a/src/gram.y +++ b/src/gram.y @@ -109,7 +109,7 @@ static void yyerror ( const char *s ); }; %token LB RB LP RP MENUS MENU BUTTON DEFAULT_FUNCTION PLUS MINUS -%token ALL OR CURSORS ICONS COLOR SAVECOLOR MONOCHROME FUNCTION +%token ALL OR CURSORS ICONS COLOR SAVECOLOR MONOCHROME %token WINDOW_FUNCTION %token MAKE_TITLE GRAYSCALE %token NO_TITLE AUTO_RAISE @@ -189,8 +189,6 @@ stmt : error menu { root->real_menu = TRUE;} | MENU string { root = GetRoot($2, NULLSTR, NULLSTR); } menu { root->real_menu = TRUE; } - | FUNCTION string { root = GetRoot($2, NULLSTR, NULLSTR); } - function | ICONS { list = &Scr->IconNames; } icon_list | COLOR { color = COLOR; } @@ -453,19 +451,6 @@ icon_entries : /* Empty */ icon_entry : string string { if (Scr->FirstTime) AddToList(list, $1, $2); } ; -function : LB function_entries RB - ; - -function_entries: /* Empty */ - | function_entries function_entry - ; - -function_entry : action { AddToMenu(root, "", Action, NULL, $1, - NULLSTR, NULLSTR); - Action = ""; - } - ; - menu : LB menu_entries RB ; diff --git a/src/menus.cc b/src/menus.cc index d496e1d..2d8d896 100644 --- a/src/menus.cc +++ b/src/menus.cc @@ -1712,32 +1712,6 @@ ExecuteFunction(int func, const char *action, Window w, TwmWindow *tmp_win, break; - case F_FUNCTION: - { - MenuRoot *mroot; - MenuItem *mitem; - - if ((mroot = FindMenuRoot(action)) == NULL) - { - fprintf (stderr, "%s: couldn't find function \"%s\"\n", - ProgramName, action); - return TRUE; - } - - if (NeedToDefer(mroot) && DeferExecution(context, func, Scr->SelectCursor)) - return true; - else - { - for (mitem = mroot->first; mitem != NULL; mitem = mitem->next) - { - if (!ExecuteFunction (mitem->func, mitem->action, w, - tmp_win, eventp, context, pulldown)) - break; - } - } - } - break; - case F_DEICONIFY: case F_ICONIFY: if (DeferExecution(context, func, Scr->SelectCursor)) diff --git a/src/parse.c b/src/parse.c index 3bdab6f..0f5c6cc 100644 --- a/src/parse.c +++ b/src/parse.c @@ -405,7 +405,6 @@ static TwmKeyword keytable[] = { { "f.focus", FKEYWORD, F_FOCUS }, { "f.forcemove", FKEYWORD, F_FORCEMOVE }, { "f.fullzoom", FKEYWORD, F_FULLZOOM }, - { "f.function", FSKEYWORD, F_FUNCTION }, { "f.hbzoom", FKEYWORD, F_BOTTOMZOOM }, { "f.horizoom", FKEYWORD, F_HORIZOOM }, { "f.htzoom", FKEYWORD, F_TOPZOOM }, @@ -448,7 +447,6 @@ static TwmKeyword keytable[] = { { "forceicons", KEYWORD, kw0_ForceIcons }, { "frame", FRAME, 0 }, { "framepadding", NKEYWORD, kwn_FramePadding }, - { "function", FUNCTION, 0 }, { "grayscale", GRAYSCALE, 0 }, { "greyscale", GRAYSCALE, 0 }, { "i", ICON, 0 }, diff --git a/src/parse.h b/src/parse.h index af5dbbf..3177f04 100644 --- a/src/parse.h +++ b/src/parse.h @@ -131,7 +131,6 @@ extern int mods; #define F_FILE 105 /* string */ #define F_EXEC 106 /* string */ #define F_CUT 107 /* string */ -#define F_FUNCTION 108 /* string */ #define F_WARPTOSCREEN 109 /* string */ #define F_COLORMAP 110 /* string */ #define F_PRIORITY 111 /* string */