Re: [O] filter for svg latex-export

2018-01-08 Thread edgar

On 2018-01-09 03:34, John Kitchin wrote:

Thank you, Dr. Kitchin! I will try this


If all you are doing is replacing includesvg with simplesvg,

#+BEGIN_SRC emacs-lisp
(let ((org-export-filter-link-functions  '((lambda (txt _ _)
 (replace-regexp-in-string "includesvg" 
"simplesvg" txt)
  (org-latex-export-as-latex))
#+END_SRC

If you are doing more than that (it looks like you are adding options?)


The only real difference in calling it is that I use {} instead of [], 
so I would not expect any problems


then one alternative option is just put a copy of your modified 
function

in your init file after you load org


Yep, I have been trying to avoid this. My init is already huge (not 
really: 2587 lines).


Thank you again!

-

ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the 
NSA's hands!
$24.95 ONETIME Lifetime accounts with Privacy Features!  
15GB disk! No bandwidth quotas!
Commercial and Bulk Mail Options!  



Re: [O] filter for svg latex-export

2018-01-08 Thread John Kitchin
If all you are doing is replacing includesvg with simplesvg, then you
might try this:

#+BEGIN_SRC emacs-lisp
(let ((org-export-filter-link-functions  '((lambda (txt _ _)
 (replace-regexp-in-string 
"includesvg" "simplesvg" txt)
  (org-latex-export-as-latex))
#+END_SRC

If you are doing more than that (it looks like you are adding options?)
then one alternative option is just put a copy of your modified function
in your init file after you load org, and then it will shadow the
ox-latex function and you might not have to change anything when you
update as long as no incompatible changes are in the update. I know,
that is hacky, but it works in cases like this.



ed...@openmail.cc writes:

> Hello,
>
> I once tried to create a filter (is that the name?) to modify the
> function which exports SVG files. Verdict: I suck! Thus, I keep
> modifying the ox-latex.el every time that I upgrade (see attached).
> Would someone please tell me what is the right way to achieve that
> (without modifying the code, please? Thanks!
>
> -
>
> ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the 
> NSA's hands!
> $24.95 ONETIME Lifetime accounts with Privacy Features!
> 15GB disk! No bandwidth quotas!
> Commercial and Bulk Mail Options!  *** org-20180103/ox-latex.el   
> 2018-01-07 16:53:43.477464348 -0700
> --- plugins/ox-latex.el   2018-01-07 16:39:52.117462098 -0700
> ***
> *** 2425,2434 
> (t (format "[%s]" options)))
>   path))
> (when (equal filetype "svg")
> ! (setq image-code (replace-regexp-in-string "^includegraphics"
> !"\\includesvg"
> !image-code
> !nil t))
>   (setq image-code (replace-regexp-in-string "\\.svg}"
>  "}"
>  image-code
> --- 2425,2437 
> (t (format "[%s]" options)))
>   path))
> (when (equal filetype "svg")
> ! (setq image-code
> !   (format "\\simplesvg%s{%s}"
> !   (cond ((not (org-string-nw-p options)) "")
> ! ((string-prefix-p "," options)
> !  (format "{%s}" (substring options 1)))
> ! (t (format "{%s}" options)))
> !   path))
>   (setq image-code (replace-regexp-in-string "\\.svg}"
>  "}"
>  image-code


--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



Re: [O] Using org-ref to automatically download articles from Pubmed that satisfies a given search term

2018-01-08 Thread John Kitchin
You might also consider the crossref search.

M-x crossref-add-bibtex-entry

It will download a bibtex and pdf (if it knows how to). I doubt you can
do year range query, but certainly authors and keywords. It really
excels at freeform citations as the query.

Doyley, Marvin M. writes:

> Hi there,
>
> I am in the process of writing a broad literature review and was wondering if 
> there is a way to get org-ref to search Pubmed and automatically pull (pdf, 
> abstracts, etc) all the papers that satisfy a given  search terms (year 
> range, keyword, authors) ?
>
> Thanks,
>
> M


-- 
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



Re: [O] org table with datestamp convert to csv and then xlsx or ods: problem

2018-01-08 Thread Nicolas Goaziou
Uwe Brauer  writes:

> > Uwe Brauer  writes:
>
> > You don't need to. These are only suggestions, the final format needs
> > not matching any item in this list.
>
>
> > Not really. See `org-table-export' docstring, last paragraph.
>
>
> > You could try (untested):
>
> > (defun my-format-timestamps (cell)
> >   (org-quote-csv-field
> >(replace-regexp-in-string
> > org-ts-regexp-both
> > (lambda (m)
> >   (if (not org-display-custom-times) (substring m 1 -1)
> > (let ((hours? (string-match-p "[0-9]+:[0-9]+" m)))
> >   (format-time-string (funcall (if hours? #'cdr #'car)
> >
> org-time-stamp-custom-formats)
> >   (org-parse-time-string m)
> > cell)))
>
>
> Thanks very much, but the outcome of that function for the table
>
>   | <2017-12-19 Tue> | 189.09 € |
>   | <2017-12-21 Wed> | 27.86  € |
>
>
> < 01.01.70 >,189.09 €
> < 01.01.70 >,27.86  €
>
>
> For all timestamp could expanded into the same string and the < > were
> left in place.

Ah well, this was a basis to get you started... This one should work

  (defun my-format-timestamps (cell)
(org-quote-csv-field
 (replace-regexp-in-string
  org-ts-regexp-both
  (lambda (m)
(format-time-string
 (let ((hours? (string-match-p "[0-9]+:[0-9]+" m)))
   (funcall (if hours? #'cdr #'car) org-time-stamp-custom-formats))
 (apply #'encod-time (save-match-data (org-parse-time-string m)
  cell)))



Re: [O] Using org-ref to automatically download articles from Pubmed that satisfies a given search term

2018-01-08 Thread Doyley, Marvin M.
Thanks John,
I really appreciate this.

Cheers,
M
> On Jan 8, 2018, at 5:37 PM, John Kitchin  wrote:
> 
> There is a command in org-ref-pubmed that will download a bibtex entry from a 
> pmid: pubmed-insert-bibtex-from-pmid. There is also the commands: 
> pubmed-simple-search which will prompt for a query and open the search in 
> pubmed, the command "pubmed" which just opens the pubmed site, and 
> "pubmed-advanced" which opens the advances search page.
> 
> There isn't however, anything as sophisticated as you want for pubmed. You 
> would have to use it to get the DOIs, and then use the doi-add-bibtex-entry 
> function to get the bibtex entry and (if it knows how) the pdf.
> 
> John
> 
> ---
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu 
> 
> 
> 
> On Mon, Jan 8, 2018 at 3:32 PM, Doyley, Marvin M.  > wrote:
> Hi there,
> 
> I am in the process of writing a broad literature review and was wondering if 
> there is a way to get org-ref to search Pubmed and automatically pull (pdf, 
> abstracts, etc) all the papers that satisfy a given  search terms (year 
> range, keyword, authors) ?
> 
> Thanks,
> 
> M
> 
> 
> 
> 
> 
> 



signature.asc
Description: Message signed with OpenPGP


Re: [O] Using org-ref to automatically download articles from Pubmed that satisfies a given search term

2018-01-08 Thread John Kitchin
There is a command in org-ref-pubmed that will download a bibtex entry from
a pmid: pubmed-insert-bibtex-from-pmid. There is also the commands:
pubmed-simple-search which will prompt for a query and open the search in
pubmed, the command "pubmed" which just opens the pubmed site, and
"pubmed-advanced" which opens the advances search page.

There isn't however, anything as sophisticated as you want for pubmed. You
would have to use it to get the DOIs, and then use the doi-add-bibtex-entry
function to get the bibtex entry and (if it knows how) the pdf.

John

---
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu


On Mon, Jan 8, 2018 at 3:32 PM, Doyley, Marvin M. 
wrote:

> Hi there,
>
> I am in the process of writing a broad literature review and was wondering
> if there is a way to get org-ref to search Pubmed and automatically pull
> (pdf, abstracts, etc) all the papers that satisfy a given  search terms
> (year range, keyword, authors) ?
>
> Thanks,
>
> M
>
>
>
>
>
>


Re: [O] org table with datestamp convert to csv and then xlsx or ods: problem

2018-01-08 Thread Uwe Brauer
> Uwe Brauer  writes:

> You don't need to. These are only suggestions, the final format needs
> not matching any item in this list.


> Not really. See `org-table-export' docstring, last paragraph.


> You could try (untested):

> (defun my-format-timestamps (cell)
>   (org-quote-csv-field
>(replace-regexp-in-string
> org-ts-regexp-both
> (lambda (m)
>   (if (not org-display-custom-times) (substring m 1 -1)
> (let ((hours? (string-match-p "[0-9]+:[0-9]+" m)))
>   (format-time-string (funcall (if hours? #'cdr #'car)
>org-time-stamp-custom-formats)
>   (org-parse-time-string m)
> cell)))


Thanks very much, but the outcome of that function for the table

  | <2017-12-19 Tue> | 189.09 € |
  | <2017-12-21 Wed> | 27.86  € |


< 01.01.70 >,189.09 €
< 01.01.70 >,27.86  €


For all timestamp could expanded into the same string and the < > were
left in place.

Uwe 




Re: [O] org table with datestamp convert to csv and then xlsx or ods: problem

2018-01-08 Thread Uwe Brauer

> Uwe Brauer  writes:

> You don't need to. These are only suggestions, the final format needs
> not matching any item in this list.


> Not really. See `org-table-export' docstring, last paragraph.


> You could try (untested):

> (defun my-format-timestamps (cell)
>   (org-quote-csv-field
>(replace-regexp-in-string
> org-ts-regexp-both
> (lambda (m)
>   (if (not org-display-custom-times) (substring m 1 -1)
> (let ((hours? (string-match-p "[0-9]+:[0-9]+" m)))
>   (format-time-string (funcall (if hours? #'cdr #'car)
>org-time-stamp-custom-formats)
>   (org-parse-time-string m)
> cell)))


Thanks, but the outcome of that function for the table

  | <2017-12-19 Tue> | 189.09 € |
  | <2017-12-21 Wed> | 27.86  € |


< 01.01.70 >,189.09 €
< 01.01.70 >,27.86  €


For all timestamp could expanded into the same string and the < > were
left in place.

Uwe 




[O] Using org-ref to automatically download articles from Pubmed that satisfies a given search term

2018-01-08 Thread Doyley, Marvin M.
Hi there,

I am in the process of writing a broad literature review and was wondering if 
there is a way to get org-ref to search Pubmed and automatically pull (pdf, 
abstracts, etc) all the papers that satisfy a given  search terms (year range, 
keyword, authors) ?

Thanks,

M







Re: [O] org table with datestamp convert to csv and then xlsx or ods: problem

2018-01-08 Thread Nicolas Goaziou
Uwe Brauer  writes:

> > Uwe Brauer  writes:
>
> > I have no trouble calling M-x org-table-export RET then choosing a file
> > name and forcing my-tbl-to-csv during prompt.
>
> Hm I had to copy org-export-table into my addons file and
>   (let* ((formats '("my-tbl-to-csv" "orgtbl-to-csv" "orgtbl-to-tsv"  
> "orgtbl-to-latex"
> "orgtbl-to-html" "orgtbl-to-generic"
> "orgtbl-to-texinfo" "orgtbl-to-orgtbl"
> "orgtbl-to-unicode"))

You don't need to. These are only suggestions, the final format needs
not matching any item in this list.

> It seems that the variable org-table-export-default-format is ignored, a
> bug?

Not really. See `org-table-export' docstring, last paragraph.

> Right, thanks. A last question though.
>
> I have set
>
> org-time-stamp-custom-formats to
>  (" %d.%m.%y " . " %d.%m.%y %a %H:%M "))
>
> '(org-time-stamp-custom-formats (quote (" %d.%m.%y " . " %d.%m.%y %a %H:%M 
> ")))
>
> And indeed in my org files the timestamp are displayed 
> for example as <19.12.17>.
>
> However when I use
> org-toggle-time-stamp-overlays
> they are displayed as <2017-12-19 Tue>
> the point is your conversion function will lead to
> 2017-12-19 Tue
>
>
> which is much better for my purpose since the < > are deleted.
>
>
>
> I am still wondering whether the format I chose via 
> org-time-stamp-custom-formats
> could be somehow used, so  that the result could be
> 19.12.17

You could try (untested):

(defun my-format-timestamps (cell)
  (org-quote-csv-field
   (replace-regexp-in-string
org-ts-regexp-both
(lambda (m)
  (if (not org-display-custom-times) (substring m 1 -1)
(let ((hours? (string-match-p "[0-9]+:[0-9]+" m)))
  (format-time-string (funcall (if hours? #'cdr #'car)
   org-time-stamp-custom-formats)
  (org-parse-time-string m)
cell)))



Re: [O] [IT] Broken support for links to text files (both internal & external)

2018-01-08 Thread Aʟᴏɴɢ-Tʀᴀᴄᴋ

This patch to my ~/.emacs PARTIALLY, but permanently, solved my issue:

diff --git a/conf/home/.emacs b/conf/home/.emacs
index 6bc96469e..cef1c08a7 100755
--- a/conf/home/.emacs
+++ b/conf/home/.emacs
@@ -27,6 +27,7 @@
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
+ '(org-link-search-must-match-exact-headline nil)
  '(inhibit-startup-screen t)
  '(safe-local-variable-values

Now, I can use again my internal links to inline random text in my
files

HOWEVER, in the case of links pointing to headlines, the matching to has
to be EXACT (but it was not necessary in earlier version since 2011 at
least) otherwise I get the message below:

  "No match for fuzzy expression: "

Do you know if I can revert some option to make the sample below to work
again?

-8<-
[[*random text][link to the past]]

* TODO random text in a headline title
-8<-

As of today, only this link with EXACT matching would work:

[[*random text in a headline title][link to the past]]

Thanks a lot,
Nicolas

On 05/01/2018 17:15, Nicolas Bercher (Aʟᴏɴɢ-Tʀᴀᴄᴋ) wrote:

On 05/01/2018 13:27, Eric S Fraga wrote:

On Friday,  5 Jan 2018 at 13:10, Nicolas Bercher (Aʟᴏɴɢ-Tʀᴀᴄᴋ) wrote:

[...]


Is it possible that this setting is set by Debian packagers?
I ask this because I reproduced this bug with and without my
  ~/.emacs[.d/] files.


It's the default for org (at least now, as far as I can tell).


But I ashamedly don't know how to set it permanently in my  ~/.emacs!
Would you please help me on this?


Easy: describe the variable

   C-h v org-link-search-must-match-exact-headline RET

and then click on the "customize" link near the end of the
description.  Make sure to "Apply and set" the change you make.



I've done this but only changed the indentation of the
custom-set-variables block and added nothing new.

And if I start from an empty ~/.emacs I got this ew block, but again, it
does not mention org-link-search-must-match-exact-headline variable:

(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
  )
(custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
  )

What should I add *by hand* in ~/.emacs?
I'm sorry, it is just a matter of very basic elisp syntax (but I never
took the time to dig into elisp yet!).

Thank you,
Nicolas



--
Nicolas Bercher
Aʟᴏɴɢ-Tʀᴀᴄᴋ
Mob: +33 651 792 011
Tel: +33 952 550 210
Fax: +33 957 550 210
http://www.along-track.com/



Re: [O] top headline's visibility property blocked by subheadline's property

2018-01-08 Thread Nicolas Goaziou
Michael Maurer <maurer.mich...@gmail.com> writes:

> On Mon, Jan 8, 2018 at 5:56 PM, Nicolas Goaziou <m...@nicolasgoaziou.fr> 
> wrote:
>> Hello,
>>
>> Michael Maurer <maurer.mich...@gmail.com> writes:
>>
>>> I installed the latest version of org, but now all my
>>> visibility/folded properties get ignored
>>
>> What version?
>
> org-plus-contrib-20180108

It should be fine.

And you don't obtain the same view with the given example?



Re: [O] top headline's visibility property blocked by subheadline's property

2018-01-08 Thread Michael Maurer
On Mon, Jan 8, 2018 at 5:56 PM, Nicolas Goaziou <m...@nicolasgoaziou.fr> wrote:
> Hello,
>
> Michael Maurer <maurer.mich...@gmail.com> writes:
>
>> I installed the latest version of org, but now all my
>> visibility/folded properties get ignored
>
> What version?

org-plus-contrib-20180108



[O] https://orgmode.org/ loads google font css through http

2018-01-08 Thread Xu Chunyang
Hi,

The source of https://orgmode.org/ contains the following

#+begin_src html
http://fonts.googleapis.com/css?family=Droid+Serif:400,400italic|Droid+Sans=latin"
 rel="stylesheet" type="text/css" />
#+end_src

My web browser (Chrome) refuses to load it and shows a warning in the
address bar.



Re: [O] top headline's visibility property blocked by subheadline's property

2018-01-08 Thread Nicolas Goaziou
Hello,

Michael Maurer  writes:

> I installed the latest version of org, but now all my
> visibility/folded properties get ignored

What version?

> so with 8.2.10 I get
>
> * 2017
> ** January
> ** February
>  
>  * 2016
>  ** January
>  ** February
>
> but with the latest I get
>
> * 2017
> ** January
> ***1
> ***2
> ***3
> ...
> ** February
> ***1
> ***2
> ***3
>  
>  * 2016
>  ** January
> ***1
> ***2
> ***3
> 
>  ** February
> ***1
> ***2
> ***3
> 

With the following document

  * 2017
  :PROPERTIES:
  :VISIBILITY: folded
  :END:
  ** december
  :PROPERTIES:
  :VISIBILITY: folded
  :END:
  *** 31
  *** 30
  ** november
  :PROPERTIES:
  :VISIBILITY: folded
  :END:

using C-u C-u TAB displays

  * 2017...

Regards,

-- 
Nicolas Goaziou



Re: [O] top headline's visibility property blocked by subheadline's property

2018-01-08 Thread Michael Maurer
On Tue, Jan 2, 2018 at 2:56 PM, Nicolas Goaziou  wrote:
> Hello,
>
> Michael Maurer  writes:
>
>> Basically what I expect is to see 2017 folded, with none of its
>> children visible (because I added the visibility/folded property).
>> Instead I see all the children, apparently because they themselves
>> have a visibility/folded property. When I delete the children's
>> visibility/folded property, the 2017 visibility/folded property gets
>> respected and they are all folded.
>>
>> What I want to see
>>
>> * 2017
>> * 2016
>>
>> What I get
>>
>> * 2017
>> ** January
>> ** February
>> 
>> * 2016
>> ** January
>> ** February
>> 
>
> I see. Fixed. Thank you.
>
> Regards,
>
> --
> Nicolas Goaziou

I installed the latest version of org, but now all my
visibility/folded properties get ignored

so with 8.2.10 I get

* 2017
** January
** February
 
 * 2016
 ** January
 ** February

but with the latest I get

* 2017
** January
***1
***2
***3
...
** February
***1
***2
***3
 
 * 2016
 ** January
***1
***2
***3

 ** February
***1
***2
***3



Maybe something fundamentally changed how properties get parsed, I don't know.



Re: [O] org table with datestamp convert to csv and then xlsx or ods: problem

2018-01-08 Thread Uwe Brauer

> Uwe Brauer  writes:

> I have no trouble calling M-x org-table-export RET then choosing a file
> name and forcing my-tbl-to-csv during prompt.

Hm I had to copy org-export-table into my addons file and
(let* ((formats '("my-tbl-to-csv" "orgtbl-to-csv" "orgtbl-to-tsv"  
"orgtbl-to-latex"
  "orgtbl-to-html" "orgtbl-to-generic"
  "orgtbl-to-texinfo" "orgtbl-to-orgtbl"
  "orgtbl-to-unicode"))

It seems that the variable org-table-export-default-format is ignored, a
bug?

> Otherwise, just evaluate

>   (org-table-export "/file/name" "my-tbl-to-csv")

Right, thanks. A last question though.

I have set

org-time-stamp-custom-formats to
 (" %d.%m.%y " . " %d.%m.%y %a %H:%M "))

'(org-time-stamp-custom-formats (quote (" %d.%m.%y " . " %d.%m.%y %a %H:%M ")))

And indeed in my org files the timestamp are displayed 
for example as <19.12.17>.

However when I use
org-toggle-time-stamp-overlays
they are displayed as <2017-12-19 Tue>
the point is your conversion function will lead to
2017-12-19 Tue


which is much better for my purpose since the < > are deleted.



I am still wondering whether the format I chose via 
org-time-stamp-custom-formats
could be somehow used, so  that the result could be
19.12.17

But maybe this is impossible

Thanks

Uwe Brauer 




Re: [O] Attempting to automate worg build

2018-01-08 Thread Kaushal Modi
On Mon, Jan 8, 2018 at 10:50 AM Kaushal Modi  wrote:

> Now I have this (
> https://gist.github.com/kaushalmodi/1932834fa33f72ff44eea476f15cad08 )
> where I have moved the local paths to defconsts. So once you set all the
> defconsts in there as needed, you should be good to go.


Just remembered.. I also needed to download htmlize.el from its Github repo
and download to the worg-other-lisp-path defconst I have in the above
linked worg-setup.el.


-- 

Kaushal Modi


Re: [O] Documentation references to htmlize and htmlize vs. htmlfontify

2018-01-08 Thread Kaushal Modi
On Mon, Jan 8, 2018 at 9:58 AM Nicolas Goaziou 
wrote:

>
> FWIW, I'm in favour of replacing entirely htmlize with htmlfontify,
> since the latter is bundled with Emacs.
>

There was a discussion on this (htmlize vs htmlfontify) 2 years back on
emacs-devel:
https://lists.gnu.org/archive/html/emacs-devel/2016-01/msg00691.html

+1 to transition to htmlfontify. Copying Rasmus for comments on efforts
needed to update ox-html to use htmlfontify..


-- 

Kaushal Modi


Re: [O] Attempting to automate worg build

2018-01-08 Thread Kaushal Modi
On Mon, Jan 8, 2018 at 10:06 AM Chris Keating 
wrote:

> Hello fellow org-mode enthusiasts.
>
> I noticed that the server move for orgmode.org has caused some of the
> docs to 404.
>

Glad to know that we have more people working on this :)


> In an attempt to automate finding broken docs I setup a travis build.
> Unfortunately I can't even seem to build the docs:
>
>
>> +emacs --batch -l etc/emacs.el -f org-publish-all
>> Loading 00debian-vars...
>> Loading /etc/emacs/site-start.d/50autoconf.el (source)...
>> Loading /home/travis/build/pdex/worg/etc/emacs-custom.el (source)...
>> Publishing file /home/travis/build/pdex/worg/org-faq.org using 
>> `org-html-publish-to-html'
>> Setting up indent for shell type bash
>> setting up indent stuff
>> Indentation variables are now local.
>> Indentation setup for shell type bash
>> Setting up indent for shell type bash
>> setting up indent stuff
>> Indentation variables are now local.
>> Indentation setup for shell type bash
>> Unable to resolve link: "id:facac2a6-3526-450d-ac42-8d36b16c6bab"
>>
>>
> https://travis-ci.org/pdex/worg/builds/326147794#L1449
>

I was also stuck on that issue, and then realized that you need to add
(require 'org-id) to fix that error on newer Org mode versions.

I'm building with the master branch of org-mode.
>

I am now able to build Worg using Org master using the below referenced
worg-setup.el.

I had to go recreate the .emacs.el file from an archive.org link as the
> original is no longer on the site and it's not in the worg repo.
>

Same here :) I started from the archive.org version. But then refactored it
a bit as it was written with hardcoded paths in many places. Now I have
this ( https://gist.github.com/kaushalmodi/1932834fa33f72ff44eea476f15cad08
) where I have moved the local paths to defconsts. So once you set all the
defconsts in there as needed, you should be good to go.

I build the site using:

emacs --batch -l ~/e/misc/worg/worg-setup.el -f org-publish-all

(Emacs 26.0.90, Org master)

@Bastien: Would it make sense to commit the worg-setup.el to the
worg/orgweb repo too, and then use a Makefile to pass the values to the
defconst variables?

Hope that helps! :)


-- 

Kaushal Modi


Re: [O] org table with datestamp convert to csv and then xlsx or ods: problem

2018-01-08 Thread Nicolas Goaziou
Uwe Brauer  writes:

>> Uwe Brauer  writes:
>
>> Use `my-tbl-to-csv' as a replacement for `orgtbl-to-csv'. How did you
> that is what I thought.
>
> So I called org-table-export
> but then the prompt did not allow my to specify my-tbl-to-csv
> so I customized (customize-option (quote org-table-export-default-format))
> to your new function. But that did not work, again a prompt appeared and
> I could not select your new filter

I have no trouble calling M-x org-table-export RET then choosing a file
name and forcing my-tbl-to-csv during prompt.

Otherwise, just evaluate

  (org-table-export "/file/name" "my-tbl-to-csv")



Re: [O] org table with datestamp convert to csv and then xlsx or ods: problem

2018-01-08 Thread Uwe Brauer

   > Uwe Brauer  writes:

   > Use `my-tbl-to-csv' as a replacement for `orgtbl-to-csv'. How did you
that is what I thought.

So I called org-table-export
but then the prompt did not allow my to specify my-tbl-to-csv
so I customized (customize-option (quote org-table-export-default-format))
to your new function. But that did not work, again a prompt appeared and
I could not select your new filter

   > "export table to CSV" in the first place?

The same way I just described but selecting orgtbl-to-csv




[O] Attempting to automate worg build

2018-01-08 Thread Chris Keating
Hello fellow org-mode enthusiasts.

I noticed that the server move for orgmode.org has caused some of the docs
to 404.

In an attempt to automate finding broken docs I setup a travis build.
Unfortunately I can't even seem to build the docs:


> +emacs --batch -l etc/emacs.el -f org-publish-all
> Loading 00debian-vars...
> Loading /etc/emacs/site-start.d/50autoconf.el (source)...
> Loading /home/travis/build/pdex/worg/etc/emacs-custom.el (source)...
> Publishing file /home/travis/build/pdex/worg/org-faq.org using 
> `org-html-publish-to-html'
> Setting up indent for shell type bash
> setting up indent stuff
> Indentation variables are now local.
> Indentation setup for shell type bash
> Setting up indent for shell type bash
> setting up indent stuff
> Indentation variables are now local.
> Indentation setup for shell type bash
> Unable to resolve link: "id:facac2a6-3526-450d-ac42-8d36b16c6bab"
>
>
https://travis-ci.org/pdex/worg/builds/326147794#L1449

That link target exists in the org-faq.org file but isn't being resolved
for some reason.

I'm building with the master branch of org-mode. I had to go recreate the
.emacs.el file from an archive.org link as the original is no longer on the
site and it's not in the worg repo. I'm guessing that there may be other
random bits and bobbles that I'm missing. I'd like to find all of these
missing pieces and get the worg repo into such a state that it can be
easily redeployed and validated.

If anyone knows how to get worg building I would love some pointers, in the
mean time I'll dig into org-mode and figure out why it doesn't like id:
links.


[O] [PATCH] Fix broken one-time continuous clock-in

2018-01-08 Thread Aliaksey Artamonau
Hi,

I noticed that when I try using C-u C-u C-u `org-clock-in', I get two clocks 
started: one using last clock out time, and one using current time. Clocking 
out then closes the last one and leaves the former one dangling. This doesn't 
happen though when I have `org-clock-continuously' simply set to `t' and use 
`org-clock-in' without any prefix. So I started looking what the cause was. 
When triple-prefix is used, `org-clock-in' binds `org-clock-continuously' to 
`t' temporarily and calls itself recursively. But then it continues the 
execution normally once the recursive call returns. And that's what seemingly 
breaks things. The attached patch addresses the issue by aborting after the 
recursive call is over. That seemed like the easiest way to address the issue, 
but if it's not in the "spirit" of org-mode, I'll be happy to work on improving 
the patch.


Thanks,
Aliaksey

>From 9aa5fb535b54df5a35c26d89f3e9ddb0e335def0 Mon Sep 17 00:00:00 2001
From: Aliaksey Artamonau 
Date: Mon, 8 Jan 2018 16:53:20 +0300
Subject: [PATCH] org-clock.el: Fix one time continuous clock in

* org-clock.el (org-clock-in): Abort after calling `org-clock-in'
  recursively with `org-clock-continuously' set.

Without the change the recursive call to `org-clock-in' would
insert a clock of last clock-out, but then the original call
would continue by inserting another clock at
current-time. As a result of that, clocking out uses the latter
of the two clocks and leaves the other one dangling.

TINYCHANGE
---
 lisp/org-clock.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 370473017..010304484 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -1235,7 +1235,8 @@ the default behavior."
   (when (equal select '(64))
 	;; Set start-time to `org-clock-out-time'
 	(let ((org-clock-continuously t))
-	  (org-clock-in nil org-clock-out-time)))
+	  (org-clock-in nil org-clock-out-time)
+	  (throw 'abort nil)))
 
   (when (equal select '(4))
 	(setq selected-task (org-clock-select-task "Clock-in on task: "))
-- 
2.15.1



Re: [O] org table with datestamp convert to csv and then xlsx or ods: problem

2018-01-08 Thread Nicolas Goaziou
Uwe Brauer  writes:

>> Uwe Brauer  writes:
>
>> For example:
>
>>   (defun my-format-timestamps (cell)
>> (org-quote-csv-field
>>  (replace-regexp-in-string org-ts-regexp-both "\\1" cell)))
>
>>   (defun my-tbl-to-csv (table params)
>> (orgtbl-to-csv table
>>(org-combine-plists '(:fmt my-format-timestamps) 
> params)))
>
> Thanks, but forgive me my ignorance, how are these functions suppose to
> work. They are not interactive, so shall I put them in some hook or
> other function? Sorry for this elementary question.

Use `my-tbl-to-csv' as a replacement for `orgtbl-to-csv'. How did you
"export table to CSV" in the first place?



Re: [O] org table with datestamp convert to csv and then xlsx or ods: problem

2018-01-08 Thread Uwe Brauer

   > Uwe Brauer  writes:

   > For example:

   >   (defun my-format-timestamps (cell)
   > (org-quote-csv-field
   >  (replace-regexp-in-string org-ts-regexp-both "\\1" cell)))

   >   (defun my-tbl-to-csv (table params)
   > (orgtbl-to-csv table
   >(org-combine-plists '(:fmt my-format-timestamps) 
params)))

Thanks, but forgive me my ignorance, how are these functions suppose to
work. They are not interactive, so shall I put them in some hook or
other function? Sorry for this elementary question.





Re: [O] Documentation references to htmlize and htmlize vs. htmlfontify

2018-01-08 Thread Nicolas Goaziou
Hello,

Tim Landscheidt  writes:

> Finally, Emacs already ships with htmlfontify.  On (non-Org)
> files, I see small, but not significant differences between
> it and htmlize.  Are there features that only htmlize of-
> fers?  Otherwise it would be very convenient to replace
> calls to htmlize with a wrapper that tests if the user set
> some configurable variable org-htmlize-function (and calls
> that), otherwise tries to load htmlize and use that, and
> falls back to using htmlfontify.  Glancing at the code, org-
> mode seems to use htmlize-region (with (point-min) (point-
> max), but on narrowed buffers) which htmlfontify does not
> offer, but it is unclear to me whether that would kill 100 %
> of all use cases or only some.  (If it works out of the box
> with htmlfontify for the most common ones, IMHO that would
> be preferable to the current situation where it does not
> work at all unless one installs htmlize.)

FWIW, I'm in favour of replacing entirely htmlize with htmlfontify,
since the latter is bundled with Emacs.

Regards,

-- 
Nicolas Goaziou



[O] Documentation references to htmlize and htmlize vs. htmlfontify

2018-01-08 Thread Tim Landscheidt
Hi,

the Org Mode Manual (here: Emacs master's 9.1.4) refers to
htmlize in several places in slightly different ways; for
example, in one place it says:

| This works automatically for the HTML back-end (it requires
| version 1.34 of the ‘htmlize.el’ package, which you need to
| install).

This is problematic as 1.34 does not work with Emacs 23+;
also it could be interpreted as saying that (current) ver-
sion 1.51 is not supported.

Additionally, there is confusing language throughout whether
it is called "htmlize" or "htmlize.el", whether it is a file
or a package, and whether one needs to download it from the
author's GitHub page.  I assume for most users it is prefer-
able to install it using the MELPA or Debian package.

I wanted to propose to move instructions on how to install
htmlize to the "Installation" node and refer to that section
everywhere else until I noted the section "Packages that Org
cooperates with" that on the other hand does not list
htmlize :-).

There may be other packages referenced in this inconsistent
way; it would be nice to have them all in one place ("Pack-
ages that Org cooperates with"?) and use uniform language.

Finally, Emacs already ships with htmlfontify.  On (non-Org)
files, I see small, but not significant differences between
it and htmlize.  Are there features that only htmlize of-
fers?  Otherwise it would be very convenient to replace
calls to htmlize with a wrapper that tests if the user set
some configurable variable org-htmlize-function (and calls
that), otherwise tries to load htmlize and use that, and
falls back to using htmlfontify.  Glancing at the code, org-
mode seems to use htmlize-region (with (point-min) (point-
max), but on narrowed buffers) which htmlfontify does not
offer, but it is unclear to me whether that would kill 100 %
of all use cases or only some.  (If it works out of the box
with htmlfontify for the most common ones, IMHO that would
be preferable to the current situation where it does not
work at all unless one installs htmlize.)

Tim




Re: [O] org table with datestamp convert to csv and then xlsx or ods: problem

2018-01-08 Thread Nicolas Goaziou
Uwe Brauer  writes:

>> Hello,
>> Uwe Brauer  writes:
>
>
>> None. The export to CSV looks correct and complete. Conversion to CSV
>> does not pretend converting anything else, in particular timestamps, to
>> another format.
>
> Ok,
>
> Now how could that be achieved? I seem not the only one missing that a
> feature.
> https://lists.gnu.org/archive/html/emacs-orgmode/2016-11/msg00398.html

For example:

  (defun my-format-timestamps (cell)
(org-quote-csv-field
 (replace-regexp-in-string org-ts-regexp-both "\\1" cell)))

  (defun my-tbl-to-csv (table params)
(orgtbl-to-csv table
   (org-combine-plists '(:fmt my-format-timestamps) params)))




Re: [O] org table with datestamp convert to csv and then xlsx or ods: problem

2018-01-08 Thread Uwe Brauer

   > Hello,
   > Uwe Brauer  writes:


   > None. The export to CSV looks correct and complete. Conversion to CSV
   > does not pretend converting anything else, in particular timestamps, to
   > another format.

Ok,

Now how could that be achieved? I seem not the only one missing that a
feature.
https://lists.gnu.org/archive/html/emacs-orgmode/2016-11/msg00398.html

So I googled and 
I tried

https://stackoverflow.com/questions/23297422/org-mode-timestamp-format-when-exported

Like
(defun org-export-filter-timestamp-remove-brackets (timestamp backend info)
  "removes relevant brackets from a timestamp"
  (cond
   ((org-export-derived-backend-p backend 'latex)
(replace-regexp-in-string "[<>]\\|[][]" "" timestamp))
   ((org-export-derived-backend-p backend 'orgtbl-to-csv)
(replace-regexp-in-string "[<>]\\|[][]" "" timestamp))
   ((org-export-derived-backend-p backend 'ascii)
(replace-regexp-in-string "[<>]\\|[][]" "" timestamp))
   ((org-export-derived-backend-p backend 'html)
(replace-regexp-in-string "&[lg]t;\\|[][]" "" timestamp

(eval-after-load 'ox '(add-to-list
   'org-export-filter-timestamp-functions
   'org-export-filter-timestamp-remove-brackets))


(defun org-ascii-timestamp (timestamp _contents info)
  (format-time-string
   "%d.%m.%y"
   (org-read-date nil t (org-timestamp-translate timestamp


(add-to-list 'org-export-filter-timestamp-functions
 #'endless/filter-timestamp)

(defun endless/filter-timestamp (trans back _comm)
  "Remove <> around time-stamps."
  (pcase back
((or `jekyll `html)
 (replace-regexp-in-string "&[lg]t;" "" trans))
(`latex
 (replace-regexp-in-string "[<>]" "" trans))
(`ascii
 (replace-regexp-in-string "[<>]" "" trans))
(`csv
 (replace-regexp-in-string "[<>]" "" trans

But nothing helped.

Thanks

Uwe Brauer 




Re: [O] org-radio tables in latex |p{3cm}

2018-01-08 Thread Uwe Brauer

> Hello,
> Uwe Brauer  writes:


> I would do

>   \begin{tabular}{l|l|}
>   % BEGIN RECEIVE ORGTBL test
>   this & that\\ \hline
>   % END RECEIVE ORGTBL test
>   \end{tabular}
>   \begin{comment}

>   #+ORGTBL: SEND test orgtbl-to-latex  :lend " \\hline" :environment 
tabular :splice t

Thanks the splice t is the important point. Thanks!

Uwe Brauer 




Re: [O] org table with datestamp convert to csv and then xlsx or ods: problem

2018-01-08 Thread Nicolas Goaziou
Hello,

Uwe Brauer  writes:

> Hi
>
> consider please
>
> | Entry | Date   |
> |   100 | <2018-01-07 Sun> |
>
> I first export this to csv
>
>
> Entry,Date
> 100,<2018-01-07 Sun>
>
>
>
> and then via gnumeric ssconvert or LO unoconv
> to xlsx or ods, however the datestamp is not correctly converted to a
> datestamp understood my xlsx or unoconv.
>
> Is this a lacking feature or a bug?

None. The export to CSV looks correct and complete. Conversion to CSV
does not pretend converting anything else, in particular timestamps, to
another format.

Regards,

-- 
Nicolas Goaziou



Re: [O] org-radio tables in latex |p{3cm}

2018-01-08 Thread Nicolas Goaziou
Hello,

Uwe Brauer  writes:

> Consider please
>
> \documentclass[12pt]{article}
> \usepackage{commment}
> \begin{document}
>
> % BEGIN RECEIVE ORGTBL test
> \begin{tabular}{l|l|}
> this & that\\ \hline
> \end{tabular}
> % END RECEIVE ORGTBL test
> \begin{comment}
> #+ORGTBL: SEND test orgtbl-to-latex  :lend " \\hline" :environment tabular
> | / | <>   | <>   |
> |   | this | that |
> \end{comment}
>
>
> \end{document}
>
> So the construct |<>| gets expanded to |l|
> which is ok, but I also want to obtain a result such as |p{3cm}|
>
> How can I achieve  that?

I would do

  \begin{tabular}{l|l|}
  % BEGIN RECEIVE ORGTBL test
  this & that\\ \hline
  % END RECEIVE ORGTBL test
  \end{tabular}
  \begin{comment}
  #+ORGTBL: SEND test orgtbl-to-latex  :lend " \\hline" :environment 
tabular :splice t
  | this | that |
  \end{comment}
  \end{document}

Regards,

-- 
Nicolas Goaziou



Re: [O] inherit priority

2018-01-08 Thread Nicolas Goaziou
Hello,

Jesse Johnson  writes:

> I am trying to determine the functions I need to add / update to
> respect priority inheritance.
>
> I see that org-show-priority would need to be updated,

Correct, but that would be a minor change.

> and likely
> a new function, say org-get-priority-with-inheritance, should
> supplement org-get-priority.

I think you need to change `org-get-priority' signature. You can remove
the string argument and possibly add an optional argument: a buffer
position. It should handle inheritance without any additional function,
if a global variable, e.g., `org-priority-use-inheritance' is non-nil.

Note that you can already achieve inheritance by setting
`org-get-priority-function' to a function that searches priority cookies
among ancestors of the current headline.

> However, I can't figure out where org-colview is getting the priority
> from.

>From `org-entry-get' -> `org-entry-properties'.

I don't think there's any change involved in "org-colview.el".

> I also don't know where sorting is considering priority.
>
> Help with pointing me in the right direction for either of those would
> be much appreciated! Also let me know if other things touching
> priority need updating for inheritance.

You should start with `org-get-priority'. Most things are going to work
once it is updated.

Regards,

-- 
Nicolas Goaziou