From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Lundin Subject: Re: footnote renumber bug Date: Sat, 04 Jul 2009 15:30:39 -0500 Message-ID: <87zlbkqjgw.fsf@fastmail.fm> References: <4A4C59EE.9020602@online.de> <0D680B96-4638-44E1-8351-3E6E4F89A404@gmail.com> <4A4F0C97.2090102@online.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MNBqi-00024l-SG for emacs-orgmode@gnu.org; Sat, 04 Jul 2009 16:28:40 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MNBqd-0001zd-83 for emacs-orgmode@gnu.org; Sat, 04 Jul 2009 16:28:39 -0400 Received: from [199.232.76.173] (port=39577 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MNBqd-0001zS-4Z for emacs-orgmode@gnu.org; Sat, 04 Jul 2009 16:28:35 -0400 Received: from out3.smtp.messagingengine.com ([66.111.4.27]:35550) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MNBqc-0000z2-OU for emacs-orgmode@gnu.org; Sat, 04 Jul 2009 16:28:34 -0400 In-Reply-To: <4A4F0C97.2090102@online.de> (Andreas Roehler's message of "Sat, 04 Jul 2009 10:02:31 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Andreas Roehler Cc: emacs-orgmode Mailinglist , Carsten Dominik Andreas Roehler writes: > Carsten Dominik wrote: >> >> On Jul 2, 2009, at 8:55 AM, Andreas Roehler wrote: >> > >> Org did not implement automatic renumbering and sorting because >> it makes less sense to do so if footnotes are inline, or named >> and referenced multiple times. >> > IMHO renumbering should be able to cope with all this circumstances. > With named footnotes "renumbering" might no longer be the appropriate > term then... I believe already Carsten built this feature into org-footnote-auto-adjust. If turned on, it automatically renumbers footnotes with automatic labels (fn:1) and sorts footnotes with custom labels. Also, in addition to nil and t, you can also set the variable to "sort" or "renumber". E.g., (setq org-footnote-auto-adjust 'sort) With this setting, org-mode will still automatically sort your footnotes in the order in which they appear in the document but will not renumber them. (BTW, thanks, as always, Carsten for such a flexible implementation of this new feature. Astonishing!) >> I can see that, when using footnotes in an isolated >> small document and automatic footnote lable generation, >> automatic renumbering and sorting is indeed useful. >> >> In this case, you could fall back to footnote.el. >> However, Org does internally have functions to sort >> and renumber footnotes, so there is no reason why we could >> not call them after generating or deleting a note. >> Lets see ... OK, in the latest git version of Org, use >> >> (setq org-footnote-auto-adjust t) >> > > My suggestion: > Make it cope with inline, named and referenced multiple notes; > then set it to t by default. I tested it, and it already copes with a mix of numbered, inline, and named footnotes. Here are some settings that might be used to provide maximum flexibility for working with all sorts of footnote labels: (setq org-footnote-auto-label 'confirm ;; [1] org-footnote-auto-adjust t ;; [2] org-footnote-define-inline nil) ;; [3] [1] Offers a prompt with automatic labels, e.g. fn:1, but gives the user the option of changing the label or leaving it blank for an inline footnote. [2] From my preliminary testing, I discovered that setting this to t means that org-mode will (a) automatically renumber footnotes with the fn:1 style notation; (b) automatically sort both named and numbered footnotes to match their order in the text; and (c) leave inline footnotes alone. [3] This is the default setting, but I included it here for the purposes of example. - Note: If one uses inline footnotes with automatic labels[fn:1: Such as this footnote], the labels will be renumbered to match their order in the text. Obviously, sorting would be irrelevant in such an instance. I have mixed feelings about turning on automatic renumbering by default. I think the key issue would be whether doing so would cause any problems or unnecessary overhead for people who do not use auto labels or who prefer unlabeled inline footnotes. Although it's probably trivial, if automatic renumbering were the default behavior, org-footnote-action would alter the buffer globally without the user explicitly requesting or permitting it---or even being aware of it. Then again, those who use org-footnote-action heavily would likely customize this variable themselves. Perhaps auto-renumbering could be the default behavior if and only if auto-labeling is turned on. Obviously, this decision is in Carsten's hands. Best, Matt