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, 28 May 2016 16:27:57 +0000 (UTC)

CVSROOT:        /sources/qemacs
Module name:    qemacs
Changes by:     Charlie Gordon <chqrlie>        16/05/28 16:27:57

Modified files:
        .              : shell.c 

Log message:
        shell: improve shell editing
        
        - add shell_exchange_point_and_mark() command
          handled by the process in interactive mode

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

Patches:
Index: shell.c
===================================================================
RCS file: /sources/qemacs/qemacs/shell.c,v
retrieving revision 1.108
retrieving revision 1.109
diff -u -b -r1.108 -r1.109
--- shell.c     28 May 2016 10:34:17 -0000      1.108
+++ shell.c     28 May 2016 16:27:56 -0000      1.109
@@ -1650,6 +1650,19 @@
     }
 }
 
+static void shell_exchange_point_and_mark(EditState *e)
+{
+    ShellState *s = shell_get_state(e, 1);
+
+    if (s && e->interactive) {
+        tty_write(s, "\030\030", 2);  /* C-x C-x */
+    } else {
+        do_exchange_point_and_mark(e);
+        if (s && (s->shell_flags & SF_INTERACTIVE))
+            e->interactive = (e->offset == s->cur_offset);
+    }
+}
+
 static void shell_scroll_up_down(EditState *e, int dir)
 {
     ShellState *s = shell_get_state(e, 1);
@@ -2077,6 +2090,8 @@
           "shell-previous", shell_previous_next, -1)
     CMD1( KEY_META('n'), KEY_NONE,
           "shell-next", shell_previous_next, -1)
+    CMD0( KEY_CTRLX(KEY_CTRL('x')), KEY_NONE,
+          "shell-exchange-point-and-mark", shell_exchange_point_and_mark)
     CMD2( KEY_CTRL('i'), KEY_NONE,
           "shell-tabulate", do_shell_tabulate, ES, "*")
     CMD3( KEY_CTRL('k'), KEY_NONE,



reply via email to

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