diff --git a/Makefile b/Makefile index 4311b03..40a7216 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ -# Makefile for emacs, updated Tue, Jul 31, 2018 20:37:16 +# Makefile for uEMACS, updated Tue, Aug 13, 2019 7:59:24 AM SRC=basic.c bind.c bindable.c buffer.c display.c ebind.c eval.c exec.c execute.c file.c fileio.c flook.c input.c isearch.c line.c lock.c main.c mingw32.c mlout.c names.c pklock.c posix.c random.c region.c search.c spawn.c tcap.c termio.c utf8.c util.c window.c word.c wrapper.c wscreen.c OBJ=basic.o bind.o bindable.o buffer.o display.o ebind.o eval.o exec.o execute.o file.o fileio.o flook.o input.o isearch.o line.o lock.o main.o mingw32.o mlout.o names.o pklock.o posix.o random.o region.o search.o spawn.o tcap.o termio.o utf8.o util.o window.o word.o wrapper.o wscreen.o -HDR=basic.h bind.h bindable.h buffer.h defines.h display.h ebind.h estruct.h eval.h exec.h execute.h file.h fileio.h flook.h input.h isearch.h line.h lock.h mlout.h names.h pklock.h random.h region.h retcode.h search.h spawn.h terminal.h termio.h utf8.h util.h version.h window.h word.h wrapper.h wscreen.h +HDR=basic.h bind.h bindable.h buffer.h defines.h display.h ebind.h estruct.h eval.h exec.h execute.h file.h fileio.h flook.h input.h isa.h isearch.h line.h lock.h mlout.h names.h pklock.h random.h region.h retcode.h search.h spawn.h terminal.h termio.h utf8.h util.h version.h window.h word.h wrapper.h wscreen.h # DO NOT ADD OR MODIFY ANY LINES ABOVE THIS -- make source creates them @@ -100,7 +100,7 @@ tags: ${SRC} source: @mv Makefile Makefile.bak - @echo "# Makefile for emacs, updated `date`" >Makefile + @echo "# Makefile for uEMACS, updated `date`" >Makefile @echo '' >>Makefile #Sorted @echo SRC=`ls *.c` >>Makefile @@ -111,11 +111,12 @@ source: # @echo OBJ=$(patsubst %.c,%.o,$(wildcard *.c)) >>Makefile # @echo HDR=$(wildcard *.h) >>Makefile @echo '' >>Makefile - @sed -n -e '/^# DO NOT ADD OR MODIFY/,$$p' >Makefile + @sed -n -e '/^# DO NOT ADD OR MODIFY/,$$p' Makefile.bak >> Makefile depend: ${SRC} @mv Makefile Makefile.bak @sed -n -e '1,/^# DO NOT DELETE THIS LINE/p' Makefile.bak > Makefile + @echo "# Updated `date`" >> Makefile @echo >> Makefile @for i in ${SRC}; do\ $(CC) ${DEFINES} -MM $$i ; done >> Makefile @@ -129,6 +130,7 @@ depend: ${SRC} $(Q) ${CC} ${CFLAGS} ${DEFINES} -c $*.c # DO NOT DELETE THIS LINE -- make depend uses it +# Updated Tue, Aug 13, 2019 7:51:49 AM basic.o: basic.c basic.h retcode.h input.h bind.h mlout.h random.h \ terminal.h defines.h utf8.h window.h buffer.h line.h diff --git a/display.c b/display.c index 03138d7..9e8f6bd 100644 --- a/display.c +++ b/display.c @@ -228,8 +228,11 @@ static int vtputs( const char *s) { int n = 0 ; while( *s) { - vtputc( *s++) ; - n += 1 ; + unicode_t c ; + + s += utf8_to_unicode( s, 0, 4, &c) ; + vtputc( c) ; + n += 1 ; /* Assume non wide char unicode */ } return n ; @@ -1103,7 +1106,7 @@ static void modeline(struct window *wp) vtputc( ' ') ; if( n == term.t_nrow - 1) - n = 3 + vtputs( PROGRAM_NAME_LONG " " VERSION ": ") ; + n = 3 + vtputs( PROGRAM_NAME_UTF8 " " VERSION ": ") ; else n = 3 ; diff --git a/eval.c b/eval.c index d9225ba..8ab2c6f 100644 --- a/eval.c +++ b/eval.c @@ -738,7 +738,7 @@ static char *gtenv( char *vname) { case EVVERSION: return VERSION; case EVPROGNAME: - return PROGRAM_NAME_PFX PROGRAM_NAME_LONG ; + return PROGRAM_NAME_UTF8 ; case EVSEED: return i_to_a(seed); case EVDISINP: diff --git a/main.c b/main.c index b696561..5f0a9eb 100644 --- a/main.c +++ b/main.c @@ -103,7 +103,7 @@ static void emergencyexit(int signr) static void edinit( char *bname) ; static void version( void) { - fputs( PROGRAM_NAME_PFX PROGRAM_NAME_LONG " version " VERSION "\n", stdout) ; + fputs( PROGRAM_NAME_UTF8 " version " VERSION "\n", stdout) ; } diff --git a/utf8.c b/utf8.c index 7508b56..b35c509 100644 --- a/utf8.c +++ b/utf8.c @@ -17,7 +17,7 @@ * NOTE 2! This does *not* verify things like minimality. So overlong forms * are happily accepted and decoded, as are the various "invalid values". */ -unsigned utf8_to_unicode( char *line, unsigned index, unsigned len, +unsigned utf8_to_unicode( const char *line, unsigned index, unsigned len, unicode_t *res) { unicode_t value ; unsigned c ; diff --git a/utf8.h b/utf8.h index ff9203a..bfc6b16 100644 --- a/utf8.h +++ b/utf8.h @@ -3,7 +3,7 @@ typedef unsigned int unicode_t ; -unsigned utf8_to_unicode( char *line, unsigned index, unsigned len, +unsigned utf8_to_unicode( const char *line, unsigned index, unsigned len, unicode_t *res) ; unsigned utf8_revdelta( unsigned char *buf, unsigned pos) ; unsigned unicode_to_utf8( unicode_t c, char *utf8) ; diff --git a/version.h b/version.h index c2dda66..b2ab58d 100644 --- a/version.h +++ b/version.h @@ -9,9 +9,8 @@ # define PROGRAM_NAME "em" #endif -# define PROGRAM_NAME_PFX "\xC2" -# define PROGRAM_NAME_LONG "\xB5""EMACS" /* UTF-8 µEMACS */ +#define PROGRAM_NAME_UTF8 "µEMACS" -# define VERSION "4.2.4" +#define VERSION "4.2.4" #endif /* VERSION_H_ */