Re: [O] ``make test'' failure

2017-11-05 Thread Nick Dokos
Thank you!

On Nov 3, 2017 17:17, "Nicolas Goaziou"  wrote:

Hello,

Nick Dokos  writes:

> Yes, indeed: the test passes here with the patch.

I merged the updated test in master branch. Thank you.

Regards,

--
Nicolas Goaziou


Re: [O] References: simplifying org mode usage for Bibtex files

2017-11-05 Thread John Kitchin
You might look into the lentic package. It might be possible to view a bib
file in two views, one in Bibtex mode for the entries, and one in org-mode
for the comments. In the bibtex view, the org narrative would be in comment
form, and in the org view the bibtex entries would be in source blocks.

I have not used lentic extensively, and haven't had much luck lately using
it but it seems to be made for the kind of purpose you describe.



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 Sun, Nov 5, 2017 at 4:00 PM,  wrote:

> My need is for a simple work flow/usage of Orgmode to annotate and
> organize existing BibTex *.bib files.  I have mentioned on this list
> that I had found Cb2Bib to work extremely well for, so to speak,
> harvesting references from Google Scholar.  In fact, Pere Constans,
> developer of Cb2Bib, recently helped me to streamline this usage to
> allow the use of the "Annotation" field, and I have also worked out a
> way to output and print a pdf with this field using Cb2Bib's bib2pdf
> utility.  I use this as a basis for library research.
>
> However, I have a wide range of such references in each file, over
> dozens of topics, and I would like to incorporate by some means an
> ability to include org-mode subheadings with maybe tags, so enable the
> citations to be more easily sorted.
>
> I do not need to have automatic selection for a bibliography in the
> output, or automatic insertion of citations, at this point.
>
> I have asked this question on this list, and studied from time to time
> the solutions for using org-mode with bibtex, and visa-versa.  I don't
> really have the time or inclination to learn  these.
>
> I remember  that  in BibTeX documentation, was mention that almost
> anything outside of the individual records could serve as a comment.
> This is more or less what I have in mind.
>
> I would appreciate hearing from anyone who use such a simple approach.
> It would be most convenient if it were not necessary to change the
> extension of the *.bib files; I used to do this, but the extra steps
> for each reference was exhausting.
>
> Thank you for any ideas,
>
> Alan Davis
>
>
>
>
>


[O] References: simplifying org mode usage for Bibtex files

2017-11-05 Thread lngndvs
My need is for a simple work flow/usage of Orgmode to annotate and
organize existing BibTex *.bib files.  I have mentioned on this list
that I had found Cb2Bib to work extremely well for, so to speak,
harvesting references from Google Scholar.  In fact, Pere Constans,
developer of Cb2Bib, recently helped me to streamline this usage to
allow the use of the "Annotation" field, and I have also worked out a
way to output and print a pdf with this field using Cb2Bib's bib2pdf
utility.  I use this as a basis for library research.

However, I have a wide range of such references in each file, over
dozens of topics, and I would like to incorporate by some means an
ability to include org-mode subheadings with maybe tags, so enable the
citations to be more easily sorted.

I do not need to have automatic selection for a bibliography in the
output, or automatic insertion of citations, at this point.

I have asked this question on this list, and studied from time to time
the solutions for using org-mode with bibtex, and visa-versa.  I don't
really have the time or inclination to learn  these.

I remember  that  in BibTeX documentation, was mention that almost
anything outside of the individual records could serve as a comment.
This is more or less what I have in mind.

I would appreciate hearing from anyone who use such a simple approach.
It would be most convenient if it were not necessary to change the
extension of the *.bib files; I used to do this, but the extra steps
for each reference was exhausting.

Thank you for any ideas,

Alan Davis






Re: [O] C++ sessions for Babel with cling interpreter

2017-11-05 Thread Martin Alsinet
Hello Garjola:

I have not used C++ source blocks, but I use them frequently with
Javascript and Python, and I don't use sessions.
The thing is, for literate programming, we want to include the code from
one source block in others, and it would seem that sessions are the
solution.
However, I find that for me it is better to use tangle to export the code
to source files and then include the tangled files from the other source
blocks.

Example:

#+BEGIN_SRC js :tangle src/hello.js
function hello(text) {
console.log("hello " + text);
}
module.exports = hello;
#+END_SRC

First I have to run *org-babel-tangle* to export all source blocks to
files, and then I can include them in other blocks.

#+BEGIN_SRC js
const hello = require("./src/hello.js");
hello("Martin");
#+END_SRC

>From what I remember, it is possible to do the same in C++, including the
source files you need from the filesystem.
In my opinion, this approach is better than sessions, because the problem
with sessions is that you have to make sure the blocks are executed
secuentially in the right order to build the "state" that allows you to run
your current block. This way each block is independent of all others, worst
case you have to run org-babel-tangle to create the required files.

Regards,


Martín


On Sun, Nov 5, 2017 at 12:13 PM  wrote:

> Hi all,
>
> I use C++ source code blocks in babel frequently and I am very happy with
> the results. As C++ is a compiled language, ob-C.el does not support
> sessions.
>
> Unfortunately, this breaks a little my litterate programming workflow,
> since I don't know how to use small code snippets without sessions.
>
> I have recently discovered cling [1], [2] a C++ interpreter which comes
> with de Root package [3]. I have also found a cling inferior mode [4] to
> interact with the interpreter in a comint buffer.
>
> I was wondering if it would be difficult to update ob-C.el to use cling
> for session support. My elisp knowledge is too poor to understand what is
> involved in doing such a thing, but I would be interested in trying or
> helping somebody do it. Unfortunately, I have the impression that the
> developers of ob-C.el are not around this list anymore?
>
> I would very much appreciate suggestions on how to proceed.
>
> Thank you.
>
> Garjola.
>
> Footnotes:
> [1]  https://root.cern.ch/cling
> [2]  https://www.youtube.com/watch?v=Lbi7MLS03Yc
> [3]  https://root.cern.ch/
> [4]  https://github.com/brianqq/inferior-cling
>
> --
> Dr. Dindi
> Dad, Philosopher, Hacker
>
>


Re: [O] function for inserting a block

2017-11-05 Thread Eric Abrahamsen

On 11/05/17 10:06 AM, Nicolas Goaziou wrote:
> Hello,
>
> Eric Abrahamsen  writes:
>
>> From 055af9e9545947b9aeccc3370c8b67a237eea5d8 Mon Sep 17 00:00:00 2001
>> From: Eric Abrahamsen 
>> Date: Mon, 30 Oct 2017 10:55:29 -0700
>> Subject: [PATCH] Replace easy templates with org-insert-structure-template
>>
>> * lisp/org.el (org-insert-structure-template): New function for
>>   wrapping region (or element at point) in a begin/end block.
>>   (org-structure-predefined-blocks): New option holding predefined
>>   blocks, for completion.
>>   (org-try-structure-completion,
>>   org-complete-expand-structure-template): Remove functions.
>> * doc/org.texi (Inserting structure templates): Document.
>> * testing/lisp/test-org.el (test-org/insert-template): New test.
>
> Thank you. I applied your patch with the changes below.

Great!

>> -* Info directory file:: Installing a manual in Info file hierarchy.
>> +* Info directory file:: Installing a manual in Info file hierarchy.
>
> Ignored.
>
>> -* Easy templates::  Quick insertion of structural elements
>> +* Inserting structure templates::  Wrapping text in code blocks
>
> I used "Structure templates" instead of "Inserting structure templates"
> and updated the rest of the "org.texi" accordingly.
>
>> -@node Introduction
>> +@node Introduction, Document structure, Top, Top
>
> There is a lot of noise like this in your patch. I removed it.

I don't know why that happened, I ran the update-menus and update-nodes
menu commands, I figured that was necessary after the section renaming.
I have noticed a bit of churn when producing other info manuals, though.

Thanks a lot for the rest of your edits!

Eric




[O] C++ sessions for Babel with cling interpreter

2017-11-05 Thread garjola
Hi all,

I use C++ source code blocks in babel frequently and I am very happy with the 
results. As C++ is a compiled language, ob-C.el does not support sessions.

Unfortunately, this breaks a little my litterate programming workflow, since I 
don't know how to use small code snippets without sessions.

I have recently discovered cling [1], [2] a C++ interpreter which comes with de 
Root package [3]. I have also found a cling inferior mode [4] to interact with 
the interpreter in a comint buffer.

I was wondering if it would be difficult to update ob-C.el to use cling for 
session support. My elisp knowledge is too poor to understand what is involved 
in doing such a thing, but I would be interested in trying or helping somebody 
do it. Unfortunately, I have the impression that the developers of ob-C.el are 
not around this list anymore?

I would very much appreciate suggestions on how to proceed.

Thank you.

Garjola.

Footnotes: 
[1]  https://root.cern.ch/cling
[2]  https://www.youtube.com/watch?v=Lbi7MLS03Yc
[3]  https://root.cern.ch/
[4]  https://github.com/brianqq/inferior-cling

-- 
Dr. Dindi
Dad, Philosopher, Hacker



Re: [O] (setq org-html-with-latex nil) is ignored

2017-11-05 Thread Uwe Brauer

   > Hello,
   > Uwe Brauer  writes:


   > "org-mime.el" hard-codes it at line 379:

   >   https://github.com/org-mime/org-mime/blob/master/org-mime.el#L379

Ah ok, thanks 
   > You may want to report it upstream.

I did.

Regards

Uwe 




Re: [O] function for inserting a block

2017-11-05 Thread Kaushal Modi
On Sun, Nov 5, 2017 at 9:24 AM Kaushal Modi  wrote:

>  This is a breaking change though (org-try-structure-completion doesn't
> exist any more.. it breaks at least my config.. could be breaking more).
>

It could actually be a wider breakage as it changes the structure of
org-structure-template-alist
-- 

Kaushal Modi


Re: [O] function for inserting a block

2017-11-05 Thread Kaushal Modi
On Sun, Nov 5, 2017 at 4:07 AM Nicolas Goaziou 
wrote:

> Hello,
>
> Eric Abrahamsen  writes:
>
> > From 055af9e9545947b9aeccc3370c8b67a237eea5d8 Mon Sep 17 00:00:00 2001
> > From: Eric Abrahamsen 
> > Date: Mon, 30 Oct 2017 10:55:29 -0700
> > Subject: [PATCH] Replace easy templates with
> org-insert-structure-template
> >
> > * lisp/org.el (org-insert-structure-template): New function for
> >   wrapping region (or element at point) in a begin/end block.
> >   (org-structure-predefined-blocks): New option holding predefined
> >   blocks, for completion.
> >   (org-try-structure-completion,
> >   org-complete-expand-structure-template): Remove functions.
> > * doc/org.texi (Inserting structure templates): Document.
> > * testing/lisp/test-org.el (test-org/insert-template): New test.
>
> Thank you. I applied your patch with the changes below.
>

I'll try this out soon. This is a breaking change though
(org-try-structure-completion doesn't exist any more.. it breaks at least
my config.. could be breaking more). Can you please also mention this
breakage in the ORG-NEWS?
-- 

Kaushal Modi


Re: [O] function for inserting a block

2017-11-05 Thread Nicolas Goaziou
Hello,

Eric Abrahamsen  writes:

> From 055af9e9545947b9aeccc3370c8b67a237eea5d8 Mon Sep 17 00:00:00 2001
> From: Eric Abrahamsen 
> Date: Mon, 30 Oct 2017 10:55:29 -0700
> Subject: [PATCH] Replace easy templates with org-insert-structure-template
>
> * lisp/org.el (org-insert-structure-template): New function for
>   wrapping region (or element at point) in a begin/end block.
>   (org-structure-predefined-blocks): New option holding predefined
>   blocks, for completion.
>   (org-try-structure-completion,
>   org-complete-expand-structure-template): Remove functions.
> * doc/org.texi (Inserting structure templates): Document.
> * testing/lisp/test-org.el (test-org/insert-template): New test.

Thank you. I applied your patch with the changes below.

> -* Info directory file:: Installing a manual in Info file hierarchy.
> +* Info directory file:: Installing a manual in Info file hierarchy.

Ignored.

> -* Easy templates::  Quick insertion of structural elements
> +* Inserting structure templates::  Wrapping text in code blocks

I used "Structure templates" instead of "Inserting structure templates"
and updated the rest of the "org.texi" accordingly.

> -@node Introduction
> +@node Introduction, Document structure, Top, Top

There is a lot of noise like this in your patch. I removed it.

> +With just a few keystrokes, it's possible to insert empty structural blocks,
> +such as @code{#+begin_src} and @code{#+end_src}, or to wrap existing text in
> +such a block.

Manual's conventions require to use uppercase keywords: #+BEGIN_SRC,
even though the function inserts them in lowercase.

> +@defun org-insert-structure-template
> +@kindex C-c C-x w

Manual uses

  @table @kbd
  @orgcmd(C-c C-x w, org-insert-structure-template)
  @end table

instead.

> +Prompt for a type of block structure, and insert the block at point.  If the
> +region is active, it will be wrapped in the block.  First prompts the user

"it is wrapped in the block"

GNU Manuals's convention is to favor present tense over future one.

> +@vindex org-structure-template-alist
> +Available structure types are defined in @code{org-structure-template-alist},
> +see the docstring for adding or changing values.
> +
> +@multitable @columnfractions 0.2 0.8
> +@item @kbd{s} @tab @code{src}
> +@item @kbd{e} @tab @code{example}
> +@item @kbd{E} @tab @code{export}
> +@item @kbd{q} @tab @code{quote}
> +@item @kbd{v} @tab @code{verse}
> +@item @kbd{c} @tab @code{center}
> +@item @kbd{C} @tab @code{comment}
> +@item @kbd{l} @tab @code{export latex}
> +@item @kbd{h} @tab @code{export html}
> +@item @kbd{a} @tab @code{export ascii}

@code{src} -> @samp{#+BEGIN_SRC}
...

I also re-ordered the entries.

> +  '((?s . "src")
> +(?e . "example")
> +(?E . "export")
> +(?q . "quote")
> +(?v . "verse")
> +(?c . "center")
> +(?C . "comment")
> +(?l . "export latex")
> +(?h . "export html")
> +(?a . "export ascii"))
>"Structure completion elements.

I re-ordered the entries.

> -This is a list of abbreviation keys and values.  The value gets inserted
> -if you type `<' followed by the key and then press the completion key,
> -usually `TAB'.  %file will be replaced by a file name after prompting
> -for the file using completion.  The cursor will be placed at the position
> -of the `?' in the template.
> -There are two templates for each key, the first uses the original Org syntax,
> -the second uses Emacs Muse-like syntax tags.  These Muse-like tags become
> -the default when the /org-mtags.el/ module has been loaded.  See also the
> -variable `org-mtags-prefer-muse-templates'."
> +This is an alist of characters and values.  When
> +`org-insert-structure-template' is called, an additional key is
> +read.  The key is first looked up in this alist, and the
> +corresponding structure is inserted, with \"#+begin\" and
> +\"#+end\" added automatically."

"#+BEGIN_" and "#+END_".

>:group 'org-completion
>:type '(repeat
> -   (list
> -(string :tag "Key")
> +   (cons
> +(character :tag "Key")
>  (string :tag "Template")))
> -  :version "26.1"
>:package-version '(Org . "8.3"))

"8.3" -> "9.2"

> +(defun org-insert-structure-template (type)
> +  "Insert a block structure of the type #+begin_foo/#+end_foo.
> +First read a character, which can be one of the keys in
> +`org-structure-template-alist'.  When it is , prompt the
> +user for a string to use.  With an active region, wrap the region
> +in the block.  Otherwise, insert an empty block."
> +  (interactive
> +   (list
> +(let* ((key (read-key "Key: "))
> +(struct-string
> + (or (cdr (assq key org-structure-template-alist))
> + (and (= key ?\t)
> +  (read-string "Structure type: "))
> + (error "'%c' has no structure definition" key

(user-error "`%c' ...")

> +  struct-string)))
> +  (let ((s (if 

Re: [O] Shouldn't org-back-to-heading skip inline tasks ?

2017-11-05 Thread Marc Ihm

Am 04.11.2017 um 22:15 schrieb Nicolas Goaziou:



Use `org-with-limited-levels' macro to ignore inlinetasks, e.g.:

   (org-with-limited-levels (org-back-to-heading))

This is how Org somewhat handles inlinetasks.

/me closes the can of worms.

Regards,



Good enough for me too. Thanx !

Best regards
Marc