[comp.emacs] function-keymap: criticism

"SDRRTR::SDRRTR::MRGATE::\"MRGATE::PSI%SCRVX2::BLUE::IN%\"davis@blue.sdr.slb.COM\"\""@sdr.slb.COM (05/07/88)

Return-path: davis@ruby
Received: from ruby.colour.uucp by blue via TCP; Sat May  7 00:14 GMT
Received: by ruby.colour.uucp (3.2/SMI-3.0DEV3) id AA23068; Sat, 7 May 88
 00:06:40 PDT
Date: Sat, 7 May 88 00:06:40 PDT
From: davis@ruby
Subject: function-keymap: criticism
To: outinfognu@blue
Reply-to: davis@blue.sdr.slb.com
Message-Id: <8805070706.AA23068@ruby.colour.uucp>
Organization: Schlumberger Cambridge Research
Snail: PO Box 153, Cambridge CB3 0HG, England
Phone: [+44] (0) 223 325282

Software Hoarding: Just Say No
Memo: To shatter tradition makes us *feel* free...



	Some comments on the use of function-keymap in terminal
	set-ups.

	1) The effective use of function-keymap is restricted to
	   keyboards that already have clearly established labelling
	   of their keys. Any attempts to map, for instance, a Sun
	   keyboard onto the standard function-keymap slots would be
	   utterly arbitrary. 

	2) function-keymap pushes users in the direction of yet
	another level of mapping. Instead of going direct from
	"what-it-says-on-the-key" to "what-I-want-it-to-do", they
	first must discover what function-keymap slot the key has.

	      example: someone wants PF1 on a VT100 to be bound to
	      save-buffer. To use function-keymap, s/he must know that
	      C-a is the slot for PF1 in this keymap. Why on earth
	      should such a mapping exist ? Why should PF1 be mapped
	      to C-a ? (well, ok, why not, but that's hardly an
	      answer, especially when F1 and PF1 on a VT200 map to
	      very different keys -- its not even the `1' that
	      counts!!).

	3) The essential feature of customized function keys is not
	labelling but *geometry*. No-one is interested in knowing that
	the `first' function key maps to C-a and has a default binding
	of foo-bar: what's desired is saying "the top left function
	key does x". function-keymap does not offer this facility, and
	indeed, no default set-up via a standard keymap ever can....

	4) Confronting people with lambda syntax on their first effort
	at Emacs customization has its drawbacks.

	(setq term-setup-hook '(lambda ()
				  (load "my-emacs-keys")))

	is not utterly transparent to early users, especially
	non-hackers.

	5) Why, oh why, is M-[ bound to backward-paragraph. How many
	keyboards with function keys are there that *do not* use this
	as an escape sequence ? Especially given the ANSI standard for
	cursor arrows...... 

	6) Terminal setup files (vt100.el, sun.el) should contain *NO*
	defuns !! Why should anyone have to lose functionality because
	their site manager didn't preload the defuns, and they decided
	to go for:

	      (setq term-file-prefix nil)
	      (load "my-emacs-keys")

	7) The basic message is -- who *wants* terminal independent
	keyboard bindings ? As indicated above, it is geometry and not
	labels that govern customization, and standard keyboard
	geometry is a long way off, if even desirable....
	      
	8) One solution, in use here at SCR, is a keymapping utility
	that maps from real function key labels to actual keyboard
	escape sequences. Writing C code (or even e-lisp code) to do
	this for any given terminal is a doddle, if messy,  and means 
	that no-one need use a .ttyswrc again (Ian B. - honest, its a
	nice idea, F1 mapped to ESC*F1 but is this is the road to 
	portability ?) Whether this sits inside Emacs (eg;
	map-key-buffer), or outside (eg; % emap > my-emacs-keys) is
	irrelevant, but at least this solution presents a uniform
	interface for any terminal (once <terminal-name>ReWrite has
	been coded, anyway).


	Ok, ok, enough self-advertisment. What comments does the gnumacs
	list have on this ? On the part of the code, vt100.el uses
	function-keymap, sun.el and the rest don't. Anyone have any
	arguments to support `independence by label' ? My experience
	of GNU so far has been that most experienced users don't
	really care about function keys, whilst most beginners, faced
	with `C-M-cokebottle-ESC-c C-x g' tend to reach for F1. This
	should be sorted out.

	Paul Davis 
	Schlumberger Cambridge Research,
	Cambridge, UK.

	<whinging in pancake country>
	
	

barmar@think.COM (Barry Margolin) (05/08/88)

In article <8805071503.AA06117@EDDIE.MIT.EDU> "SDRRTR::SDRRTR::MRGATE::\"MRGATE::PSI%SCRVX2::BLUE::IN%\"davis@blue.sdr.slb.COM\"\""@sdr.slb.COM writes:
>	5) Why, oh why, is M-[ bound to backward-paragraph. How many
>	keyboards with function keys are there that *do not* use this
>	as an escape sequence ? Especially given the ANSI standard for
>	cursor arrows...... 

M-[ has been the Emacs backward-paragraph command for as long as there
has been Emacs.  I think Emacs is older than the ANSI standard you
cite.  I believe Emacs was developed at MIT around 1976.  Its command
set is basically a conglomeration of the various popular TECO macro
sets that were in use at the time, so I suspect that M-[ was in use
even earlier.


Barry Margolin
Thinking Machines Corp.

barmar@think.com
uunet!think!barmar

Ram-Ashwin@cs.yale.edu (Ashwin Ram) (05/12/88)

In article <8805071503.AA06117@EDDIE.MIT.EDU>, "SDRRTR::SDRRTR::MRGATE::\"MRGATE::PSI%SCRVX2::BLUE::IN%\"davis writes:
> 	5) Why, oh why, is M-[ bound to backward-paragraph. How many
> 	keyboards with function keys are there that *do not* use this
> 	as an escape sequence ? Especially given the ANSI standard for
> 	cursor arrows...... 

I use M-p and M-n for backward/forward-paragraph.  M-[ has the disadvantage you
mentioned; besides, M-p and M-n are a lot more mnemonic ("bigger" versions of
C-p and C-n, the usual upward and downward motion commands).

>                                                      My experience
> 	of GNU so far has been that most experienced users don't
> 	really care about function keys, whilst most beginners, faced
> 	with `C-M-cokebottle-ESC-c C-x g' tend to reach for F1. This
> 	should be sorted out.

I never use function keys because it slows me down.  I find it a lot faster to
hit a control key (right there at my finger tips) rather than reach across for a
special key (involves looking down at the terminal), hit the key, and bring your
hand back to typing position.  Besides, I can never remember which function key
does what.

My feeling is that beginners will use whatever they are given.  I know GNU
beginners who don't use function keys because that's what they learned from me.
The complexity of customizing function keys is also a deterrent to the beginner.

-- Ashwin.

ARPA:    Ram-Ashwin@cs.yale.edu
UUCP:    {decvax,ucbvax,harvard,cmcl2,...}!yale!Ram-Ashwin
BITNET:  Ram@yalecs

allbery@ncoast.UUCP (Brandon S. Allbery) (05/17/88)

As quoted from <8805071503.AA06117@EDDIE.MIT.EDU> by "SDRRTR::SDRRTR::MRGATE::\"MRGATE::PSI%SCRVX2::BLUE::IN%\"davis@blue.sdr.slb.COM\"\""@sdr.slb.COM:
+---------------
| 	4) Confronting people with lambda syntax on their first effort
| 	at Emacs customization has its drawbacks.
| 
| 	(setq term-setup-hook '(lambda ()
| 				  (load "my-emacs-keys")))
| 
| 	is not utterly transparent to early users, especially
| 	non-hackers.
+---------------

Undoubtedly my code is less than perfect (not really a lisp hacker, and I
haven't (yet) had a chance to bring up Gnu on my new *nix box), but it
should at least get the basic idea across.

(defmacro set-hook (hook value)
  "Set a hook's value, wrapping the value in a lambda if it's non-nil."
  (if (eq value nil)
      ()
    (setq value '(lambda () value)))
  `(setq ,hook ,@value))
-- 
	      Brandon S. Allbery, moderator of comp.sources.misc
	{well!hoptoad,uunet!marque,cbosgd,sun!mandrill}!ncoast!allbery
Delphi: ALLBERY						     MCI Mail: BALLBERY