1
0
mirror of https://github.com/rfivet/uemacs.git synced 2024-12-18 07:16:23 -05:00

Partial fix of issues when using unicode sequence with describe-key, search-forward, query-replace-string.

This commit is contained in:
Renaud 2016-04-09 11:46:40 +08:00
parent f83ab08609
commit 1b2307e056
10 changed files with 28 additions and 23 deletions

View File

@ -139,7 +139,7 @@ bindable.o: bindable.c bindable.h defines.h buffer.h line.h retcode.h \
terminal.h terminal.h
buffer.o: buffer.c buffer.h line.h retcode.h utf8.h defines.h estruct.h \ buffer.o: buffer.c buffer.h line.h retcode.h utf8.h defines.h estruct.h \
file.h input.h bind.h mlout.h window.h file.h input.h bind.h mlout.h window.h
display.o: display.c display.h estruct.h buffer.h line.h retcode.h utf8.h \ display.o: display.c display.h estruct.h utf8.h buffer.h line.h retcode.h \
input.h bind.h termio.h terminal.h defines.h version.h wrapper.h \ input.h bind.h termio.h terminal.h defines.h version.h wrapper.h \
window.h window.h
ebind.o: ebind.c ebind.h basic.h bind.h estruct.h bindable.h buffer.h \ ebind.o: ebind.c ebind.h basic.h bind.h estruct.h bindable.h buffer.h \
@ -151,15 +151,15 @@ eval.o: eval.c eval.h basic.h bind.h buffer.h line.h retcode.h utf8.h \
exec.o: exec.c exec.h retcode.h buffer.h line.h utf8.h bind.h display.h \ exec.o: exec.c exec.h retcode.h buffer.h line.h utf8.h bind.h display.h \
estruct.h eval.h file.h flook.h input.h random.h window.h defines.h estruct.h eval.h file.h flook.h input.h random.h window.h defines.h
execute.o: execute.c execute.h estruct.h bind.h random.h retcode.h \ execute.o: execute.c execute.h estruct.h bind.h random.h retcode.h \
display.h file.h buffer.h line.h utf8.h input.h mlout.h search.h \ display.h utf8.h file.h buffer.h line.h input.h mlout.h search.h \
terminal.h defines.h window.h terminal.h defines.h window.h
file.o: file.c file.h buffer.h line.h retcode.h utf8.h defines.h \ file.o: file.c file.h buffer.h line.h retcode.h utf8.h defines.h \
display.h estruct.h execute.h fileio.h input.h bind.h lock.h mlout.h \ display.h estruct.h execute.h fileio.h input.h bind.h lock.h mlout.h \
window.h window.h
fileio.o: fileio.c fileio.h defines.h retcode.h utf8.h fileio.o: fileio.c fileio.h defines.h retcode.h utf8.h
flook.o: flook.c flook.h retcode.h defines.h fileio.h flook.o: flook.c flook.h retcode.h defines.h fileio.h
input.o: input.c input.h bind.h estruct.h bindable.h display.h exec.h \ input.o: input.c input.h bind.h estruct.h bindable.h display.h utf8.h \
retcode.h names.h terminal.h defines.h utf8.h wrapper.h exec.h retcode.h names.h terminal.h defines.h wrapper.h
isearch.o: isearch.c isearch.h basic.h buffer.h line.h retcode.h utf8.h \ isearch.o: isearch.c isearch.h basic.h buffer.h line.h retcode.h utf8.h \
display.h estruct.h exec.h input.h bind.h search.h terminal.h defines.h \ display.h estruct.h exec.h input.h bind.h search.h terminal.h defines.h \
window.h window.h
@ -186,9 +186,9 @@ search.o: search.c search.h line.h retcode.h utf8.h basic.h buffer.h \
spawn.o: spawn.c spawn.h defines.h buffer.h line.h retcode.h utf8.h \ spawn.o: spawn.c spawn.h defines.h buffer.h line.h retcode.h utf8.h \
display.h estruct.h exec.h file.h flook.h input.h bind.h terminal.h \ display.h estruct.h exec.h file.h flook.h input.h bind.h terminal.h \
window.h window.h
tcap.o: tcap.c terminal.h defines.h retcode.h display.h estruct.h \ tcap.o: tcap.c terminal.h defines.h retcode.h utf8.h display.h estruct.h \
termio.h termio.h
termio.o: termio.c termio.h estruct.h retcode.h utf8.h termio.o: termio.c termio.h utf8.h estruct.h retcode.h
utf8.o: utf8.c utf8.h utf8.o: utf8.c utf8.h
window.o: window.c window.h defines.h buffer.h line.h retcode.h utf8.h \ window.o: window.c window.h defines.h buffer.h line.h retcode.h utf8.h \
basic.h display.h estruct.h execute.h terminal.h wrapper.h basic.h display.h estruct.h execute.h terminal.h wrapper.h

View File

@ -15,10 +15,10 @@
#define NSTRING 128 /* # of bytes, string buffers */ #define NSTRING 128 /* # of bytes, string buffers */
#define CONTROL 0x10000000 /* Control flag, or'ed in */ #define CONTROL 0x01000000 /* Control flag, or'ed in */
#define META 0x20000000 /* Meta flag, or'ed in */ #define META 0x02000000 /* Meta flag, or'ed in */
#define CTLX 0x40000000 /* ^X flag, or'ed in */ #define CTLX 0x04000000 /* ^X flag, or'ed in */
#define SPEC 0x80000000 /* special key (function keys) */ #define SPEC 0x08000000 /* special key (function keys) */
/* Actual 380x134 on a 1920x1080 screen in landscape, /* Actual 380x134 on a 1920x1080 screen in landscape,
if smaller font or portrait orientation limit to 400x150 */ if smaller font or portrait orientation limit to 400x150 */

View File

@ -1284,7 +1284,7 @@ void mlerase( void) {
TTflush() ; TTflush() ;
} }
static void mlputc( char c) { static void mlputc( unicode_t c) {
if( ttcol < term.t_ncol) { if( ttcol < term.t_ncol) {
TTputc( c) ; TTputc( c) ;
++ttcol ; ++ttcol ;
@ -1297,9 +1297,11 @@ static void mlputc( char c) {
* char *s; string to output * char *s; string to output
*/ */
void ostring( char *s) { void ostring( char *s) {
unsigned char c ;
if( discmd) if( discmd)
while( *s) while( (c = *s++) != 0)
mlputc( *s++ & 0xFF) ; mlputc( c) ;
} }
@ -1552,7 +1554,7 @@ static int newscreensize(int h, int w)
* *
* char c ; character to output * char c ; character to output
*/ */
void echoc( char c) { void echoc( unicode_t c) {
if( disinp) if( disinp)
TTputc( c) ; TTputc( c) ;
} }

View File

@ -4,6 +4,7 @@
#include <stdarg.h> #include <stdarg.h>
#include "estruct.h" #include "estruct.h"
#include "utf8.h"
extern int mpresf ; /* Stuff in message line */ extern int mpresf ; /* Stuff in message line */
extern int scrollcount ; /* number of lines to scroll */ extern int scrollcount ; /* number of lines to scroll */
@ -28,7 +29,7 @@ void mlerase( void) ;
void vmlwrite( const char *fmt, va_list ap) ; void vmlwrite( const char *fmt, va_list ap) ;
void mlwrite( const char *fmt, ...) ; void mlwrite( const char *fmt, ...) ;
void ostring( char *s) ; void ostring( char *s) ;
void echoc( char c) ; void echoc( unicode_t c) ;
void echos( char *s) ; void echos( char *s) ;
void getscreensize( int *widthp, int *heightp) ; void getscreensize( int *widthp, int *heightp) ;

View File

@ -724,7 +724,7 @@ int getstring( const char *prompt, char *buf, int nbuf, int eolchar)
for (n = 0; n < cpos; n++) { for (n = 0; n < cpos; n++) {
c = buf[n]; c = buf[n];
if ((c < ' ') && (c != '\n')) { if ((c < ' ') && (c != '\n')) {
echos("^"); echoc( '^') ;
++ttcol; ++ttcol;
c ^= 0x40; c ^= 0x40;
} }
@ -751,7 +751,7 @@ int getstring( const char *prompt, char *buf, int nbuf, int eolchar)
buf[cpos++] = c; buf[cpos++] = c;
if ((c < ' ') && (c != '\n')) { if ((c < ' ') && (c != '\n')) {
echos("^"); echoc( '^') ;
++ttcol; ++ttcol;
c ^= 0x40; c ^= 0x40;
} }

View File

@ -119,8 +119,7 @@ void ttclose(void)
* On CPM terminal I/O unbuffered, so we just write the byte out. Ditto on * On CPM terminal I/O unbuffered, so we just write the byte out. Ditto on
* MS-DOS (use the very very raw console output routine). * MS-DOS (use the very very raw console output routine).
*/ */
int ttputc(int c) int ttputc( unicode_t c) {
{
char utf8[6]; char utf8[6];
int bytes; int bytes;

2
tcap.c
View File

@ -370,6 +370,6 @@ static void tcapbeep(void)
static void putpad(char *str) static void putpad(char *str)
{ {
tputs(str, 1, ttputc); tputs( str, 1, (int (*)( int)) ttputc) ;
} }
#endif /* TERMCAP */ #endif /* TERMCAP */

View File

@ -4,6 +4,7 @@
#include "defines.h" /* COLOR, SCROLLCODE */ #include "defines.h" /* COLOR, SCROLLCODE */
#include "retcode.h" #include "retcode.h"
#include "utf8.h"
/* /*
* The editor communicates with the display using a high level interface. A * The editor communicates with the display using a high level interface. A
@ -27,7 +28,7 @@ struct terminal {
void (*t_kopen)(void); /* Open keyboard */ void (*t_kopen)(void); /* Open keyboard */
void (*t_kclose)(void); /* close keyboard */ void (*t_kclose)(void); /* close keyboard */
int (*t_getchar)(void); /* Get character from keyboard. */ int (*t_getchar)(void); /* Get character from keyboard. */
int (*t_putchar)(int); /* Put character to display. */ int (*t_putchar)( unicode_t) ; /* Put character to display. */
void (*t_flush) (void); /* Flush output buffers. */ void (*t_flush) (void); /* Flush output buffers. */
void (*t_move)(int, int);/* Move the cursor, origin 0. */ void (*t_move)(int, int);/* Move the cursor, origin 0. */
void (*t_eeol)(void); /* Erase to end of line. */ void (*t_eeol)(void); /* Erase to end of line. */

View File

@ -281,7 +281,7 @@ void ttclose(void)
* On CPM terminal I/O unbuffered, so we just write the byte out. Ditto on * On CPM terminal I/O unbuffered, so we just write the byte out. Ditto on
* MS-DOS (use the very very raw console output routine). * MS-DOS (use the very very raw console output routine).
*/ */
int ttputc( int c) { int ttputc( unicode_t c) {
#if VMS #if VMS
if (nobuf >= NOBUF) if (nobuf >= NOBUF)
ttflush(); ttflush();

View File

@ -1,6 +1,8 @@
#ifndef _TERMIO_H_ #ifndef _TERMIO_H_
#define _TERMIO_H_ #define _TERMIO_H_
#include "utf8.h"
#define TYPEAH 1 /* type ahead causes update to be skipped */ #define TYPEAH 1 /* type ahead causes update to be skipped */
#define HUGE 1000 /* Huge number (for row/col) */ #define HUGE 1000 /* Huge number (for row/col) */
@ -10,7 +12,7 @@ extern int ttcol ; /* Column location of HW cursor */
void ttopen( void) ; void ttopen( void) ;
void ttclose( void) ; void ttclose( void) ;
int ttputc( int c) ; int ttputc( unicode_t c) ;
void ttflush( void) ; void ttflush( void) ;
int ttgetc( void) ; int ttgetc( void) ;
int typahead( void) ; int typahead( void) ;