Re: [O] slack syntax exporter/copier

2018-10-22 Thread Matt Price
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!
>


Re: [O] slack syntax exporter/copier

2018-10-22 Thread Neil Jerram
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.

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!



[O] slack syntax exporter/copier

2018-10-22 Thread Matt Price
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

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

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!


[O] [feature] Handle recurrence in <> and [] dates

2018-10-22 Thread Leo Gaspard
Hello all!

I have been using org-mode for a few days (switching over from
todo.txt [1]), and for the time being my experience has been great!

There is a single thing I found weird up to now: it seems that
recurrence tags in <> and [] “tags” don't get bumped when a task is
completed and has a recurrence set in its SCHEDULED or DEADLINE date.

The reason I'd like this is because I have monthly bank statements,
which come in the next month, and I'd like to store the bank statement's
date in a [] “tag” so that I can easily know which statement I'm
supposed to handle, even though this date is neither a SCHEDULED (as I
don't have the statement yet at the date it's produced) nor a DEADLINE
(for the same reason).

What do you think about this?

Anyway, thanks a lot for the great work!

Cheers,
  Leo


[1] http://todotxt.org/



Re: [O] Trying to use :post header argument to set #+ATTR_LATEX: line

2018-10-22 Thread Berry, Charles



> On Oct 22, 2018, at 7:43 AM, L.C. Karssen  wrote:
> 
> Dear list,
> 
> I'd like to create several tables from R and export those to a LaTeX
> document. Because only input variable differs for the R code that
> generates the tables, I thought I could use the :post header argument to
> add the #+ATTR_LATEX: line I need to each of the outputs of my R source
> code blocks.
> 
> I tried to follow the Org manual (section 14.8.2.27), but that doesn't
> seem to work. My R results blocks all get colons in front of the output
> and if I set :results drawer, I get the following error:

I do not doubt that this is possible with enough tooling. I think it will be 
easier with the xtable R package.

But for issues like this I usually find it easier to export the document to 
*.Rmd (R markdown) or *.Rnw (knitr) and render from there.

See https://github.com/chasberry/orgmode-accessories for some examples.


HTH,

Chuck



Re: [O] Org source block header argument :var does not support space separated string

2018-10-22 Thread Berry, Charles



> On Oct 21, 2018, at 5:48 PM, stardiviner  wrote:
> 
> Oops, I misunderstand the :var variable="literal quoted string".
> I want to reference the named source's result in variable.
> 
> Like:
> 
>  encrypt text -- ~<<< [TEXT]~
> 
> #+NAME: base64 encrypt text
> #+begin_src sh
> base64 <<< "stardiviner "
> #+end_src
> 
> #+RESULTS: base64 encrypt text
> : c3RhcmRpdmluZXIgPG51bWJjaGlsZEBnbWFpbC5jb20+Cg==
> 
>  decrypt text -- ~-d~
> 
> #+begin_src sh :var encrypted=
> # base64 -d <<< c3RhcmRpdmluZXIgPG51bWJjaGlsZEBnbWFpbC5jb20+Cg==
> # base64 -d <<< $encrypted
> echo $encrypted
> #+end_src


This works 

#+begin_src sh :var encrypted=(org-babel-ref-resolve "base64 encrypt text()")
echo $encrypted
#+end_src

You might write a wrapper, so something like (quote-ref "base64 encrypt text")  
will handle it.

HTH,

Chuck



[O] Trying to use :post header argument to set #+ATTR_LATEX: line

2018-10-22 Thread L.C. Karssen
Dear list,

I'd like to create several tables from R and export those to a LaTeX
document. Because only input variable differs for the R code that
generates the tables, I thought I could use the :post header argument to
add the #+ATTR_LATEX: line I need to each of the outputs of my R source
code blocks.

I tried to follow the Org manual (section 14.8.2.27), but that doesn't
seem to work. My R results blocks all get colons in front of the output
and if I set :results drawer, I get the following error:

  org-babel-R-evaluate-session: Wrong type argument: listp,

followed by a double quoted string containing the data, excluding the
#+ATTR_LATEX line.


I have attached an example Org file that illustrates what I am trying to
achieve and where it goes wrong. I tested this using Emacs 26.1 of
2018-05-29 and Org 9.1.13 from elpa (2018-06-25).

In short, I'm trying the following:


#+name: attr_wrap
#+begin_src R :var data="" :results output
  cat("#+ATTR_LATEX: :environment tabularx  :width \\textwidth :align
Xrrr", "\n")
  data
#+end_src

#+name: create_table2
  #+begin_src R :rownames yes :colnames yes :var brand="Mazda" :post
attr_wrap(data=*this*)
  mtcars[grepl(brand, rownames(mtcars)), c("mpg", "cyl", "disp")]
#+end_src

And call it:
#+call: create_table2(brand="Toyota")

#+RESULTS:
: #+ATTR_LATEX: :environment tabularx  :width \textwidth :align Xrrr
:X  mpg cyl  disp
: 1 Toyota Corolla 33.9   4  71.1
: 2  Toyota Corona 21.5   4 120.1

Note that the whole results block is preceded by a colon, instead
of the table being formatted by Org.


Thanks for any help!

Best regards,

Lennart.

-- 
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
L.C. Karssen
's-Hertogenbosch
The Netherlands

lenn...@karssen.org
http://blog.karssen.org
GPG key ID: A88F554A
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
#+TITLE: Testing the :post header arg

# Set some Org Babel values for the whole document
#+PROPERTY: header-args:R :session *myR*

* Introduction
  In this document I explore the use of the =:post= header argument
  for Org mode source code blocks. My aim is to create several tables
  for export to LaTeX and have the =ATTR_LATEX= blocks automatically
  added to the output of the source code blocks.

  For these tests we wil use the =mtcars= data set that comes with R.

* Testing the =:post= header argument
  The following block is supposed to be used in a =:post= call to set
  the =ATTR_LATEX= line.
  #+name: attr_wrap
  #+begin_src R :var data="" :results output
  cat("#+ATTR_LATEX: :environment tabularx  :width \\textwidth :align Xrrr", 
"\n")
  data
  #+end_src

  The idea is to use this as a named src block so it can be reused for
  each table I want to create (here still without =:post= to show the
  regular output).
  #+name: create_table
  #+begin_src R :rownames yes :colnames yes :var brand="Mazda"
  mtcars[grepl(brand, rownames(mtcars)), c("mpg", "cyl", "disp")]
  #+end_src

  This works using =#+call:=:
  #+call: create_table(brand="Hornet")

  #+RESULTS:
  |   |  mpg | cyl | disp |
  |---+--+-+--|
  | Hornet 4 Drive| 21.4 |   6 |  258 |
  | Hornet Sportabout | 18.7 |   8 |  360 |

  Define a slightly different src block that actually uses the =:post=
  header argument:
  #+name: create_table2
  #+begin_src R :rownames yes :colnames yes :var brand="Mazda" :post 
attr_wrap(data=*this*)
  mtcars[grepl(brand, rownames(mtcars)), c("mpg", "cyl", "disp")]
  #+end_src

  And call it:
  #+call: create_table2(brand="Toyota")

  #+RESULTS:
  : #+ATTR_LATEX: :environment tabularx  :width \textwidth :align Xrrr
  :X  mpg cyl  disp
  : 1 Toyota Corolla 33.9   4  71.1
  : 2  Toyota Corona 21.5   4 120.1

  Note that the whole results block is preceded by a colon, instead
  of being formatted by Org.

  Using the Shell code from the Org manual doesn't work either, it
  adds a comma in front of the =#+ATTR_LATEX= line.
  #+name: attr_wrap2
  #+begin_src sh :var data="" :results output
echo "#+ATTR_LATEX: :environment tabularx :width \\textwidth :align Xrrr"
echo "$data"
  #+end_src

  New =create_table= function:
  #+name: create_table3
  #+begin_src R :rownames yes :colnames yes :var brand="Mazda" :post 
attr_wrap2(data=*this*)
  mtcars[grepl(brand, rownames(mtcars)), c("mpg", "cyl", "disp")]
  #+end_src

  And call it:
  #+call: create_table3(brand="Toyota")

  #+RESULTS:
  : #+ATTR_LATEX: :environment tabularx :width \textwidth :align Xrrr
  : Toyota Corolla  33.94   71.1
  : Toyota Corona   21.54   120.1

  Observe that now the column names have completely disappeared.


signature.asc
Description: OpenPGP digital signature


[O] bug#32722: bug#32722: bug#32722: 26.1; Org-publish depend on non-free platform ?

2018-10-22 Thread Eli Zaretskii
> From: Nicolas Goaziou 
> Cc: r...@gnu.org,  n...@flqt.fr,  r...@gnu.org,  a...@gnu.org,  
> 32...@debbugs.gnu.org,  rjhorn...@gmail.com,  kaushal.m...@gmail.com
> Date: Mon, 22 Oct 2018 15:13:39 +0200
> 
> Some users reported that htmlfontify output is too verbose (font-style,
> font-family, font-size...). 
> 
> Is there a way to clean up the output from htmlfontify and include only
> minimal information? It might be something related to
> `hfy-default-face-def', but the documentation is not clear to me.

I have no idea.  CC'ing the author in the hope that he does.





[O] bug#32722: bug#32722: bug#32722: 26.1; Org-publish depend on non-free platform ?

2018-10-22 Thread Nicolas Goaziou
Hello,

Eli Zaretskii  writes:

>> From: Nicolas Goaziou 

>> I assume this is the only way out of this, so I'll have a look at it.
>
> Thank you.

In an attempt to move Org from htmlize to htmlfontify, I'm encountering
an issue with the generated CSS. Exporting the same simple document with
htmlize, I get:

--8<---cut here---start->8---



--8<---cut here---end--->8---

Then, with htmlfontify:

--8<---cut here---start->8---