qemacs-commit
[Top][All Lists]
Advanced

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

[Qemacs-commit] qemacs hex.c


From: Charlie Gordon
Subject: [Qemacs-commit] qemacs hex.c
Date: Tue, 18 Dec 2007 12:17:10 +0000

CVSROOT:        /cvsroot/qemacs
Module name:    qemacs
Changes by:     Charlie Gordon <chqrlie>        07/12/18 12:17:10

Modified files:
        .              : hex.c 

Log message:
        display ISO-latin1 chars as graphics in ascii dump
        default display width to a multiple of 16 in ascii dump
        hex mode probe returns non 0 on text files

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemacs/hex.c?cvsroot=qemacs&r1=1.11&r2=1.12

Patches:
Index: hex.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/hex.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- hex.c       12 Dec 2007 02:51:05 -0000      1.11
+++ hex.c       18 Dec 2007 12:17:10 -0000      1.12
@@ -24,8 +24,14 @@
 
 static int to_disp(int c)
 {
+#if 1
+    /* Allow characters in range 160-255 to show as graphics */
+    if ((c & 127) < ' ' || c == 127)
+        c = '.';
+#else
     if (c < ' ' || c >= 127)
         c = '.';
+#endif
     return c;
 }
 
@@ -141,6 +147,11 @@
     release_font(s->screen, font);
 
     s->disp_width = (s->screen->width / num_width) - 10;
+    /* align on 16 byte boundary */
+    s->disp_width &= ~15;
+    if (s->disp_width < 16)
+       s->disp_width = 16;
+    //s->insert = 1;
     s->hex_mode = 0;
     s->wrap = WRAP_TRUNCATE;
     return 0;
@@ -153,10 +164,12 @@
     ret = text_mode_init(s, saved_data);
     if (ret)
         return ret;
+
     s->disp_width = 16;
     s->hex_mode = 1;
     s->unihex_mode = 0;
     s->hex_nibble = 0;
+    //s->insert = 1;
     s->wrap = WRAP_TRUNCATE;
     return 0;
 }
@@ -180,7 +193,7 @@
     if (detect_binary(p->buf, p->buf_size))
         return 50;
     else
-        return 0;
+        return 10;
 }
 
 static void hex_move_bol(EditState *s)




reply via email to

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