help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: redefine C-h


From: Drew Adams
Subject: RE: redefine C-h
Date: Sun, 10 Aug 2008 21:07:40 -0700

> > Icicles does not bind `C-h'. `C-h' with Icicle mode is the 
> > same as it is without it.
>
> I must have turned on an icicles setting to override these keys,
> since commenting out these lines in icicles-mode.el gave me the
> C-h behavior I was looking for:
> 
> ;    (icicle-remap 'where-is 'icicle-where-is
> ;                  icicle-mode-map (current-global-map)) ; `C-h w'
> ;    (define-key icicle-mode-map "\C-h\C-o" 'icicle-describe-option-
>       of-type) ; `C-h C-o'

1. That should have nothing to do with your binding of `C-h'.

2. The right way to remove those Icicle mode bindings, if you want to, is to
customize option `icicle-top-level-key-bindings', as I mentioned. That is the
way to customize all top-level (i.e., non-minibuffer) Icicles bindings. You
don't need to know any Lisp to do this; it's very simple.

> I'm not exactly sure why, actually. Possibly I made another change at
> around the same time that I can't recall right now that actually
> "fixed" my C-h issue.

I expect so. I don't think Icicles is related to your problem in any way.

> > Similarly, for `C-M-h': Icicles should not affect it....
> 
> Yes, C-M-h worked correctly right away. It's the 'C-h' rebinding that
> was not taking.

Others have explained why. See below for a summary recipe.

> > Icicle mode does, however make some changes in the 
> > minibuffer keymaps. One that is pertinent here is that
> > it remaps command `delete-backward-char' to
> > `icicle-delete-backward-char' in the minibuffer completion 
> > keymaps. This is so that whenever you delete a character
> > in the minibuffer the set of candidate completions is
> > updated to reflect your edited input...
> 
> Yes..I would prefer to keep the iciciles minibuffer features intact
> since I do use icicles entirely for its minibuffer enhancements.
>
> In my current setup, C-h does do the right thing in the minibuffer -
> delete the char before point, and update the completion list.

And it does the right thing outside the minibuffer too, right? Doesn't it delete
a char there too? If so, then the only thing that is not yet working is `C-M-h'
for `help-command', is that correct? Or is that working now also?

The following should do what you need. It should work whether or not you use
Icicles (it does for me).

(global-set-key "\C-h" 'delete-backward-char)
(setq help-char ?\C-\M-h)
(define-key global-map (char-to-string help-char) 'help-command)

`C-M-h w' should then give you `where-is', and so on.

Note, BTW, that `C-M-h C-h' gives you `help-for-help' - don't expect this to be
`C-M-h C-M-h'.



[Instead of using `setq' to set `help-char', you can use Customize:
`M-x customize-option help-char'.
In the Customize buffer, type: C-q C-M-h
(that is, Control-q key followed by Control-Meta-h chord)

`C-q' quotes the key you hit after it. You will see \210 as the displayed new
value of `help-char' in Customize, but that's OK. (Sometimes Customize is less
user-friendly than Lisp. ;-))

But you might as well just use (setq help-char ?\C-\M-h), to keep all of this
stuff together.]





reply via email to

[Prev in Thread] Current Thread [Next in Thread]