[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH][RFC] some emacs like keybidings for grub 0.93
From: |
Daniele Bellucci |
Subject: |
[PATCH][RFC] some emacs like keybidings for grub 0.93 |
Date: |
Tue, 30 Sep 2003 00:21:59 +0200 |
User-agent: |
Mutt/1.4.1i |
Hi All,
i've just cleaned my patch, let me show you:
this little patch add the following emacs like keybindings:
- C-SPC set a marker
- C-w move text from marker to current position(or viceversa) in kill_buf
Patch looks good to me....
i've patched Changelog too.
Feedbacks are much appreciated!
Tnx!
--- grub-0.93.orig/ChangeLog 2002-12-04 05:42:41.000000000 +0100
+++ grub-0.93/ChangeLog 2003-09-29 23:50:03.000000000 +0200
@@ -1,3 +1,8 @@
+2003-09-30 Daniele Bellucci <address@hidden>
+
+ * stage2/char_io.c (real_get_cmdline): Added the following Eamcs
+ binding: C-SPC, C-w.
+
2002-12-04 Yoshinori K. Okuji <address@hidden>
* stage2/builtins.c (embed_func): When checking if the disk can
--- grub-0.93.orig/stage2/char_io.c 2002-12-03 00:49:07.000000000 +0100
+++ grub-0.93/stage2/char_io.c 2003-09-29 23:46:58.000000000 +0200
@@ -312,6 +312,7 @@
until this code is freezed. */
#define CMDLINE_WIDTH 78
#define CMDLINE_MARGIN 10
+#define min(a,b) ( a < b )?a: b
int xpos, lpos, c, section;
/* The length of PROMPT. */
@@ -320,6 +321,8 @@
int llen;
/* The index for the history. */
int history = -1;
+ /* The index for the marker. */
+ int kpos = -1;
/* The working buffer for the command-line. */
char *buf = (char *) CMDLINE_BUF;
/* The kill buffer. */
@@ -635,6 +638,30 @@
cl_init ();
}
break;
+ case 0:
+ kpos = lpos; /* C-SPC set the mark */
+ break;
+ case 23: /* C-w move to killbuffer */
+ if (kpos != -1)
+ {
+ int count;
+ if (lpos > kpos)
+ {
+ grub_memmove (kill_buf, buf + kpos, lpos - kpos);
+ kill_buf[lpos-kpos] = 0;
+ count = lpos;
+ cl_backward (lpos - kpos);
+ cl_delete (count - kpos);
+ }
+ else
+ {
+ grub_memmove (kill_buf, buf + lpos, kpos - lpos);
+ kill_buf[kpos-lpos] = 0;
+ cl_delete (kpos - lpos);
+ }
+ kpos = lpos;
+ }
+ break;
case 1: /* C-a go to beginning of line */
cl_backward (lpos);
break;
--
Daniele.
- [PATCH][RFC] some emacs like keybidings for grub 0.93,
Daniele Bellucci <=