From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Schaumburg Subject: Re: C-c C-c in Org Footnotes Date: Wed, 19 Feb 2014 17:45:26 +0100 Message-ID: References: <87r46z3k0g.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47818) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGAHC-0005z0-SO for emacs-orgmode@gnu.org; Wed, 19 Feb 2014 11:45:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WGAH6-0000FS-6k for emacs-orgmode@gnu.org; Wed, 19 Feb 2014 11:45:38 -0500 Received: from blu0-omc1-s17.blu0.hotmail.com ([65.55.116.28]:40022) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGAH5-0000FH-T7 for emacs-orgmode@gnu.org; Wed, 19 Feb 2014 11:45:32 -0500 In-Reply-To: <87r46z3k0g.fsf@ericabrahamsen.net> 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@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Abrahamsen Cc: emacs-orgmode@gnu.org Thanks Eric, I think that will do. Cheers Samuel eric@ericabrahamsen.net writes: > Samuel Schaumburg 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! > > E