From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Abrahamsen Subject: Re: C-c C-c in Org Footnotes Date: Wed, 19 Feb 2014 10:37:35 +0800 Message-ID: <87r46z3k0g.fsf@ericabrahamsen.net> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53131) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFx0b-0004ph-39 for emacs-orgmode@gnu.org; Tue, 18 Feb 2014 21:35:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WFx0U-00011B-TZ for emacs-orgmode@gnu.org; Tue, 18 Feb 2014 21:35:36 -0500 Received: from plane.gmane.org ([80.91.229.3]:38402) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFx0U-000110-EW for emacs-orgmode@gnu.org; Tue, 18 Feb 2014 21:35:30 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WFx0S-0003tG-5C for emacs-orgmode@gnu.org; Wed, 19 Feb 2014 03:35:28 +0100 Received: from 111.197.164.194 ([111.197.164.194]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 19 Feb 2014 03:35:28 +0100 Received: from eric by 111.197.164.194 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 19 Feb 2014 03:35:28 +0100 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: emacs-orgmode@gnu.org 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