* Is it legal to set `help-char' to nil?
@ 2013-04-06 10:27 YE Qianchuan
2013-04-06 11:04 ` Peter Dyballa
0 siblings, 1 reply; 9+ messages in thread
From: YE Qianchuan @ 2013-04-06 10:27 UTC (permalink / raw)
To: help-gnu-emacs
I prefer using C-h to delete backward, thus I mapped C-h to DEL by
modifying key-translation-map.
Then set `help-char' to nil to avoid invoking help for a list of
commands start by prefix. (I can't find a good enough char to replace it)
For example, press C-x C-h to invoke C-x DEL but not to print help message.
If it's not legal, are there any workaround?
If it's legal, then there are bugs in certain modules like term, because
doing such thing breaks it.
Thank you.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Is it legal to set `help-char' to nil?
2013-04-06 10:27 Is it legal to set `help-char' to nil? YE Qianchuan
@ 2013-04-06 11:04 ` Peter Dyballa
2013-04-06 14:13 ` YE Qianchuan
0 siblings, 1 reply; 9+ messages in thread
From: Peter Dyballa @ 2013-04-06 11:04 UTC (permalink / raw)
To: YE Qianchuan; +Cc: help-gnu-emacs
Am 06.04.2013 um 12:27 schrieb YE Qianchuan:
> If it's not legal, are there any workaround?
Press F1 instead of C-h! See also C-h b.
--
Greetings
Pete
The best way to accelerate a PC is 9.8 m/s²
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Is it legal to set `help-char' to nil?
2013-04-06 11:04 ` Peter Dyballa
@ 2013-04-06 14:13 ` YE Qianchuan
0 siblings, 0 replies; 9+ messages in thread
From: YE Qianchuan @ 2013-04-06 14:13 UTC (permalink / raw)
To: Peter Dyballa; +Cc: help-gnu-emacs
On 04/06/2013 07:04 PM, Peter Dyballa wrote:
> Am 06.04.2013 um 12:27 schrieb YE Qianchuan:
>
>> If it's not legal, are there any workaround?
> Press F1 instead of C-h! See also C-h b.
>
> --
> Greetings
>
> Pete
>
> The best way to accelerate a PC is 9.8 m/s²
>
Well, you didn't get my meaning. I should put it more clearly.
I mean, if it's not legal to set `help-char' to nil, then when I press
C-x C-h,
it would show me a buffer with a list of key bindings starting with C-x.
But I want it invokes C-x DEL. So the workaround I'm looking for is
how to keep `help-char' to C-h and avoid showing me the help buffer when
I press C-h.
(Note I can't find another good char to replace C-h. Also note f1 is not
a legal character)
On the other hand, if it's legal to set `help-char' to nil, the problem
has gone.
Because this setting breaks term mode. I am wondering it's a bug in term
mode or I shouldn't do so.
Thank you anyway.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Is it legal to set `help-char' to nil?
[not found] <mailman.23660.1365244070.855.help-gnu-emacs@gnu.org>
@ 2013-04-10 14:49 ` Michael Heerdegen
[not found] ` <8738uyo2r3.fsf@web.de>
1 sibling, 0 replies; 9+ messages in thread
From: Michael Heerdegen @ 2013-04-10 14:49 UTC (permalink / raw)
To: help-gnu-emacs; +Cc: help-gnu-emacs
YE Qianchuan <stool.ye@gmail.com> writes:
> I prefer using C-h to delete backward, thus I mapped C-h to DEL by
> modifying key-translation-map. Then set `help-char' to nil to avoid
> invoking help for a list of commands start by prefix. (I can't find a
> good enough char to replace it) For example, press C-x C-h to invoke
> C-x DEL but not to print help message.
>
> If it's not legal, are there any workaround?
Dunno if it's legal.
> If it's legal, then there are bugs in certain modules like term,
> because doing such thing breaks it.
In which way?
In term, no matter if `help-char' is bound to 8 or not, I see that C-h
is bound to the command `term-send-raw' in char-mode. Or do you use
line-mode? In this case, note that C-h is still bound in the
global-map (which is something different than `help-char'):
,----------------------------------------------------------------------
| ELISP> (lookup-key global-map [?\C-h])
| help-command
|
| ELISP> (symbol-function 'help-command)
| (keymap
| (111 . my-info-org)
| (11 . describe-bindings-for-key)
| (113 . help-quit)
| (118 . describe-variable)
| (119 . where-is)
| (116 . my-info-tramp)
| (115 . describe-syntax)
| (114 . info-emacs-manual)
| (80 . describe-package)
| (112 . finder-by-keyword)
| (110 . view-emacs-news)
| (109 . describe-mode)
| (108 . view-lossage)
| (107 . describe-key)
| (52 keymap
| (105 . info-other-window))
| (105 . info)
| (104 . view-hello-file)
| (103 . my-info-gnus)
| (102 . describe-function)
| (101 . my-info-elisp)
| (100 . apropos-documentation)
| (99 . my-info-cl)
| (98 . describe-bindings)
| (97 . apropos)
| (83 . info-lookup-symbol)
| (76 . describe-language-environment)
| (75 . Info-goto-emacs-key-command-node)
| (73 . describe-input-method)
| (70 . Info-goto-emacs-command-node)
| (67 . describe-coding-system)
| (28 . describe-input-method)
| (23 . describe-no-warranty)
| (20 . view-emacs-todo)
| (16 . view-emacs-problems)
| (15 . describe-distribution)
| (14 . view-emacs-news)
| (13 . view-order-manuals)
| (6 . view-emacs-FAQ)
| (5 . view-external-packages)
| (4 . view-emacs-debugging)
| (3 . describe-copying)
| (1 . about-emacs)
| (63 . help-for-help)
| (46 . display-local-help)
| (f1 . help-for-help)
| (help . help-for-help)
| (8 . help-for-help))
`----------------------------------------------------------------------
Of course, you can unbind it.
Regards,
Michael.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Is it legal to set `help-char' to nil?
[not found] ` <8738uyo2r3.fsf@web.de>
@ 2013-04-11 9:21 ` YE Qianchuan
2013-04-11 10:59 ` Michael Heerdegen
0 siblings, 1 reply; 9+ messages in thread
From: YE Qianchuan @ 2013-04-11 9:21 UTC (permalink / raw)
To: Michael Heerdegen, help-gnu-emacs
On 04/10/2013 10:49 PM, Michael Heerdegen wrote:
> YE Qianchuan <stool.ye@gmail.com> writes:
>
>> I prefer using C-h to delete backward, thus I mapped C-h to DEL by
>> modifying key-translation-map. Then set `help-char' to nil to avoid
>> invoking help for a list of commands start by prefix. (I can't find a
>> good enough char to replace it) For example, press C-x C-h to invoke
>> C-x DEL but not to print help message.
>>
>> If it's not legal, are there any workaround?
> Dunno if it's legal.
>
>> If it's legal, then there are bugs in certain modules like term,
>> because doing such thing breaks it.
> In which way?
>
> In term, no matter if `help-char' is bound to 8 or not, I see that C-h
> is bound to the command `term-send-raw' in char-mode. Or do you use
> line-mode? In this case, note that C-h is still bound in the
> global-map (which is something different than `help-char'):
Well, I can't even enter term-mode.
I can reproduce it in this way:
1. open emacs without initial files (emacs -Q)
2. eval (setq help-char nil)
3. type M-x term
Then it throw an error: Wrong type argument: characterp, nil.
If you don't have this problem, maybe it's a bug in trunk.
>
> ,----------------------------------------------------------------------
> | ELISP> (lookup-key global-map [?\C-h])
> | help-command
> |
> | ELISP> (symbol-function 'help-command)
> | (keymap
> | (111 . my-info-org)
> | (11 . describe-bindings-for-key)
> | (113 . help-quit)
> | (118 . describe-variable)
> | (119 . where-is)
> | (116 . my-info-tramp)
> | (115 . describe-syntax)
> | (114 . info-emacs-manual)
> | (80 . describe-package)
> | (112 . finder-by-keyword)
> | (110 . view-emacs-news)
> | (109 . describe-mode)
> | (108 . view-lossage)
> | (107 . describe-key)
> | (52 keymap
> | (105 . info-other-window))
> | (105 . info)
> | (104 . view-hello-file)
> | (103 . my-info-gnus)
> | (102 . describe-function)
> | (101 . my-info-elisp)
> | (100 . apropos-documentation)
> | (99 . my-info-cl)
> | (98 . describe-bindings)
> | (97 . apropos)
> | (83 . info-lookup-symbol)
> | (76 . describe-language-environment)
> | (75 . Info-goto-emacs-key-command-node)
> | (73 . describe-input-method)
> | (70 . Info-goto-emacs-command-node)
> | (67 . describe-coding-system)
> | (28 . describe-input-method)
> | (23 . describe-no-warranty)
> | (20 . view-emacs-todo)
> | (16 . view-emacs-problems)
> | (15 . describe-distribution)
> | (14 . view-emacs-news)
> | (13 . view-order-manuals)
> | (6 . view-emacs-FAQ)
> | (5 . view-external-packages)
> | (4 . view-emacs-debugging)
> | (3 . describe-copying)
> | (1 . about-emacs)
> | (63 . help-for-help)
> | (46 . display-local-help)
> | (f1 . help-for-help)
> | (help . help-for-help)
> | (8 . help-for-help))
> `----------------------------------------------------------------------
>
> Of course, you can unbind it.
>
>
> Regards,
>
> Michael.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Is it legal to set `help-char' to nil?
2013-04-11 9:21 ` YE Qianchuan
@ 2013-04-11 10:59 ` Michael Heerdegen
2013-04-12 10:14 ` YE Qianchuan
0 siblings, 1 reply; 9+ messages in thread
From: Michael Heerdegen @ 2013-04-11 10:59 UTC (permalink / raw)
To: YE Qianchuan; +Cc: help-gnu-emacs
YE Qianchuan <stool.ye@gmail.com> writes:
> Well, I can't even enter term-mode.
> I can reproduce it in this way:
> 1. open emacs without initial files (emacs -Q)
> 2. eval (setq help-char nil)
> 3. type M-x term
> Then it throw an error: Wrong type argument: characterp, nil.
> If you don't have this problem, maybe it's a bug in trunk.
I can reproduce this. The error happens when loading "ehelp", here, in
the definition of `electric-help-map':
(define-key map (char-to-string help-char) 'electric-help-help)
Similar examples are spread over diverse other elisp files. So, we know
now that Emacs indeed assumes that `help-char' is a character (and not
nil), so nil is not allowed as a value.
I don't have a better solution than to bind `help-char' to a different
character. You could also create a bug report - I think what you want
could be made possible, but I don't know if emacs-dev would do it.
Regards,
Michael.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Is it legal to set `help-char' to nil?
2013-04-11 10:59 ` Michael Heerdegen
@ 2013-04-12 10:14 ` YE Qianchuan
2013-04-12 16:54 ` Stefan Monnier
0 siblings, 1 reply; 9+ messages in thread
From: YE Qianchuan @ 2013-04-12 10:14 UTC (permalink / raw)
To: help-gnu-emacs
On 04/11/2013 06:59 PM, Michael Heerdegen wrote:
> I can reproduce this. The error happens when loading "ehelp", here, in
> the definition of `electric-help-map':
>
> (define-key map (char-to-string help-char) 'electric-help-help)
Thanks for the explanation. It makes sense now.
>
> Similar examples are spread over diverse other elisp files. So, we know
> now that Emacs indeed assumes that `help-char' is a character (and not
> nil), so nil is not allowed as a value.
OK, so it answered my question. nil is not legal for `help-char'.
>
> I don't have a better solution than to bind `help-char' to a different
> character. You could also create a bug report - I think what you want
> could be made possible, but I don't know if emacs-dev would do it.
All the legal characters have been defined for other commands, or can't
be used in terminal.
It's fine with me to just leave C-h for help in those cases.
Thank you.
>
> Regards,
>
> Michael.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Is it legal to set `help-char' to nil?
2013-04-12 10:14 ` YE Qianchuan
@ 2013-04-12 16:54 ` Stefan Monnier
2013-04-13 15:29 ` YE Qianchuan
0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2013-04-12 16:54 UTC (permalink / raw)
To: help-gnu-emacs
>> I don't have a better solution than to bind `help-char' to a different
>> character. You could also create a bug report - I think what you want
>> could be made possible, but I don't know if emacs-dev would do it.
> All the legal characters have been defined for other commands, or can't be
> used in terminal.
You can use an "unlikely" char, such as \uffff.
Stefan
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Is it legal to set `help-char' to nil?
2013-04-12 16:54 ` Stefan Monnier
@ 2013-04-13 15:29 ` YE Qianchuan
0 siblings, 0 replies; 9+ messages in thread
From: YE Qianchuan @ 2013-04-13 15:29 UTC (permalink / raw)
To: help-gnu-emacs
On 04/13/2013 12:54 AM, Stefan Monnier wrote:
>>> I don't have a better solution than to bind `help-char' to a different
>>> character. You could also create a bug report - I think what you want
>>> could be made possible, but I don't know if emacs-dev would do it.
>> All the legal characters have been defined for other commands, or can't be
>> used in terminal.
> You can use an "unlikely" char, such as \uffff.
>
>
> Stefan
>
>
Good tips. This is the best solution so far. Thank you.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2013-04-13 15:29 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-06 10:27 Is it legal to set `help-char' to nil? YE Qianchuan
2013-04-06 11:04 ` Peter Dyballa
2013-04-06 14:13 ` YE Qianchuan
[not found] <mailman.23660.1365244070.855.help-gnu-emacs@gnu.org>
2013-04-10 14:49 ` Michael Heerdegen
[not found] ` <8738uyo2r3.fsf@web.de>
2013-04-11 9:21 ` YE Qianchuan
2013-04-11 10:59 ` Michael Heerdegen
2013-04-12 10:14 ` YE Qianchuan
2013-04-12 16:54 ` Stefan Monnier
2013-04-13 15:29 ` YE Qianchuan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).