[PATCH] Assume Shift+Backspace is Backspace

2003-06-06 Thread David Sterba
Hello,

I'm sending a patch, wich corrects keypress of 'Shift+Backspace'
to 'Backspace'.

It seems to me more comfortable not to release the Shift key
when typing variable name and making a typo.
By now Shift+BS does nothing and only slows down typing.

I think Shift+BS has not any specific meaning which could be
possibly broken by such change.


David
diff -urN key.c.orig key.c
--- key.c.orig	Sat Mar 15 01:31:15 2003
+++ key.c	Mon May 12 21:08:38 2003
@@ -595,6 +595,12 @@
 	mod = ~KEY_M_CTRL;
 }
 
+/* Shift+BackSpace is backspace */
+if (c == KEY_BACKSPACE  (mod  KEY_M_SHIFT)) {
+c = KEY_BACKSPACE;
+mod = ~KEY_M_SHIFT;
+}
+
 /* Convert Shift+Fn to F(n+10) */
 if (c = KEY_F (1)  c = KEY_F (10)  (mod  KEY_M_SHIFT)) {
 	c += 10;


Re: A fix for the F3 /var/log bug... / POSIX and '##'

2003-06-06 Thread Alfie Costa
On Sun, 1 Jun 2003 12:10, Oswald Buddenhagen wrote:

one thing to consider is, whether all 'file's in the wild support -z
or a configure check and optionally manual on-the-fly decompression
would have to be done instead.
Dismaying thought.  Going through the checklist:  Linux is OK.

HP-UX?  Here's a 'file' man page from HP-UX Release 11.00: October
1997, with no '-z' switch:
	http://www.calpoly.edu/cgi-bin/man-cgi?file+1

Might have changed in six years though...

SunOS?  AIX?

 The logic would go like:

 1) let x = `file foo`
 2) is foo compressed?  Goto 4.

what would these be good for?
Nothing, it was a typo.  I meant 2) is foo UNcompressed?  Goto 4.

The idea was to save a '-z' call, on the guess that not using '-z'
many times would be worth calling 'file' twice if necessary
 3) let x = `file -z foo`
 4) return x
...but now I think that guess was wrong.  I had thought that 'file -z' 
took much longer with big files, but after running some tests, it seems 
not to be the case.

---

Recap:  /var/log files don't view right using F3 in 'mc'.  This can be 
gotten around using various filters.  The two attempts considered here 
so far (one using the POSIX shell's '##', and the other using 'file -z') 
may not work out of the box on all of mc's current platforms.

Are there more portable substitutes?   The POSIX shell '##' can be 
replaced with a less efficient 'grep' pipe.  Before:

	View=%view{ascii,nroff} d=%d ; d=${d##/var/log*} ; if [ -z $d] ; 
then  gzip -dc %f  ; else   gzip -dc %f | nroff -c -Tlatin1 -mandoc ;  fi

After:

	View=%view{ascii,nroff} if echo %d | grep --quiet /var/log ; then  gzip 
-dc %f  ; else   gzip -dc %f | nroff -c -Tlatin1 -mandoc ;  fi

(If not all greps have the '--quiet' switch, then 'grep /var/log  
/dev/null' would work...)

How to most efficiently replace 'file -z' is less obvious. 
Uncompressing a big file just to get its type could cause long waits if 
resources are low.  Man pages don't tend to be too big, perhaps only 
checking the file types of archives smaller than a given size is better?

___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel


Re: A fix for the F3 /var/log bug... / POSIX and '##'

2003-06-06 Thread Pavel Roskin
On Fri, 6 Jun 2003, Alfie Costa wrote:

 Recap:  /var/log files don't view right using F3 in 'mc'.  This can be
 gotten around using various filters.  The two attempts considered here
 so far (one using the POSIX shell's '##', and the other using 'file -z')
 may not work out of the box on all of mc's current platforms.

Thanks for the recap.  I have implemented it using case, which is the
fastest and the most portable way.  It's in CVS now.

-- 
Regards,
Pavel Roskin
___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel