From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sebastien Vauban" Subject: Re: Can not get keybinding to work in org-agenda-mode Date: Mon, 05 Nov 2012 13:43:59 +0100 Message-ID: <80sj8o9q40.fsf@somewhere.org> References: <20121105122602.4b1fa5dc@hsdev.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hi Marcel, Marcel van der Boom wrote: > I use org-mime to mail subtrees from org-mode and have bound this to > 'C-c m' > I would like to be able to do the same thing from my agenda views, but > somehow I can't get the keybinding to work. > > This is what I have: > > (defun m/ms-org-agenda () > (interactive) > (org-agenda-goto) > (org-mime-subtree)) > > ;; This works > (define-key org-mode-map [(control c) m] 'org-mime-subtree) > > ;; This does not > (define-key org-agenda-mode-map [(control c) m] 'm/ms-org-agenda) > > When asking help about modes (C-h m) I see the keybinding listed: > > key binding > --- ------- > ... > C-c m/ms-org-agenda > ... > > I don't get any errors, other than 'C-c m is undefined' > > What am I missing here? I don't know, but the following does work for me: #+begin_src emacs-lisp (add-hook 'org-mode-hook (lambda () (local-set-key (kbd "C-c m") 'org-mime-subtree))) (defun my/mail-subtree () (interactive) (org-agenda-goto) (org-mime-subtree)) (add-hook 'org-agenda-mode-hook (lambda () (local-set-key (kbd "C-c m") 'my/mail-subtree))) #+end_src Best regards, Seb -- Sebastien Vauban