Re: [O] Importing ODT/libreoffice into Org

2016-07-16 Thread Eric Abrahamsen
John Kitchin  writes:

> It is formatted from org to applications. That may not be the
> direction you were going. 

Ah, no -- I'm going in the other direction, into Org. I installed the
package anyway :)




Re: [O] Importing ODT/libreoffice into Org

2016-07-16 Thread John Kitchin
It is formatted from org to applications. That may not be the direction you
were going.

On Saturday, July 16, 2016, Eric Abrahamsen  wrote:

> John Kitchin > writes:
>
> > Check out ox-clip. It does formatted copy and paste. It is on Melpa.
>
> Oh cool -- thanks for the tip!
>
>
>

-- 
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


[O] org-info

2016-07-16 Thread Phillip Lord


I'm having two problems with org-info.js.

Firstly, it's currently available and is linked into generated HTML at
http://orgmode.org/org-info.js; this makes it non-functional when
delivered via https.

Secondly, in HTML generated by org mode, this license condition is
added:

* As additional permission under GNU GPL version 3 section 7, you
 * may distribute non-source (e.g., minimized or compacted) forms of
 * that code without the copy of the GNU GPL normally required by
 * section 4, provided you include this license notice and a URL
 * through which recipients can access the Corresponding Source.

which is fine, except that by default, the URL doesn't appear to be
added. There is this:

  * @source: http://orgmode.org/org-info.js

but that's not the source, but a minimized version.

Is it possible to have an option for linking via https? And have a link
to the actual source added?

Phil



Re: [O] Importing ODT/libreoffice into Org

2016-07-16 Thread Eric Abrahamsen
John Kitchin  writes:

> Check out ox-clip. It does formatted copy and paste. It is on Melpa. 

Oh cool -- thanks for the tip!




Re: [O] Importing ODT/libreoffice into Org

2016-07-16 Thread John Kitchin
Check out ox-clip. It does formatted copy and paste. It is on Melpa.

On Saturday, July 16, 2016, Eric Abrahamsen  wrote:

> Has anyone written a Libreoffice extension that will export Org mode? I
> do this a lot, and it's a huge waste of time -- doing a search and
> replace for bold or italics, in particular, is very annoying, and
> sometimes doesn't work for reasons I don't understand. I just had to
> convert a 200+ page document to Org by hand: searching for italics
> worked, but not replace.
>
> Does anyone have any handy tools? Most of it can be done after a
> document has been turned into plain text, but not headings and emphasis
> markup...
>
> Thanks,
> Eric
>
>
>

-- 
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


Re: [O] Importing ODT/libreoffice into Org

2016-07-16 Thread Eric Abrahamsen
swfl...@flintfam.org (Samuel W. Flint) writes:

> Export to docx and use pandoc?  Something like `pandoc input.doc -o
> output.org` should work.

Well dammit. I just tried it, and it worked great. Next time...

E




Re: [O] Importing ODT/libreoffice into Org

2016-07-16 Thread Eric Abrahamsen
swfl...@flintfam.org (Samuel W. Flint) writes:

> Export to docx and use pandoc?  Something like `pandoc input.doc -o
> output.org` should work.

I should have thought of that! Will give it a shot.

I also noticed (too late) that my Libreoffice will export to mediawiki
format. That's plain text, at any rate, and keeps formatting, so regular
expressions should do the trick.

E




Re: [O] Importing ODT/libreoffice into Org

2016-07-16 Thread Samuel W. Flint
Export to docx and use pandoc?  Something like `pandoc input.doc -o
output.org` should work.

HTH,

Sam

-- 
Samuel W. Flint
4096R/266596F4
  (9477 D23E 389E 40C5 2F10  DE19 68E5 318E 2665 96F4)
(λs.s s) λs.s s



[O] PATCH for Re: Bug: src block asterisk escaping doesn't work anymore

2016-07-16 Thread Robert Klein
Hi,

 On Wed, 13 Jul 2016 18:47:58 -0700
"Charles C. Berry"  wrote:

> On Wed, 13 Jul 2016, Robert Klein wrote:
> 
> > Hi,
> >
> > When exporting a source block, e.g.
> >
> > --- snip (example org file) ---
> > #+begin_src conf
> >  Test
> >
> >  ,* asterisk in src block
> > #+end_src
> > --- snip ---
> >
> >
> > the escaping of the asterisk does not work.  Instead a headline
> > “asterisk in src block” is created.  
> 
> I don't have `ob-conf', but this:
> 
> --8<---cut here---start->8---
> 
> #+begin_src emacs-lisp :exports both
>"Test
> 
>,* asterisk in src block"
> #+end_src
> 
> --8<---cut here---end--->8---
> 
> shows the issue. Also, the #+[BEGIN|END]_SRC parts of the src block 
> are showing up in the export.
> 
> Putting `org-escape-code-in-string' back in `org-babel-exp-code' here
> 
> :  ("body"  . ,(org-escape-code-in-string (nth 1 info)))
> 
> seems to fix this as long as there is a newline after the last
> #+END_SRC in the buffer.

Thanks for the confirmation.  I also have issues exporting
http://orgmode.org/worg/dev/org-element-api.org -- while the error
message is "Unable to resolve code reference: end" bisecting leads to
the same commit; reverting the commit solves the issue.  I reckon the
line(s) beginning with #+ in the src block above confuse the exporter
in the same way.

I attached a tentative patch.

Best regards
Robert
>From ceecd352546453eb0215628c093faf13bca16b97 Mon Sep 17 00:00:00 2001
From: Robert Klein 
Date: Sat, 16 Jul 2016 20:50:01 +0200
Subject: [PATCH] Revert "ob-exp: Remove spurious comma un-escaping"

This reverts commit 0279d84cd7f857535342b4ec3c2e70ac76c1ee27.

The original commit breaks exports containing lines beginning
with "* "  or "#+" in src blocks.
---
 lisp/ob-exp.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/ob-exp.el b/lisp/ob-exp.el
index e824992..a1a945f 100644
--- a/lisp/ob-exp.el
+++ b/lisp/ob-exp.el
@@ -48,6 +48,7 @@
 (declare-function org-element-property "org-element" (property element))
 (declare-function org-element-type "org-element" (element))
 (declare-function org-id-get "org-id" ( pom create prefix))
+(declare-function org-escape-code-in-string "org-src" (s))
 
 (defcustom org-export-babel-evaluate t
   "Switch controlling code evaluation during export.
@@ -385,7 +386,7 @@ replaced with its value."
org-babel-exp-inline-code-template
org-babel-exp-code-template)
`(("lang"  . ,(nth 0 info))
- ("body"  . ,(nth 1 info))
+ ("body"  . ,(org-escape-code-in-string (nth 1 info)))
  ("switches" . ,(let ((f (nth 3 info)))
 		  (and (org-string-nw-p f) (concat " " f
  ("flags" . ,(let ((f (assq :flags (nth 2 info
-- 
2.9.0



[O] Importing ODT/libreoffice into Org

2016-07-16 Thread Eric Abrahamsen
Has anyone written a Libreoffice extension that will export Org mode? I
do this a lot, and it's a huge waste of time -- doing a search and
replace for bold or italics, in particular, is very annoying, and
sometimes doesn't work for reasons I don't understand. I just had to
convert a 200+ page document to Org by hand: searching for italics
worked, but not replace.

Does anyone have any handy tools? Most of it can be done after a
document has been turned into plain text, but not headings and emphasis
markup...

Thanks,
Eric




Re: [O] Using property values in source code blocks

2016-07-16 Thread Joon Ro
> I do not see an easy way to do what you want only with tangle.
> 
> There are hooks you can define that might enable you to set things up. 
> Maybe you can use `org-babel-pre-tangle-hook' to collect the property 
> values and put them somewhere that `org-babel-post-tangle-hook' can get at 
> them and use them to modify the tangled results accordingly. Or maybe 
> `org-babel-post-tangle-hook' can do it by using methods like those in 
> `org-babel-detangle' to look back at the *.org file.
> 
> Another alternative is to write all of your code blocks so they will 
> execute to create the code you want as results and then tangle those 
> results. You would use :wrap like this:
> 
> --8<---cut here---start->8---
> 
> #+BEGIN_SRC shell :noweb yes :wrap "src shell :tangle ./tangle-test.sh"
> echo "echo " <>
> #+END_SRC
> 
> --8<---cut here---end--->8---
> 
> Execute the src block and then tangle the buffer.
> 
> In fact, if you go that route it might make more sense to write elisp 
> code blocks to find the prpoerty values and then format the results.
> 

I see - thank you so much for your help. It does look like I have to write some 
code to do this.
Since I'm not that familiar with elisp, I think I will write a Python code 
block which has the template as a multi-line string, and then just pass values 
as arguments to the source code block to generate the shell scripts.
Best,Joon

  

Re: [O] Using property values in source code blocks

2016-07-16 Thread Charles C. Berry

On Fri, 15 Jul 2016, Joon Ro wrote:






Example:

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

* Top Heading

#+NAME: get-property
#+BEGIN_SRC emacs-lisp :noweb yes :var prop="prop" :var pom=0
(car (org-entry-get-multivalued-property pom prop))
#+END_SRC

** Subheading
:PROPERTIES:
:DUMMY: 100
:END:

#+BEGIN_SRC shell :noweb yes
echo <>
#+END_SRC

#+RESULTS:
: 100

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



Hi Chuck,


Thank you so much. It definitely works when I evaluate the code block - 
but my ultimate goal is to tangle the source code (I want to generate 
bunch of script files with a template using property values), and when I 
tangle the code block it returns nil.


I do not see an easy way to do what you want only with tangle.

There are hooks you can define that might enable you to set things up. 
Maybe you can use `org-babel-pre-tangle-hook' to collect the property 
values and put them somewhere that `org-babel-post-tangle-hook' can get at 
them and use them to modify the tangled results accordingly. Or maybe 
`org-babel-post-tangle-hook' can do it by using methods like those in 
`org-babel-detangle' to look back at the *.org file.


Another alternative is to write all of your code blocks so they will 
execute to create the code you want as results and then tangle those 
results. You would use :wrap like this:


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

#+BEGIN_SRC shell :noweb yes :wrap "src shell :tangle ./tangle-test.sh"
echo "echo " <>
#+END_SRC

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

Execute the src block and then tangle the buffer.

In fact, if you go that route it might make more sense to write elisp 
code blocks to find the prpoerty values and then format the results.



Chuck



Re: [O] negating a filetag on an entry?

2016-07-16 Thread John Kitchin
That is neat, but not quite what I had in mind.

I have a roster of headlines, one for each student in a course. The file
is tagged with #+FILETAGS: course_name


During a semester, students drop, and I have tried a few different
models to designate that, e.g. move the headline to an archived
headline, or tagging them as :dropped:. 

I use this file like a database to generate lists of students, emails,
etc... but I want to exclude dropped students from that list. 

I can use this as a "query" to org-map-entries

+course_name-dropped

but it seems like the best idea is to just archive the headline to
another file or delete the headline.

Juan Pechiar writes:

> On Fri, Jul 15, 2016 at 08:20:58AM -0400, John Kitchin wrote:
>> If I use a line like:
>>
>> #+FILETAGS: f16-06625
>>
>> and I want a headline in the file to not have that tag, is that possible?
>
> There is a hack by David Maus to remove redundant (already inherited)
> tags from a heading:
>
> https://lists.gnu.org/archive/html/emacs-orgmode/2010-01/msg00630.html
>
> Regards,
> .j.


-- 
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] Substitute for (bh/org-agenda-to-appt)

2016-07-16 Thread Myles English
Hello Lou,

Louis Turk writes:

> With this fuction appointments are set up when Emacs starts:
>
> (bh/org-agenda-to-appt)

Presumably you got this function from here:

http://doc.norang.ca/org-mode.html

> I would like to substitute it with a function that sets the appointments
> up when org-mode starts instead of when emacs starts. The reason being
> that (bh/org-agenda-to-appt) causes all the org-agenda-files to load,
> which is very irritating when I'm editing none org-mode files (which is
> probably 95% of the time).

That webpage goes on to say:

#+BEGIN_QUOTE
; Rebuild the reminders everytime the agenda is displayed
(add-hook 'org-finalize-agenda-hook 'bh/org-agenda-to-appt 'append)

; This is at the end of my .emacs - so appointments are set up when Emacs starts
(bh/org-agenda-to-appt)
#+END_QUOTE

So just comment out that line, like this:

;; (bh/org-agenda-to-appt)

or delete it, and that function won't be called when your emacs starts,
only when the agenda is displayed (assuming you set it up like that).

Myles