I want a keyboard macro that does something like this:

  1. Call org-refile
  2. Insert two characters(In this case '')

So whenever I invoke the keyboard macro, it lets me enter some other text, but saves me the fact of entering '' every time I use it. The problem is that I try to stop recording the keyboard macro after entering those 2 characters, but helm doesn't allow me to do it. Then, if I try to edit the keyboard macro to something like this: (I've remapped org-refile to F7)

(fset 'interesting-name
   [f7 ?\' ?\'])

But I think it adds a RET at the end, because it doesn't allow me to enter text, and refiles the subtree to the first result in the helm minibuffer. I hope there's a way to do this, maybe it's a simple fix and I don't get it, thanks for reading.

  • 1
    Hope this question is clear to someone else. It's not clear to me (so far).
    – Drew
    Aug 15, 2015 at 5:03
  • I don't know how to solve this, but just want to show some empathy. I used Helm for a while and loved everything about it except two things: it made startup really slow (which I didn't really care about since I used the server/client setup) and I couldn't use it in macros. Switching from Helm to ivy solved both problems (at the cost of some wonderful functionality, such as doing file operations from within helm-find-files).
    – Omar
    Nov 16, 2015 at 19:05

1 Answer 1


Here's a non-interactive way to do it:

(defun auto-org-refile-helper ()
  (insert "''")
  (remove-hook 'post-command-hook #'helm-helm-commands-helper))

(defun auto-org-refile ()
  (add-hook 'post-command-hook #'helm-helm-commands-helper)
  (call-interactively #'org-refile))

I'd love to see a less hacky method, but I doubt you will find one that works interactively.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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