From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Schorfheide Subject: Re: Patch for ox-confluence.el Date: Sat, 19 Mar 2016 14:27:35 +0000 Message-ID: References: <87zitxmjlg.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=001a113dca9aca7a6f052e67aa7a Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55264) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ahHr1-0000CR-SJ for emacs-orgmode@gnu.org; Sat, 19 Mar 2016 10:27:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ahHr0-0000rC-HJ for emacs-orgmode@gnu.org; Sat, 19 Mar 2016 10:27:47 -0400 Received: from mail-vk0-x236.google.com ([2607:f8b0:400c:c05::236]:35885) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ahHr0-0000r7-4o for emacs-orgmode@gnu.org; Sat, 19 Mar 2016 10:27:46 -0400 Received: by mail-vk0-x236.google.com with SMTP id q138so80654481vkb.3 for ; Sat, 19 Mar 2016 07:27:45 -0700 (PDT) In-Reply-To: <87zitxmjlg.fsf@nicolasgoaziou.fr> 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 --001a113dca9aca7a6f052e67aa7a Content-Type: multipart/alternative; boundary=001a113dca9aca7a6a052e67aa78 --001a113dca9aca7a6a052e67aa78 Content-Type: text/plain; charset=UTF-8 Thanks for the feedback, Nicolas. I wasn't familiar with defcustom. I made the two edits and attached an updated patch. I would be happy to maintain the file in org-mode for now and look into moving it into ELPA. Thanks Paul Schorfheide On Thu, Mar 17, 2016 at 6:23 AM Nicolas Goaziou wrote: > Hello, > > Paul Schorfheide writes: > > > I made a small change to ox-confluence.el to support additional language > > name mappings. Can someone please review it? > > Thank you for the patch. > > AFAIU, "ox-confluence.el" doesn't have a maintainer anymore, in case you > feel like doing the job. > > The library could also be moved to ELPA, IMO. > > > +(defvar org-confluence-lang-alist > > + '(("sh" . "bash")) > > + "Map from org-babel language name to confluence wiki language name") > > What about making it a defcustom? > > > ;; All the functions we use > > (defun org-confluence-bold (bold contents info) > > (format "*%s*" contents)) > > @@ -111,8 +115,9 @@ > > (defun org-confluence-src-block (src-block contents info) > > ;; FIXME: provide a user-controlled variable for theme > > (let* ((lang (org-element-property :language src-block)) > > - (language (if (string= lang "sh") "bash" ;; FIXME: provide a > mapping of some sort > > - lang)) > > + (language (if (assoc lang org-confluence-lang-alist) > > + (cdr (assoc lang org-confluence-lang-alist)) > > + lang)) > > Nitpick: > > (or (cdr (assoc lang org-confluence-lang-alist) lang)) > > > Regards, > > -- > Nicolas Goaziou > --001a113dca9aca7a6a052e67aa78 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thanks for the feedback, Nicolas. I wasn't f= amiliar with defcustom. I made the two edits and attached an updated patch.= I would be happy to maintain the file in org-mode for now and look into mo= ving it into ELPA.

Thanks
Paul Schorfheide

On Thu, Mar 17, 2016 at = 6:23 AM Nicolas Goaziou <mail@= nicolasgoaziou.fr> wrote:
He= llo,

Paul Schorfheide <pschorf2@gmail.com> writes:

> I made a small change to ox-confluence.el to support additional langua= ge
> name mappings. Can someone please review it?

Thank you for the patch.

AFAIU, "ox-confluence.el" doesn't have a maintainer anymore, = in case you
feel like doing the job.

The library could also be moved to ELPA, IMO.

> +(defvar org-confluence-lang-alist
> +=C2=A0 '(("sh" . "bash"))
> +=C2=A0 "Map from org-babel language name to confluence wiki lang= uage name")

What about making it a defcustom?

>=C2=A0 ;; All the functions we use
>=C2=A0 (defun org-confluence-bold (bold contents info)
>=C2=A0 =C2=A0 (format "*%s*" contents))
> @@ -111,8 +115,9 @@
>=C2=A0 (defun org-confluence-src-block (src-block contents info)
>=C2=A0 =C2=A0 ;; FIXME: provide a user-controlled variable for theme >=C2=A0 =C2=A0 (let* ((lang (org-element-property :language src-block))<= br> > -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(language (if (string=3D lang "= ;sh") "bash" ;; FIXME: provide a mapping of some sort
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0lang))
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(language (if (assoc lang org-confl= uence-lang-alist)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= (cdr (assoc lang org-confluence-lang-alist))
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0lang))

Nitpick:

=C2=A0 (or (cdr (assoc lang org-confluence-lang-alist) lang))


Regards,

--
Nicolas Goaziou
--001a113dca9aca7a6a052e67aa78-- --001a113dca9aca7a6f052e67aa7a Content-Type: application/octet-stream; name="0001-Add-org-confluence-lang-alist.patch" Content-Disposition: attachment; filename="0001-Add-org-confluence-lang-alist.patch" Content-Transfer-Encoding: base64 Content-ID: <1538f45d07a6d8f716e1> X-Attachment-Id: 1538f45d07a6d8f716e1 RnJvbSAyZmM1YmMzMTk5NDUyNTA2YjMxM2QzNjgxNjcyNDAyZGVmMjg1OWM2IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBQYXVsIFNjaG9yZmhlaWRlIDxwc2Nob3JmMkBnbWFpbC5jb20+ CkRhdGU6IFdlZCwgOSBNYXIgMjAxNiAxMDozODo0NiAtMDYwMApTdWJqZWN0OiBbUEFUQ0hdIEFk ZCBvcmctY29uZmx1ZW5jZS1sYW5nLWFsaXN0CgoqIG94LWNvbmZsdWVuY2UuZWwgKG9yZy1jb25m bH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