Patch for switching to subshel in editor and viewer



Hello.

Here is the patch which allows to switch to subshell
from internal viewer (Ctrl-O) and from internal editor
(Ctrl-Shift-O, because Ctrl-O is already taken by another function).

view.c.diff		- viewer stuff.
edit_key_translator.c	- edutor stuff
mc.1.in.diff		- documentation patch


I hope this patch will be included into CVS.


Regards, Walery
--- edit_key_translator.orig.c	Sun Aug  5 15:00:40 2001
+++ edit_key_translator.c	Sun Aug  5 15:13:50 2001
@@ -111,11 +111,24 @@
      KEY_DOWN, KEY_RIGHT, KEY_HOME, KEY_UP, KEY_PPAGE};
 
 
+
 #define DEFAULT_NUM_LOCK        0
 
     static int num_lock = DEFAULT_NUM_LOCK;
     int i = 0;
 
+#if !HAVE_X && HAVE_SUBSHELL_SUPPORT
+    /* Show subshell */
+    if (x_key == XCTRL('o') && (x_state & SHIFT_PRESSED)) {
+	view_other_cmd();
+
+	edit->force = REDRAW_COMPLETELY;
+	command = CK_Refresh;
+	goto fin;
+    }
+#endif
+
+
     switch (edit_key_emulation) {
     case EDIT_KEY_EMULATION_NORMAL:
 	key_map = cooledit_key_map;
@@ -155,6 +168,7 @@
 	goto fin;
     }
 #endif
+
 
     if (x_key == XCTRL ('q')) {
 	char_for_insertion = edit_raw_key_query (_(" Insert Literal "), _(" Press any key: "), 0);
--- view.orig.c	Sat Jul 28 22:08:40 2001
+++ view.c	Sun Aug  5 15:13:38 2001
@@ -2334,6 +2334,16 @@
 	return 1;
 #endif
 
+#if !HAVE_X && HAVE_SUBSHELL_SUPPORT
+    case XCTRL('o'):
+	/* Show subshell */
+	view_other_cmd();
+
+	view->dirty++;
+	view_update( view, TRUE );
+	return 1;
+#endif
+
     }
     if (c >= '0' && c <= '9')
 	view->marker = c - '0';
--- mc.1.in.orig	Sun Aug  5 15:22:50 2001
+++ mc.1.in	Sun Aug  5 15:33:16 2001
@@ -2416,6 +2416,9 @@
 .B M-r 
 Toggle the ruler.
 .PP
+.B C-o
+Temporarly switch to subshell.
+.PP
 It's possible to instruct the file viewer how to display a file, look
 at the 
 .\"LINK2"
@@ -2488,6 +2491,10 @@
 which is copied to
 .B .cedit/edit.indent.rc
 in your home directory the first time you use it.
+.PP
+You can use
+.B Ctrl-Shift-O
+to temporarly switch to subshell.
 .PP
 You can use scanf search and replace to search and replace
 a C format string. First take a look at the 


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