Re: [O] what settings would make original export to pdf as good as pandoc conversion?

2018-03-13 Thread Eric S Fraga
On Monday, 12 Mar 2018 at 16:42, Samuel Wales wrote:
> seems to work.  the only thing is that the first page is blank with
> "[DEFAULT-PACKAGES] on it.  i tried commenting that part out and got a
> blank page.  i presume this is because i am using maint and not
> master.  again thanks.

Could you post a minimal example that illustrates this?
-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.6-191-g90607d


signature.asc
Description: PGP signature


Re: [O] [PATCH 3/6] Fix org-table-sort-lines test

2018-03-13 Thread Nicolas Goaziou
Sebastian Reuße  writes:

> * test-org-table.el (test-org-table/sort-lines): Fix and improve
> testcase.
>
> Sorting and reversing «a C b» should result in «C b a», not in «b a
> C».  This test did not fail previously only because
> org-table-sort-lines had an issue whereby sorts were always
> case-sensitive.

Applied. Thank you.



Re: [O] [PATCH 4/6] Fix string-collate-lessp shim

2018-03-13 Thread Nicolas Goaziou
Sebastian Reuße  writes:

> * org-compat.el (org-string-collate-lessp): When shimming
> string-collate-lessp, accept the same arguments as in the unshimmed
> case.

Applied. Thank you.



Re: [O] [PATCH] ob-sql.el: Improve Oracle connection and usage for ob-sql.

2018-03-13 Thread Nicolas Goaziou
Hello,

pierre.techouey...@free.fr (Pierre Téchoueyres) writes:

> Hello all Org's developpers,
> I would like to provide a small improvement to ob-sql : the possibility to
> connect to an oracle database by using the alias defined in TNSNAMES file.
>
> The patch joined here try to achive this. It also improve (slightly) the
> data fetching by removing unwanted trailing whitespaces provided by the
> LINESIZE directive.

Thank you.

Have you signed FSF papers? Otherwise, you need to add TINYCHANGE at the
end of your message?

Otherwise, it looks good. Would you mind adding an entry in ORG-NEWS
about it?


Regards,

-- 
Nicolas Goaziou



Re: [O] [PATCH 5/6] org-table-sort-lines: Fix case-sensitive sorting

2018-03-13 Thread Nicolas Goaziou
Sebastian Reuße  writes:

> * org-table.el (org-table-sort-lines): Fix case sensitive sorting,
> improve docstring.
> * test-org-table.el (test-org-table/sort-lines): Enforce C locale when
> testing alphabetic sorting.
>
> ‘sort-subr’ ignores ‘sort-fold-case’ when a predicate is provided. To
> correctly handle case-sensitivity, we now bake it into the predicate.
>
> Since we are now sorting according to the user’s locale, WITH-CASE
> will not make a difference in most instances, since most locales
> always sort case-insensitively (cf. how GNU sort ignores the ‘-f’
> switch).  We now mention this in the function docstring.
>
> In order to meaningfully test case-sensitive sorting, we now enforce
> the C locale in the respective unit test.

Applied. Thank you.



Re: [O] [PATCH 1/6] Fix alphabetic sorting for tables, plain lists

2018-03-13 Thread Nicolas Goaziou
Hello,

Sebastian Reuße  writes:

> * org-table.el (org-table-sort-lines): Use collated sorting.
> * org-list.el (org-sort-list): Use collated sorting.
>
> Cf. commit 551d2f1fe.

Applied. Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] [PATCH] Fix alphabetic string matching operators

2018-03-13 Thread Nicolas Goaziou
Sebastian Reuße  writes:

> * org.el (org-string<): Add.
> (org-op-to-function): Use it.
> (org-string> etc.): Use collated comparison.
>
> Cf. commit 551d2f1fe.

Applied. Thank you.



Re: [O] [PATCH 6/6] Improve ‘org-sort-list’ test

2018-03-13 Thread Nicolas Goaziou
Sebastian Reuße  writes:

> * test-org-list.el (test-org-list/sort): Take case-sensitive
> vs. insensitive sorting into account.

Applied. Thank you.



Re: [O] Link abbreviations: include abbreviation table and linkwords with spaces

2018-03-13 Thread ST

> > after reading "4.6 Link abbreviations" of the manual I have two
> > questions:
> >
> > 1. is it possible to define linkwords with spaces, like this: [[Harry
> > Potter:Chapter1]], it looks much more nice than
> > [[Harry_Potter:Chapter1]]?
> 
> I think so.

If yes, then it's really worth mentioning this fact in the manual (4.6
Link abbreviations) because ones get the impression that only - and _
are allowed. One of the most strong sides of org is its readability as
raw text and in this case space makes link more readable.

> 
> > 2. is it possible to define a "links catalog" of abbreviations, like
> >
> > #+LINK: bugzilla  http://10.1.2.9/bugzilla/show_bug.cgi?id=
> > #+LINK: googlehttp://www.google.com/search?q=%s
> >
> >
> > and then include them in all possible org files with
> >
> > #+INCLUDE: "links_catalog.org"
> 
> SETUPFILE would be more appropriate. Also, you can define abbreviations
> globally. See `org-link-abbrev-alist'.

I wanted to avoid `org-link-abbrev-alist' as it is Emacs specific, while
#+INCLUDE: is part of the org-mode standard which should work also on
other platforms (theoretically).

Thank you!





Re: [O] upgrade from 8.2 to 9.2 breaks agenda timestamp font?

2018-03-13 Thread Nicolas Goaziou
Hello,

David Belohrad  writes:

> yesterday evening i found by chance what it was. Problem of changed 
> definition of org-agenda-time-grid? Following definition is valid for org8, 
> but not org9:
>
> (setq org-agenda-time-grid '((daily require-timed)
>  ""
>  (800  900
>  1000
>  1100
>  1200
>  1300
>  1400
>  1500
>  1600
>  1700
>  1800
>  1900
>  2000
>  2100
>  2200)))
>
> I have removed that (anyways, not too often used), and the problem
> disappeared.

I suggest to read the "Incompatible changes" section for both Org 9.0
and Org 9.1 in ORG-NEWS.

Regards,

-- 
Nicolas Goaziou



Re: [O] [PATCH] add :session support for ob-js.el

2018-03-13 Thread Nicolas Goaziou
Hello,

stardiviner  writes:

> I added org-mode babel ob-js.el header argument :session.
>
> Following packages :session are supported:
>
> - skewer-mode
>
> - js-comint
>
> - Indium

I don't know any of these, but here come some comments about the code.

>  then create.  Return the initialized session."
>(unless (string= session "none")
>  (cond

Nitpick: You can merge the `unless' into the `cond'.

> - ((string= "*skewer-repl*" session)
> + ((and (string= "js-comint" org-babel-js-cmd) ; `js-comint'
> +(string= "*Javascript REPL*" session))
> +  (require 'js-comint)
> +  (let ((session-buffer "*Javascript REPL*"))
> + (if (and (org-babel-comint-buffer-livep (get-buffer session-buffer))
> +  (comint-check-proc session-buffer))
> + session-buffer
> +   (call-interactively 'run-js)

The `run-js' probably needs to be declared at the beginning of the file.

> +  (cond
> +   ;; Indium Node
> +   ((string= "*JS REPL*" session)
> +(require 'indium-repl)
> +(unless (get-buffer session)
> +  (indium-run-node))

The function above needs to be declared, too.

> +(indium-eval full-body))

So does this one.

> +   (t
> +(let ((session (org-babel-prep-session:js
> +(cdr (assq :session params)) params)))
> +  (nth 1
> +   (org-babel-comint-with-output
> +   (session (format "%S" org-babel-js-eoe) t 
> body)
> + (mapc   ; FIXME: stack on this scope when 
> `skewer-eval'

What does mean this FIXME?

> +  (lambda (line)

Nitpick: `mapc' + `lambda' -> `dolist'

>  (cond
> + ((string= "*skewer-repl*" session)
> +  (require 'skewer-repl)
> +  (let ((session-buffer (get-buffer "*skewer-repl*")))
> + (if (and (org-babel-comint-buffer-livep (get-buffer session-buffer))
> +  (comint-check-proc session-buffer))
> + session-buffer
> +   ;; start skewer REPL.
> +   (sit-for .5)

Why is this `sit-for' needed?

> +   (httpd-start)
> +   (run-skewer)

These functions need to be declared.

Regards,

-- 
Nicolas Goaziou



Re: [O] upgrade from 8.2 to 9.2 breaks agenda timestamp font?

2018-03-13 Thread David Belohrad
hello both,

yesterday evening i found by chance what it was. Problem of changed definition 
of org-agenda-time-grid? Following definition is valid for org8, but not org9:

(setq org-agenda-time-grid '((daily require-timed)
 ""
 (800  900
   1000
   1100
   1200
   1300
   1400
   1500
   1600
   1700
   1800
   1900
   2000
   2100
   2200)))

I have removed that (anyways, not too often used), and the problem disappeared.

thanks
.d.



Samuel Wales  writes:

> locale?



Re: [O] Link abbreviations: include abbreviation table and linkwords with spaces

2018-03-13 Thread Nicolas Goaziou
Hello,

ST  writes:

>> > after reading "4.6 Link abbreviations" of the manual I have two
>> > questions:
>> >
>> > 1. is it possible to define linkwords with spaces, like this: [[Harry
>> > Potter:Chapter1]], it looks much more nice than
>> > [[Harry_Potter:Chapter1]]?
>> 
>> I think so.
>
> If yes, then it's really worth mentioning this fact in the manual (4.6
> Link abbreviations) because ones get the impression that only - and _
> are allowed. One of the most strong sides of org is its readability as
> raw text and in this case space makes link more readable.

My bad. Spaces are not allowed, because

  #+LINK: linkword URL

would not be parse-able. The manual states

The linkword must be a word, starting with a letter, followed by
letters, numbers, ‘-’, and ‘_’.

but it seems implementation only disallows spaces (for LINK keyword) and
colons (for links).

Regards,

-- 
Nicolas Goaziou0x80A93738



Re: [O] Link abbreviations: include abbreviation table and linkwords with spaces

2018-03-13 Thread ST
> >> > after reading "4.6 Link abbreviations" of the manual I have two
> >> > questions:
> >> >
> >> > 1. is it possible to define linkwords with spaces, like this: [[Harry
> >> > Potter:Chapter1]], it looks much more nice than
> >> > [[Harry_Potter:Chapter1]]?
> >> 
> >> I think so.
> >
> > If yes, then it's really worth mentioning this fact in the manual (4.6
> > Link abbreviations) because ones get the impression that only - and _
> > are allowed. One of the most strong sides of org is its readability as
> > raw text and in this case space makes link more readable.
> 
> My bad. Spaces are not allowed, because
> 
>   #+LINK: linkword URL
> 
> would not be parse-able.

#+LINK: link word URL

Why should this not be parse-able? Cut #+LINK: from the beginning, URL
(last token) from the end, and the rest will be "link word", even with
(several) spaces in between...

Thanks.




Re: [O] [PATCH] org-src-edit support open edit buffer bellow current window

2018-03-13 Thread stardiviner

I regenerated the path file.

- mentioned `org-src-window-setup' in commit message
- added `TINYCHANGE` in commit message
- added change in `ORG-NEWS'
>From 762f6c06621e12c98031363fe3e70345e342ffeb Mon Sep 17 00:00:00 2001
From: stardiviner 
Date: Tue, 13 Mar 2018 01:23:52 +0800
Subject: [PATCH] org-src.el: (org-src-window-setup) support open edit src
 window below.

TINYCHANGE
---
 etc/ORG-NEWS| 2 ++
 lisp/org-src.el | 6 ++
 2 files changed, 8 insertions(+)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index da189eed5..10687ba83 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -107,6 +107,8 @@ document, use =shrink= value instead, or in addition to align:
 #+END_EXAMPLE
 
 ** New features
+*** Add support for open src block in below window
+Set option ~org-src-window-setup~ to ~'split-window-below~.
 *** Add support for links to LaTeX equations in HTML export
 Use MathJax links when enabled (by ~org-html-with-latex~), otherwise
 add a label to the rendered equation.
diff --git a/lisp/org-src.el b/lisp/org-src.el
index dfa2ae3de..5d3c2e538 100644
--- a/lisp/org-src.el
+++ b/lisp/org-src.el
@@ -155,6 +155,8 @@ Possible values for this option are:
 
 current-windowShow edit buffer in the current window, keeping all other
   windows.
+split-window-below Show edit buffer below the current window, keeping all
+   other windows.
 other-window  Use `switch-to-buffer-other-window' to display edit buffer.
 reorganize-frame  Show only two windows on the current frame, the current
   window and the edit buffer.  When exiting the edit buffer,
@@ -164,6 +166,7 @@ other-frame   Use `switch-to-buffer-other-frame' to display edit buffer.
   :group 'org-edit-structure
   :type '(choice
 	  (const current-window)
+	  (const split-window-below)
 	  (const other-frame)
 	  (const other-window)
 	  (const reorganize-frame)))
@@ -746,6 +749,9 @@ If BUFFER is non-nil, test it instead."
 (`current-window (pop-to-buffer-same-window buffer))
 (`other-window
  (switch-to-buffer-other-window buffer))
+(`split-window-below
+ (select-window (split-window-vertically))
+ (pop-to-buffer-same-window buffer))
 (`other-frame
  (pcase context
(`exit
-- 
2.16.2



Re: [O] [PATCH] add :session support for ob-js.el

2018-03-13 Thread stardiviner
updated my code. I followed your suggestions. But modify code one by one 
messed code up. So I merge all related commits into one commit. Sorry 
for this.



>From 23ef274fd418c876be85871f8da34738ae15ffd5 Mon Sep 17 00:00:00 2001
From: stardiviner 
Date: Thu, 8 Mar 2018 17:15:58 +0800
Subject: [PATCH] * ob-js.el: support :session for many JS packages.

- ob-js.el: support :session for js-comint.
- ob-js.el: support :session for Indium Node.js REPL.
- ob-js.el: (org-babel-js-initiate-session): merge the `unless' into the `cond'
---
 etc/ORG-NEWS  |   8 
 lisp/ob-js.el | 141 --
 2 files changed, 97 insertions(+), 52 deletions(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 10687ba83..5cbc10b8b 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -107,6 +107,14 @@ document, use =shrink= value instead, or in addition to align:
 #+END_EXAMPLE
 
 ** New features
+*** Add support for ob-js :session with Indium
+You can specify :session for js src block with ~*JS REPL*~.
+*** Add support for ob-js :session with js-comint
+After you launched js-comint REPL. You can specify :session for js
+src block with ~*Javascript REPL*~.
+*** Add support for ob-js :session with skewer-mode
+After you launched skewer-mode REPL. You can specify :session for js
+src block with ~*skewer-repl*~.
 *** Add support for open src block in below window
 Set option ~org-src-window-setup~ to ~'split-window-below~.
 *** Add support for links to LaTeX equations in HTML export
diff --git a/lisp/ob-js.el b/lisp/ob-js.el
index 38c8c39ac..93c08c162 100644
--- a/lisp/ob-js.el
+++ b/lisp/ob-js.el
@@ -41,6 +41,9 @@
 (require 'ob)
 
 (declare-function run-mozilla "ext:moz" (arg))
+(declare-function run-js "js-comint" (cmd))
+(declare-function indium-run-node "indium-nodejs" (command))
+(declare-function indium-eval "indium-interaction" (string  callback))
 
 (defvar org-babel-default-header-args:js '()
   "Default header arguments for js code blocks.")
@@ -52,7 +55,11 @@
   "Name of command used to evaluate js blocks."
   :group 'org-babel
   :version "24.1"
-  :type 'string)
+  :type '(choice (const "node")
+		 (const "mozrepl")
+		 (const "js-comint")
+		 (const "skewer-mode"))
+  :safe #'stringp)
 
 (defvar org-babel-js-function-wrapper
   "require('sys').print(require('sys').inspect(function(){\n%s\n}()));"
@@ -62,32 +69,40 @@
   "Execute a block of Javascript code with org-babel.
 This function is called by `org-babel-execute-src-block'"
   (let* ((org-babel-js-cmd (or (cdr (assq :cmd params)) org-babel-js-cmd))
+	   (session (cdr (assq :session params)))
  (result-type (cdr (assq :result-type params)))
  (full-body (org-babel-expand-body:generic
-		 body params (org-babel-variable-assignments:js params)))
-	 (result (if (not (string= (cdr (assq :session params)) "none"))
-		 ;; session evaluation
-		 (let ((session (org-babel-prep-session:js
- (cdr (assq :session params)) params)))
-		   (nth 1
-			(org-babel-comint-with-output
-(session (format "%S" org-babel-js-eoe) t body)
-			  (mapc
-			   (lambda (line)
- (insert (org-babel-chomp line))
- (comint-send-input nil t))
-			   (list body (format "%S" org-babel-js-eoe))
-		   ;; external evaluation
-		   (let ((script-file (org-babel-temp-file "js-script-")))
-		 (with-temp-file script-file
-		   (insert
-			;; return the value or the output
-			(if (string= result-type "value")
-			(format org-babel-js-function-wrapper full-body)
-			  full-body)))
-		 (org-babel-eval
-		  (format "%s %s" org-babel-js-cmd
-			  (org-babel-process-file-name script-file)) "")
+		 body params (org-babel-variable-assignments:js params)))
+	   (result (if (not (string= (cdr (assq :session params)) "none"))
+		 ;; session evaluation
+		 (cond
+		  ;; Indium Node
+		  ((string= "*JS REPL*" session)
+		   (require 'indium-repl)
+		   (unless (get-buffer session)
+			   (indium-run-node))
+		   (indium-eval full-body))
+		  (t
+		   (let ((session (org-babel-prep-session:js
+   (cdr (assq :session params)) params)))
+			   (nth 1
+			(org-babel-comint-with-output
+  (session (format "%S" org-babel-js-eoe) t body)
+(dolist ((code (list body (format "%S" org-babel-js-eoe
+  (lambda (code)
+(insert (org-babel-chomp code))
+(comint-send-input nil t
+		   ;; external evaluation
+		   (let ((script-file (org-babel-temp-file "js-script-")))
+		 (with-temp-file 

Re: [O] [PATCH] org-src-edit support open edit buffer bellow current window

2018-03-13 Thread Nicolas Goaziou
Hello,

stardiviner  writes:

> Add a more better way to open src block.

Thank you.

> From d0db82e0b3f7e6ff0102b4b08ba18de883da32e2 Mon Sep 17 00:00:00 2001
> From: stardiviner 
> Date: Tue, 13 Mar 2018 01:23:52 +0800
> Subject: [PATCH] org-src.el: (org-edit-src) support open edit src window
>  below.

Your commit message is incomplete as you didn't mention you modified the
variable `org-src-window-setup'.

Also, would you mind adding an ORG-NEWS entry about it?

Regards,

-- 
Nicolas Goaziou



Re: [O] org mode error "pdf wasn't produced"

2018-03-13 Thread Eric S Fraga
On Monday, 12 Mar 2018 at 15:40, Dereje Tefera wrote:
> I can export to HTML or tet latex but not to pdf.
> Any help would be highly appreciated.

Switch to the buffer "*Org PDF LaTeX Output*" and scroll through it to
see what errors LaTeX generated in trying to generate the PDF.

You could also have a look at the LaTeX file created by org.

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.6-191-g90607d


signature.asc
Description: PGP signature


Re: [O] [PATCH] ob-sql.el: Improve Oracle connection and usage for ob-sql.

2018-03-13 Thread pierre . techoueyres

Hello,

Hello Nicolas,


pierre.techouey...@free.fr (Pierre Téchoueyres) writes:


Hello all Org's developpers,
I would like to provide a small improvement to ob-sql : the 
possibility to
connect to an oracle database by using the alias defined in TNSNAMES 
file.


The patch joined here try to achive this. It also improve (slightly) 
the
data fetching by removing unwanted trailing whitespaces provided by 
the

LINESIZE directive.


Thank you.

Have you signed FSF papers? Otherwise, you need to add TINYCHANGE at 
the

end of your message?


Normally, I've done this some time ago for TRAMP and EMACS core (I 
think).


Otherwise, it looks good. Would you mind adding an entry in ORG-NEWS
about it?


Yes, I'll try to send a new patch soon.



Regards,




[O] Capture template expansion: feature or bug?

2018-03-13 Thread François Allisson
Hello everyone,

When one uses the following template expansion,

> %^{prop}p   Prompt the user for a value for property ‘prop’.

it supposes one to supply a non-empty string of characters. If one
simply hits RETURN on a given prompt for property, the capture process
ends with an

> org-capture: Capture abort: (quit)

message. This means that all prompts for properties are mandatory. It
this a feature or a bug?

Of course, if I ask the question, it is because I clearly see use cases
for optional properties prompts (which would leave empty the property in
question): you ask for several information, which you don't always have;
and you don't want the capture process to quit because of that. But may
be there is a better way to achieve this?

Many thanks in advance for your time!

Best,
François
--
Org 9.0.10 / Emacs 25.2.1
http://francois.allisson.co



[O] org mode error "pdf wasn't produced"

2018-03-13 Thread Dereje Tefera
Dear good team of Org-mode,

I am using org-mode in the Emacs, but I have a problem exporting to Latex,
PDF.

"I always have this message that says, PDF was not produced, when i try to
export to latex pdf.


I can export to HTML or tet latex but not to pdf.


Any help would be highly appreciated.


Thank you for your time.



Regards

Dereje


Re: [O] org mode error "pdf wasn't produced"

2018-03-13 Thread R Jain
Hi Dereje,Have you already looked at (8) from https://orgmode.org/worg/org-tutorials/org-latex-export.html?--Rishabh
  

On Mar 12 2018, at 5:40 pm, Dereje Tefera  wrote:


  Dear good team of Org-mode,I am using org-mode in the Emacs, but I have a problem exporting to Latex,  PDF."I always have this message that says, PDF was not produced, when i try to export to latex pdf. I can export to HTML or tet latex but not to pdf. Any help would be highly appreciated.Thank you for your time.RegardsDereje 



  



[O] org export to PDF src block syntax highlighting not working

2018-03-13 Thread stardiviner

I use the following settings to toggle src block syntax highlighting:

#+begin_src emacs-lisp

;;; export to PDF with src blocks syntax highlighting.
(setq org-latex-listings 'minted)
(add-to-list 'org-latex-packages-alist '("newfloat" "minted" "color"))
(add-to-list 'org-latex-pdf-process
 '("latexmk -shell-escape -bibtex -f -pdf %f"))
(setq org-latex-minted-options
  '(("frame" "lines")
    ("linenos" "true")
    ("bgcolor" "bg")
    ))
#+end_src


In attachment, has the org-mode template file.



org-export-template.org
Description: Lotus Organizer


Re: [O] Export to LaTeX buffer

2018-03-13 Thread Hoffmann, Jobst
Am Montag, den 12.03.2018, 20:53 +0100 schrieb Nicolas Goaziou:
> "Hoffmann, Jobst"  writes:
> 
> > I'm using Fedora with a packaged emacs and an .rpm package emacs-
> > commons, which contains beside other packages that I use the org
> > files
> > in a directory org.
> > 
> > On the load path there comes org from git first, if I open an .org
> > file,
> >  "org-version" shows the current version number (Org mode version
> > 9.1.7
> > (release_9.1.7-506-g0de818 @ /path/to/my/installation) but "org-
> > latex-
> > export-as-latex" still doesn't work, it ends with the above
> > mentioned
> > error message.
> > 
> > Do you have any idea how to get around that behavior?
> 
> Have you run "make" from the Org repository? It could fix autoloads.

Yes, I even did a clean install:

git clone

and the commands as described in "Using Org’s git repository":

CURR_DIR=$(pwd)
# make test
make
make doc
make refcard
make config

printf "Only root can do this...\n"
sudo make --directory=${CURR_DIR} install

This is what the installation process said:

= Emacs executable and Installation paths
EMACS   = emacs
DESTDIR = 
ORGCM   = dirall
ORG_MAKE_DOC= info html pdf
lispdir = /usr/share/emacs/site-lisp/org
infodir = /usr/share/info
datadir = /usr/share/emacs/etc/org
testdir = /tmp/tmp-orgtest
= Additional files from contrib/lisp

= Org version
make:  Org mode version 9.1.7 (release_9.1.7-516-gbc7b24.dirty =>
/usr/share/emacs/site-lisp/org)

As there is no real error, I can't produce a backtrace, but I try to
follow the call chain of the uncompiled files - at the moment without
success.

I'm quite desperated, do you have an idea?

Best regards
Jobst
-- 
Prof. Dr. Jobst HoffmannTel:   +49 (241) 6009-5 31 59
Fachhochschule Aachen Abt. Jülich   Fax:   +49 (241) 6009-5 31 89
Fachbereich 09  email: j.hoffm...@fh-aachen.de


[O] [BUG] org-sort-entries errors out when headline is empty

2018-03-13 Thread Sebastian Reuße
So, I’ve noticed that when sorting a subtree (alphabetically or numerically),
‘org-sort-entries’ will raise an error arising from the call to
‘org-sort-remove-invisible’ (lines 8761 and 8766 in bc7b24d0d).

I’m following up with a test. The error is triggered by the capture group in
‘org-complex-heading-regexp’ returning nil, which is then passed on to
‘org-sort-remove-invisible’, which expects a string and chokes on the nil.

As for a fix, the quick fix would be guarding against this case in
‘org-sort-remove-invisible’, but that seemed a bit meh since sanitation should
probably be handled higher up.

An alternative is to guard inside ‘org-sort-entries’. I’m following up with an
implementation of this.

I was also wondering if it might make sense to tweak
‘org-complex-heading-regexp’ so that the respective capture group captures an
empty string. This could be achieved by making the title group greedy again
(reverting 9d334897e). Whether we want this probably depends on the motivation
for 9d334897e. However, doing so would be more consistent with the org-elements
API, which does assign a tag list to the title property when the heading is
otherwise empty.

Any thoughts?

Kind regards,
SR

-- 
Insane cobra split the wood
Trader of the lowland breed
Call a jittney, drive away
In the slipstream we will stay




[O] [PATCH 1/2] Extend org-sort-entries test

2018-03-13 Thread Sebastian Reuße
* test-org.el (test-org/sort-entries): Test with empty headings.
---
 testing/lisp/test-org.el | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index 33769aafa..8c98fce4d 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -2745,6 +2745,11 @@
  (org-test-with-temp-text "\n* def\n* xyz\n* abc\n"
(org-sort-entries nil ?A)
(buffer-string
+  (should
+   (equal "\n* \n* klm\n* xyz\n"
+ (org-test-with-temp-text "\n* xyz\n* \n* klm\n"
+   (org-sort-entries nil ?a)
+   (buffer-string
   ;; Sort numerically.
   (should
(equal "\n* 1\n* 2\n* 10\n"
@@ -2756,6 +2761,11 @@
  (org-test-with-temp-text "\n* 10\n* 1\n* 2\n"
(org-sort-entries nil ?N)
(buffer-string
+  (should
+   (equal "\n* \n* 1\n* 2\n"
+ (org-test-with-temp-text "\n* 1\n* \n* 2\n"
+   (org-sort-entries nil ?n)
+   (buffer-string
   ;; Sort by custom function.
   (should
(equal "\n* b\n* aa\n* ccc\n"
-- 
2.16.2




Re: [O] org alters output of bash code blocks when run with :session

2018-03-13 Thread Tyler Smith
On Mon, Feb 26, 2018, at 6:27 AM, Nicolas Goaziou wrote:
> Tyler Smith  writes:
> >
> > How do I force the babel session to leave the output alone, and print
> > it verbatim into the org file?
> 
> It may be related to other problems related to prompt in shell sessions.
> See for example
> ,
> , and for
> step forward a solution
> .
> 
> Patches welcome!

It looks like ob-shell sets up sessions just by calling `shell`, which means 
all the user's customizations for shell-mode are automatically applied. This 
includes setting the prompt (e.g., from .emacs.d/init_bash.sh), as well as the 
value of `comint-prompt-regexp`.

I can't see any straightforward way to modify ob-shell sessions without also 
changing regular shell-mode. So I wonder if the easiest way to address this 
would be to create a new mode derived from shell-mode, ('ob-shell-mode')? That 
would give us a way to modify the prompt code inside babel without interfering 
with shell-mode.

If that sounds sensible I can put together a patch for ob-shell.el. Let me know 
what you think.

Best,

Tyler



[O] [PATCH 2/2] Guard against empty headings when sorting

2018-03-13 Thread Sebastian Reuße
* org.el (org-sort-entries): Guard against empty headings when sorting
alphabetically, numerically.

Due to how ‘org-complex-heading-regexp’ is defined, the title capture group
currently returns nil in empty headings, which we don’t want to pass on to
‘org-sort-remove-invisible’.
---
 lisp/org.el | 18 ++
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 76bc60c88..07203c9e1 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -8756,15 +8756,17 @@ (defun org-sort-entries
  (lambda ()
(cond
 ((= dcst ?n)
- (if (looking-at org-complex-heading-regexp)
- (string-to-number
-  (org-sort-remove-invisible (match-string 4)))
-   nil))
+ (let ((heading (and (looking-at org-complex-heading-regexp)
+ (match-string 4
+   (if heading
+   (string-to-number (org-sort-remove-invisible heading))
+ 0)))
 ((= dcst ?a)
- (if (looking-at org-complex-heading-regexp)
- (funcall case-func
-  (org-sort-remove-invisible (match-string 4)))
-   nil))
+ (let ((heading (and (looking-at org-complex-heading-regexp)
+ (match-string 4
+   (if heading
+   (funcall case-func (org-sort-remove-invisible heading))
+ "")))
 ((= dcst ?k)
  (or (get-text-property (point) :org-clock-minutes) 0))
 ((= dcst ?t)
-- 
2.16.2




Re: [O] Structured links to headings with endless depth

2018-03-13 Thread John Kitchin
This is a tricky problem to generally solve. I think this does it
approximately well enough. It is lightly tested and works by exactly
matching headlines at subsequent levels. It will be problematic if you have
headlines with : in them, and it assumes there is a level 1 headline to
start in.

#+BEGIN_SRC emacs-lisp
(defun xpath-follow (path)
  (let* ((fields (split-string path "::"))
(fname (car fields))
(paths (split-string (cadr fields) ":"))
(level 0)
(current-point (point))
cp hls n found)
(org-mark-ring-push)
(find-file fname)
(save-restriction
  (while paths
(setq cp (pop paths))
(incf level)
(setq hls (org-element-map (org-element-parse-buffer) 'headline
(lambda (hl)
  (when (eq level (org-element-property :level hl))
hl
(setq n (-find-index (lambda (hl)
   (string= cp (org-no-properties
(org-element-property :raw-value hl
 hls))
(if (not n)
(progn
  (goto-char current-point)
  (user-error "%s not found" cp))
  (goto-char (org-element-property :begin (nth n hls)))
  (org-narrow-to-subtree))

(org-link-set-parameters
 "xpath"
 :follow 'xpath-follow)
#+END_SRC


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, Mar 12, 2018 at 8:08 AM, ST  wrote:

> Hello,
>
> Ss Christian has pointed out - introduce a separate CUSTOM_ID for text
> with fixed structure and rather short verses is too heavy.
>
> I do need to write a custom link type, if this use case is not of common
> interest for the orgmode community.
>
> Thank you,
>
>
> On Mon, 2018-03-12 at 15:10 +0100, Nicolas Goaziou wrote:
> > Hello,
> >
> > ST  writes:
> >
> > > I'm not that experienced in writing in lisp. Is it difficult to create
> > > such custom link type? What is the closest link type that you would
> > > recommend to take as starting point (link on code, if possible)?
> >
> > I'm not answering your question, but I suggest to use a CUSTOM_ID
> > instead. This is readily available.
> >
> > Regards,
> >
>
>
>


Re: [O] org mode error "pdf wasn't produced"

2018-03-13 Thread John Hendy
Dejere,


Org-mode is not able to find your latex installation. That's the
problem, just as it says: it's trying to run the compilation command,
`pdflatex` and it can find no such thing.

Either it's not installed, or it's not in your path. The more details
you can provide, the better. For starters 1) what latex variant is
installed and 2) is it in your path (and how do you know)?


Best regards,
John

On Tue, Mar 13, 2018 at 7:29 PM, Dereje Tefera  wrote:
>
> Hi Prof. Kitchin and others,
>
> I am using Emacs-org-mode on a windows machine and launch the program from 
> the desktop shortcut.
>
>
>
>
> Regards
>
> Dereje
>
>
>
> On Tue, Mar 13, 2018 at 6:05 PM, John Kitchin  wrote:
>>
>> That means emacs is not finding pdflatex on your path.
>>
>> A little more information might help.
>>
>> 1. In a terminal, if you type:
>>
>> > which pdflatex
>>
>> to you get anything?
>>
>> 2. How do you launch emacs? If you are launching it from some icon, you 
>> might not be getting the same path environment as from a shell.
>>
>> 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 Tue, Mar 13, 2018 at 4:37 PM, Dereje Tefera  wrote:
>>>
>>> Hi Everyone,
>>>
>>> thank you very much for the response.
>>>
>>> Rishabh, yes i have check the link you mentioned.
>>>
>>> the error  says "'pdflatex"' is not recognized as an internal or external 
>>> command,
>>> operable program or batch file." but i have that in my init.el file 
>>> configured.
>>>
>>>
>>>
>>>
>>>
>>>
>>> Regards
>>>
>>> Dereje
>>>
>>>
>>>
>>> On Tue, Mar 13, 2018 at 6:28 AM, R Jain  wrote:

 Hi Dereje,

 Have you already looked at (8) from 
 https://orgmode.org/worg/org-tutorials/org-latex-export.html?

 --Rishabh

 On Mar 12 2018, at 5:40 pm, Dereje Tefera  wrote:
>
> Dear good team of Org-mode,
>
> I am using org-mode in the Emacs, but I have a problem exporting to 
> Latex,  PDF.
>
> "I always have this message that says, PDF was not produced, when i try 
> to export to latex pdf.
>
>
> I can export to HTML or tet latex but not to pdf.
>
>
> Any help would be highly appreciated.
>
>
> Thank you for your time.
>
>
>
> Regards
>
> Dereje
>
>
>>>
>>
>



Re: [O] org mode error "pdf wasn't produced"

2018-03-13 Thread John Hendy
Oops. Sincere apologies for misspelling your name, Dereje! I misread
in my hasty skim.

John

On Tue, Mar 13, 2018 at 8:28 PM, John Hendy  wrote:
> Dejere,
>
>
> Org-mode is not able to find your latex installation. That's the
> problem, just as it says: it's trying to run the compilation command,
> `pdflatex` and it can find no such thing.
>
> Either it's not installed, or it's not in your path. The more details
> you can provide, the better. For starters 1) what latex variant is
> installed and 2) is it in your path (and how do you know)?
>
>
> Best regards,
> John



Re: [O] [PATCH 1/3] ob-table: Fix org-sbe's handling of quotes in arguments

2018-03-13 Thread Vladimir Panteleev

Hi,

On 2018-03-12 23:15, Nicolas Goaziou wrote:

The dollar character looks strange. What syntax is that?


I agree that it is strange. I mentioned it (and its strangeness) in the 
cover-letter. The documentation of org-sbe describes it as well.



+#+name: identity
+#+begin_src emacs-lisp :eval yes
+  x
+#+end_src"
+(should (equal "a\"b\"c"
+  (eval '(org-sbe identity (x $ "a\"b\"c")))


Why `eval'? Why not simply (org-sbe identity (x ...)) ?


Ah, I guess that's another "funny" thing about org-sbe that I forgot to 
mention. It is a macro, but it does some things that are rather 
non-macro-y. In this case, eval is required, otherwise it will attempt 
to parse the Org document during Lisp *compilation*, and you will see:


Eager macro-expansion failure: (error "Reference ‘identity’ not found in 
this buffer")
Eager macro-expansion failure: (error "Reference ‘identity’ not found in 
this buffer")

Reference ‘identity’ not found in this buffer

--
Best regards,
 Vladimir



Re: [O] [PATCH] ob-sql.el: Improve Oracle connection and usage for ob-sql.

2018-03-13 Thread Pierre Téchoueyres
Nicolas Goaziou  writes:
> ...
> Otherwise, it looks good. Would you mind adding an entry in ORG-NEWS
> about it?
Hello Nicolas,

What dou you think about the attached patch ?

>From 0103a07b10915ce7c919b8a6858beff3dbd7e45f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pierre=20T=C3=A9choueyres?= 
Date: Thu, 8 Mar 2018 23:37:29 +0100
Subject: [PATCH] ob-sql.el: Improve Oracle connection and usage for ob-sql.

* lisp/ob-sql.el  (org-babel-sql-dbstring-oracle): don't use empty
args. This allow use of alias defined in Oracle's TNSNAMES files.
(org-babel-execute:sql): don't feed lines with trailing spaces. This
also improve speed for retrieving data.
---
 etc/ORG-NEWS   | 18 ++
 lisp/ob-sql.el | 11 +--
 2 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 77373d442..11fe4395d 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -199,6 +199,24 @@ you should expect to see something like:
 #+BEGIN_EXAMPLE
   ,#+STARTUP: shrink
 #+END_EXAMPLE
+*** Add support for Oracle's database alias in Babel blocks
+=ob-sql= library already support running SQL blocks against an Oracle
+database using ~sqlplus~.  Now it's possible to use alias names
+defined in TNSNAMES file instead of specifying full connection
+parameters.  See example bellow.
+
+#+BEGIN_SRC org
+  you can use the previous full connection parameters
+  ,#+BEGIN_SRC sql :engine oracle :dbuser me :dbpassword my_insecure_password :database my_db_name :dbhost my_db_host :dbport 1521
+  select sysdate from dual;
+  ,#+END_SRC
+
+  or the alias defined in your TNSNAMES file
+  ,#+BEGIN_SRC sql :engine oracle :dbuser me :dbpassword my_insecure_password :database my_tns_alias
+  select sysdate from dual;
+  ,#+END_SRC
+#+END_SRC
+
 ** New functions
 *** ~org-insert-structure-template~
 
diff --git a/lisp/ob-sql.el b/lisp/ob-sql.el
index 959ede3de..3ad7906cf 100644
--- a/lisp/ob-sql.el
+++ b/lisp/ob-sql.el
@@ -111,8 +111,14 @@ Pass nil to omit that arg."
 	   (when database (concat "-d" database))
 
 (defun org-babel-sql-dbstring-oracle (host port user password database)
-  "Make Oracle command line args for database connection."
-  (format "%s/%s@%s:%s/%s" user password host port database))
+  "Make Oracle command line args for database connection.
+
+If PORT and DATABASE are nil then don't pass them. This allow you to
+use names defined in your TNSNAMES file."
+  (format "%s/%s@%s%s" user password host
+	  (if (and port database)
+	  (format ":%s/%s" port database)
+	"")))
 
 (defun org-babel-sql-dbstring-mssql (host user password database)
   "Make sqlcmd command line args for database connection.
@@ -241,6 +247,7 @@ SET NEWPAGE 0
 SET TAB OFF
 SET SPACE 0
 SET LINESIZE 
+SET TRIMOUT ON TRIMSPOOL ON
 SET ECHO OFF
 SET FEEDBACK OFF
 SET VERIFY OFF
-- 
2.14.3



Re: [O] org mode error "pdf wasn't produced"

2018-03-13 Thread Dereje Tefera
Hi Everyone,

thank you very much for the response.

Rishabh, yes i have check the link you mentioned.

the error  says "'pdflatex"' is not recognized as an internal or external
command,
operable program or batch file." but i have that in my init.el file
configured.






Regards

Dereje



On Tue, Mar 13, 2018 at 6:28 AM, R Jain  wrote:

> Hi Dereje,
>
> Have you already looked at (8) from https://orgmode.org/worg/
> org-tutorials/org-latex-export.html?
>
> --Rishabh
>
> On Mar 12 2018, at 5:40 pm, Dereje Tefera  wrote:
>
>> Dear good team of Org-mode,
>>
>> I am using org-mode in the Emacs, but I have a problem exporting to
>> Latex,  PDF.
>>
>> "I always have this message that says, PDF was not produced, when i try
>> to export to latex pdf.
>>
>>
>> I can export to HTML or tet latex but not to pdf.
>>
>>
>> Any help would be highly appreciated.
>>
>>
>> Thank you for your time.
>>
>>
>>
>> Regards
>>
>> Dereje
>>
>>
>>


Re: [O] org mode error "pdf wasn't produced"

2018-03-13 Thread John Kitchin
That means emacs is not finding pdflatex on your path.

A little more information might help.

1. In a terminal, if you type:

> which pdflatex

to you get anything?

2. How do you launch emacs? If you are launching it from some icon, you
might not be getting the same path environment as from a shell.

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 Tue, Mar 13, 2018 at 4:37 PM, Dereje Tefera  wrote:

> Hi Everyone,
>
> thank you very much for the response.
>
> Rishabh, yes i have check the link you mentioned.
>
> the error  says "'pdflatex"' is not recognized as an internal or external
> command,
> operable program or batch file." but i have that in my init.el file
> configured.
>
>
>
>
>
>
> Regards
>
> Dereje
>
>
>
> On Tue, Mar 13, 2018 at 6:28 AM, R Jain  wrote:
>
>> Hi Dereje,
>>
>> Have you already looked at (8) from https://orgmode.org/worg/
>> org-tutorials/org-latex-export.html?
>>
>> --Rishabh
>>
>> On Mar 12 2018, at 5:40 pm, Dereje Tefera  wrote:
>>
>>> Dear good team of Org-mode,
>>>
>>> I am using org-mode in the Emacs, but I have a problem exporting to
>>> Latex,  PDF.
>>>
>>> "I always have this message that says, PDF was not produced, when i try
>>> to export to latex pdf.
>>>
>>>
>>> I can export to HTML or tet latex but not to pdf.
>>>
>>>
>>> Any help would be highly appreciated.
>>>
>>>
>>> Thank you for your time.
>>>
>>>
>>>
>>> Regards
>>>
>>> Dereje
>>>
>>>
>>>
>


Re: [O] org mode error "pdf wasn't produced"

2018-03-13 Thread Dereje Tefera
Hi Prof. Kitchin and others,

I am using Emacs-org-mode on a windows machine and launch the program from
the desktop shortcut.




Regards

Dereje



On Tue, Mar 13, 2018 at 6:05 PM, John Kitchin 
wrote:

> That means emacs is not finding pdflatex on your path.
>
> A little more information might help.
>
> 1. In a terminal, if you type:
>
> > which pdflatex
>
> to you get anything?
>
> 2. How do you launch emacs? If you are launching it from some icon, you
> might not be getting the same path environment as from a shell.
>
> John
>
> ---
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803 <(412)%20268-7803>
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>
>
> On Tue, Mar 13, 2018 at 4:37 PM, Dereje Tefera  wrote:
>
>> Hi Everyone,
>>
>> thank you very much for the response.
>>
>> Rishabh, yes i have check the link you mentioned.
>>
>> the error  says "'pdflatex"' is not recognized as an internal or external
>> command,
>> operable program or batch file." but i have that in my init.el file
>> configured.
>>
>>
>>
>>
>>
>>
>> Regards
>>
>> Dereje
>>
>>
>>
>> On Tue, Mar 13, 2018 at 6:28 AM, R Jain  wrote:
>>
>>> Hi Dereje,
>>>
>>> Have you already looked at (8) from https://orgmode.org/worg/
>>> org-tutorials/org-latex-export.html?
>>>
>>> --Rishabh
>>>
>>> On Mar 12 2018, at 5:40 pm, Dereje Tefera  wrote:
>>>
 Dear good team of Org-mode,

 I am using org-mode in the Emacs, but I have a problem exporting to
 Latex,  PDF.

 "I always have this message that says, PDF was not produced, when i try
 to export to latex pdf.


 I can export to HTML or tet latex but not to pdf.


 Any help would be highly appreciated.


 Thank you for your time.



 Regards

 Dereje



>>
>