From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Price Subject: Writing Exporter Tests [was: slack syntax exporter/copier] Date: Fri, 9 Nov 2018 21:36:51 -0500 Message-ID: References: <87zhv5brhb.fsf@ossau.homelinux.net> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000005de899057a4655f5" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43561) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLJ8K-0003zt-TQ for emacs-orgmode@gnu.org; Fri, 09 Nov 2018 21:36:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gLJ8J-0006l4-6w for emacs-orgmode@gnu.org; Fri, 09 Nov 2018 21:36:24 -0500 Received: from mail-it1-x143.google.com ([2607:f8b0:4864:20::143]:54978) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gLJ8I-0006gc-U4 for emacs-orgmode@gnu.org; Fri, 09 Nov 2018 21:36:23 -0500 Received: by mail-it1-x143.google.com with SMTP id a205-v6so150287itd.4 for ; Fri, 09 Nov 2018 18:36:22 -0800 (PST) In-Reply-To: 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" To: Matt Price Cc: Org Mode --0000000000005de899057a4655f5 Content-Type: text/plain; charset="UTF-8" OK, I have a minimal working example and would like to add some unit tests to this project, largely as a way to learn more about testing in emacs/org so that I can start writing tests for some other projects. However... I don't really understand how to build tests in org (and in fact I don't really understand ert much at all). Looks like the worg page is largely a stub. Does anyone have any hints for getting started? Like, should i be able to use ~testing/test-ox.el~ to test my exporter? I would like to start doing a better job of developing in elisp, but I am having trouble getting started on my own, so, once again, I appreciate any help you cna give! Thanks, Matt On Mon, Oct 22, 2018 at 9:02 PM Matt Price wrote: > > > On Mon, Oct 22, 2018 at 5:29 PM Neil Jerram > wrote: > >> Matt Price writes: >> >> > A while ago I asked about a slack syntax exporter. I cpy text from org >> to >> > slack often enough that I spent an hour or two today writing a simple >> one, >> > which I put up in a gist: >> > https://gist.github.com/titaniumbones/c0c171e4df8a6ff5f0f564b8a655c079 >> >> Nice, thank you! >> >> > If people are interested, I will be happy to package it up & put on >> melpa >> > or whatever (would be the first time for me). >> >> Yes, I think it's quite likely that I would use this sometimes, so I'd >> love if it was conveniently available. >> >> > I've put it up in a repo: https://github.com/titaniumbones/ox-slack > > I don't know how to add something to Melpa so that might be a while, I > think I'm running out of personal time :-) > > Best wishes, >> Neil >> >> >> > I mostly am interested in copy-paste, not in producing permanent files, >> so >> > I use it with this simple utility function: >> > >> > (defun ora-org-export-to-clipboard-as-slack () >> > "Export region to FMT, and copy to the kill ring for pasting into >> > other programs." >> > (interactive) >> > (let* ((org-export-with-toc nil) >> > (org-export-with-smart-quotes nil)) >> > (kill-new (org-export-as 'slack) )) >> > ) >> > (global-set-key (kbd "C-c W s") >> 'ora-org-export-to-clipboard-as-slack) >> > >> > The "ora" prefix reflects its origins in an old oremacs function that I >> use >> > for (much more involved) HTML copy-paste: >> > - [[ >> > >> https://github.com/abo-abo/oremacs/commit/6c86696c0a1f66bf690e1a934683f85f04c6f34d#diff-ecff87135600df0cafffb47c303ae9c6][abo-abo's >> > code from oremacs]] >> > - [[ >> > >> http://kitchingroup.cheme.cmu.edu/blog/2016/06/16/Copy-formatted-org-mode-text-from-Emacs-to-other-applications/#comment-2735698988][john's >> > original post]] >> > >> > >> > SO far it seems OK. There are doubtless still bugs so probably it would >> be >> > better to make a repo after all! >> > --0000000000005de899057a4655f5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
OK, I have a minimal working example and would like to add= some unit tests to this project, largely as a way to learn more about test= ing in emacs/org so that I can start writing tests for some other projects.= =C2=A0=C2=A0

However... I don't really understand how to build t= ests in org (and in fact I don't really understand ert much at all). Lo= oks like the worg page is largely a stub. Does anyone have any hints for ge= tting started? Like, should i be able to use ~testing/test-ox.el~ to test m= y exporter?=C2=A0

I would like to start doing a better j= ob of developing in elisp, but I am having trouble getting started on my ow= n, so, once again, I appreciate any help you cna give!=C2=A0

=
Thanks,
Matt


On Mon, Oct 22, 2018 at 9:02 P= M Matt Price <moptop99@gmail.com> wrote:


<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft:1px solid rgb(204,204,204);padding-left:1ex">Matt Price <moptop99@gmail.com> wri= tes:

> A while ago I asked about a slack syntax exporter.=C2=A0 I cpy text fr= om org to
> slack often enough that I spent an hour or two today writing a simple = one,
> which I put up in a=C2=A0 gist:
> https://gist.github.com/t= itaniumbones/c0c171e4df8a6ff5f0f564b8a655c079

Nice, thank you!

> If people are interested, I will be happy to package it up & put o= n melpa
> or whatever (would be the first time for me).

Yes, I think it's quite likely that I would use this sometimes, so I= 9;d
love if it was conveniently available.



I don'= ;t know how to add something to Melpa so that might be a while, I think I&#= 39;m running out of personal time :-)

Best wishes,
=C2=A0 =C2=A0Neil


> I mostly am interested in copy-paste, not in producing permanent files= , so
> I use it with this simple utility function:
>
> (defun ora-org-export-to-clipboard-as-slack ()
>=C2=A0 =C2=A0 =C2=A0 =C2=A0"Export region to FMT, and copy to the = kill ring for pasting into
> other programs."
>=C2=A0 =C2=A0 =C2=A0 =C2=A0(interactive)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0(let* ((org-export-with-toc nil)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-export-with-smart= -quotes nil))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(kill-new (org-export-as 'slack) = ))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0)
>=C2=A0 =C2=A0 =C2=A0(global-set-key (kbd "C-c W s") 'ora-= org-export-to-clipboard-as-slack)
>
> The "ora" prefix reflects its origins in an old oremacs func= tion that I use
> for (much more involved) HTML copy-paste:
> - [[
> https://github.com/abo-abo/oremacs/= commit/6c86696c0a1f66bf690e1a934683f85f04c6f34d#diff-ecff87135600df0cafffb4= 7c303ae9c6][abo-abo's
> code from oremacs]]
> - [[
> http://kitchingroup.cheme.c= mu.edu/blog/2016/06/16/Copy-formatted-org-mode-text-from-Emacs-to-other-app= lications/#comment-2735698988][john's
> original post]]
>
>
> SO far it seems OK. There are doubtless still bugs so probably it woul= d be
> better to make a repo after all!
--0000000000005de899057a4655f5--