all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to bind C-x = = to describe-char ?
@ 2021-05-25 18:26 Hashish Singh
  2021-05-28 13:47 ` Abhiseck Paira
  0 siblings, 1 reply; 2+ messages in thread
From: Hashish Singh @ 2021-05-25 18:26 UTC (permalink / raw)
  To: Dmitry Alexandrov

Hi

How to bind C-x = = to describe-char ?

Or is there a way to have auto completion for key names ?

For eg I do not want to disturb the current "C-x =" binding to
"what-cursor-position" ?

What new bindings have you set up , give some examples.

I get errors like:

Key sequence C-x C-x = starts with non-prefix key C-x C-x
Key sequence C-x = = starts with non-prefix key C-x =

What is the difference between OR why are these two NON-Equivalent ?

(global-set-key "\C-xx=" 'describe-char)            ;;; works
(global-unset-key "\C-xx=")                         ;;; unbind
(global-set-key (kbd "<C-x-x-=>") 'describe-char)   ;;; why does not not work ?

Thanks
HS





^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How to bind C-x = = to describe-char ?
  2021-05-25 18:26 How to bind C-x = = to describe-char ? Hashish Singh
@ 2021-05-28 13:47 ` Abhiseck Paira
  0 siblings, 0 replies; 2+ messages in thread
From: Abhiseck Paira @ 2021-05-28 13:47 UTC (permalink / raw)
  To: Hashish Singh; +Cc: Dmitry Alexandrov, help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1578 bytes --]



> How to bind C-x = = to describe-char ?

If you want to bind "C-x = =" to 'describe-char' you first have to
unbind "C-x =" keybinding as it's already bound to
'what-cursor-position'.

To unbind the "C-x =" place the following in your init.el file:
(global-unset-key (kbd "C-x ="))

Now it'll be possible to bind 'describe-char' to "C-x = ="
(global-set-key (kbd "C-x = =") #'describe-char)

Now you if you still need to have easy access to 'what-cursor-position'
command, bind it to something else. For example let's bind it to
"C-x = w"
(global-set-key (kbd "C-x = w") #'what-cursor-position)


> For eg I do not want to disturb the current "C-x =" binding to
> "what-cursor-position" ?

It is not possible to have "C-x =" bound to a function and "C-x = ="
bound to some other function simultaneously. A key combination is either
a complete key sequence or a prefix key. It can't be both.

> What is the difference between OR why are these two NON-Equivalent ?
>
> (global-set-key "\C-xx=" 'describe-char)            ;;; works
> (global-unset-key "\C-xx=")                         ;;; unbind

> (global-set-key (kbd "<C-x-x-=>") 'describe-char)   ;;; why does not
> not work ?

kbd takes key sequence strings like described in the manual, like "C-h
k", "C-x x =" etc. This key sequence "<C-x-x-=>" basically means type
left angle bracket, right angle bracket, Control, x, = all at the same
time. 

-- 
Abhisek Paira
E34E 825B 979E EB9F 8505  F80E E93D 353B 7740 0709
"There is no system but GNU, and Linux is one of its kernels."

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-28 13:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-25 18:26 How to bind C-x = = to describe-char ? Hashish Singh
2021-05-28 13:47 ` Abhiseck Paira

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.