emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Can not get keybinding to work in org-agenda-mode
@ 2012-11-05 11:26 Marcel van der Boom
  2012-11-05 12:43 ` Sebastien Vauban
  0 siblings, 1 reply; 3+ messages in thread
From: Marcel van der Boom @ 2012-11-05 11:26 UTC (permalink / raw)
  To: Org Mode List

Hi,

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>		m/ms-org-agenda
...

I don't get any errors, other than 'C-c m is undefined'

What am I missing here?

Thx,
marcel
-- 
Marcel van der Boom  -- http://hsdev.com/mvdb.vcf
HS-Development BV    -- http://www.hsdev.com
We use bitcoin!      -- http://bitcoin.org

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Can not get keybinding to work in org-agenda-mode
  2012-11-05 11:26 Can not get keybinding to work in org-agenda-mode Marcel van der Boom
@ 2012-11-05 12:43 ` Sebastien Vauban
  2012-11-05 13:23   ` Marcel van der Boom
  0 siblings, 1 reply; 3+ messages in thread
From: Sebastien Vauban @ 2012-11-05 12:43 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Can not get keybinding to work in org-agenda-mode
  2012-11-05 12:43 ` Sebastien Vauban
@ 2012-11-05 13:23   ` Marcel van der Boom
  0 siblings, 0 replies; 3+ messages in thread
From: Marcel van der Boom @ 2012-11-05 13:23 UTC (permalink / raw)
  To: emacs-orgmode


On ma 05-nov-2012 13:43
"Sebastien Vauban" <wxhgmqzgwmuf@spammotel.com> wrote:

>> I don't get any errors, other than 'C-c m is undefined'
>>
>> What am I missing here?  

I experimented a bit and 

 (define-key org-agenda-mode-map "\C-cm" 'm/ms-org-agenda)

also seems to work. I don't understand what the difference is, if any.

Marcel
-- 
Marcel van der Boom  -- http://hsdev.com/mvdb.vcf
HS-Development BV    -- http://www.hsdev.com
We use bitcoin!      -- http://bitcoin.org

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-11-05 13:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-05 11:26 Can not get keybinding to work in org-agenda-mode Marcel van der Boom
2012-11-05 12:43 ` Sebastien Vauban
2012-11-05 13:23   ` Marcel van der Boom

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).