Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm playing around with textmate.el: https://github.com/defunkt/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
add comment

1 Answer

up vote 0 down vote accepted

All it should take is

(eval-after-load 'textmate
  '(progn
     (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
  '(progn
     (define-key *textmate-mode-map* [(control tab)]
       (lambda () (interactive)
         ...))))
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.