diff --git a/emacs.hlp b/emacs.hlp index 7dcbf20..1b21db6 100644 --- a/emacs.hlp +++ b/emacs.hlp @@ -111,8 +111,8 @@ Pipe command .......... ^X @ Execute buffer ........ not bound Search forward ........ Meta S :: End string with Meta. Incremental search .... ^X S :: Search next ^X, stop Meta, cancel ^G. Search reverse ........ ^R -Reverse incremental search Hunt forward .......... Alt-S -....................... ^X R Hunt backward ......... Alt-R +Reverse incremental Hunt forward .......... Alt-S + search ^X R Hunt backward ......... Alt-R Replace string ........ Meta R Query replace string .. Meta ^R :: Yes/no Y/N, replace rest !, cancel ^G. ------------------------------------------------------------------------------- @@ -164,9 +164,9 @@ Page overlap .......... $overlap :: # lines, default 0, 0 = 1/3 page => FILE NAME COMPLETION File name completion can be used with all file commands (find-file, -view-file, ...) but it works only under UNIX and MS-DOS. It is invoked -by a or . If there exist more than one possible completions -they are displayed one by one. If the file name contains wild card -characters, the name is expanded instead of simple completion. Special -characters can be entered verbatim by prefixing them with ^V (or ^Q). +view-file, ...). It is invoked by a or . If there exist more +than one possible completions they are displayed one by one. If the file +name contains wild card characters, the name is expanded instead of simple +completion. Special characters can be entered verbatim by prefixing them +with ^V (or ^Q). ------------------------------------------------------------------------------- diff --git a/eval.c b/eval.c index ced8549..b6cc97a 100644 --- a/eval.c +++ b/eval.c @@ -395,13 +395,8 @@ static const char *gtfun( char *fname) { case UFLEFT: sz1 = strlen( argv[ 0]) ; sz = 0 ; - for( int i = atoi( argv[ 1]) ; i > 0 ; i -= 1) { - unicode_t c ; - + for( int i = atoi( argv[ 1]) ; sz < sz1 && i > 0 ; i -= 1) sz += utf8_to_unicode( argv[ 0], sz, sz1, &c) ; - if( sz == sz1) - break ; - } if( sz >= ressize) { free( result) ; @@ -431,19 +426,12 @@ static const char *gtfun( char *fname) { case UFMID: sz1 = strlen( argv[ 0]) ; int start = 0 ; - for( i = atoi( argv[ 1]) - 1 ; i > 0 ; i -= 1) { + for( i = atoi( argv[ 1]) - 1 ; start < sz1 && i > 0 ; i -= 1) start += utf8_to_unicode( argv[ 0], start, sz1, &c) ; - if( start == sz1) - break ; - } sz = start ; - if( sz < sz1) - for( i = atoi( argv[ 2]) ; i > 0 ; i -= 1) { + for( i = atoi( argv[ 2]) ; sz < sz1 && i > 0 ; i -= 1) sz += utf8_to_unicode( argv[ 0], sz, sz1, &c) ; - if( sz == sz1) - break ; - } sz -= start ; if( sz >= ressize) {