Re: mg dired diff to reduce annoyance

2011-07-30 Thread Loganaden Velvindron
I'll wait for kjell@ to have some time
to review this diff.

No big deal really :-D



Re: mg dired diff to reduce annoyance

2011-07-30 Thread Kenneth R Westerback
On Sat, Jul 30, 2011 at 04:30:42PM -0400, Loganaden Velvindron wrote:
 I'll wait for kjell@ to have some time
 to review this diff.
 
 No big deal really :-D
 

You might wait a long time. Kjell has transitioned to the real world
and now works for a living. :-)

 Ken



Re: mg dired diff to reduce annoyance

2011-07-25 Thread Loganaden Velvindron
It uses wrapper functions around forwpage,backpage,
and goto-line, and maps the dot on the filename itself,
which is less confusing.

C-W for going 1 page forward, C-T for going 1 page
backwards, and finally C-O for going on a specific line.

This paches doesn't override the existing functions,
so people who ared used to the conventional keys can't
complain.



mg dired diff to reduce annoyance

2011-07-18 Thread Loganaden Velvindron
Hi,

kjell@ suggested a different approach. Instead of
using hacks in basic.c, I've added wrappers in dired
itself.

Rather than overwriting existing keys (C-v and M-v),
I think that using C-w and C-T is better for now.

As usual, I welcome feedback.

Index: src/usr.bin/mg/dired.c
===
RCS file: /cvs/src/usr.bin/mg/dired.c,v
retrieving revision 1.48
diff -u -p -r1.48 dired.c
--- src/usr.bin/mg/dired.c  23 Jan 2011 00:45:03 -  1.48
+++ src/usr.bin/mg/dired.c  18 Jul 2011 22:47:43 -
@@ -36,6 +36,8 @@ static int d_rename(int, int);
 static int  d_shell_command(int, int);
 static int  d_create_directory(int, int);
 static int  d_makename(struct line *, char *, size_t);
+static int  d_forwpage(int, int);
+static int  d_backpage(int, int);
 static void reaper(int);
 
 extern struct keymap_s helpmap, cXmap, metamap;
@@ -63,10 +65,10 @@ static PF diredcl[] = {
rescan, /* ^Q */
backisearch,/* ^R */
forwisearch,/* ^S */
-   rescan, /* ^T */
+   d_backpage, /* ^T */
universal_argument, /* ^U */
forwpage,   /* ^V */
-   rescan, /* ^W */
+   d_forwpage, /* ^W */
NULL/* ^X */
 };
 
@@ -590,6 +592,26 @@ d_makename(struct line *lp, char *fn, si
if (strlcat(fn, p, len) = len)
return (FALSE);
return ((lgetc(lp, 2) == 'd') ? TRUE : FALSE);
+}
+
+static int
+d_forwpage(int f, int n)
+{
+   forwpage(f | FFRAND, n);
+   if ((strrchr(curwp-w_dotp-l_text, ' ')) != NULL)
+   curwp-w_doto = strrchr(curwp-w_dotp-l_text, ' ') -
+  curwp-w_dotp-l_text + 1;
+   return TRUE;
+}
+
+static int
+d_backpage(int f, int n)
+{
+   backpage(f | FFRAND, n);
+   if ((strrchr(curwp-w_dotp-l_text, ' ')) != NULL)
+   curwp-w_doto = strrchr(curwp-w_dotp-l_text, ' ') -
+  curwp-w_dotp-l_text + 1;
+   return TRUE;
 }
 
 /*