1
0
mirror of https://github.com/rfivet/uemacs.git synced 2025-11-23 11:41:15 -05:00

Remove function pointer from key to bindable table.

Emphasize bindable functions in code.
Use function name based prompts.
This commit is contained in:
2021-07-24 08:58:23 +08:00
parent f30ef38bc8
commit 1aadb53956
10 changed files with 109 additions and 138 deletions

View File

@@ -214,18 +214,16 @@ int execute( int c, int f, int n) {
/* if the keystroke is a bound function...do it */
key_tab *ktp = getkeybind( c) ;
fnp_t execfunc = ktp->k_fp ;
if( execfunc != NULL) {
if( ktp->k_code != 0) {
thisflag = 0 ;
if( ktp->k_nbp == NULL)
ktp->k_nbp = getfncnb( execfunc) ;
assert( ktp->k_nbp->n_func == execfunc) ;
assert( ktp->k_nbp != NULL) ;
char tag = bind_tag( ktp->k_nbp) ;
if( (tag & 1) && (curbp->b_mode & MDVIEW))
status = rdonly() ;
else
else {
fnp_t execfunc = ktp->k_nbp->n_func ;
status = execfunc( f, n) ;
}
lastflag = thisflag ;
return status ;
@@ -340,11 +338,12 @@ void kbd_loop( void) {
newc = getcmd() ;
update( FALSE) ;
do {
key_tab *ktp ;
fnp_t execfunc ;
if( c == newc
&& (execfunc = getkeybind( c)->k_fp) != NULL
&& execfunc != insert_newline
&& (ktp = getkeybind( c))->k_code == c
&& (execfunc = ktp->k_nbp->k_func) != insert_newline
&& execfunc != insert_tab)
newc = getcmd() ;
else