qemacs-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemacs-commit] qemacs .cvsignore Makefile arabic.c bufed.c buf...


From: Charlie Gordon
Subject: [Qemacs-commit] qemacs .cvsignore Makefile arabic.c bufed.c buf...
Date: Thu, 03 Jan 2008 09:51:33 +0000

CVSROOT:        /cvsroot/qemacs
Module name:    qemacs
Changes by:     Charlie Gordon <chqrlie>        08/01/03 09:51:33

Modified files:
        .              : .cvsignore Makefile arabic.c bufed.c buffer.c 
                         cfb.c cfb.h charset.c charsetjis.c 
                         charsetjis.def charsetmore.c clang.c cptoqe.c 
                         cutils.c cutils.h dired.c display.c display.h 
                         fbfrender.c fbfrender.h fbftoqe.c hex.c html.c 
                         html2png.c htmlsrc.c image.c indic.c input.c 
                         jistoqe.c kmaptoqe.c latex-mode.c libfbf.c 
                         libfbf.h ligtoqe.c list.c makemode.c mpeg.c 
                         perl.c qe-doc.html qe-doc.texi qe.c qe.h 
                         qeconfig.h qestyles.h qfribidi.c qfribidi.h 
                         shell.c tty.c unicode_join.c unihex.c unix.c 
                         util.c video.c win32.c x11.c xml.c 
        cp             : cpdata.txt 
        kmap           : HOWTO-keymap.txt 
        libqhtml       : css.c css.h cssparse.c docbook.css html.css 
                         htmlent.h xmlparse.c 

Log message:
        added remove_slash and append_slash path utilities
        renamed canonize to canonicalize
        added crude support for ~user -> /home/user
        added win32 specific stuff in basename
        added C-/ as an alias for C-_
        some cosmetics, moved code
        create files with mode 0644 in raw_save_buffer
        untabified, removed redundant spaces
        modified code generators to the same effect

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemacs/.cvsignore?cvsroot=qemacs&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/qemacs/Makefile?cvsroot=qemacs&r1=1.27&r2=1.28
http://cvs.savannah.gnu.org/viewcvs/qemacs/arabic.c?cvsroot=qemacs&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/qemacs/bufed.c?cvsroot=qemacs&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/qemacs/buffer.c?cvsroot=qemacs&r1=1.28&r2=1.29
http://cvs.savannah.gnu.org/viewcvs/qemacs/cfb.c?cvsroot=qemacs&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/qemacs/cfb.h?cvsroot=qemacs&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/qemacs/charset.c?cvsroot=qemacs&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/qemacs/charsetjis.c?cvsroot=qemacs&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/qemacs/charsetjis.def?cvsroot=qemacs&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/qemacs/charsetmore.c?cvsroot=qemacs&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/qemacs/clang.c?cvsroot=qemacs&r1=1.22&r2=1.23
http://cvs.savannah.gnu.org/viewcvs/qemacs/cptoqe.c?cvsroot=qemacs&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/qemacs/cutils.c?cvsroot=qemacs&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/qemacs/cutils.h?cvsroot=qemacs&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/qemacs/dired.c?cvsroot=qemacs&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/qemacs/display.c?cvsroot=qemacs&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/qemacs/display.h?cvsroot=qemacs&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/qemacs/fbfrender.c?cvsroot=qemacs&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/qemacs/fbfrender.h?cvsroot=qemacs&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/qemacs/fbftoqe.c?cvsroot=qemacs&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/qemacs/hex.c?cvsroot=qemacs&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/qemacs/html.c?cvsroot=qemacs&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/qemacs/html2png.c?cvsroot=qemacs&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/qemacs/htmlsrc.c?cvsroot=qemacs&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/qemacs/image.c?cvsroot=qemacs&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/qemacs/indic.c?cvsroot=qemacs&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/qemacs/input.c?cvsroot=qemacs&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/qemacs/jistoqe.c?cvsroot=qemacs&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/qemacs/kmaptoqe.c?cvsroot=qemacs&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/qemacs/latex-mode.c?cvsroot=qemacs&r1=1.20&r2=1.21
http://cvs.savannah.gnu.org/viewcvs/qemacs/libfbf.c?cvsroot=qemacs&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/qemacs/libfbf.h?cvsroot=qemacs&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/qemacs/ligtoqe.c?cvsroot=qemacs&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/qemacs/list.c?cvsroot=qemacs&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/qemacs/makemode.c?cvsroot=qemacs&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/qemacs/mpeg.c?cvsroot=qemacs&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/qemacs/perl.c?cvsroot=qemacs&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/qemacs/qe-doc.html?cvsroot=qemacs&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/qemacs/qe-doc.texi?cvsroot=qemacs&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/qemacs/qe.c?cvsroot=qemacs&r1=1.57&r2=1.58
http://cvs.savannah.gnu.org/viewcvs/qemacs/qe.h?cvsroot=qemacs&r1=1.53&r2=1.54
http://cvs.savannah.gnu.org/viewcvs/qemacs/qeconfig.h?cvsroot=qemacs&r1=1.24&r2=1.25
http://cvs.savannah.gnu.org/viewcvs/qemacs/qestyles.h?cvsroot=qemacs&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/qemacs/qfribidi.c?cvsroot=qemacs&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/qemacs/qfribidi.h?cvsroot=qemacs&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/qemacs/shell.c?cvsroot=qemacs&r1=1.35&r2=1.36
http://cvs.savannah.gnu.org/viewcvs/qemacs/tty.c?cvsroot=qemacs&r1=1.33&r2=1.34
http://cvs.savannah.gnu.org/viewcvs/qemacs/unicode_join.c?cvsroot=qemacs&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/qemacs/unihex.c?cvsroot=qemacs&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/qemacs/unix.c?cvsroot=qemacs&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/qemacs/util.c?cvsroot=qemacs&r1=1.30&r2=1.31
http://cvs.savannah.gnu.org/viewcvs/qemacs/video.c?cvsroot=qemacs&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/qemacs/win32.c?cvsroot=qemacs&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/qemacs/x11.c?cvsroot=qemacs&r1=1.19&r2=1.20
http://cvs.savannah.gnu.org/viewcvs/qemacs/xml.c?cvsroot=qemacs&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/qemacs/cp/cpdata.txt?cvsroot=qemacs&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/qemacs/kmap/HOWTO-keymap.txt?cvsroot=qemacs&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/qemacs/libqhtml/css.c?cvsroot=qemacs&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/qemacs/libqhtml/css.h?cvsroot=qemacs&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/qemacs/libqhtml/cssparse.c?cvsroot=qemacs&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/qemacs/libqhtml/docbook.css?cvsroot=qemacs&r1=1.1.1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/qemacs/libqhtml/html.css?cvsroot=qemacs&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/qemacs/libqhtml/htmlent.h?cvsroot=qemacs&r1=1.1.1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/qemacs/libqhtml/xmlparse.c?cvsroot=qemacs&r1=1.14&r2=1.15

Patches:
Index: .cvsignore
===================================================================
RCS file: /cvsroot/qemacs/qemacs/.cvsignore,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- .cvsignore  3 Dec 2007 16:15:01 -0000       1.4
+++ .cvsignore  3 Jan 2008 09:51:29 -0000       1.5
@@ -11,3 +11,4 @@
 kmaptoqe
 ligtoqe
 jistoqe
+allmodules.txt

Index: Makefile
===================================================================
RCS file: /cvsroot/qemacs/qemacs/Makefile,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -b -r1.27 -r1.28

Index: arabic.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/arabic.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7

Index: bufed.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/bufed.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11

Index: buffer.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/buffer.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -b -r1.28 -r1.29
--- buffer.c    27 Dec 2007 10:04:09 -0000      1.28
+++ buffer.c    3 Jan 2008 09:51:30 -0000       1.29
@@ -436,16 +436,16 @@
 /* rename a buffer and add characters so that the name is unique */
 void eb_set_buffer_name(EditBuffer *b, const char *name1)
 {
-    char name[sizeof(b->name)];
+    char name[MAX_BUFFERNAME_SIZE];
     int n, pos;
 
-    pstrcpy(name, sizeof(b->name) - 10, name1);
+    pstrcpy(name, sizeof(name) - 10, name1);
     /* set the buffer name to NULL since it will be changed */
     b->name[0] = '\0';
     pos = strlen(name);
     n = 2;
     while (eb_find(name) != NULL) {
-        snprintf(name + pos, sizeof(b->name) - pos, "<%d>", n);
+        snprintf(name + pos, sizeof(name) - pos, "<%d>", n);
         n++;
     }
     pstrcpy(b->name, sizeof(b->name), name);
@@ -1331,6 +1331,7 @@
     int len;
     unsigned char buf[IOBUF_SIZE];
 
+    //put_status(NULL, "loading %s", filename);
     for (;;) {
         len = fread(buf, 1, IOBUF_SIZE, f);
         if (len < 0)
@@ -1340,6 +1341,7 @@
         eb_insert(b, offset, buf, len);
         offset += len;
     }
+    //put_status(NULL, "");
     return 0;
 }
 
@@ -1363,6 +1365,7 @@
     if (fd < 0)
         return -1;
     file_size = lseek(fd, 0, SEEK_END);
+    //put_status(NULL, "mapping %s", filename);
     file_ptr = mmap(NULL, file_size, PROT_READ, MAP_SHARED, fd, 0);
     if ((void*)file_ptr == MAP_FAILED) {
         close(fd);
@@ -1391,6 +1394,7 @@
         p++;
     }
     b->file_handle = fd;
+    //put_status(NULL, "");
     return 0;
 }
 
@@ -1401,8 +1405,7 @@
     int ret;
     struct stat st;
 
-    if (stat(b->filename, &st) == 0 &&
-        st.st_size >= MIN_MMAP_SIZE) {
+    if (stat(b->filename, &st) == 0 && st.st_size >= MIN_MMAP_SIZE) {
         ret = mmap_buffer(b, b->filename);
     } else {
         ret = raw_load_buffer1(b, f, 0);
@@ -1419,10 +1422,11 @@
     int fd, len, size, written;
     unsigned char buf[IOBUF_SIZE];
 
-    fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0600);
+    fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0644);
     if (fd < 0)
         return -1;
 
+    //put_status(NULL, "writing %s", filename);
     if (end < start) {
         int tmp = start;
         start = end;
@@ -1449,6 +1453,7 @@
         size -= len;
     }
     close(fd);
+    //put_status(NULL, "");
     return written;
 }
 

Index: cfb.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/cfb.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7

Index: cfb.h
===================================================================
RCS file: /cvsroot/qemacs/qemacs/cfb.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3

Index: charset.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/charset.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14

Index: charsetjis.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/charsetjis.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4

Index: charsetjis.def
===================================================================
RCS file: /cvsroot/qemacs/qemacs/charsetjis.def,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2

Index: charsetmore.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/charsetmore.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12

Index: clang.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/clang.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23

Index: cptoqe.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/cptoqe.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- cptoqe.c    15 Dec 2007 16:02:48 -0000      1.9
+++ cptoqe.c    3 Jan 2008 09:51:30 -0000       1.10
@@ -219,7 +219,7 @@
         for (i = min_code; i <= max_code; i++) {
             if ((j & 7) == 0)
                 printf("    ");
-            printf("0x%04x, ", table[i]);
+            printf(" 0x%04x,", table[i]);
             if ((j++ & 7) == 7)
                 printf("\n");
         }

Index: cutils.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/cutils.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13

Index: cutils.h
===================================================================
RCS file: /cvsroot/qemacs/qemacs/cutils.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11

Index: dired.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/dired.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- dired.c     27 Dec 2007 10:04:09 -0000      1.14
+++ dired.c     3 Jan 2008 09:51:30 -0000       1.15
@@ -231,7 +231,7 @@
     dired_free(s);
 
     /* CG: should make absolute ? */
-    canonize_path(hs->path, sizeof(hs->path), path);
+    canonicalize_path(hs->path, sizeof(hs->path), path);
     eb_set_filename(s->b, hs->path);
     s->b->flags |= BF_DIRED;
 
@@ -327,7 +327,7 @@
     dip = item->opaque;
     
     /* build filename */
-    /* CG: Should canonize path */
+    /* CG: Should canonicalize path */
     return makepath(buf, buf_size, hs->path, dip->name);
 }
 
@@ -509,7 +509,7 @@
     p = strrchr(filename, '/');
     if (p)
         *p = '\0';
-    canonize_absolute_path(filename, sizeof(filename), filename);
+    canonicalize_absolute_path(filename, sizeof(filename), filename);
     eb_set_filename(b, filename);
     
     width = qs->width / 5;

Index: display.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/display.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11

Index: display.h
===================================================================
RCS file: /cvsroot/qemacs/qemacs/display.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10

Index: fbfrender.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/fbfrender.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9

Index: fbfrender.h
===================================================================
RCS file: /cvsroot/qemacs/qemacs/fbfrender.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4

Index: fbftoqe.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/fbftoqe.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- fbftoqe.c   6 Dec 2007 17:43:47 -0000       1.6
+++ fbftoqe.c   3 Jan 2008 09:51:31 -0000       1.7
@@ -45,11 +45,9 @@
         if ((j & 7) == 0)
             printf("    ");
         j++;
-        printf("0x%02x,", c);
+        printf(" 0x%02x,", c);
         if ((j & 7) == 0)
             printf("\n");
-        else
-            printf(" ");
     }
     if ((j & 7) != 0)
         printf("\n");

Index: hex.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/hex.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16

Index: html.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/html.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13

Index: html2png.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/html2png.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11

Index: htmlsrc.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/htmlsrc.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2

Index: image.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/image.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14

Index: indic.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/indic.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4

Index: input.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/input.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15

Index: jistoqe.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/jistoqe.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- jistoqe.c   3 Dec 2007 16:16:24 -0000       1.1
+++ jistoqe.c   3 Jan 2008 09:51:31 -0000       1.2
@@ -143,7 +143,7 @@
             for (j = 0; j <= b2_max; j++) {
                 if ((n & 7) == 0)
                     printf("    ");
-                printf("0x%04x, ", table[i * 94 + j]);
+                printf(" 0x%04x,", table[i * 94 + j]);
                 if ((n++ & 7) == 7)
                     printf("\n");
             }

Index: kmaptoqe.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/kmaptoqe.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9

Index: latex-mode.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/latex-mode.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21

Index: libfbf.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/libfbf.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8

Index: libfbf.h
===================================================================
RCS file: /cvsroot/qemacs/qemacs/libfbf.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4

Index: ligtoqe.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/ligtoqe.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7

Index: list.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/list.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6

Index: makemode.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/makemode.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2

Index: mpeg.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/mpeg.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4

Index: perl.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/perl.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4

Index: qe-doc.html
===================================================================
RCS file: /cvsroot/qemacs/qemacs/qe-doc.html,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- qe-doc.html 21 Dec 2007 10:28:14 -0000      1.6
+++ qe-doc.html 3 Jan 2008 09:51:31 -0000       1.7
@@ -1,6 +1,6 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html401/loose.dtd";>
 <html>
-<!-- Created on December, 21 2007 by texi2html 1.76 -->
+<!-- Created on January, 3 2008 by texi2html 1.76 -->
 <!--
 Written by: Lionel Cons <address@hidden> (original author)
             Karl Berry  <address@hidden>
@@ -1445,7 +1445,7 @@
 <p>Available commands:
 </p>
 <dl compact="compact">
-<dt> <kbd>t</kbd> </dt>
+<dt> <kbd>t</kbd></dt>
 <dd><p>(<samp>`M-x image-rotate'</samp>) Rotate right image by 90 degrees.
 </p></dd>
 <dt> <kbd>f</kbd></dt>
@@ -1810,7 +1810,7 @@
 </tr></table>
 <h1>About This Document</h1>
 <p>
-  This document was generated by <em>Charlie Gordon</em> on <em>December, 21 
2007</em> using <a href="http://texi2html.cvshome.org/";><em>texi2html 
1.76</em></a>.
+  This document was generated by <em>Charlie Gordon</em> on <em>January, 3 
2008</em> using <a href="http://texi2html.cvshome.org/";><em>texi2html 
1.76</em></a>.
 </p>
 <p>
   The buttons in the navigation panels have the following meaning:
@@ -1912,7 +1912,7 @@
 <hr size="1">
 <p>
  <font size="-1">
-  This document was generated by <em>Charlie Gordon</em> on <em>December, 21 
2007</em> using <a href="http://texi2html.cvshome.org/";><em>texi2html 
1.76</em></a>.
+  This document was generated by <em>Charlie Gordon</em> on <em>January, 3 
2008</em> using <a href="http://texi2html.cvshome.org/";><em>texi2html 
1.76</em></a>.
  </font>
  <br>
 

Index: qe-doc.texi
===================================================================
RCS file: /cvsroot/qemacs/qemacs/qe-doc.texi,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6

Index: qe.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/qe.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -b -r1.57 -r1.58
--- qe.c        27 Dec 2007 11:20:38 -0000      1.57
+++ qe.c        3 Jan 2008 09:51:31 -0000       1.58
@@ -67,12 +67,14 @@
 
 void qe_register_mode(ModeDef *m)
 {
+    QEmacsState *qs = &qe_state;
     ModeDef **p;
     CmdDef *def;
 
-    /* record mode in mode list */
-    p = &qe_state.first_mode;
-    while (*p != NULL) p = &(*p)->next;
+    /* register mode in mode list (at end) */
+    p = &qs->first_mode;
+    while (*p != NULL)
+        p = &(*p)->next;
     m->next = NULL;
     *p = m;
     
@@ -91,7 +93,7 @@
         char buf[64];
         int size;
 
-        /* lower case convert for C mode */
+        /* lower case convert for C mode, Perl... */
         pstrcpy(buf, sizeof(buf) - 10, m->name);
         css_strtolower(buf, sizeof(buf));
         pstrcat(buf, sizeof(buf) - 10, "-mode");
@@ -111,9 +113,10 @@
 
 void mode_completion(StringArray *cs, const char *input)
 {
+    QEmacsState *qs = &qe_state;
     ModeDef *m;
     
-    for (m = qe_state.first_mode; m != NULL; m = m->next) {
+    for (m = qs->first_mode; m != NULL; m = m->next) {
         if (strstart(m->name, input, NULL))
             add_string(cs, m->name);
     }
@@ -121,9 +124,10 @@
 
 static ModeDef *find_mode(const char *name)
 {
+    QEmacsState *qs = &qe_state;
     ModeDef *m;
 
-    for (m = qe_state.first_mode; m != NULL; m = m->next) {
+    for (m = qs->first_mode; m != NULL; m = m->next) {
         if (!strcmp(m->name, name))
             return m;
     }
@@ -134,9 +138,10 @@
 
 CmdDef *qe_find_cmd(const char *cmd_name)
 {
+    QEmacsState *qs = &qe_state;
     CmdDef *d;
     
-    d = qe_state.first_cmd;
+    d = qs->first_cmd;
     while (d != NULL) {
         while (d->name != NULL) {
             if (!strcmp(cmd_name, d->name))
@@ -151,6 +156,7 @@
 static int qe_register_binding1(unsigned int *keys, int nb_keys,
                                 CmdDef *d, ModeDef *m)
 {
+    QEmacsState *qs = &qe_state;
     KeyDef **lp, *p;
 
     /* add key */
@@ -163,13 +169,13 @@
     memcpy(p->keys, keys, nb_keys * sizeof(unsigned int));
     /* find position : mode keys should be before generic keys */
     if (m == NULL) {
-        lp = &qe_state.first_key;
+        lp = &qs->first_key;
         while (*lp != NULL) lp = &(*lp)->next;
         *lp = p;
         p->next = NULL;
     } else {
-        p->next = qe_state.first_key;
-        qe_state.first_key = p;
+        p->next = qs->first_key;
+        qs->first_key = p;
     }
     return 0;
 }
@@ -198,75 +204,6 @@
     qe_register_binding1(keys, nb_keys, d, m);
 }
 
-void do_toggle_control_h(EditState *s, int set)
-{
-    /* Achtung Minen! do_toggle_control_h can be called from tty_init
-     * with a NULL EditState.
-     */
-    QEmacsState *qs = s ? s->qe_state : &qe_state;
-    KeyDef *p;
-    int i;
-
-    if (set)
-        set = (set > 0);
-    else
-        set = !qs->backspace_is_control_h;
-
-    if (qs->backspace_is_control_h == set)
-        return;
-    
-    qs->backspace_is_control_h = set;
-
-    for (p = qs->first_key; p; p = p->next) {
-        for (i = 0; i < p->nb_keys; i++) {
-            switch (p->keys[i]) {
-            case KEY_CTRL('h'):
-                p->keys[i] = set ? KEY_META('h') : 127;
-                break;
-            case 127:
-                if (set)
-                    p->keys[i] = KEY_CTRL('h');
-                break;
-            case KEY_META('h'):
-                if (!set)
-                    p->keys[i] = KEY_CTRL('h');
-                break;
-            }
-        }
-    }
-}
-
-void do_set_emulation(EditState *s, const char *name)
-{
-    QEmacsState *qs = s->qe_state;
-
-    if (!strcmp(name, "epsilon")) {
-        qs->flag_split_window_change_focus = 1;
-    } else
-    if (!strcmp(name, "emacs") || !strcmp(name, "xemacs")) {
-        qs->flag_split_window_change_focus = 0;
-    } else
-    if (!strcmp(name, "vi") || strcmp(name, "vim")) {
-        put_status(s, "emulation '%s' not available yet", name);
-    } else {
-        put_status(s, "unknown emulation '%s'", name);
-    }
-}
-
-void do_set_trace(EditState *s)
-{
-    do_split_window(s, 0);
-    do_switch_to_buffer(s, "*trace*");
-    do_previous_window(s);
-}
-
-void do_cd(__unused__ EditState *s, const char *name)
-{
-    chdir(name);
-    /* CG: Should issue diagnostics upon failure */
-    /* CG: Should display current directory after chdir */
-}
-
 /* if mode is non NULL, the defined keys are only active in this mode */
 void qe_register_cmd_table(CmdDef *cmds, const char *mode)
 {
@@ -351,9 +288,10 @@
 
 void command_completion(StringArray *cs, const char *input)
 {
+    QEmacsState *qs = &qe_state;
     CmdDef *d;
     
-    d = qe_state.first_cmd;
+    d = qs->first_cmd;
     while (d != NULL) {
         while (d->name != NULL) {
             if (strstart(d->name, input, NULL))
@@ -378,11 +316,82 @@
         return;
 
     d = qe_find_cmd(cmd_name);
-    if (!d)
+    if (!d) {
+        put_status(s, "No command %s", cmd_name);
         return;
+    }
     qe_register_binding1(keys, nb_keys, d, NULL);
 }
 
+void do_toggle_control_h(EditState *s, int set)
+{
+    /* Achtung Minen! do_toggle_control_h can be called from tty_init
+     * with a NULL EditState.
+     */
+    QEmacsState *qs = s ? s->qe_state : &qe_state;
+    KeyDef *p;
+    int i;
+
+    if (set)
+        set = (set > 0);
+    else
+        set = !qs->backspace_is_control_h;
+
+    if (qs->backspace_is_control_h == set)
+        return;
+
+    qs->backspace_is_control_h = set;
+
+    for (p = qs->first_key; p; p = p->next) {
+        for (i = 0; i < p->nb_keys; i++) {
+            switch (p->keys[i]) {
+            case KEY_CTRL('h'):
+                p->keys[i] = set ? KEY_META('h') : 127;
+                break;
+            case 127:
+                if (set)
+                    p->keys[i] = KEY_CTRL('h');
+                break;
+            case KEY_META('h'):
+                if (!set)
+                    p->keys[i] = KEY_CTRL('h');
+                break;
+            }
+        }
+    }
+}
+
+void do_set_emulation(EditState *s, const char *name)
+{
+    QEmacsState *qs = s->qe_state;
+
+    if (!strcmp(name, "epsilon")) {
+        qs->flag_split_window_change_focus = 1;
+    } else
+    if (!strcmp(name, "emacs") || !strcmp(name, "xemacs")) {
+        qs->flag_split_window_change_focus = 0;
+    } else
+    if (!strcmp(name, "vi") || strcmp(name, "vim")) {
+        put_status(s, "emulation '%s' not available yet", name);
+    } else {
+        put_status(s, "unknown emulation '%s'", name);
+    }
+}
+
+void do_set_trace(EditState *s)
+{
+    do_split_window(s, 0);
+    do_switch_to_buffer(s, "*trace*");
+    do_previous_window(s);
+}
+
+void do_cd(__unused__ EditState *s, const char *name)
+{
+    chdir(name);
+    /* CG: Should issue diagnostics upon failure */
+    /* CG: Should display current directory after chdir */
+}
+
 /* basic editing functions */
 /* CG: should indirect these through mode ! */
 void do_bof(EditState *s)
@@ -727,8 +736,10 @@
 {
     int offset1;
 
-    if (s->b->flags & BF_READONLY)
+    if (s->b->flags & BF_READONLY) {
+        /* CG: could scroll down */
         return;
+    }
 
     if (argval == NO_ARG) {
         eb_prevc(s->b, s->offset, &offset1);
@@ -1223,6 +1234,9 @@
     int cur_ch, len, cur_len, offset1, ret, insert;
     char buf[MAX_CHAR_BYTES];
 
+    //if (s->b->flags & BF_READONLY)
+    //    return;
+
     cur_ch = eb_nextc(s->b, s->offset, &offset1);
     cur_len = offset1 - s->offset;
     len = unicode_to_charset(buf, key, s->b->charset);
@@ -1359,7 +1373,7 @@
     s->offset++;
 }
 
-void do_break(__unused__ EditState *s)
+void do_break(EditState *s)
 {
     /* well, currently nothing needs to be aborted in global context */
     /* CG: Should remove popups, sidepanes, helppanes... */
@@ -1396,7 +1410,7 @@
     return b;
 }
 
-void do_append_next_kill(EditState *s)
+void do_append_next_kill(__unused__ EditState *s)
 {
     /* do nothing! */
 }
@@ -2028,7 +2042,6 @@
         style->fg_color = s->fg_color;
         style->bg_color = s->bg_color;
     }
-
 }
 
 void get_style(EditState *e, QEStyleDef *style, int style_index)
@@ -2533,7 +2546,7 @@
     //dst_max_size = MAX_SCREEN_WIDTH - s->line_index;
     //if (dst_max_size <= 0)
     //    goto the_end;
-    dst_max_size = MAX_WORD_SIZE; // assumming s->fragment_index MAX_WORD_SIZE
+    dst_max_size = MAX_WORD_SIZE; // assuming s->fragment_index MAX_WORD_SIZE
     nb_glyphs = unicode_to_glyphs(s->line_chars + s->line_index, 
                                   char_to_glyph_pos, dst_max_size,
                                   s->fragment_chars, s->fragment_index, 
@@ -3053,6 +3066,8 @@
         colored_nb_chars = 0;
     }
     
+    /* CG: should colorize regions: s->curline_style, s->region_style */
+
     bd = embeds + 1;
     char_index = 0;
     for (;;) {
@@ -4149,8 +4164,8 @@
 /* compute the client area from the window position */
 static void compute_client_area(EditState *s)
 {
-    int x1, y1, x2, y2;
     QEmacsState *qs = s->qe_state;
+    int x1, y1, x2, y2;
 
     x1 = s->x1;
     y1 = s->y1;
@@ -4181,8 +4196,8 @@
                     int x1, int y1, int width, int height, int flags)
 {
     /* b may be NULL ??? */
-    EditState *s;
     QEmacsState *qs = &qe_state;
+    EditState *s;
     
     s = qe_mallocz(EditState);
     if (!s)
@@ -4199,6 +4214,7 @@
     qs->first_window = s;
     if (!qs->active_window)
         qs->active_window = s;
+    /* restore saved window settings, set mode */
     switch_to_buffer(s, b);
     return s;
 }
@@ -4248,6 +4264,7 @@
     QEmacsState *qs = s->qe_state;
     EditState **ps;
 
+    /* save current state for later window reattachment */
     switch_to_buffer(s, NULL);
 
     /* free from window list */
@@ -4834,8 +4851,10 @@
     EditBuffer *b;
 
     b = eb_find(bufname);
-    if (!b)
+    if (!b) {
+        /* Create a new buffer */
         b = eb_new(bufname, BF_SAVELOG);
+    }
     if (b)
         switch_to_buffer(s, b);
 }
@@ -4860,7 +4879,7 @@
 
     b = eb_find(bufname);
     if (!b) {
-        put_status(s, "No match");
+        put_status(s, "No buffer %s", bufname);
     } else {
         /* if associated to a filename, then ask */
         if (b->modified && b->filename[0] != '\0') {
@@ -4937,7 +4956,7 @@
     } else {
         filename = s->b->filename;
     }
-    canonize_absolute_path(buf1, sizeof(buf1), filename);
+    canonicalize_absolute_path(buf1, sizeof(buf1), filename);
     splitpath(buf, buf_size, NULL, 0, buf1);
 }
 
@@ -4991,7 +5010,7 @@
             return;
     } else {
         /* compute full name */
-        canonize_absolute_path(filename, sizeof(filename), filename1);
+        canonicalize_absolute_path(filename, sizeof(filename), filename1);
     }
 
     if (kill_buffer) {
@@ -5135,7 +5154,7 @@
 {
     char path[MAX_FILENAME_SIZE];
 
-    canonize_absolute_path(path, sizeof(path), filename);
+    canonicalize_absolute_path(path, sizeof(path), filename);
     if (*renamefile == 'y' && s->b->filename) {
         if (rename(s->b->filename, path))
             put_status(s, "Cannot rename file to %s", path);
@@ -5172,7 +5191,7 @@
 {
     char absname[MAX_FILENAME_SIZE];
 
-    canonize_absolute_path(absname, sizeof(absname), filename);
+    canonicalize_absolute_path(absname, sizeof(absname), filename);
     put_save_message(s, filename,
                      eb_write_buffer(s->b, s->b->mark, s->offset, filename));
 }
@@ -6009,7 +6028,6 @@
         do_refresh(qs->first_window);
 }
 
-
 void do_delete_other_windows(EditState *s)
 {
     QEmacsState *qs = s->qe_state;
@@ -6037,7 +6055,7 @@
     EditState *e;
     int x, y;
 
-    /* cannot split minibuf */
+    /* cannot split minibuf or popup */
     if (s->minibuf || (s->flags & WF_POPUP))
         return;
             

Index: qe.h
===================================================================
RCS file: /cvsroot/qemacs/qemacs/qe.h,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -b -r1.53 -r1.54
--- qe.h        27 Dec 2007 11:20:38 -0000      1.53
+++ qe.h        3 Jan 2008 09:51:31 -0000       1.54
@@ -166,12 +166,14 @@
 FindFileState *find_file_open(const char *path, const char *pattern);
 int find_file_next(FindFileState *s, char *filename, int filename_size_max);
 void find_file_close(FindFileState *s);
-void canonize_path(char *buf, int buf_size, const char *path);
-void canonize_absolute_path(char *buf, int buf_size, const char *path1);
+void canonicalize_path(char *buf, int buf_size, const char *path);
+void canonicalize_absolute_path(char *buf, int buf_size, const char *path1);
 const char *basename(const char *filename);
 const char *extension(const char *filename);
 char *get_dirname(char *dest, int size, const char *file);
 int match_extension(const char *filename, const char *extlist);
+int remove_slash(char *buf);
+int append_slash(char *buf, int buf_size);
 char *makepath(char *buf, int buf_size, const char *path, const char 
*filename);
 void splitpath(char *dirname, int dirname_size,
                char *filename, int filename_size, const char *pathname);

Index: qeconfig.h
===================================================================
RCS file: /cvsroot/qemacs/qemacs/qeconfig.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25

Index: qestyles.h
===================================================================
RCS file: /cvsroot/qemacs/qemacs/qestyles.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6

Index: qfribidi.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/qfribidi.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5

Index: qfribidi.h
===================================================================
RCS file: /cvsroot/qemacs/qemacs/qfribidi.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4

Index: shell.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/shell.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -b -r1.35 -r1.36

Index: tty.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/tty.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -b -r1.33 -r1.34

Index: unicode_join.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/unicode_join.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11

Index: unihex.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/unihex.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10

Index: unix.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/unix.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6

Index: util.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/util.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -b -r1.30 -r1.31
--- util.c      21 Dec 2007 14:27:11 -0000      1.30
+++ util.c      3 Jan 2008 09:51:32 -0000       1.31
@@ -127,7 +127,7 @@
 
 /* suppress redundant ".", ".." and "/" from paths */
 /* XXX: make it better */
-static void canonize_path1(char *buf, int buf_size, const char *path)
+static void canonicalize_path1(char *buf, int buf_size, const char *path)
 {
     const char *p;
     char *q, *q1;
@@ -190,7 +190,7 @@
     }
 }
 
-void canonize_path(char *buf, int buf_size, const char *path)
+void canonicalize_path(char *buf, int buf_size, const char *path)
 {
     const char *p;
     /* check for URL protocol or windows drive */
@@ -198,18 +198,18 @@
     p = strchr(path, ':');
     if (p) {
         if ((p - path) == 1) {
-            /* windows drive : we canonize only the following path */
+            /* windows drive: we canonicalize only the following path */
             buf[0] = p[0];
             buf[1] = p[1];
             /* CG: this will not work for non current drives */
-            canonize_path1(buf + 2, buf_size - 2, p);
+            canonicalize_path1(buf + 2, buf_size - 2, p);
         } else {
-            /* URL: it is already canonized */
+            /* URL: it is already canonical */
             pstrcpy(buf, buf_size, path);
         }
     } else {
         /* simple unix path */
-        canonize_path1(buf, buf_size, path);
+        canonicalize_path1(buf, buf_size, path);
     }
 }
 
@@ -217,6 +217,7 @@
 static int is_abs_path(const char *path)
 {
     const char *p;
+
     p = strchr(path, ':');
     if (p)
         p++;
@@ -225,24 +226,33 @@
     return *p == '/';
 }
 
-/* canonize the path and make it absolute */
-void canonize_absolute_path(char *buf, int buf_size, const char *path1)
+/* canonicalize the path and make it absolute */
+void canonicalize_absolute_path(char *buf, int buf_size, const char *path1)
 {
     char cwd[MAX_FILENAME_SIZE];
     char path[MAX_FILENAME_SIZE];
     char *homedir;
 
     if (!is_abs_path(path1)) {
-        /* XXX: should call it again */
-        if (*path1 == '~' && (path1[1] == '\0' || path1[1] == '/')) {
+        if (*path1 == '~') {
+            if (path1[1] == '\0' || path1[1] == '/') {
             homedir = getenv("HOME");
             if (homedir) {
-                /* CG: should test for trailing slash */
                 pstrcpy(path, sizeof(path), homedir);
+#ifdef WIN32
+                    path_win_to_unix(path);
+#endif
+                    remove_slash(path);
                 pstrcat(path, sizeof(path), path1 + 1);
-                goto next;
+                    path1 = path;
             }
+            } else {
+                /* CG: should get info from getpwnam */
+                pstrcpy(path, sizeof(path), "/home/");
+                pstrcat(path, sizeof(path), path1 + 1);
+                path1 = path;
         }
+        } else {
         /* CG: not sufficient for windows drives */
         /* CG: should test result */
         getcwd(cwd, sizeof(cwd));
@@ -250,26 +260,32 @@
         path_win_to_unix(cwd);
 #endif
         makepath(path, sizeof(path), cwd, path1);
-    } else {
-        pstrcpy(path, sizeof(path), path1);
+            path1 = path;
+        }
     }
-next:
-    canonize_path(buf, buf_size, path);
+    canonicalize_path(buf, buf_size, path1);
 }
 
 /* Get the filename portion of a path */
 const char *basename(const char *filename)
 {
     const char *p;
+    const char *base;
 
-    p = strrchr(filename, '/');
-    if (!p) {
-        /* should also scan for ':' and '\\' in WIN32 */
-        return filename;
-    } else {
-        p++;
-        return p;
+    base = filename;
+    if (base) {
+        for (p = base; *p; p++) {
+#ifdef WIN32
+            /* Simplitic DOS filename support */
+            if (*p == '/' || *p == '\\' || *p == ':')
+                base = p + 1;
+#else
+            if (*p == '/')
+                base = p + 1;
+#endif
+        }
     }
+    return base;
 }
 
 /* Return the last extension in a path, ignoring leading dots */
@@ -277,20 +293,19 @@
 {
     const char *p, *ext;
 
-    p = filename;
-  restart:
+    p = basename(filename);
+    ext = NULL;
+    if (p) {
     while (*p == '.')
         p++;
-    ext = NULL;
     for (; *p; p++) {
-        if (*p == '/') {
-            p++;
-            goto restart;
-        }
         if (*p == '.')
             ext = p;
     }
-    return ext ? ext : p;
+        if (!ext)
+            ext = p;
+    }
+    return ext;
 }
 
 /* Extract the directory portion of a path:
@@ -330,17 +345,36 @@
     }
 }
 
-char *makepath(char *buf, int buf_size, const char *path,
-               const char *filename)
+/* Remove trailing slash from path, except for / directory */
+int remove_slash(char *buf)
 {
     int len;
 
-    pstrcpy(buf, buf_size, path);
-    len = strlen(path);
-    if (len > 0 && path[len - 1] != '/' && len + 1 < buf_size) {
+    len = strlen(buf);
+    if (len > 1 && buf[len - 1] == '/') {
+        buf[--len] = '\0';
+    }
+    return len;
+}
+
+/* Append trailing slash to path if none there already */
+int append_slash(char *buf, int buf_size)
+{
+    int len;
+
+    len = strlen(buf);
+    if (len > 0 && buf[len - 1] != '/' && len + 1 < buf_size) {
         buf[len++] = '/';
         buf[len] = '\0';
     }
+    return len;
+}
+
+char *makepath(char *buf, int buf_size, const char *path,
+               const char *filename)
+{
+    pstrcpy(buf, buf_size, path);
+    append_slash(buf, buf_size);
     return pstrcat(buf, buf_size, filename);
 }
 
@@ -606,7 +640,7 @@
 static unsigned short const keycodes[] = {
     KEY_SPC, KEY_DEL, KEY_RET, KEY_ESC, KEY_TAB, KEY_SHIFT_TAB,
     KEY_CTRL(' '), KEY_DEL, KEY_CTRL('\\'),
-    KEY_CTRL(']'), KEY_CTRL('^'), KEY_CTRL('_'),
+    KEY_CTRL(']'), KEY_CTRL('^'), KEY_CTRL('_'), KEY_CTRL('_'),
     KEY_LEFT, KEY_RIGHT, KEY_UP, KEY_DOWN,
     KEY_HOME, KEY_END, KEY_PAGEUP, KEY_PAGEDOWN,
     KEY_CTRL_LEFT, KEY_CTRL_RIGHT, KEY_CTRL_UP, KEY_CTRL_DOWN,
@@ -621,7 +655,7 @@
 
 static const char * const keystr[] = {
     "SPC", "DEL", "RET", "ESC", "TAB", "S-TAB",
-    "C-SPC", "C-?", "C-\\", "C-]", "C-^", "C-_",
+    "C-SPC",  "C-?",      "C-\\",     "C-]",    "C-^", "C-_", "C-/",
     "left", "right", "up", "down",
     "home", "end", "prior", "next",
     "C-left", "C-right", "C-up", "C-down",
@@ -685,6 +719,8 @@
         return key;
     }
 #endif
+    /* Should also support backslash escapes: \000 \x00 \u0000 */
+    /* Should also support ^x and syntax and Ctrl- prefix for control keys */
     if (p[0] == 'C' && p[1] == '-' && p1 == p + 3) {
         /* control */
         key = KEY_CTRL(p[2]);
@@ -702,11 +738,13 @@
     int key;
 
     p = *pp;
+    /* Should also support A- and Alt- prefix for meta keys */
     if (p[0] == 'M' && p[1] == '-') {
         p += 2;
         key = KEY_META(strtokey1(&p));
     } else
     if (p[0] == 'C' && p[1] == '-' && p[2] == 'M' && p[3] == '-') {
+        /* Should pass buffer with C-xxx to strtokey1 */
         p += 4;
         key = KEY_META(KEY_CTRL(strtokey1(&p)));
     } else {

Index: video.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/video.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9

Index: win32.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/win32.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11

Index: x11.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/x11.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20

Index: xml.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/xml.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11

Index: cp/cpdata.txt
===================================================================
RCS file: /cvsroot/qemacs/qemacs/cp/cpdata.txt,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5

Index: kmap/HOWTO-keymap.txt
===================================================================
RCS file: /cvsroot/qemacs/qemacs/kmap/HOWTO-keymap.txt,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2

Index: libqhtml/css.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/libqhtml/css.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15

Index: libqhtml/css.h
===================================================================
RCS file: /cvsroot/qemacs/qemacs/libqhtml/css.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7

Index: libqhtml/cssparse.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/libqhtml/cssparse.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13

Index: libqhtml/docbook.css
===================================================================
RCS file: /cvsroot/qemacs/qemacs/libqhtml/docbook.css,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -b -r1.1.1.1 -r1.2

Index: libqhtml/html.css
===================================================================
RCS file: /cvsroot/qemacs/qemacs/libqhtml/html.css,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3

Index: libqhtml/htmlent.h
===================================================================
RCS file: /cvsroot/qemacs/qemacs/libqhtml/htmlent.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -b -r1.1.1.1 -r1.2

Index: libqhtml/xmlparse.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/libqhtml/xmlparse.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15




reply via email to

[Prev in Thread] Current Thread [Next in Thread]