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

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

How to get the function by the keymap?


From: Adam Jiang
Subject: How to get the function by the keymap?
Date: Sun, 11 Nov 2012 01:09:02 +0900

Hi,

I am working on a minor mode in which I want to remap [backspace] key to different functions in different situation. The lisp code looks like

(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?

/Adam

reply via email to

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