Re: [O] moving an entry from one date tree to another

2019-09-27 Thread Adam Porter
See unpackaged/org-refile-to-datetree from:

https://github.com/alphapapa/unpackaged.el#refile-to-datetree-file-using-earliestlatest-timestamp-in-entry




[O] :libs header in fortran code blocks

2019-09-27 Thread Alberto Ramos

  Hi all,

  I am completely new to this mailing list, and in fact to elisp. I am
  an user of org-babel, and in particular use a lot of fortran code
  blocks. 

  One annoyance is that these blocks were not supporting the :libs
  header: I had to tangle the code and compile it by hand.

  After asking for a solution in emacs-reddit
  
(https://www.reddit.com/r/emacs/comments/d8krp0/org_mode_code_blocks_and_libraries/),
  I was suggested to try to contribute with a patch.

  Here it is. Since it is the first time that I do something like this,
  please let me know if something is wrong or not done correctly.

  Thanks to all for the awesome org-mode!

  A.
>From 5c42f43bc2c1e95a54e0bee0f7f97e4d673238e9 Mon Sep 17 00:00:00 2001
From: Alberto Ramos 
Date: Fri, 27 Sep 2019 23:11:02 +0100
Subject: [PATCH] ob-fortran.el: Add support for :libs header

lisp/ob-fortran.el: Add support for :libs header in fortran code
blocks.

TINYCHANGE
---
 lisp/ob-fortran.el | 16 ++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/lisp/ob-fortran.el b/lisp/ob-fortran.el
index f1285f6ab..6e3421a75 100644
--- a/lisp/ob-fortran.el
+++ b/lisp/ob-fortran.el
@@ -40,6 +40,10 @@
 
 (defvar org-babel-default-header-args:fortran '())
 
+(defconst org-babel-header-args:fortran '((libs. :any))
+  "Fortran-specific header arguments.")
+
+
 (defvar org-babel-fortran-compiler "gfortran"
   "fortran command used to compile a fortran source code file into an
   executable.")
@@ -50,15 +54,23 @@
  (tmp-bin-file (org-babel-temp-file "fortran-bin-" org-babel-exeext))
  (cmdline (cdr (assq :cmdline params)))
  (flags (cdr (assq :flags params)))
+	 (libs (org-babel-read
+		(or (cdr (assq :libs params))
+		(org-entry-get nil "libs" t))
+		nil))
+	 (libs (mapconcat #'identity
+			  (if (listp libs) libs (list libs))
+			  " "))
  (full-body (org-babel-expand-body:fortran body params)))
 (with-temp-file tmp-src-file (insert full-body))
 (org-babel-eval
- (format "%s -o %s %s %s"
+ (format "%s -o %s %s %s %s"
 	 org-babel-fortran-compiler
 	 (org-babel-process-file-name tmp-bin-file)
 	 (mapconcat 'identity
 			(if (listp flags) flags (list flags)) " ")
-	 (org-babel-process-file-name tmp-src-file)) "")
+	 (org-babel-process-file-name tmp-src-file)
+	 libs) "")
 (let ((results
(org-trim
 (org-remove-indentation
-- 
2.22.0



[O] Bug: org-publish-resolve-external-link doesn't respect org-export-with-broken-links for fuzzy links

2019-09-27 Thread Robert Irelan
Patch to fix attached

-- 
Robert Irelan
rire...@gmail.com
From 3d3008398abb6c3a8cdfd796e6daa3f3ba909ad2 Mon Sep 17 00:00:00 2001
From: Robert Irelan 
Date: Fri, 27 Sep 2019 12:19:03 -0700
Subject: [PATCH] ox-publish: signal org-link-broken for broken fuzzy links

* lisp/ox-publish.el (org-publish-resolve-external-link): Signal
`org-link-broken' when `org-link-search' fails to resolve a link.
Without this change, a broken fuzzy link will always abort the export
even when `org-export-with-broken-links' is non-nil.
---
 lisp/ox-publish.el | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/ox-publish.el b/lisp/ox-publish.el
index 8928301fd..92a8aead3 100644
--- a/lisp/ox-publish.el
+++ b/lisp/ox-publish.el
@@ -1171,7 +1171,10 @@ (defun org-publish-resolve-external-link (search file  prefer-custom)
 	   (with-current-buffer (find-file-noselect file)
 	 (org-with-point-at 1
 	   (let ((org-link-search-must-match-exact-headline t))
-		 (org-link-search search nil t))
+		 (condition-case err
+		 (org-link-search search nil t)
+		   (error
+		(signal 'org-link-broken (cdr err)
 	   (and (org-at-heading-p)
 		(org-string-nw-p (org-entry-get (point) "CUSTOM_ID"
((not org-publish-cache)
-- 
2.23.0.444.g18eeb5a265-goog



Re: [O] Cannot display local images with orgmode under macOS

2019-09-27 Thread Marco Wahl
Zhengyu Duan  writes:

> My image display problem was fixed with this commit
>
> https://github.com/hlissner/doom-emacs/commit/87b7a8da052601c51bc0577484916856364401cb

Thanks for the information!


Ciao,
-- 
Marco






Re: [O] Cannot display local images with orgmode under macOS

2019-09-27 Thread Zhengyu Duan
My image display problem was fixed with this commit

https://github.com/hlissner/doom-emacs/commit/87b7a8da052601c51bc0577484916856364401cb



> On Sep 14, 2019, at 15:43, Marco Wahl  wrote:
> 
> Hi!
> 
> Thanks all for checking the issue!
> 
> * The problem
> 
>   Orgmode under macOS cannot display local images correctly, but
> it can display internet images
> without problem.
> 
>   I tried both emacs-mac and emacs-plus, they both have this
> image problem. But emacs under
> ArchLinux don’t have this problem.
> 
>   [[file:xxx.png]] cannot be displayed even the file exists.
>   [[./xxx.png]] cannot be displayed even the file exists.
>   [[http://example.org/xxx.png]]  can be displayed if the link exists.
> 
> Your analysis hints to check the handling of images given by an url
> vs. given by file.  I think this is something for somewhen else.  (At
> least I captured a respective task.)
> 
> Regarding the issue about the display of inline images the tests
> can be summarized like this:
> 
> |   | OS  |  Emacs | magick | inline images |
> |   | ||| display   |
> |---+-+++---|
> | Duan  | arch||| yes   |
> | Duan  | mac ||| no|
> | Chuck | mac 10.14.6 |   26.1 | yes| yes   |
> | Tim   | mac 10.14.6 |   26.3 | yes| yes   |
> | Rick  | mac | master | no | yes   |
> 
> This is indication that there is an individual issue on Duan's side
> AFAICT.
> 
> I highly recommend to blend out the individual configuration and try
> again.  If the display still fails then provide a concrete minimal
> complete example for further invesigation.
> 
> 
> Thanks all and best regards,
> -- 
> Marco




Re: [O] org-mode vs pandoc export

2019-09-27 Thread CHARPENTIER Emmanuel
1) I just checked: I was incorrect, Pythontex now has complete support
for R language. One can now use it for processing \LaTeX files
including Sage, R (and of course, Python) chunks.

2) Please, DO NOT include "images of a table" in a scientific document!
Lazy students pull this one on me in their manuscripts, and it's a
pain: you can't do a thing with such horrors, and you have to retype
manually these data if you want to work on them...

3) Did you try the route org-->LaTeX-->WhateverViaPandoc suggested by
John Kitchin ?

--
Emmanuel Charpentier

PS: I'm surprised that a philosophy journal does not accept \LaTeX
submissions: formal mathematics have been part of the philosophical
toolbox for a long while (since about 700 BC IIRC...).



Re: [O] PPTX link: Open with PowerPoint on Mac

2019-09-27 Thread Nathan Neff
Here it is: https://orgmode.org/manual/External-Links.html#External-Links

I was looking here:
https://orgmode.org/manual/External-links.html - but wait, what's the
difference?  Whoa, the
"l" is lower case on the second link - looks like a doc / publishing bug -
one page has 4.3 and the
other says 4.4.

What do I need to do to report this doc / publishing bug?

Thanks,
--Nate



On Fri, Sep 27, 2019 at 5:50 AM Nathan Neff  wrote:

>
>
> On Fri, Sep 27, 2019 at 4:45 AM Takaaki Ishikawa  wrote:
>
>> I think you may have to put “file+sys:/“ before your path.
>>
>> For example: file+sys://Users/nate/some_pptx.pptx
>>
>
> Thank you Takaaki very much! This worked great!
>
>
>>
>> Best,
>> Takaaki
>>
>> > On Sep 27, 2019, at 18:42, Nathan Neff  wrote:
>> >
>> > Hello all,
>> >
>> > I have a simple path in org-mode
>> >
>> > /Users/nate/some_pptx.pptx
>> >
>> > When I press C-c C-o it opens the file in binary mode in Emacs.
>> >
>> > A path to a PDF will actually open the file with the associated program:
>> > /Users/nate/some_png.png -> Opens in Preview when I press C-c C-o
>> >
>> > How can I get emacs / org to open pptx files in the same fashion as if
>> I had
>> > double-clicked using Finder on Mac?
>> >
>> > Thanks,
>> > --Nate
>>
>>


Re: [O] PPTX link: Open with PowerPoint on Mac

2019-09-27 Thread Nathan Neff
On Fri, Sep 27, 2019 at 4:45 AM Takaaki Ishikawa  wrote:

> I think you may have to put “file+sys:/“ before your path.
>
> For example: file+sys://Users/nate/some_pptx.pptx
>

Thank you Takaaki very much! This worked great!


>
> Best,
> Takaaki
>
> > On Sep 27, 2019, at 18:42, Nathan Neff  wrote:
> >
> > Hello all,
> >
> > I have a simple path in org-mode
> >
> > /Users/nate/some_pptx.pptx
> >
> > When I press C-c C-o it opens the file in binary mode in Emacs.
> >
> > A path to a PDF will actually open the file with the associated program:
> > /Users/nate/some_png.png -> Opens in Preview when I press C-c C-o
> >
> > How can I get emacs / org to open pptx files in the same fashion as if I
> had
> > double-clicked using Finder on Mac?
> >
> > Thanks,
> > --Nate
>
>


Re: [O] PPTX link: Open with PowerPoint on Mac

2019-09-27 Thread Takaaki Ishikawa
I think you may have to put “file+sys:/“ before your path.

For example: file+sys://Users/nate/some_pptx.pptx

Best,
Takaaki

> On Sep 27, 2019, at 18:42, Nathan Neff  wrote:
> 
> Hello all,
> 
> I have a simple path in org-mode
> 
> /Users/nate/some_pptx.pptx
> 
> When I press C-c C-o it opens the file in binary mode in Emacs.
> 
> A path to a PDF will actually open the file with the associated program:
> /Users/nate/some_png.png -> Opens in Preview when I press C-c C-o
> 
> How can I get emacs / org to open pptx files in the same fashion as if I had
> double-clicked using Finder on Mac?
> 
> Thanks,
> --Nate



signature.asc
Description: Message signed with OpenPGP


[O] PPTX link: Open with PowerPoint on Mac

2019-09-27 Thread Nathan Neff
Hello all,

I have a simple path in org-mode

/Users/nate/some_pptx.pptx

When I press C-c C-o it opens the file in binary mode in Emacs.

A path to a PDF will actually open the file with the associated program:
/Users/nate/some_png.png -> Opens in Preview when I press C-c C-o

How can I get emacs / org to open pptx files in the same fashion as if I had
double-clicked using Finder on Mac?

Thanks,
--Nate


Re: [O] Basic Q: Display specific property in custom agenda view

2019-09-27 Thread Nathan Neff
Thanks Eric, this does it!

On Thu, Sep 26, 2019 at 12:27 AM Fraga, Eric  wrote:

> On Thursday, 26 Sep 2019 at 00:06, Nathan Neff wrote:
> > Got it!  Now, all I need to do is add the cool ":" functionality
> > where a ":" is appended to the result if there is a result :-)
>
> Maybe something like
>
> ;; Return PROJ property or category property
> (defun njn-get-proj-property()
>   (if (org-entry-get (point) "PROJ" t)
>   (concat (org-get-category) ":")
> ""))
>
> (untested)
> --
> Eric S Fraga via Emacs 27.0.50, Org release_9.2.4-401-gfabd6d
>


Re: [O] org-mode vs pandoc export

2019-09-27 Thread Joseph Vidal-Rosset
Hello,

Many thanks Emmanuel for your help.

Indeed, I'm  using org-ref and scimax, all the  nice tools that
John offers very  generously to the community; org-ref  is so convenient
that  now I  cannot  imagine to  work  without it.  Maybe  John has  the
solution for future exports. (I did not succeed to export in odt because
of links, bibliography links.)

Finally the best result was done directly via pandoc, via a command line
like this one:

pandoc -s --filter pandoc-crossref --bibliography=reforg.bib --csl=ieee.csl -o 
mydocument.odt mydocument.org

But pandoc-crossref never  worked and I had also to  make png images for
tables.

The best  solution that I  found was to install  libreoffice-texmaths. I
just had  to enter "sudo  aptitude install libreoffice-texmaths"  via my
GNU/Linux Debian sid, but for other OS, the package is here

https://extensions.libreoffice.org/extensions/texmaths-1

and it works.

Of course the output is less pretty than the pdf via the tex life

I hope that it will help other people.

Best wishes,

Jo.

PS: The publisher is in philosophy... 



[O] moving an entry from one date tree to another

2019-09-27 Thread Alan Schmitt

Hello,

Is there an easy way to move an entry from one date tree to 
another? I

guess I need two things:
- figure out where in the date tree the entry is,
- create the parents if needed, and move it there.

This might be a more general question: given an entry in some 
file, can
I move it recreating the path form the root of the file to another 
file?


Thanks,

Alan


signature.asc
Description: PGP signature