So this is a bit specialised. I've used org-mode for a while now but never before the agenda command to list a "stuck project". The sequence built in to do this with org-agenda is C-c a #. This doesn't work out of the box for anyone with a UK keyboard because the # key is on Alt-3 and Alt is bound to Meta (I can't realistically change this) in Emacs. Actually I use Aquamacs but I don't think this is relevant.

I tried the method suggested in namely

;; Allow hash to be entered   
(global-set-key (kbd "M-3") '(lambda () (interactive) (insert "#")))

and that does indeed allow me to enter # symbols in many contexts but when I enter the # symbol in the org-agenda context I get the error:

org-agenda-get-restriction-and-command: Wrong type argument: characterp, 134217779

So I could always type

M-x org-agenda-list-stuck-projects

but that's way too cumbersome. I suppose I could just find another key combination, but I want it to start with C-c aand I'm not so sure how to proceed with this. Suggestions?

The solution I found was to change my input keyboard source to Australian as suggested by another SX user (sorry, I lost the reference). That also helps in other ways as my keyboards at work are laid out in the same way now.

You can use M-3 instead of # as part of a key definition. Use something like this in your .emacs:

;; fix agenda command with # for UK keyboard
(define-key org-mode-map (kbd "C-c a M-3") 'org-agenda-list-stuck-projects)

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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