Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm playing around with textmate.el: A little confusing at first if you've never tried textmate, but pretty cool!

I'd like to override a binding in the minor mode.

Here is a snippet from the source that does the binding:

(defvar *textmate-mode-map*
  (let ((map (make-sparse-keymap)))
    (cond ((featurep 'aquamacs)
(t ;; Any other version
 (define-key map [(control tab)] 'textmate-shift-right)
 (define-key map [(control shift tab)] 'textmate-shift-left)

Rather than modifying the source I got from github, I'd like to override in my .emacs.

share|improve this question
up vote 0 down vote accepted

All it should take is

(eval-after-load 'textmate
     (define-key *textmate-mode-map* [(control tab)] 'my-cool-function)))

replacing of course my-cool-function with whatever you actually want it to do. If you want to use a lambda function, don't forget to make it interactive or you will get an error:

(eval-after-load 'textmate
     (define-key *textmate-mode-map* [(control tab)]
       (lambda () (interactive)
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .