qemacs-commit
[Top][All Lists]
Advanced

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

[Qemacs-commit] qemacs shell.c


From: Charlie Gordon
Subject: [Qemacs-commit] qemacs shell.c
Date: Sat, 15 Dec 2007 07:30:20 +0000

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

Modified files:
        .              : shell.c 

Log message:
        simplified code using new buffer functions

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemacs/shell.c?cvsroot=qemacs&r1=1.25&r2=1.26

Patches:
Index: shell.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/shell.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- shell.c     12 Dec 2007 11:49:03 -0000      1.25
+++ shell.c     15 Dec 2007 07:30:20 -0000      1.26
@@ -633,12 +633,7 @@
             break;
         case 13:        /* ^M  CR = carriage return */
             /* move to bol */
-            for (;;) {
-                c = eb_prevc(s->b, s->cur_offset, &offset1);
-                if (c == '\n')
-                    break;
-                s->cur_offset = offset1;
-            }
+            s->cur_offset = eb_goto_bol(s->b, s->cur_offset);
             break;
         case 14:        /* ^N  SO = shift out */
             // was in qemacs-0.3.1.g2.gw
@@ -833,13 +828,7 @@
                 }
                 break;
             case 'K':   /* clear eol (parm=1 -> bol) */
-                offset1 = s->cur_offset;
-                for (;;) {
-                    c = eb_nextc(s->b, offset1, &offset2);
-                    if (c == '\n')
-                        break;
-                    offset1 = offset2;
-                }
+                offset1 = eb_goto_eol(s->b, s->cur_offset);
                 eb_delete(s->b, s->cur_offset, offset1 - s->cur_offset);
                 break;
             case 'P':
@@ -1312,7 +1301,7 @@
     QEmacsState *qs = s->qe_state;
     EditState *e;
     EditBuffer *b;
-    int offset, offset1, found_offset;
+    int offset, found_offset;
     char filename[MAX_FILENAME_SIZE], *q;
     int line_num, c;
 
@@ -1340,23 +1329,13 @@
                 put_status(s, "No more errors");
                 return;
             }
-            for (;;) {
-                c = eb_nextc(b, offset, &offset);
-                if (c == '\n')
-                    break;
-            }
+            offset = eb_next_line(b, offset);
         } else {
             if (offset <= 0) {
                 put_status(s, "No previous error");
                 return;
             }
-            eb_prevc(b, offset, &offset);
-            for (;;) {
-                c = eb_prevc(b, offset, &offset1);
-                if (c == '\n')
-                    break;
-                offset = offset1;
-            }
+            offset = eb_prev_line(b, offset);
         }
     find_error:
         found_offset = offset;




reply via email to

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