[comp.emacs] Help needed with GNUemacs C-h

chet@uwovax.uwo.ca (06/01/90)

With GNU Emacs 18.52.0 on a Sun OS 4.0x used via remote access, I would
like to retain use of help facilities while disabling the connection
between C-h and help-command (C-h is bound to the backspace key, and I
don't believe I can change this).

(global-set-key "\C-h" 'delete-backward-char) gives me use of the backspace
key, but I have not been able to bind help-command to anything, nor to
access any of the key combinations that C-h is a prefix for.

Can anything be done? Any suggestions for rebinding if it can be done?
(I had thought of M-? because of its use with Unisys Emacs.)

Chet
creider@csd.uwo.ca

dankg@tornado.Berkeley.EDU (Dan KoGai) (06/04/90)

In article <6143.266617fa@uwovax.uwo.ca> chet@uwovax.uwo.ca writes:
>With GNU Emacs 18.52.0 on a Sun OS 4.0x used via remote access, I would
>like to retain use of help facilities while disabling the connection
>between C-h and help-command (C-h is bound to the backspace key, and I
>don't believe I can change this).
>
>(global-set-key "\C-h" 'delete-backward-char) gives me use of the backspace
>key, but I have not been able to bind help-command to anything, nor to
>access any of the key combinations that C-h is a prefix for.
>
>Can anything be done? Any suggestions for rebinding if it can be done?
>(I had thought of M-? because of its use with Unisys Emacs.)

	Sure you can.  Just put

(clobal-set-key "\M-?" 'help-for-help)

	in your .emacs.  For detail, you can see $lisp/help.el where $lisp
is your emacs lisp directory.

----------------
____  __  __    + Dan The "(dump-core)" Man
    ||__||__|   + E-mail:	dankg@ocf.berkeley.edu
____| ______ 	+ Voice:	+1 415-549-6111
|     |__|__|	+ USnail:	1730 Laloma Berkeley, CA 94709 U.S.A
|___  |__|__|	+	
    |____|____	+ "What's the biggest U.S. export to Japan?" 	
  \_|    |      + "Bullshit.  It makes the best fertilizer for their rice"

shurr@cbnews.att.com (Larry A. Shurr) (06/05/90)

In article <1990Jun4.093306.12038@agate.berkeley.edu> dankg@tornado.Berkeley.EDU (Dan KoGai) writes:
}In article <6143.266617fa@uwovax.uwo.ca> chet@uwovax.uwo.ca writes:
}}With GNU Emacs 18.52.0 on a Sun OS 4.0x used via remote access, I would
}}like to retain use of help facilities while disabling the connection
}}between C-h and help-command (C-h is bound to the backspace key, and I
}}don't believe I can change this).

}}(global-set-key "\C-h" 'delete-backward-char) gives me use of the backspace
}}key, but I have not been able to bind help-command to anything, nor to
}}access any of the key combinations that C-h is a prefix for.

}}Can anything be done? Any suggestions for rebinding if it can be done?
}}(I had thought of M-? because of its use with Unisys Emacs.)

I have long used the following in my .emacs file:

	;;; Create keyboard translate table and use it to swap ^H and DEL
	(let ((the-table (make-string 128 0)))
	  (let ((i 0))
	    (while (< i 128)
	      (aset the-table i i)
	      (setq i (1+ i))
	    )
	  )
	  ;; Swap ^H and DEL
	  (aset the-table ?\177 ?\^h)
	  (aset the-table ?\^h ?\177)
	  (setq keyboard-translate-table the-table)
	)

Like it says, it completely swaps the BackSpace and DEL keys; i.e., it
thinks DEL is c-h and vice-versa.  Of course, this is not an ideal solu-
tion as it requires your brain to translate references to c-h into DEL
and vice-versa, but my fingers like it because they are tuned to think 
of c-h as the delete-char-backwards key.  Apparently Richard Stallman 
is so adamantly opposed to the use of c-h for that purpose and, conversely,
so in favor of c-h as the logical choice for a help key that he made the 
GNU Emacs code reflect that point-of-view.  I never was able to find a set 
of key rebindings that totally converted c-h away from the help function 
while still retaining the help function - which is not to say that there 
isn't one, I just never found it before I obtained the above solution (of
course, I was still really green with GNU Emacs at the time).

BTW: I would like to credit the originator of the above Elisp, but I
don't know who did it.  With a minor cognitive adjustment made years
ago, I have used it successfully ever since.

regards, Larry
-- 
Signed: Larry A. Shurr (cbnmva!las@att.ATT.COM or att!cbnmva!las)
My psuedo-Burma Shave .signature has served me long and well and has been
retired.  A new .signature is now under consideration.
This posting reflects my opinions, not those of AGS or AT&T, but you knew that)

scott@truevision.com (Scott Stevens) (06/08/90)

In article <6143.266617fa@uwovax.uwo.ca> chet@uwovax.uwo.ca writes:
#With GNU Emacs 18.52.0 on a Sun OS 4.0x used via remote access, I would
#like to retain use of help facilities while disabling the connection
#between C-h and help-command (C-h is bound to the backspace key, and I
#don't believe I can change this).
#
#(global-set-key "\C-h" 'delete-backward-char) gives me use of the backspace
#key, but I have not been able to bind help-command to anything, nor to
#access any of the key combinations that C-h is a prefix for.
#

I don't recall where I found the following, but I've used it for some time
(with GNU Emacs 18.55) with no problem:

;; Change the keyboard translation to interpret:
;; C-h as DEL
;; C-? as C-h (actually C-? generates C-_)
(setq keyboard-translate-table
      "\000\^a\^b\^c\^d\^e\^f\^g\^?\^i\^j\^k\^l\^m\^n\^o\^p\^q\^r\^s\^t\^u\^v\^w\^x\^y\^z\^[\034\^]\035\^h")