qemacs-commit
[Top][All Lists]
Advanced

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

[Qemacs-commit] qemacs latex-mode.c


From: Charlie Gordon
Subject: [Qemacs-commit] qemacs latex-mode.c
Date: Sat, 15 Dec 2007 07:32:45 +0000

CVSROOT:        /cvsroot/qemacs
Module name:    qemacs
Changes by:     Charlie Gordon <chqrlie>        07/12/15 07:32:45

Modified files:
        .              : latex-mode.c 

Log message:
        cosmetics, fixed encoding issue in do_tex_insert_quote

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemacs/latex-mode.c?cvsroot=qemacs&r1=1.16&r2=1.17

Patches:
Index: latex-mode.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/latex-mode.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- latex-mode.c        12 Dec 2007 02:51:05 -0000      1.16
+++ latex-mode.c        15 Dec 2007 07:32:45 -0000      1.17
@@ -150,24 +150,25 @@
 {
     int offset_bol, len, offset1;
     unsigned int buf[MAX_BUF_SIZE];
-    int p;
+    int pos;
 
-    offset_bol = eb_goto_bol(s->b, s->offset);
+    offset_bol = eb_goto_bol2(s->b, s->offset, &pos);
     offset1 = offset_bol;
-    len = eb_get_line(s->b, buf, MAX_BUF_SIZE - 1, &offset1);
-    p = s->offset - offset_bol;
-
-    if (p >= 1 && buf[p-1] == '\"') {
+    len = eb_get_line(s->b, buf, countof(buf), &offset1);
+    if (pos > len)
+        return;
+    if (pos >= 1 && buf[pos-1] == '\"') {
         eb_insert(s->b, s->offset, "\"", 1);
         s->offset++;
-    } else if (p >= 2 && (buf[p-1] == '`' || buf[p-1] == '\'') &&
-               buf[p-1] == buf[p-2])
+    } else
+    if (pos >= 2 && (buf[pos-1] == '`' || buf[pos-1] == '\'') &&
+          buf[pos-1] == buf[pos-2])
     {
         eb_delete(s->b, s->offset - 2, 2);
         eb_insert(s->b, s->offset, "\"", 1);
         s->offset++;
     } else {
-        if (p == 0 || buf[p-1] == ' ') {
+        if (pos == 0 || buf[pos-1] == ' ') {
             eb_insert(s->b, s->offset, "``", 2);
             s->offset += 2;
         } else {




reply via email to

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