Re: [O] Extracting headlines?

2017-06-28 Thread Loris Bennett
Hi Eric,

Eric S Fraga  writes:

> On Wednesday, 28 Jun 2017 at 14:40, Loris Bennett wrote:
>> I tried
>>
>>   C-c m a
>
> Not sure as I do not know what that is bound to!  I suggested using
> org-sparse-tree (normally bound to C-c /) with the D option.  Have you
> tried that?

Sorry, I should have said that I did indeed try what you suggested, but
to no avail - no entries were found in the selected time period.

Doing 'C-c a' brings up the agenda commands menu and the option 'm' is
'Match a TAGS/PROP/TODO query (I think this is standard binding).

Can you give an MWE for the sparse tree approach?  Maybe I can then modify my
capture template appropriately.

Cheers,

Loris

-- 
Dr. Loris Bennett (Mr.)
ZEDAT, Freie Universität Berlin Email loris.benn...@fu-berlin.de




Re: [O] Why ob-clojure.el does not respect :dir header argument?

2017-06-28 Thread numbch...@gmail.com
I will dive into source code, and try whether I can add advice on
ob-clojure.el to inject Org-mode file directory into CIDER working
directory everytime executing the clojure babel src block.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Thu, Jun 29, 2017 at 10:40 AM, Tim Cross  wrote:

> ob-clojure is limited by what can be done via the interfaces offered by
> cider. Have a look at the ob-clojure.el source code - it is very simple and
> does not have options/interfaces to support the full range of possible
> source block headers. Someone may be able to implement this, but nobody
> has. Feel free to have a go at it.
>
> IMO ob-clojure is only written to do very basic clojure code evaluation.
> If you want something more complex, you have to add that hyourself.
>
>
>
> On 28 June 2017 at 21:01, numbch...@gmail.com  wrote:
>
>> In Org-mode Info page, the header argument `:dir` is used to specify the
>> default directory for code block execution.
>> But `ob-clojure` with `cider` as backend, will always use the
>> `cider-jack-in` directory as default working directly. Is there a way to
>> change this?
>>
>> [stardiviner] GPG key ID: 47C32433
>> IRC(freeenode): stardiviner Twitter:  @numbchild
>> Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
>> Blog: http://stardiviner.github.io/
>>
>
>
>
> --
> regards,
>
> Tim
>
> --
> Tim Cross
>
>


Re: [O] Why ob-clojure.el does not respect :dir header argument?

2017-06-28 Thread Tim Cross
ob-clojure is limited by what can be done via the interfaces offered by
cider. Have a look at the ob-clojure.el source code - it is very simple and
does not have options/interfaces to support the full range of possible
source block headers. Someone may be able to implement this, but nobody
has. Feel free to have a go at it.

IMO ob-clojure is only written to do very basic clojure code evaluation. If
you want something more complex, you have to add that hyourself.



On 28 June 2017 at 21:01, numbch...@gmail.com  wrote:

> In Org-mode Info page, the header argument `:dir` is used to specify the
> default directory for code block execution.
> But `ob-clojure` with `cider` as backend, will always use the
> `cider-jack-in` directory as default working directly. Is there a way to
> change this?
>
> [stardiviner] GPG key ID: 47C32433
> IRC(freeenode): stardiviner Twitter:  @numbchild
> Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
> Blog: http://stardiviner.github.io/
>



-- 
regards,

Tim

--
Tim Cross


Re: [O] [PATCH 2/2] org-refile: Fix inconsistency when listing refile targets

2017-06-28 Thread Allen Li
I just realized that this patch was applied to the master branch, not
the maint branch.

The absence of this patch results in the continued life of a bug in
the maint branch where it is not possible to refile to the top level
of an agenda file when using full-file-path for
org-refile-use-outline-path.

Is it possible to backport this to the maint branch?  This will
require adding the org-protect-slash that I mentioned earlier in this
thread.  Otherwise, refile is basically unusable for me when
full-file-path is set.

On Wed, Jun 21, 2017 at 1:01 AM, Allen Li  wrote:
> Thanks for the info. I was chasing down this bug in org-20170606,
> where it still required `org-protect-slash`, so I was anxious about
> its absence in your patch.
>
> On Wed, Jun 21, 2017 at 12:55 AM, Sebastian Reuße  wrote:
>> Hello Allen,
>>
>> Allen Li  writes:
>>
>>> On Mon, May 15, 2017 at 5:54 AM, Sebastian Reuße  wrote:
 * org.el (org-refile-get-targets): Setting org-refile-use-outline-path
 to `file' or `buffer-name' causes an additional target for the file’s
 root node to be inserted. This functionality was absent when using
 `full-file-path'. We now add this since it is convenient and makes the
 behavior more consistent.
 ---
  lisp/org.el | 2 ++
  1 file changed, 2 insertions(+)

 diff --git a/lisp/org.el b/lisp/org.el
 index 97713c523..28277e352 100644
 --- a/lisp/org.el
 +++ b/lisp/org.el
 @@ -11563,6 +11563,8 @@ (defun org-refile-get-targets ( 
 default-buffer)
  (push (list (file-name-nondirectory f) f nil nil) tgs))
(when (eq org-refile-use-outline-path 'buffer-name)
  (push (list (buffer-name (buffer-base-buffer)) f nil nil) 
 tgs))
 +  (when (eq org-refile-use-outline-path 'full-file-path)
 +(push (list (file-truename (buffer-file-name 
 (buffer-base-buffer))) f nil nil) tgs))
(org-with-wide-buffer
 (goto-char (point-min))
 (setq org-outline-path-cache nil)
 --
 2.13.0


>>>
>>> If I'm not mistaken, the full file path needs to be wrapped in
>>> org-protect-slash?
>>
>> Slashes that are part of file paths aren’t escaped anymore, as of
>> 53bcf91a9. The only reason to escape slashes is to indicate they are not
>> part of the outline or file path, but part of the headline instead.
>>
>> In fact it looks like Nicolas removed ‘org-protect-slash’ in 2b44a1a74
>> and inlined it at its only use site.
>>
>> Kind regards,
>>
>> Sebastian
>>
>> --
>> Insane cobra split the wood
>> Trader of the lowland breed
>> Call a jittney, drive away
>> In the slipstream we will stay



Re: [O] org table toggle narrowing and true column hiding

2017-06-28 Thread Nicolas Goaziou
Samuel Wales  writes:

> never mind.  just would not want only on the fly.

Actually, from an Model-View-Controller point of view, storing narrowing
cookies in the table is mixing Model and View. Narrowing a new column
requires to change the data, which is bad.

Furthermore, narrowing cookies influence export, so this is not
gratuitous at all.

IMO, dynamic narrowing makes much more sense than static one.

>>>   - toggle: remove spc and | and use a minimal column -t or align.el
>>>   type setup
>
> spc and | waste space.  i am saying toggle minimal presentation of table.

There is no space in shrunk columns. Such a column looks like this: |…|

True, there are still "|", but removing them would be ambiguous:

| and so on…until |  

vs

   | and so on |…| until |

Expanded columns still have to be readable.

>>>   - edit: similar to c-c ' for babel blocks, but opens up a really
>>> nice ses type spreadsheet
>>
>> This is unrelated to column narrowing, isn't it?
>
> for me, column narrowing is to preserve space.  a c-c ' for a nice ses
> type spreadsheet might be a better truncation scheme for some.  

Since I don't know what is a "nice SES type spreadsheet", I cannot
comment on this. Do you mean that C-c ' should open the table as an SES
spreadsheet?

If so, converting the data would be easy, converting the formulas more
difficult.

> for example, you go to a cell and [formula and contents] shows in
> minibuffer. also intuitive imo.

How is this an example for the above idea? SES is a spreadsheet whereas
the above is about using minibuffer to display fields.

This can be implemented independently of columns narrowing so this is
orthogonal to the current patch.

Regards,



[O] minitocs not displaying in latex export

2017-06-28 Thread Sharon Kimble

I'm having great difficulties in getting minitocs appearing in my chapters. 
This is my preamble -

--8<---cut here---start->8---
#+LaTeX_class: my-report
#+latex_header: 
\usepackage[a4paper,left=25mm,right=25mm,top=25mm,bottom=30mm,footskip=5mm,headsep=2mm]{geometry}
#+latex_header: \input{/home/boudiccas/research/hormones/hormones18/titlepage}
#+LATEX_CLASS_OPTIONS: 
[a4paper,11pt,oneside,openany,british,svgnames,dvipsnames]
#+latex_header: 
\usepackage[backend=biber,style=authoryear,doi=true,hyperref=true,backref=true,backrefstyle=two,date=year,maxcitenames=3]{biblatex}
#+LATEX_HEADER: 
\addbibresource{/home/boudiccas/research/hormones/hormones18/hormones18.bib}
#+latex_header: \input{/home/boudiccas/research/codebase}
#+latex_header: \makeindex[title=General Index,options=-s 
./index.ist,columnseprule,intoc]
#+latex_header: \makeindex[name=horm,title=Index of Hormones,options=-s 
./index.ist,columnseprule,intoc,columns=2]
#+latex_header: \makeindex[name=side,title=Index of Hormones 
Side-Effects,options=-s ./index.ist,columnseprule,intoc,columns=2]
#+latex_header: \makeindex[name=inter,title=Index of Interactions,options=-s 
./index.ist,columnseprule,intoc,columns=2]
#+latex_header: \usepackage{bookmark,hyperref}
#+latex_header: 
\hypersetup{linktoc=all,colorlinks,linkcolor={red},citecolor={magenta},urlcolor={blue}}
#+latex_header: \usepackage[toc,nopostdot,style=listgroup]{glossaries}
#+latex_header: \input{hormones18.glos}
#+latex_header: \makeglossaries
#+latex_header: \glsenablehyper
#+latex_header: \renewcommand{\glstextformat}[1]{\underline{\color{red}\em #1}}
#+latex_header: \usepackage{todo}
#+latex_header: \usepackage[nostamp,firstpage]{draftwatermark}
#+LaTeX_header: \setcounter{secnumdepth}{1}
#+latex_header: \setcounter{tocdepth}{1}
#+latex_header: \usepackage{everypage}
#+latex_header: \usepackage{booktabs}
#+latex_header: \usepackage[mark]{gitinfo2}
#+latex_header: \usepackage{upgreek}
#+latex_header: \usepackage{pifont}
#+latex_header: \usepackage{textgreek}

#+latex_header: \usepackage{bookmark}
#+latex_header: \usepackage{color,soul,xcolor}
#+latex_header: \usepackage{caption}
#+latex_header: \setlength\parindent{0pt} % sets indent to zero
#+latex_header: \usepackage{chngcntr}
#+latex_header: \counterwithout{footnote}{chapter}
#+latex_header: \usepackage[Lenny]{fncychap} 
#+latex_header: \usepackage[toc]{multitoc}
#+latex_header: \usepackage{minibox}
#+latex_header: \renewcommand{\footnotesize}{\normalsize}
#+latex_header: \usepackage{morewrites}
#+latex_header: \usepackage{calc,tikz} 
#+latex_header: \definecolor{ocre}{HTML}{F16723}
#+latex_header: \usepackage{imakeidx}
#+latex_header: \footnotesep\baselineskip
#+latex_header: \setlength{\parskip}{5pt}
#+latex_header: \usepackage{framed}
#+latex_header: \colorlet{shadecolor}{PaleTurquoise} %% use \begin{shaded}
#+latex_header: \usepackage[defaultlines=2,all]{nowidow}
#+latex_header: \sloppy
#+latex_header: \flushbottom
#+latex_header: \usepackage{url}
#+latex_header: \urlstyle{same} %%## 2017/01/30
#+latex_header: \usepackage[useregional,showdow]{datetime2}
#+latex_header: \usepackage{enumitem}
#+latex_header: \setlist{nolistsep}
#+latex_header: \setlist[itemize]{noitemsep}
#+latex_header: \setlist[enumerate]{noitemsep}
#+latex_header: \renewcommand*\glspostdescription{\dotfill} %%## for syn 
2017/01/30
#+latex_header: \usepackage{array}
#+latex_header: \usepackage[framemethod=tikz]{mdframed}
#+latex_header: \usetikzlibrary{shadows}
#+latex_header: \definecolor{cccolor}{rgb}{.67,.7,.67}
#+latex_header: \usepackage{tcolorbox}
#+latex_header: \usepackage{float}

#+include: /home/boudiccas/research/header.org
#+latex_header: \usepackage{minitoc}


#+latex_header: \setlength{\parskip}{5pt} % gap between paragraphs
#+latex_header: \setlength{\parsep}{0pt} % space between paragraphs within an 
item
#+latex_header: \setlength{\topskip}{0pt} % between header and text
#+latex_header: \setlength{\topmargin}{0pt} % gap above header
#+latex_header: \setlength{\topsep}{0pt} % space between first item and 
preceding paragraph
#+latex_header: \setlength{\partopsep}{0pt} % extra space added to \topsep when 
environment starts a new paragraph
# # http://www-h.eng.cam.ac.uk/help/tpl/textprocessing/squeeze.html
#+latex_header: \linespread{0.9}
--8<---cut here---end--->8---

This is in an emacs org-mode file which is then exported to latex.
According to the 'hormones18.log' minitoc is being loaded, but in the
projects folder it only shows these files - 'hormones18.maf',
'hormones18.mtc', and 'hormones18.mtc0'.

What do I need please to persuade it to produce all the required
minitocs in the chapters?

Thanks
Sharon.
-- 
A taste of linux = http://www.sharons.org.uk
TGmeds = http://www.tgmeds.org.uk
DrugFacts = https://www.drugfacts.org.uk  
Debian 9.0, fluxbox 1.3.5-2, emacs 25.1.1, org-mode 9.0.7


signature.asc
Description: PGP signature


Re: [O] org table toggle narrowing and true column hiding

2017-06-28 Thread Samuel Wales
On 6/28/17, Nicolas Goaziou  wrote:
>> i'd want it to be stored in the table, not in the user's head.

never mind.  just would not want only on the fly.

>>   - toggle: remove spc and | and use a minimal column -t or align.el
>>   type setup

spc and | waste space.  i am saying toggle minimal presentation of table.

>>   - edit: similar to c-c ' for babel blocks, but opens up a really
>> nice ses type spreadsheet
>
> This is unrelated to column narrowing, isn't it?

for me, column narrowing is to preserve space.  a c-c ' for a nice ses
type spreadsheet might be a better truncation scheme for some.  for
example, you go to a cell and [formula and contents] shows in
minibuffer.  also intuitive imo.

so it's tangential.

never mind these ideas if they are too radical.

-- 
The Kafka Pandemic: 

The disease DOES progress. MANY people have died from it. And ANYBODY
can get it at any time.

"You’ve really gotta quit this and get moving, because this is murder
by neglect." ---
.



Re: [O] org table toggle narrowing and true column hiding

2017-06-28 Thread Nicolas Goaziou
Hello,

Samuel Wales  writes:

> good ideas.
>
> i'd want it to be stored in the table, not in the user's head.

I don't understand.

> more radical ideas:
>
>   - toggle: remove spc and | and use a minimal column -t or align.el
>   type setup

I don't understand.

>   - edit: similar to c-c ' for babel blocks, but opens up a really
> nice ses type spreadsheet

This is unrelated to column narrowing, isn't it?

Regards,

-- 
Nicolas Goaziou



Re: [O] org table toggle narrowing and true column hiding

2017-06-28 Thread Samuel Wales
good ideas.

i'd want it to be stored in the table, not in the user's head.

more radical ideas:

  - toggle: remove spc and | and use a minimal column -t or align.el type setup
  - edit: similar to c-c ' for babel blocks, but opens up a really
nice ses type spreadsheet

-- 
The Kafka Pandemic: 

The disease DOES progress. MANY people have died from it. And ANYBODY
can get it at any time.

"You’ve really gotta quit this and get moving, because this is murder
by neglect." ---
.



Re: [O] exporting org to docx

2017-06-28 Thread Doyley, Marvin M.
Hi John,

I really appreciate your help. I tried the latest version of ox-word.el that 
you place in scimax, but got the same error. I suspect that there is a bug in 
my set-up. 

I will investigate and keep you posted.

Cheers,
M 
> On Jun 27, 2017, at 7:21 PM, Doyley, Marvin M.  wrote:
> 
> Here is a sample file that I have been using,
> 
> 
>> On Jun 27, 2017, at 10:53 AM, John Kitchin  wrote:
>> 
>> can you post a small org file that has this problem?
>> 
>> Doyley, Marvin M. writes:
>> 
>>> Thanks for point this out, which I have now removed, but  I still get an 
>>> error. This time I get
>>> 
>>> pandoc: nil: openFile: does not exist (No such file or directory)
>>> helm-M-x: Wrong type argument: stringp, nil
>>> 
>>> Thanks,
>>> M
>>> PS here is the back trace
>>> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>>> delete-file(nil)
>>> (let* ((bibfiles (mapcar (quote expand-file-name) 
>>> (org-ref-find-bibliography))) (temp-bib) (bibtex-entries) biboption csl 
>>> (current-file (buffer-file-name)) (basename (file-name-sans-extension 
>>> current-file)) (tex-file (concat basename ".tex")) (docx-file (concat 
>>> basename ".docx"))) (save-buffer) (if bibfiles (progn (setq bibtex-entries 
>>> (let* ((bibtex-files bibfiles) (keys (reverse ...)) 
>>> (bibtex-entry-kill-ring-max (length keys)) (bibtex-entry-kill-ring (quote 
>>> nil))) (let ((wconfig ...)) (unwind-protect (progn ...) 
>>> (set-window-configuration wconfig))) (mapconcat (quote identity) 
>>> bibtex-entry-kill-ring "\n\n")) temp-bib (make-temp-file "ox-word-" nil 
>>> ".bib") biboption (format " --bibliography=%s " temp-bib)) (let ((temp-file 
>>> temp-bib) (temp-buffer (get-buffer-create (generate-new-buffer-name " *temp 
>>> file*" (unwind-protect (prog1 (save-current-buffer (set-buffer 
>>> temp-buffer) (insert bibtex-entries)) (save-current-buffer (set-buffer 
>>> temp-buffer) (write-region nil nil temp-file nil 0))) (and (buffer-name 
>>> temp-buffer) (kill-buffer temp-buffer)) (setq csl (cdr (assoc 
>>> "PANDOC-CSL" (org-element-map (org-element-parse-buffer) (quote keyword) 
>>> (function (lambda (key) (cons ... ...))) (if csl (setq csl (format " 
>>> --csl=%s " csl)) (setq csl " ")) (org-latex-export-to-latex async subtreep 
>>> visible-only body-only options) (if (file-exists-p docx-file) (progn 
>>> (delete-file docx-file))) (shell-command (format "pandoc -s -S %s%s\"%s\" 
>>> -o \"%s\"" biboption csl tex-file docx-file)) (delete-file temp-bib) 
>>> (org-open-file docx-file (quote (16
>>> ox-export-via-latex-pandoc-to-docx-and-open()
>>> funcall-interactively(ox-export-via-latex-pandoc-to-docx-and-open)
>>> call-interactively(ox-export-via-latex-pandoc-to-docx-and-open record nil)
>>> command-execute(ox-export-via-latex-pandoc-to-docx-and-open record)
>>> helm-M-x(nil #("ox-export-via-latex-pandoc-to-docx-and-open" 0 43 
>>> (match-part "ox-export-via-latex-pandoc-to-docx-and-open")))
>>> funcall-interactively(helm-M-x nil 
>>> #("ox-export-via-latex-pandoc-to-docx-and-open" 0 43 (match-part 
>>> "ox-export-via-latex-pandoc-to-docx-and-open")))
>>> call-interactively(helm-M-x nil nil)
>>> command-execute(helm-M-x)
>>> 
>>> 
>>> 
>>> 
 On Jun 24, 2017, at 1:07 PM, John Kitchin  wrote:
 
 what is this function: my-other-delete-trailing-blank-lines
 
 it appears it is not defined. but is getting called in a before-save-hook.
 
 Doyley, Marvin M. writes:
 
> Hi there,
> 
> I am play with John’s ox-word.el function, which us pandoc to convert org 
> via latex to docx. However, when I try to use it, I get  the following 
> error
> 
> helm-M-x: Wrong type argument: stringp, nil
> 
> 
> Any suggestion on how to resolve this issue.
> 
> Cheers,
> M
> 
> Ps Here is the backtrace
> 
> Debugger entered--Lisp error: (void-function 
> my-other-delete-trailing-blank-lines)
> my-other-delete-trailing-blank-lines()
> run-hooks(before-save-hook)
> basic-save-buffer(nil)
> save-buffer()
> write-file("./test.tex.tex")
> (let ((coding-system-for-write encoding)) (write-file file))
> (progn (insert output) (let ((coding-system-for-write encoding)) 
> (write-file file)))
> (unwind-protect (progn (insert output) (let ((coding-system-for-write 
> encoding)) (write-file file))) (and (buffer-name temp-buffer) 
> (kill-buffer temp-buffer)))
> (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn 
> (insert output) (let ((coding-system-for-write encoding)) (write-file 
> file))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer
> (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer 
> (set-buffer temp-buffer) (unwind-protect (progn (insert output) (let 
> ((coding-system-for-write encoding)) (write-file file))) (and 
> (buffer-name 

Re: [O] import excel files into org

2017-06-28 Thread Uwe Brauer

   > On 27/06/17 17:54, Uwe Brauer wrote:

   > What is the intended difference between those?
The first one imports a xlsx file, which has the same name as the org
file


   > The second one looks odd, because

Asks for a file.

   > - xlsx-file is never used

Right, my bad


   > - there doesn't appear to be any link from the CSV output from 'file'
   > (presumably in a file whose name is derived from 'file') and the
   > 'csv-file' content that org then imports (in a file whose name is
   > derived from the current buffer).

I look into it
   > Regards - Neil







Re: [O] [PATCH] org-protocol: fixes open-source and extends rewriting of URLs

2017-06-28 Thread Nicolas Goaziou
Mario Martelli  writes:

> Hi,
>
>> Would it be possible to make the path involved smaller so that the
>> example can fit in 80 columns?
>
> The idea was to give an example which is available online and could get 
> cloned easily onto the local machine.
> Changed it to a simple example.
>
>> Here, `replacement' isn't lexically bound, so compiling
>> "org-protocol.el" should return an error. `replacement' should be
>> let-bound instead.
>  ...
> Thank you for your patience, Nicolas 
> Please find attached a fresh attempt.

Applied. Thank you.

I fixed some whitespace issue and typo in the test.

Could you provide an ORG-NEWS entry about it?

Regards,



Re: [O] Extracting headlines?

2017-06-28 Thread Eric S Fraga
On Wednesday, 28 Jun 2017 at 14:40, Loris Bennett wrote:
> I tried
>
>   C-c m a

Not sure as I do not know what that is bound to!  I suggested using
org-sparse-tree (normally bound to C-c /) with the D option.  Have you
tried that?

-- 
: Eric S Fraga via Emacs 26.0.50, Org release_9.0.9-551-g92e8c8


signature.asc
Description: PGP signature


Re: [O] Moving and resetting attachments

2017-06-28 Thread Florian Lindner
Am 24.06.2017 um 10:53 schrieb Nicolas Goaziou:> Hello,
>
> Florian Lindner  writes:
>
>> Ok, so it's basically a conversion to bool.
>
> Correct.
>
>> That I'm not so sure of. I try to get myself aquainted to ert, but my elisp 
>> knowledge, you surely know, is very limited.
>
> I think you're doing well so far.
>
>> Do I understand correctly, that there is no test for any org-attach stuff so 
>> far? I've found
lisp/test-org-attach-annex.el, but that's for git-annex
>> stuff.
>
> That's correct. Anyway, tests can be postponed to a later patch. It can
> be cumbersome to play with temporary files without clobbering the
> repository.
>
> However, I think tests are important in this case, considering we're
> moving user's data around.

Hey,

I have attached a patch, based on the current git master. I'm not sure how the 
contribution process works. Do I need to
sign stuff such as copyright assignement? Do you use a Git webinterface, GitHub 
or Lab?

Writing a test for it is on my todo list.

Best,
Florian





Re: [O] [PATCH] org-protocol: fixes open-source and extends rewriting of URLs

2017-06-28 Thread Mario Martelli
Hi,

> Would it be possible to make the path involved smaller so that the
> example can fit in 80 columns?

The idea was to give an example which is available online and could get cloned 
easily onto the local machine.
Changed it to a simple example.

> Here, `replacement' isn't lexically bound, so compiling
> "org-protocol.el" should return an error. `replacement' should be
> let-bound instead.
 ...
Thank you for your patience, Nicolas 
Please find attached a fresh attempt.



0001-org-protocol.el-sources-with-date-URL-are-supported.patch
Description: Binary data


> Great. Let me know when the process is complete.

Will do. Sent out the signed copy today.

Kind regards
Mario

— 




Re: [O] Extracting headlines?

2017-06-28 Thread Loris Bennett
Eric S Fraga  writes:

> On Wednesday, 28 Jun 2017 at 08:50, Loris Bennett wrote:
>> does Org provide any way of extracting just the level 3 headlines for a
>> given 7 day period?
>
> If you have org timestamps on those headlines, you might be able to use
> org-sparse-tree (C-c /) with the D option (dates range).

Each headline has an inactive timestamp like this:

  Added: [2017-06-28 Wed 10:35]

So, following

  http://orgmode.org/worg/org-tutorials/advanced-searching.html

I tried

  C-c m a

with

  TIMESTAMP_IA>="<-1w>"

but there was no match.  Am I missing something?

Cheers,

Loris

-- 
Dr. Loris Bennett (Mr.)
ZEDAT, Freie Universität Berlin Email loris.benn...@fu-berlin.de




Re: [O] org-irc.el get IRC link port error

2017-06-28 Thread numbch...@gmail.com
confirm fixed, thanks.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Wed, Jun 28, 2017 at 8:47 PM, Nicolas Goaziou 
wrote:

> Hello,
>
> "numbch...@gmail.com"  writes:
>
> > Here is the steps to reproduce this issue:
> >
> > Emacs version: 26.0.50 (from source code repo master branch)
> > Org-mode version: 9.0.8 (from source code repo master branch)
> >
> > Here is the example link:
> > IRC: [[irc://irc.freenode.net/#nextcloud][#nextcloud]] on Freenode
> >
> > I use Edebug to debug on function `org-irc-visit-erc`:
> >
> > - [-] check out source code
> >   - [X] org-open-at-point(nil)
> >   - [X] org-irc-visit("//irc.freenode.net/#nextcloud")
> >   - [ ] org-irc-visit-erc((("irc.freenode.net") "#nextcloud"))
> > - [ ] (port (or (string-to-number (cadr (pop link)))
> erc-default-port))
> >   - [ ] (string-to-number (cadr (pop link)))
> > - [ ] (cadr (pop link)) -> (cadr ("irc.freenode.net")) -> nil
> >
> >   #+BEGIN_SRC emacs-lisp
> >   (setq temp-link '(("irc.freenode.net") ("#clojure")))
> >
> >   (pop temp-link)
> >   (cadr (pop temp-link))
> >   #+END_SRC
> >
> > - [ ] (string-to-number nil)
>
> Fixed. Thank you.
>
> Regards,
>
> --
> Nicolas Goaziou
>


Re: [O] Export results of code literal blocks (Jekyll directory structure) xpost emacs.stackexchange

2017-06-28 Thread Nicolas Goaziou
Hello,

Jeremy Reeve  writes:

> Org-mode newbie here.  Please be gentle.

Do you have any reason to think we will not be gentle?

  "We have a squeaker today, class. Isn't he cute?"

> I'm trying to follow the recipe for exporting Org-mode documents for
> processing by Jekyll. My publishing org-publish-project-alist is
> configured to place exported html in my _posts directory and take
> images and place them in _posts/assets with org-publish-attachment.
> This modification of directory structure seems to be the root of the
> problem.

[...]

> #+RESULTS: [[file:../images/hw1-p3.png]]
>
> #+BEGIN_EXPORT html
> 
>  src="{{ site.url }}/assets/hw1-p3.png"
>   alt="Problem 3 visualisation">
>   Problem 3 visualisation
> 
> #+END_EXPORT html
>
> The end result I would like is to have the link to the result of the
> literal code block automatically generated either such that it is not
> exported as an inline image (as the relative path is incorrect) and be
> forced to manually add a correct link for HTML export or have the
> inline image link transformed such that it is correct.

Can't you write a function that fixes generated links? See
`org-export-before-parsing-hook'.

> Also, the above snippet exports everything including the "BEGIN
> export" which I think shouldn't happen but I'll examine that
> separately.

The closing line is wrong. It should be "#+end_export". Use `M-x
org-lint' to find this kind of problem.

Regards,

-- 
Nicolas Goaziou



Re: [O] org-git-link 's open function org-git-open does not work correctly

2017-06-28 Thread Nicolas Goaziou
Hello,

"numbch...@gmail.com"  writes:

> When I `org-store-link` in a local git repository file buffer, I got this
> link:
>
> [[git:~/.emacs.d/init/org-mode/init-my-org-hyperlink.el::develop@
> {2017-06-24}::202][git:~/.emacs.d/init/org-mode/init-my-org-hyperlink.el::develop@
> {2017-06-24}::202]]
>
> Then I insert link into Org-mode buffer.
> But when I open link with `[C-c C-o]`, it open git revision:
> ```
> "/tmp/org-git-8fd5f4cf5d17479ead7b4329024860e84b6f2453/init-my-org-hyperlink.el"
> ```
> This is not correct.
> My current `HEAD` (command: `git show HEAD`) is:
> ```
> commit 3cc7ee1792a7d7b8ddf51897f7b968af36bae745 (HEAD -> develop)

Thank you.

This is a contributed package. I'm Cc'ing the original author as he
might want to fix the issue.

Regards,

-- 
Nicolas Goaziou



Re: [O] org-irc.el get IRC link port error

2017-06-28 Thread Nicolas Goaziou
Hello,

"numbch...@gmail.com"  writes:

> Here is the steps to reproduce this issue:
>
> Emacs version: 26.0.50 (from source code repo master branch)
> Org-mode version: 9.0.8 (from source code repo master branch)
>
> Here is the example link:
> IRC: [[irc://irc.freenode.net/#nextcloud][#nextcloud]] on Freenode
>
> I use Edebug to debug on function `org-irc-visit-erc`:
>
> - [-] check out source code
>   - [X] org-open-at-point(nil)
>   - [X] org-irc-visit("//irc.freenode.net/#nextcloud")
>   - [ ] org-irc-visit-erc((("irc.freenode.net") "#nextcloud"))
> - [ ] (port (or (string-to-number (cadr (pop link))) erc-default-port))
>   - [ ] (string-to-number (cadr (pop link)))
> - [ ] (cadr (pop link)) -> (cadr ("irc.freenode.net")) -> nil
>
>   #+BEGIN_SRC emacs-lisp
>   (setq temp-link '(("irc.freenode.net") ("#clojure")))
>
>   (pop temp-link)
>   (cadr (pop temp-link))
>   #+END_SRC
>
> - [ ] (string-to-number nil)

Fixed. Thank you.

Regards,

-- 
Nicolas Goaziou



[O] org-irc.el get IRC link port error

2017-06-28 Thread numbch...@gmail.com
Here is the steps to reproduce this issue:

Emacs version: 26.0.50 (from source code repo master branch)
Org-mode version: 9.0.8 (from source code repo master branch)

Here is the example link:
IRC: [[irc://irc.freenode.net/#nextcloud][#nextcloud]] on Freenode

I use Edebug to debug on function `org-irc-visit-erc`:

- [-] check out source code
  - [X] org-open-at-point(nil)
  - [X] org-irc-visit("//irc.freenode.net/#nextcloud")
  - [ ] org-irc-visit-erc((("irc.freenode.net") "#nextcloud"))
- [ ] (port (or (string-to-number (cadr (pop link))) erc-default-port))
  - [ ] (string-to-number (cadr (pop link)))
- [ ] (cadr (pop link)) -> (cadr ("irc.freenode.net")) -> nil

  #+BEGIN_SRC emacs-lisp
  (setq temp-link '(("irc.freenode.net") ("#clojure")))

  (pop temp-link)
  (cadr (pop temp-link))
  #+END_SRC

- [ ] (string-to-number nil)

You can see what's wrong.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


[O] Why ob-clojure.el does not respect :dir header argument?

2017-06-28 Thread numbch...@gmail.com
In Org-mode Info page, the header argument `:dir` is used to specify the
default directory for code block execution.
But `ob-clojure` with `cider` as backend, will always use the
`cider-jack-in` directory as default working directly. Is there a way to
change this?

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


Re: [O] import excel files into org

2017-06-28 Thread Neil Jerram

On 27/06/17 17:54, Uwe Brauer wrote:

Hi

Maybe the following is helpful:


(defun org-table-import-xlsx-to-csv-org ()
   (interactive)
   (let* ((source-file  (file-name-sans-extension (buffer-file-name 
(current-buffer
  (xlsx-file (concat source-file ".xlsx"))
  (csv-file (concat source-file ".csv")))
 (org-odt-convert xlsx-file "csv")
 (org-table-import csv-file  nil)))


(defun org-table-import-xlsx-file-to-csv-org (file)
   (interactive "f")
   (let* ((source-file  (file-name-sans-extension (buffer-file-name 
(current-buffer
  (xlsx-file (concat source-file ".xlsx"))
  (csv-file (concat source-file ".csv")))
 (org-odt-convert file "csv")
 (org-table-import csv-file  nil)))


What is the intended difference between those?

The second one looks odd, because
- xlsx-file is never used
- there doesn't appear to be any link from the CSV output from 'file' 
(presumably in a file whose name is derived from 'file') and the 
'csv-file' content that org then imports (in a file whose name is 
derived from the current buffer).


Regards - Neil




Re: [O] org table toggle narrowing and true column hiding

2017-06-28 Thread Uwe Brauer

Hello

> Hello,
> Uwe Brauer  writes:


> I toyed a bit further with the idea, and re-designed the whole thing.


I just applied the patch and installed it and run a quick test. Great!
A huge improvement. I will test it during the day and report back if I
see something worth to mention.

Thanks again

Uwe 




Re: [O] [PATCH] org-protocol: fixes open-source and extends rewriting of URLs

2017-06-28 Thread Nicolas Goaziou
Hello,

Mario Martelli  writes:

> Sorry for producing noise. Just read the contribution guidelines once again ;)
> Hope everything is now according to the guidelines.

Thank you. Comments follow.

> Subject: [PATCH 1/4] org-protocol.el: Fix for failing open-source subprotocol
>
> *  (org-protocol-open-source): make sure url is
> sanitised before processing

Applied.

> Subject: [PATCH 2/4] org-protocol.el: Fix for silently failing open-source
>  subprotocol
>
> * (org-protocol-open-source): tests URL against
> base-url and not the filename

Applied.

> Subject: [PATCH 3/4] org-protocol.el sources with date URL are supported
>
> * (org-protocol-project-alist): date-URL is added as example
> * (org-protocol-open-source): first match is processed in rewrite

Not applied. See below.

> +  :rewrites ((\"org/?$\" . \"index.php\")))
> + (\"Hugo based blog\"
> +  :base-url \"https://themes.gohugo.io/theme/hugo-icarus/\;
> +  :working-directory 
> \"~/Documents/MyBlog/themes/hugo-icarus-theme/exampleSite/content/post/\"
> +  :online-suffix \".html\"
> +  :working-suffix \".md\"
> +  :rewrites 
> ((\"\\(https://themes.gohugo.io/theme/hugo-icarus/[0-9]+/[0-9]+/[0-9]+/\\)\" 
> . \".md\")

Would it be possible to make the path involved smaller so that the
example can fit in 80 columns?

> The last line tells `org-protocol-open-source' to open
> /home/user/org/index.php, if the URL cannot be mapped to an existing
> @@ -554,8 +561,13 @@ The location for a browser's bookmark should look like 
> this:
> ;; Try to match a rewritten URL and map it to
> ;; a real file.  Compare redirects without
> ;; suffix.
> -   (when (string-match-p (car rewrite) f1)
> - (throw 'result (concat wdir (cdr rewrite
> +   (when (string-match (car rewrite) f1)
> + (setq replacement (cdr rewrite))

Here, `replacement' isn't lexically bound, so compiling
"org-protocol.el" should return an error. `replacement' should be
let-bound instead.

> + (if (match-string 0 f1)

AFAIU, (match-string 0 f1) is necessarily true, per the (string-match
(car rewrite) f1) above, so the test can be removed.

> + (setq replacement (concat
> +(directory-file-name  
> (replace-match "" nil nil f1 1))
> +replacement )

Spurious white space character before the parenthesis.

> + (throw 'result (concat wdir replacement)

Shouldn't the (throw ...) be within the (when (string-match ...)) as it
was before? I may be wrong. I didn't check the high level logic of the
patch since I don't know "org-protocol.el".

> Applied for it just now. Have marked the changes as tiny.

Great. Let me know when the process is complete.

Regards,

-- 
Nicolas Goaziou0x80A93738



Re: [O] Extracting headlines?

2017-06-28 Thread Eric S Fraga
On Wednesday, 28 Jun 2017 at 08:50, Loris Bennett wrote:
> does Org provide any way of extracting just the level 3 headlines for a
> given 7 day period?

If you have org timestamps on those headlines, you might be able to use
org-sparse-tree (C-c /) with the D option (dates range).

-- 
: Eric S Fraga via Emacs 26.0.50, Org release_9.0.9-551-g92e8c8


signature.asc
Description: PGP signature


[O] Extracting headlines?

2017-06-28 Thread Loris Bennett
Hi,

If I have captured stuff in a journal file like so:

* 2017
** 2017-06 June
*** 2017-06-01 Thursday
 Tweaked .bashrc
Added some aliases
*** 2017-06-02 Friday
 Tweaked .emacs
Added some abbreviations
*** 2017-06-07 Wednesday
 Tweaked .tweakrc
Set up autotweak

does Org provide any way of extracting just the level 3 headlines for a
given 7 day period?

Cheers,

Loris

-- 
Dr. Loris Bennett (Mr.)
ZEDAT, Freie Universität Berlin Email loris.benn...@fu-berlin.de