[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] C-c C-c in Org Footnotes

From: Eric Abrahamsen
Subject: Re: [O] C-c C-c in Org Footnotes
Date: Wed, 19 Feb 2014 10:37:35 +0800
User-agent: Gnus/5.13001 (Ma Gnus v0.10) Emacs/24.3 (gnu/linux)

Samuel Schaumburg <address@hidden> writes:

> Hi there,
> I frequently use org to write outlines for my thesis-papers. This often
> requires lenghty footnotes. The manual says, that I can use C-c C-c to
> jump back into the main text, where the footnote was originally set.
>  back to the footnotemark. I can use C-a if it is just a one line, but
>  often it is not, and I find myself moving around in the buffer some
>  way, to get back to the footnote mark and then C-c C-c.
> What I would like to know is, wether there is an easy way, to just make
> C-c C-c work whenever I am in a footnote paragraph, no mater where the
> cursor currently is positioned.
> If you have any idea on how to do that, I would appreciate that.
> Thanks
> Samuel

I'm not sure if this counts as an "easy" way, but you could add a
function to org-ctrl-c-ctrl-c-final-hook, that checks if you're in a
multi-line footnote definition and then calls org-footnote-action as if
you were. I say put it in the final hook just so it doesn't clobber
anything else that C-c C-c might want to do at point. It could look
like (very lightly tested):

(defun my-return-from-fn ()
  (let* ((context (org-element-context))
         (parent (org-element-property :parent context)))
    (when (eq (org-element-type parent) 'footnote-definition)
      (goto-char (org-element-property :post-affiliated context))
      (call-interactively 'org-footnote-action))))

(add-hook 'org-ctrl-c-ctrl-c-final-hook 'my-return-from-fn)

It still tells you "C-c C-c can do nothing useful at this location", but
at least it returns you to the right place!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]