From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scot Becker Subject: Re: [Accepted] New option to create unique, random labels for footnotes. Date: Thu, 17 Mar 2011 12:35:12 +0000 Message-ID: References: <87y64ji2hj.fsf@fastmail.fm> <20110317082516.337BB6523@myhost.localdomain> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=000325556deeb2fc55049eace5a9 Return-path: Received: from [140.186.70.92] (port=50398 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q0CQR-00012n-Tx for emacs-orgmode@gnu.org; Thu, 17 Mar 2011 08:35:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q0CQQ-0000A2-1k for emacs-orgmode@gnu.org; Thu, 17 Mar 2011 08:35:35 -0400 Received: from mail-bw0-f41.google.com ([209.85.214.41]:37597) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q0CQP-00009p-Nn for emacs-orgmode@gnu.org; Thu, 17 Mar 2011 08:35:34 -0400 Received: by bwz17 with SMTP id 17so2690106bwz.0 for ; Thu, 17 Mar 2011 05:35:32 -0700 (PDT) In-Reply-To: <20110317082516.337BB6523@myhost.localdomain> 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: Bastien Guerry Cc: emacs-orgmode@gnu.org --000325556deeb2fc55049eace5a9 Content-Type: text/plain; charset=ISO-8859-1 I like this, Matt! On Thu, Mar 17, 2011 at 8:25 AM, Bastien Guerry wrote: > Patch 680 (http://patchwork.newartisans.com/patch/680/) is now "Accepted". > > Maintainer comment: none > > This relates to the following submission: > > http://mid.gmane.org/%3C87y64ji2hj.fsf%40fastmail.fm%3E > > Here is the original message containing the patch: > > > Content-Type: text/plain; charset="utf-8" > > MIME-Version: 1.0 > > Content-Transfer-Encoding: 7bit > > Subject: [O] New option to create unique, random labels for footnotes. > > Date: Fri, 11 Mar 2011 18:50:59 -0000 > > From: Matt Lundin > > X-Patchwork-Id: 680 > > Message-Id: <87y64ji2hj.fsf@fastmail.fm> > > To: Org Mode > > > > * lisp/org-footnote.el: (org-footnote-auto-label): New random option > > * lisp/org-footnote.el: (org-footnote-new): Create random footnote > > labels with unique ids > > > > --- > > lisp/org-footnote.el | 16 ++++++++++++---- > > 1 files changed, 12 insertions(+), 4 deletions(-) > > > > diff --git a/lisp/org-footnote.el b/lisp/org-footnote.el > > index 2ce6668..9dbd6be 100644 > > --- a/lisp/org-footnote.el > > +++ b/lisp/org-footnote.el > > @@ -113,12 +113,14 @@ t create unique labels of the form [fn:1], > [fn:2], ... > > confirm like t, but let the user edit the created value. In > particular, > > the label can be removed from the minibuffer, to create > > an anonymous footnote. > > +random Automatically generate a unique, random label. > > plain Automatically create plain number labels like [1]" > > :group 'org-footnote > > :type '(choice > > (const :tag "Prompt for label" nil) > > (const :tag "Create automatic [fn:N]" t) > > (const :tag "Offer automatic [fn:N] for editing" confirm) > > + (const :tag "Create a random label" random) > > (const :tag "Create automatic [N]" plain))) > > > > (defcustom org-footnote-auto-adjust nil > > @@ -253,16 +255,22 @@ This command prompts for a label. If this is a > label referencing an > > existing label, only insert the label. If the footnote label is empty > > or new, let the user edit the definition of the footnote." > > (interactive) > > - (let* ((labels (org-footnote-all-labels)) > > + (let* ((labels (and (not (equal org-footnote-auto-label 'random)) > > + (org-footnote-all-labels))) > > (propose (org-footnote-unique-label labels)) > > (label > > - (if (member org-footnote-auto-label '(t plain)) > > - propose > > + (cond > > + ((member org-footnote-auto-label '(t plain)) > > + propose) > > + ((equal org-footnote-auto-label 'random) > > + (require 'org-id) > > + (substring (org-id-uuid) 0 8)) > > + (t > > (completing-read > > "Label (leave empty for anonymous): " > > (mapcar 'list labels) nil nil > > (if (eq org-footnote-auto-label 'confirm) propose nil) > > - 'org-footnote-label-history)))) > > + 'org-footnote-label-history))))) > > (setq label (org-footnote-normalize-label label)) > > (cond > > ((equal label "") > > > > --000325556deeb2fc55049eace5a9 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I like this, Matt!

On Thu, Mar 17, 2011 a= t 8:25 AM, Bastien Guerry <bzg@altern.org> wrote:
Patch 680 (http://patchwork.newartisans.com/patch/680/) is now "A= ccepted".

Maintainer comment: none

This relates to the following submission:

http://mid.gmane.org/%3C87y64ji2hj.fsf%40fastmail.fm%3E

Here is the original message containing the patch:

> Content-Type: text/plain; charset=3D"utf-8"
> MIME-Version: 1.0
> Content-Transfer-Encoding: 7bit
> Subject: [O] New option to create unique, random labels for footnotes.=
> Date: Fri, 11 Mar 2011 18:50:59 -0000
> From: Matt Lundin <mdl@imapmail= .org>
> X-Patchwork-Id: 680
> Message-Id: <87y64ji2= hj.fsf@fastmail.fm>
> To: Org Mode <emacs-orgmod= e@gnu.org>
>
> * lisp/org-footnote.el: (org-footnote-auto-label): New random option > * lisp/org-footnote.el: (org-footnote-new): Create random footnote
> =A0 labels with unique ids
>
> ---
> lisp/org-footnote.el | =A0 16 ++++++++++++----
> =A01 files changed, 12 insertions(+), 4 deletions(-)
>
> diff --git a/lisp/org-footnote.el b/lisp/org-footnote.el
> index 2ce6668..9dbd6be 100644
> --- a/lisp/org-footnote.el
> +++ b/lisp/org-footnote.el
> @@ -113,12 +113,14 @@ t =A0 =A0 =A0 =A0 =A0create unique labels of the= form [fn:1], [fn:2], ...
> =A0confirm =A0 =A0like t, but let the user edit the created value. =A0= In particular,
> =A0 =A0 =A0 =A0 =A0 =A0 the label can be removed from the minibuffer, = to create
> =A0 =A0 =A0 =A0 =A0 =A0 an anonymous footnote.
> +random =A0 =A0 =A0 =A0 =A0Automatically generate a unique, random lab= el.
> =A0plain =A0 =A0 =A0Automatically create plain number labels like [1]&= quot;
> =A0 =A0:group 'org-footnote
> =A0 =A0:type '(choice
> =A0 =A0 =A0 =A0 (const :tag "Prompt for label" nil)
> =A0 =A0 =A0 =A0 (const :tag "Create automatic [fn:N]" t)
> =A0 =A0 =A0 =A0 (const :tag "Offer automatic [fn:N] for editing&q= uot; confirm)
> + =A0 =A0 =A0 (const :tag "Create a random label" random) > =A0 =A0 =A0 =A0 (const :tag "Create automatic [N]" plain)))<= br> >
> =A0(defcustom org-footnote-auto-adjust nil
> @@ -253,16 +255,22 @@ This command prompts for a label. =A0If this is = a label referencing an
> =A0existing label, only insert the label. =A0If the footnote label is = empty
> =A0or new, let the user edit the definition of the footnote."
> =A0 =A0(interactive)
> - =A0(let* ((labels (org-footnote-all-labels))
> + =A0(let* ((labels (and (not (equal org-footnote-auto-label 'rand= om))
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (org-footnote-all-labels)))
> =A0 =A0 =A0 =A0(propose (org-footnote-unique-label labels))
> =A0 =A0 =A0 =A0(label
> - =A0 =A0 =A0 (if (member org-footnote-auto-label '(t plain))
> - =A0 =A0 =A0 =A0 =A0 propose
> + =A0 =A0 =A0 (cond
> + =A0 =A0 =A0 =A0((member org-footnote-auto-label '(t plain))
> + =A0 =A0 =A0 =A0 propose)
> + =A0 =A0 =A0 =A0((equal org-footnote-auto-label 'random)
> + =A0 =A0 =A0 =A0 (require 'org-id)
> + =A0 =A0 =A0 =A0 (substring (org-id-uuid) 0 8))
> + =A0 =A0 =A0 =A0(t
> =A0 =A0 =A0 =A0 =A0 (completing-read
> =A0 =A0 =A0 =A0 =A0 =A0"Label (leave empty for anonymous): "=
> =A0 =A0 =A0 =A0 =A0 =A0(mapcar 'list labels) nil nil
> =A0 =A0 =A0 =A0 =A0 =A0(if (eq org-footnote-auto-label 'confirm) p= ropose nil)
> - =A0 =A0 =A0 =A0 =A0'org-footnote-label-history))))
> + =A0 =A0 =A0 =A0 =A0'org-footnote-label-history)))))
> =A0 =A0 =A0(setq label (org-footnote-normalize-label label))
> =A0 =A0 =A0(cond
> =A0 =A0 =A0 ((equal label "")
>


--000325556deeb2fc55049eace5a9--