jupp26 jupp-3_1_26
authorThorsten Glaser <tg@mirbsd.org>
Thu, 7 Nov 2013 22:53:54 +0000 (22:53 +0000)
committerThorsten Glaser <tg@mirbsd.org>
Thu, 7 Nov 2013 22:53:54 +0000 (22:53 +0000)
19 files changed:
NEWS
builtins.c
bw.c
configure
configure.ac
jmacsrc.in
joerc.in
jpicorc.in
jstarrc.in
jupprc
kbd.c
main.c
rjoerc.in
scrn.c
syntax.c
tty.h
uedit.c
utf8.c
utf8.h

diff --git a/NEWS b/NEWS
index 5fd3f39..29c83bd 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,16 @@
-$MirOS: contrib/code/jupp/NEWS,v 1.76 2013/08/19 23:05:07 tg Exp $
+$MirOS: contrib/code/jupp/NEWS,v 1.83 2013/11/07 22:19:02 tg Exp $
 ------------------------------------------------------------------
 
+JOE 3.1jupp26
+
+- Syntax files are now both parsed and applied on bytes, not characters;
+  matching on Unicode characters is possible using buffer/strings though
+- Prevent segfault on ‘`…’ (out-of-bounds keymap array access)
+- Fix m{,s}{old,new} operation when opening multiple files from cmdline
+- Update “visible spaces” while typing and fix it for nōn-UTF8 files
+- jupprc: No longer wordwrap *.{asc,doc,txt} by default
+- Add five or six hooks for modification to rc files (Natureshadow’s idea)
+
 JOE 3.1jupp25
 
 - Better colouring of diffs; better support for CVS and git
index 2da9d2b..aeb20de 100644 (file)
@@ -142,9 +142,10 @@ const unsigned char * const builtins[]=
                "\\i \\i go to \\uhttp://sf.net/projects/joe-editor/\\u for upstream bug reports. JUPP 2.8 \\i \\i\n"
                "\\i \\i for DOS compiled by A. Totlis, packed with LHarc 2.13; JUPP 3.x for UNIX\\d(R)\\d \\i \\i\n"
                "\\i \\i at \\uhttp://mirbsd.de/jupp\\u and by \\bThorsten \"\\dmirabilos\\d\" Glaser <\\utg@mirbsd.org\\u>\\b \\i \\i\n"
-               "\\i \\i @(#) blt_in 2013-08-19; 3.1; autoCR-LF; UTF-8 via locale; per-file encoding \\i \\i\n"
+               "\\i \\i @(#) blt_in 2013-11-07; 3.1; autoCR-LF; UTF-8 via locale; per-file encoding \\i \\i\n"
                "}\n"
                "\n"
+               "\n"
                "{CharTable\n"
                "\\i   Help Screen    turn off with ^J     prev. screen ^[,    \\uCharacter Map\\u       \\i\n"
                "\\i \\i Dec Hex  \\u 0123 4567  89AB CDEF    0123 4567  89AB CDEF \\u  Hex Dec            \\i \\i\n"
@@ -531,5 +532,5 @@ const unsigned char * const builtins[]=
                ":querysr\n"
                "type           ^@ TO \xFF\n"
 ,      NULL
-,      "@(#) $MirOS: contrib/code/jupp/builtins.c,v 1.17 2013/08/19 23:05:08 tg Exp $"
+,      "@(#) $MirOS: contrib/code/jupp/builtins.c,v 1.18 2013/11/07 22:19:02 tg Exp $"
 };
diff --git a/bw.c b/bw.c
index 417fda5..0804e43 100644 (file)
--- a/bw.c
+++ b/bw.c
@@ -1,4 +1,4 @@
-/* $MirOS: contrib/code/jupp/bw.c,v 1.18 2012/12/30 21:45:12 tg Exp $ */
+/* $MirOS: contrib/code/jupp/bw.c,v 1.19 2013/11/07 21:50:35 tg Exp $ */
 /*
  *     Edit buffer window generation
  *     Copyright
@@ -309,8 +309,6 @@ void bwdel(BW *w, long int l, long int n, int flg)
 
 /* Update a single line */
 
-#define maybe_from_uni(map,ch) ((bw->b->o.charmap->type) ? (ch) : from_uni(map, ch))
-
 static int lgen(SCRN *t, int y, int *screen, int *attr, int x, int w, P *p, long int scr, long int from, long int to,int st,BW *bw)
         
       
@@ -418,10 +416,7 @@ static int lgen(SCRN *t, int y, int *screen, int *attr, int x, int w, P *p, long
                                ta = p->b->o.tab - col % p->b->o.tab;
                                if (ta + col > scr) {
                                        ta -= scr - col;
-                                       tach1 = tach = ' ';
-                                       if (bw->o.vispace)
-                                               tach = maybe_from_uni(locale_map, 0x2192);
-                                       goto dota;
+                                       goto dota_tab;
                                }
                                if ((col += ta) == scr) {
                                        --amnt;
@@ -456,7 +451,7 @@ static int lgen(SCRN *t, int y, int *screen, int *attr, int x, int w, P *p, long
                                        } else if (col > scr) {
                                                ta = col - scr;
                                                tach1 = tach = '<';
-                                               goto dota;
+                                               goto dota_gen;
                                        }
                                } else
                                        --idx;  /* Get highlighting character again.. */
@@ -532,12 +527,13 @@ static int lgen(SCRN *t, int y, int *screen, int *attr, int x, int w, P *p, long
                        ++byte;
                        if (bc == '\t') {
                                ta = p->b->o.tab - ((x - ox + scr) % p->b->o.tab);
+ dota_tab:
                                tach1 = tach = ' ';
                                if (bw->o.vispace)
-                                       tach = maybe_from_uni(locale_map, 0x2192);
                            dota:
+                                       tach = 0x2192;
dota_gen:
                                do {
-                                       outatr(bw->b->o.charmap, t, screen + x, attr + x, x, y, tach, c1|atr);
+                                       outatr(utf8_map, t, screen + x, attr + x, x, y, tach, c1|atr);
                                        tach = tach1;
                                        if (ifhave)
                                                goto bye;
@@ -587,9 +583,10 @@ static int lgen(SCRN *t, int y, int *screen, int *attr, int x, int w, P *p, long
                                        } else if (utf8_char == 0x1000FFFE) while (wid--) {
                                                outatr(bw->b->o.charmap, t, screen + x, attr + x, x, y, 0xFFFD, (c1|atr|UNDERLINE)^INVERSE);
                                                x++;
+                                       } else if (bw->o.vispace && (utf8_char == 0x20)) {
+                                               outatr(utf8_map, t, screen + x, attr + x, x, y, 0xB7, c1|atr);
+                                               x += wid;
                                        } else {
-                                               if (bw->o.vispace && (utf8_char == 0x20))
-                                                       utf8_char = maybe_from_uni(locale_map, 0xB7);
                                                outatr(bw->b->o.charmap, t, screen + x, attr + x, x, y, utf8_char, c1|atr);
                                                x += wid;
                                        }
index de712d6..4e095a7 100644 (file)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61-MirPorts-1 for joe 3.1jupp25.
+# Generated by GNU Autoconf 2.61-MirPorts-1 for joe 3.1jupp26.
 #
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
 # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
@@ -572,8 +572,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
 # Identity of this package.
 PACKAGE_NAME='joe'
 PACKAGE_TARNAME='joe'
-PACKAGE_VERSION='3.1jupp25'
-PACKAGE_STRING='joe 3.1jupp25'
+PACKAGE_VERSION='3.1jupp26'
+PACKAGE_STRING='joe 3.1jupp26'
 PACKAGE_BUGREPORT=''
 
 ac_unique_file="b.c"
@@ -1223,7 +1223,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures joe 3.1jupp25 to adapt to many kinds of systems.
+\`configure' configures joe 3.1jupp26 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1294,7 +1294,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of joe 3.1jupp25:";;
+     short | recursive ) echo "Configuration of joe 3.1jupp26:";;
    esac
   cat <<\_ACEOF
 
@@ -1385,7 +1385,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-joe configure 3.1jupp25
+joe configure 3.1jupp26
 generated by GNU Autoconf 2.61-MirPorts-1
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1399,7 +1399,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by joe $as_me 3.1jupp25, which was
+It was created by joe $as_me 3.1jupp26, which was
 generated by GNU Autoconf 2.61-MirPorts-1.  Invocation command line was
 
   $ $0 $@
@@ -2200,7 +2200,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='joe'
- VERSION='3.1jupp25'
+ VERSION='3.1jupp26'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -10908,7 +10908,7 @@ exec 6>&1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by joe $as_me 3.1jupp25, which was
+This file was extended by joe $as_me 3.1jupp26, which was
 generated by GNU Autoconf 2.61-MirPorts-1.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -10961,7 +10961,7 @@ Report bugs to <bug-autoconf@gnu.org>."
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
-joe config.status 3.1jupp25
+joe config.status 3.1jupp26
 configured by $0, generated by GNU Autoconf 2.61-MirPorts-1,
   with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
index 465dd30..f263a0d 100644 (file)
@@ -1,4 +1,4 @@
-# $MirOS: contrib/code/jupp/configure.ac,v 1.43 2013/08/19 19:23:44 tg Exp $
+# $MirOS: contrib/code/jupp/configure.ac,v 1.44 2013/11/07 22:17:43 tg Exp $
 #-
 # Process this file with autoconf to produce a configure script.
 
@@ -6,7 +6,7 @@
 AC_PREREQ(2.54)
 
 #### Here's the only place where to change version number ####
-AC_INIT(joe, 3.1jupp25)
+AC_INIT(joe, 3.1jupp26)
 #### But see main.c for the Copyright (c) owner and year! ####
 AC_CONFIG_SRCDIR([b.c])
 
index e9d5d04..ff8dc4b 100644 (file)
@@ -1,4 +1,4 @@
- $MirOS: contrib/code/jupp/jmacsrc.in,v 1.15 2013/08/19 19:20:21 tg Exp $
+ $MirOS: contrib/code/jupp/jmacsrc.in,v 1.17 2013/11/07 22:14:31 tg Exp $
 
                          Initialization file for JOE
                                 GNU-Emacs Joe
 -smartbacks
 --wordwrap
 
+ #HOOK#1 global/default flags
+
  === Generic files
  No '.' in filename?
 *
 *.tcl
 -syntax tcl
 
- === Text
-*.asc
--wordwrap
-
-*.doc
--wordwrap
-
-*.txt
--wordwrap
-
  === Verilog
 *.v
 -syntax verilog
 *.y
 -syntax yacc
 
+ === Text (except in jupp)
+*.asc
+-wordwrap
+
+*.doc
+-wordwrap
+
+*.txt
+-wordwrap
+
+ #HOOK#2 filename matching
+
  THIRD SECTION: Named help screens:
 
  Use \i to turn on/off inverse video
 \i \i For bug reports and other information, refer to: \uhttp://mirbsd.de/jupp\u      \|\i \i
 }
 
+ #HOOK#3 additional help screens
+
 {CharTable
 \i   Help Screen    turn off with ^J     prev. screen ^[,    \uCharacter Map\u       \i
 \i \i Dec Hex  \u 0123 4567  89AB CDEF    0123 4567  89AB CDEF \u  Hex Dec            \i \i
  Macros may cross lines if they end with ,
 
 :windows               Bindings common to all windows
+ #HOOK#4 common keybindings
 type           ^@ TO ÿ         Self insert
 abort          ^G              Abort window
 abort          ^X ^C
@@ -765,6 +772,8 @@ keymap,"prompt",rtn                 ^D
 helpcard,"Paste",rtn,keymap,"Paste",rtn        ^[ [ 2 0 0 ~
 nop                                    ^[ [ 2 0 1 ~
 
+ #HOOK#5 main keybindings
+
   ESC-x compile
 
 :def compile querysave,query,scratch,"* Build Log *",rtn,bof,markb,eof," ",markk,blkdel,build
index 228baa5..a3e4c47 100644 (file)
--- a/joerc.in
+++ b/joerc.in
@@ -1,4 +1,4 @@
- $MirOS: contrib/code/jupp/joerc.in,v 1.15 2013/08/19 19:20:21 tg Exp $
+ $MirOS: contrib/code/jupp/joerc.in,v 1.17 2013/11/07 22:14:31 tg Exp $
 
                          Initialization file for JOE
                                 Standard Joe
 -tab 8
 --wordwrap
 
+ #HOOK#1 global/default flags
+
  === Generic files
  No '.' in filename?
 *
 *.tcl
 -syntax tcl
 
- === Text
-*.asc
--wordwrap
-
-*.doc
--wordwrap
-
-*.txt
--wordwrap
-
  === Verilog
 *.v
 -syntax verilog
 *.y
 -syntax yacc
 
+ === Text (except in jupp)
+*.asc
+-wordwrap
+
+*.doc
+-wordwrap
+
+*.txt
+-wordwrap
+
+ #HOOK#2 filename matching
+
  THIRD SECTION: Named help screens:
 
  Use \i to turn on/off inverse video
 \i \i For bug reports and other information, refer to: \uhttp://mirbsd.de/jupp\u      \|\i \i
 }
 
+ #HOOK#3 additional help screens
+
 {CharTable
 \i   Help Screen    turn off with ^J     prev. screen ^[,    \uCharacter Map\u       \i
 \i \i Dec Hex  \u 0123 4567  89AB CDEF    0123 4567  89AB CDEF \u  Hex Dec            \i \i
  To define a command foo which will goto the beginning of the last line.
 
 :windows               Bindings common to all windows
+ #HOOK#4 common keybindings
 type           ^@ TO ÿ         Type a character
 abort          ^C              Abort window
 abort          ^K Q
@@ -825,6 +832,8 @@ keymap,"prompt",rtn                 ^D
 helpcard,"Paste",rtn,keymap,"Paste",rtn        ^[ [ 2 0 0 ~
 nop                                    ^[ [ 2 0 1 ~
 
+ #HOOK#5 main keybindings
+
  Spell-check macros
 
  Ispell
@@ -1179,6 +1188,7 @@ type              ^@ TO 
 
 :cua                   Undo/Cut/Copy/Paste, CUA style
 :inherit main
+ #HOOK#6 extra keybindings in CUA mode
 undo           ^Z
 blkdel,nmark   ^X
 copy           ^C
index 2993af5..3fc4802 100644 (file)
@@ -1,4 +1,4 @@
- $MirOS: contrib/code/jupp/jpicorc.in,v 1.15 2013/08/19 19:20:22 tg Exp $
+ $MirOS: contrib/code/jupp/jpicorc.in,v 1.17 2013/11/07 22:14:31 tg Exp $
 
                          Initialization file for JOE
                                  Super Pico
 -tab 8
 --wordwrap
 
+ #HOOK#1 global/default flags
+
  === Generic files
  No '.' in filename?
 *
 *.tcl
 -syntax tcl
 
- === Text
-*.asc
--wordwrap
-
-*.doc
--wordwrap
-
-*.txt
--wordwrap
-
  === Verilog
 *.v
 -syntax verilog
 *.y
 -syntax yacc
 
+ === Text (except in jupp)
+*.asc
+-wordwrap
+
+*.doc
+-wordwrap
+
+*.txt
+-wordwrap
+
+ #HOOK#2 filename matching
+
  THIRD SECTION: Named help screens:
 
  Use \i to turn on/off inverse video
 \i \i For bug reports and other information, refer to: \uhttp://mirbsd.de/jupp\u      \|\i \i
 }
 
+ #HOOK#3 additional help screens
+
 {CharTable
 \i   Help Screen    turn off with ^J     prev. screen ^[,    \uCharacter Map\u       \i
 \i \i Dec Hex  \u 0123 4567  89AB CDEF    0123 4567  89AB CDEF \u  Hex Dec            \i \i
  To define a command foo which will goto the beginning of the last line.
 
 :windows               Bindings common to all windows
+ #HOOK#4 common keybindings
 type           ^@ TO ÿ         Type a character
 abort          ^C              Abort window
 arg            ^[ \            Repeat next command
@@ -784,6 +791,8 @@ keymap,"prompt",rtn                 ^D
 helpcard,"Paste",rtn,keymap,"Paste",rtn        ^[ [ 2 0 0 ~
 nop                                    ^[ [ 2 0 1 ~
 
+ #HOOK#5 main keybindings
+
 begin_marking,uparw,toggle_marking     ^[ [ 1 ; 2 A    xterm shift-up mark
 begin_marking,dnarw,toggle_marking     ^[ [ 1 ; 2 B    xterm shift-down mark
 begin_marking,rtarw,toggle_marking     ^[ [ 1 ; 2 C    xterm shift-right mark
index 53682f5..c382b0f 100644 (file)
@@ -1,4 +1,4 @@
- $MirOS: contrib/code/jupp/jstarrc.in,v 1.15 2013/08/19 19:20:22 tg Exp $
+ $MirOS: contrib/code/jupp/jstarrc.in,v 1.17 2013/11/07 22:14:31 tg Exp $
 
                          Initialization file for JOE
                            WordStar / Turbo-C Joe
 -tab 8
 --wordwrap
 
+ #HOOK#1 global/default flags
+
  === Generic files
  No '.' in filename?
 *
 *.tcl
 -syntax tcl
 
- === Text
-*.asc
--wordwrap
-
-*.doc
--wordwrap
-
-*.txt
--wordwrap
-
  === Verilog
 *.v
 -syntax verilog
 *.y
 -syntax yacc
 
+ === Text (except in jupp)
+*.asc
+-wordwrap
+
+*.doc
+-wordwrap
+
+*.txt
+-wordwrap
+
+ #HOOK#2 filename matching
+
  THIRD SECTION: Named help screens:
 
  Use \i to turn on/off inverse video
 \i \i For bug reports and other information, refer to: \uhttp://mirbsd.de/jupp\u      \|\i \i
 }
 
+ #HOOK#3 additional help screens
+
 {CharTable
 \i   Help Screen    turn off with ^J     prev. screen ^[,    \uCharacter Map\u       \i
 \i \i Dec Hex  \u 0123 4567  89AB CDEF    0123 4567  89AB CDEF \u  Hex Dec            \i \i
  Macros may cross lines if they end with ,
 
 :windows               Bindings common to all windows
+ #HOOK#4 common keybindings
 type           ^@ TO ÿ
 abort          ^K Q
 abort          ^K ^Q
@@ -784,6 +791,8 @@ keymap,"prompt",rtn                 ^D
 helpcard,"Paste",rtn,keymap,"Paste",rtn        ^[ [ 2 0 0 ~
 nop                                    ^[ [ 2 0 1 ~
 
+ #HOOK#5 main keybindings
+
 begin_marking,uparw,toggle_marking     ^[ [ 1 ; 2 A    xterm shift-up mark
 begin_marking,dnarw,toggle_marking     ^[ [ 1 ; 2 B    xterm shift-down mark
 begin_marking,rtarw,toggle_marking     ^[ [ 1 ; 2 C    xterm shift-right mark
@@ -1117,6 +1126,7 @@ type              ^@ TO 
 
 :cua                   Undo/Cut/Copy/Paste, CUA style
 :inherit main
+ #HOOK#6 extra keybindings in CUA mode
 undo           ^Z
 blkdel,nmark   ^X
 copy           ^C
diff --git a/jupprc b/jupprc
index 78be3a0..efc352f 100644 (file)
--- a/jupprc
+++ b/jupprc
@@ -47,6 +47,8 @@
 -tab 8
 --wordwrap
 
+ #HOOK#1 global/default flags
+
  === Generic files
  No '.' in filename?
 *
 *.tcl
 -syntax tcl
 
- === Text
-*.asc
--wordwrap
-
-*.doc
--wordwrap
-
-*.txt
--wordwrap
-
  === Verilog
 *.v
 -syntax verilog
 *.y
 -syntax yacc
 
+ #HOOK#2 filename matching
+
 {Basic
 \i   Help Screen    turn off with ^J     more help with ESC . (^[.)              \i
 \i \i\u\bCURSOR\b\u           \u\bGOTO\b\u             \u\bBLOCK\b\u    \u\bDELETE\b\u    \u\bMISC\b\u         \u\bEXIT\b\u       \i \i
 \i \i go to \uhttp://sf.net/projects/joe-editor/\u for upstream bug reports. JUPP 2.8 \i \i
 \i \i for DOS compiled by A. Totlis, packed with LHarc 2.13; JUPP 3.x for UNIX\d(R)\d \i \i
 \i \i at \uhttp://mirbsd.de/jupp\u and by \bThorsten "\dmirabilos\d" Glaser <\utg@mirbsd.org\u>\b \i \i
-\i \i @(#) jupprc 2013-08-19; 3.1; autoCR-LF; UTF-8 via locale; per-file encoding \i \i
+\i \i @(#) jupprc 2013-11-07; 3.1; autoCR-LF; UTF-8 via locale; per-file encoding \i \i
 }
 
+ #HOOK#3 additional help screens
+
 {CharTable
 \i   Help Screen    turn off with ^J     prev. screen ^[,    \uCharacter Map\u       \i
 \i \i Dec Hex  \u 0123 4567  89AB CDEF    0123 4567  89AB CDEF \u  Hex Dec            \i \i
 }
 
 :windows
+ #HOOK#4 common keybindings
 type           ^@ TO ÿ
 abort          ^K Q
 abort          ^K ^Q
@@ -580,6 +577,7 @@ keymap,"prompt",rtn                 ^D
 
 :main
 :inherit windows
+ #HOOK#5 main keybindings
 bof,qrepl,"\\[",quote,"i",quote,"k",quote,"l",quote,"m ]\\+\\[",quote,"i",quote,"k",quote,"l",quote,"m ]\\$",rtn,rtn,rtn,"r",eof       ^K ]
 edit,rtn,filt,query,parserr    ^[ C
 edit,rtn,filt,query,parserr    ^[ c
@@ -887,6 +885,7 @@ type                ^@ TO 
 
 :cua
 :inherit main
+ #HOOK#6 extra keybindings in CUA mode
 undo           ^Z
 blkdel,nmark   ^X
 copy           ^C
diff --git a/kbd.c b/kbd.c
index a09fd5e..f548416 100644 (file)
--- a/kbd.c
+++ b/kbd.c
@@ -1,4 +1,4 @@
-/* $MirOS: contrib/code/jupp/kbd.c,v 1.2 2008/05/13 13:08:23 tg Exp $ */
+/* $MirOS: contrib/code/jupp/kbd.c,v 1.3 2013/10/23 18:46:59 tg Exp $ */
 /*
  *     Key-map handler
  *     Copyright
@@ -45,6 +45,10 @@ void *dokey(KBD *kbd, int n)
        if (n < 0)
                n += 256;
 
+       /* kmap->keys[KEYS]; */
+       if ((size_t)n >= (size_t)(KEYS))
+               return (NULL);
+
        /* If we're starting from scratch, clear the keymap sequence buffer */
        if (kbd->curmap == kbd->topmap)
                kbd->x = 0;
diff --git a/main.c b/main.c
index fe26d80..73ae918 100644 (file)
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $MirOS: contrib/code/jupp/main.c,v 1.21 2013/08/19 23:05:11 tg Exp $ */
+/* $MirOS: contrib/code/jupp/main.c,v 1.22 2013/11/07 21:15:04 tg Exp $ */
 
 #define JUPP_IS_COPYRIGHT_C_BY "2013 mirabilos"
 
@@ -187,7 +187,7 @@ int main(int argc, char **argv, char **envp)
        unsigned char *s;
        unsigned char *run;
        SCRN *n;
-       int opened = 0;
+       W *opened = NULL;
        int omid;
        int backopt;
        int c;
@@ -346,19 +346,23 @@ int main(int argc, char **argv, char **envp)
                                }
                                bw->b->o = bw->o;
                                bw->b->rdonly = bw->o.readonly;
-                               if (!opened)
-                                       maint->curwin = bw->parent;
+                               if (!opened || opened == (void *)&opened)
+                                       opened = bw->parent;
+                               maint->curwin = bw->parent;
                                if (er == -1 && bw->o.mnew)
                                        exemac(bw->o.mnew);
                                if (er == 0 && bw->o.mold)
                                        exemac(bw->o.mold);
+                               maint->curwin = opened;
                                if (lnum > 0)
                                        pline(bw->cursor, lnum - 1);
                        }
-                       opened = 1;
+                       if (!opened)
+                               opened = (void *)&opened;
                        backopt = 0;
                }
 
+       maint->curwin = opened == (void *)&opened ? NULL : opened;
        if (opened) {
                wshowall(maint);
                omid = mid;
index ac0a1e3..6a11c52 100644 (file)
--- a/rjoerc.in
+++ b/rjoerc.in
@@ -1,4 +1,4 @@
- $MirOS: contrib/code/jupp/rjoerc.in,v 1.15 2013/08/19 19:20:23 tg Exp $
+ $MirOS: contrib/code/jupp/rjoerc.in,v 1.17 2013/11/07 22:14:32 tg Exp $
 
                          Initialization file for JOE
                             Restricted access Joe
 -tab 8
 --wordwrap
 
+ #HOOK#1 global/default flags
+
  === Generic files
  No '.' in filename?
 *
 *.tcl
 -syntax tcl
 
- === Text
-*.asc
--wordwrap
-
-*.doc
--wordwrap
-
-*.txt
--wordwrap
-
  === Verilog
 *.v
 -syntax verilog
 *.y
 -syntax yacc
 
+ === Text (except in jupp)
+*.asc
+-wordwrap
+
+*.doc
+-wordwrap
+
+*.txt
+-wordwrap
+
+ #HOOK#2 filename matching
+
  THIRD SECTION: Named help screens:
 
  Use \i to turn on/off inverse video
 \i \i For bug reports and other information, refer to: \uhttp://mirbsd.de/jupp\u      \|\i \i
 }
 
+ #HOOK#3 additional help screens
+
 {CharTable
 \i   Help Screen    turn off with ^J     prev. screen ^[,    \uCharacter Map\u       \i
 \i \i Dec Hex  \u 0123 4567  89AB CDEF    0123 4567  89AB CDEF \u  Hex Dec            \i \i
  To define a command foo which will goto the beginning of the last line.
 
 :windows               Bindings common to all windows
+ #HOOK#4 common keybindings
 type           ^@ TO ÿ         Type a character
 abort          ^C              Abort window
 abort          ^K Q
@@ -808,6 +815,8 @@ keymap,"prompt",rtn                 ^D
 helpcard,"Paste",rtn,keymap,"Paste",rtn        ^[ [ 2 0 0 ~
 nop                                    ^[ [ 2 0 1 ~
 
+ #HOOK#5 main keybindings
+
  Spell-check macros
 
  Ispell
@@ -1155,6 +1164,7 @@ type              ^@ TO 
 
 :cua                   Undo/Cut/Copy/Paste, CUA style
 :inherit main
+ #HOOK#6 extra keybindings in CUA mode
 undo           ^Z
 blkdel,nmark   ^X
 copy           ^C
diff --git a/scrn.c b/scrn.c
index ed23f2a..ec5fff4 100644 (file)
--- a/scrn.c
+++ b/scrn.c
@@ -1,4 +1,4 @@
-/* $MirOS: contrib/code/jupp/scrn.c,v 1.11 2012/12/30 21:45:17 tg Exp $ */
+/* $MirOS: contrib/code/jupp/scrn.c,v 1.12 2013/11/07 21:50:35 tg Exp $ */
 /*
  *     Device independant TTY interface for JOE
  *     Copyright
@@ -1860,7 +1860,7 @@ void genfield(SCRN *t,int *scrn,int *attr,int x,int y,int ofst,unsigned char *s,
                                if (x + wid > last_col) {
                                        /* Character crosses end of field, so fill balance of field with '>' characters instead */
                                        while (x < last_col) {
-                                               outatr(locale_map, t, scrn, attr, x, y, '>', my_atr);
+                                               outatr(utf8_map, t, scrn, attr, x, y, '>', my_atr);
                                                ++scrn;
                                                ++attr;
                                                ++x;
@@ -1877,7 +1877,7 @@ void genfield(SCRN *t,int *scrn,int *attr,int x,int y,int ofst,unsigned char *s,
                                wid -= ofst - col;
                                col = ofst;
                                while (wid) {
-                                       outatr(locale_map, t, scrn, attr, x, y, '<', my_atr);
+                                       outatr(utf8_map, t, scrn, attr, x, y, '<', my_atr);
                                        ++scrn;
                                        ++attr;
                                        ++x;
@@ -1890,7 +1890,7 @@ void genfield(SCRN *t,int *scrn,int *attr,int x,int y,int ofst,unsigned char *s,
        }
        /* Fill balance of field with spaces */
        while (x < last_col) {
-               outatr(locale_map, t, scrn, attr, x, y, ' ', 0);
+               outatr(utf8_map, t, scrn, attr, x, y, ' ', 0);
                ++x;
                ++scrn;
                ++attr;
@@ -1995,7 +1995,7 @@ void genfmt(SCRN *t, int x, int y, int ofst, const unsigned char *s, int flg)
                                                --wid;
                                        }
                                        while (wid) {
-                                               outatr(locale_map, t, scrn, attr, x, y, '<', atr);
+                                               outatr(utf8_map, t, scrn, attr, x, y, '<', atr);
                                                ++scrn;
                                                ++attr;
                                                ++x;
index 24945f1..cf0f105 100644 (file)
--- a/syntax.c
+++ b/syntax.c
@@ -1,4 +1,4 @@
-/* $MirOS: contrib/code/jupp/syntax.c,v 1.9 2012/12/22 00:06:14 tg Exp $ */
+/* $MirOS: contrib/code/jupp/syntax.c,v 1.10 2013/09/27 00:51:52 tg Exp $ */
 /*
  *     Syntax highlighting DFA interpreter
  *     Copyright
@@ -41,14 +41,10 @@ int parse(struct high_syntax *syntax,P *line,int state)
        int ofst = 0;   /* record offset after we've stopped buffering */
 
        /* Get next character */
-       while((c=pgetc(line))!=NO_MORE_DATA) {
+       while((c=pgetb(line))!=NO_MORE_DATA) {
                struct high_cmd *cmd, *kw_cmd;
                int x;
 
-               /* Hack so we can have UTF-8 characters without crashing */
-               if (c < 0 || c > 255)
-                       c = 0x1F;
-
                /* Expand attribute array if necessary */
                if(attr==attr_end) {
                        attr_buf = realloc(attr_buf,sizeof(int)*(attr_size*2));
diff --git a/tty.h b/tty.h
index accb93f..124bfa6 100644 (file)
--- a/tty.h
+++ b/tty.h
@@ -1,4 +1,4 @@
-/* $MirOS: contrib/code/jupp/tty.h,v 1.5 2012/12/30 18:18:07 tg Exp $ */
+/* $MirOS: contrib/code/jupp/tty.h,v 1.6 2013/10/31 20:05:43 tg Exp $ */
 /*
  *     TTY interface header file
  *     Copyright
@@ -148,7 +148,7 @@ extern int leave;
  */
 RETSIGTYPE ttsig PARAMS((int sig))
 #ifdef __GNUC__
-    __attribute__((noreturn))
+    __attribute__((__noreturn__))
 #endif
     ;
 
diff --git a/uedit.c b/uedit.c
index 3f9f42b..9fe800c 100644 (file)
--- a/uedit.c
+++ b/uedit.c
@@ -1,4 +1,4 @@
-/* $MirOS: contrib/code/jupp/uedit.c,v 1.10 2013/08/19 19:19:31 tg Exp $ */
+/* $MirOS: contrib/code/jupp/uedit.c,v 1.11 2013/11/07 21:50:36 tg Exp $ */
 /*
  *     Basic user edit functions
  *     Copyright
@@ -1131,7 +1131,17 @@ int utypebw_raw(BW *bw, int k, int no_decode)
                        simple = 0;
                if (simple && bw->parent->t->t->sary[bw->y + bw->cursor->line - bw->top->line])
                        simple = 0;
-               if (simple && k != '\t' && k != '\n' && !curmacro) {
+               else if (simple)
+                       switch (k) {
+                       case ' ':
+                               if (bw->o.vispace)
+                                       /* FALLTHROUGH */
+                       case '\t':
+                       case '\n':
+                                 simple = 0;
+                               break;
+                       }
+               if (simple && !curmacro) {
                        int atr = 0;
                        SCRN *t = bw->parent->t->t;
                        int y = bw->y + bw->cursor->line - bw->top->line;
diff --git a/utf8.c b/utf8.c
index d4b597d..870eecb 100644 (file)
--- a/utf8.c
+++ b/utf8.c
@@ -1,4 +1,4 @@
-/* $MirOS: contrib/code/jupp/utf8.c,v 1.9 2012/06/08 16:55:29 tg Exp $ */
+/* $MirOS: contrib/code/jupp/utf8.c,v 1.10 2013/11/07 21:50:36 tg Exp $ */
 /*
  *     UTF-8 Utilities
  *     Copyright
@@ -217,6 +217,8 @@ unsigned char *codeset;     /* Codeset of terminal */
 
 struct charmap *locale_map;
                        /* Character map of terminal */
+struct charmap *utf8_map;
+                       /* Handy character map for UTF-8 */
 
 void
 joe_locale(void)
@@ -251,9 +253,10 @@ joe_locale(void)
 #endif
        if (!locale_map)
                locale_map = find_charmap(US "ascii");
+       utf8_map = find_charmap(US "utf-8");
 
 #ifdef defutf8
-       fdefault.charmap = find_charmap(US "utf-8");
+       fdefault.charmap = utf8_map;
 #else
        fdefault.charmap = locale_map;
 #endif
diff --git a/utf8.h b/utf8.h
index 8a077ed..68e8f26 100644 (file)
--- a/utf8.h
+++ b/utf8.h
@@ -1,4 +1,4 @@
-/* $MirOS: contrib/code/jupp/utf8.h,v 1.3 2010/04/08 15:31:06 tg Exp $ */
+/* $MirOS: contrib/code/jupp/utf8.h,v 1.4 2013/11/07 21:50:36 tg Exp $ */
 /*
  *     UTF-8 Utilities
  *     Copyright
@@ -59,5 +59,6 @@ extern int utf8;
 int mk_wcwidth PARAMS((int wide,int c));
 
 extern struct charmap *locale_map;     /* Default bytemap of terminal */
+extern struct charmap *utf8_map;       /* Bytemap for UTF-8 */
 
 #endif