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

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

Re: How to get the function by the keymap?


From: Eli Zaretskii
Subject: Re: How to get the function by the keymap?
Date: Sat, 10 Nov 2012 18:38:51 +0200

> Date: Sun, 11 Nov 2012 01:09:02 +0900
> From: Adam Jiang <address@hidden>
> 
> (defun smart-operator-backspace ()
>   (interactive)
>   (cond ((looking-back "hello"))
>      (save-excursion
>         (replace-regexp-in-string ".*hello" "" (match-string 1))))
>      (t
>         (delete-char 1))))
> 
> 
> However, (delete-char) never works for me. The reason is another minor mode
> remapped the backspace key to function 'autopair-backspace'. Then, I
> realized that I need a method to fetch the function by given keymap and get
> it called rather thant have hardcoded deletion executed.
> 
> How can I do that with elisp code?

I think you want lookup-key or local-key-binding.



reply via email to

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