From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Giovanni Bono Newsgroups: gmane.emacs.help Subject: Re: how to renumber footnotes? Date: Fri, 17 Apr 2020 14:45:00 +0200 Message-ID: <87ftd2s2lv.fsf@cb001.local.net> References: <87v9lyvk3z.fsf@skimble.plus.com> <87mu7aycm5.fsf@ebih.ebihd> <87a73aaar5.fsf@hillenius.net> <87a73av34s.fsf@skimble.plus.com> <87y2qu8g92.fsf@hillenius.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="35626"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cc: help-gnu-emacs@gnu.org, Sharon Kimble To: =?utf-8?Q?G=C4=B3s?= Hillenius Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Apr 17 15:01:33 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jPQce-00092U-MM for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 17 Apr 2020 15:01:32 +0200 Original-Received: from localhost ([::1]:46950 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jPQcd-0006y7-MQ for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 17 Apr 2020 09:01:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57771) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jPQMr-0001sO-O1 for help-gnu-emacs@gnu.org; Fri, 17 Apr 2020 08:45:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jPQMq-00055Q-LY for help-gnu-emacs@gnu.org; Fri, 17 Apr 2020 08:45:13 -0400 Original-Received: from sender7.unimi.it ([159.149.10.87]:43064) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jPQMq-00053R-Ec for help-gnu-emacs@gnu.org; Fri, 17 Apr 2020 08:45:12 -0400 X-Envelope-From: Original-Received: from mta05.msg.unimi.it (unknown [172.24.11.15]) by sender7.unimi.it (Postfix) with ESMTP id 38652402D0 for ; Fri, 17 Apr 2020 14:45:02 +0200 (CEST) Original-Received: from cb001 ([84.33.144.204]) by mta05.msg.unimi.it (Oracle Communications Messaging Server 8.1.0.0.20190227 64bit (built Feb 27 2019)) with ESMTPSA id <0Q8X00E2NNF1MOC0@mta05.msg.unimi.it> for help-gnu-emacs@gnu.org; Fri, 17 Apr 2020 14:45:02 +0200 (CEST) In-reply-to: <87y2qu8g92.fsf@hillenius.net> X-Unimi-Libra-ESVA-Information: Please contact for more information X-Unimi-Libra-ESVA-ID: 38652402D0.A5194 X-Unimi-Libra-ESVA: No virus found X-Unimi-Libra-ESVA-SpamScore: ss X-Unimi-Libra-ESVA-From: giovanni.bono@unimi.it X-Unimi-Libra-ESVA-Watermark: 1587732302.72948@1XQ6mJ6dqWViFlA0XK6vdQ X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 159.149.10.87 X-Mailman-Approved-At: Fri, 17 Apr 2020 09:00:49 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:122865 Archived-At: G=C4=B3s Hillenius writes: > [...] > >> org-footnote can't tell that footnote 1 ([fn:1]) at the beginning is in >> the right place when confronted with footnote 1 ([fn:1]) half-way >> through! Which is why I'm looking for some other solution, and I believe >> that it might be able to be achieved programmatically. Unfortunately my >> lisp skills are almost nil, hence my request for someone to help. > > Ah! > > Suppose file A has 372 footnotes, and B has another x. I would create a > macro that I start just ahead of the second [fn:1], and that adds 372 to > [fn:1] so it becomes [fn:373] and repeat that to x. > > It might take you a few tries, but something like put point at the > second [fn:1] c-X ( to start recording the macro, search for [fn: copy > the 1 (+ "yank" 273) paste (<-- I'm missing a step here, I bet), and > then end the macro-recording with C-x ). An even simpler manual solution could be adding a sentence with 372 footnotes at the beginning of file-b and merging the relevant part of file-b with file-a. Maybe with something like: (let ((org-footnote-define-inline t) (org-footnote-auto-adjust t)) (dotimes (x 371) (insert (concat "a [fn:" (number-to-string (1+ x)) ":a] ")))) Regards, Giovanni