Re: [O] [PATCH] Add support for Babel with Eshell, (updated PATCH)

2018-04-21 Thread stardiviner
In this latest PATCH, contains fix of ob-shell :session initialize and 
execution.

From 596da7b0384d64f3c1c22a49bc9bced8d0d8abf8 Mon Sep 17 00:00:00 2001
From: stardiviner 
Date: Sun, 22 Apr 2018 09:37:40 +0800
Subject: [PATCH] ob-eshell.el: Add Eshell support for Babel.

* lisp/ob-eshell.el (org-babel-execute:eshell): Execute Eshell code in Babel.
(org-babel-prep-session:eshell):
(ob-eshell-session-live-p):
(org-babel-eshell-initiate-session):
(org-babel-variable-assignments:eshell):
(org-babel-load-session:eshell):

* testing/test-ob-eshell.el: Write test for ob-eshell.

* doc/org-manual.org (Languages): Add document for ob-eshell.
---
 doc/org-manual.org |   1 +
 lisp/ob-eshell.el  | 100 +
 testing/lisp/test-ob-eshell.el |  73 
 3 files changed, 174 insertions(+)
 create mode 100644 lisp/ob-eshell.el
 create mode 100644 testing/lisp/test-ob-eshell.el

diff --git a/doc/org-manual.org b/doc/org-manual.org
index 0ffa73911..38a6e8fa4 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -17579,6 +17579,7 @@ Code blocks in the following languages are supported.
 | D  | d  | ditaa  | ditaa  |
 | Graphviz   | dot| Emacs Calc | calc   |
 | Emacs Lisp | emacs-lisp | Fortran| fortran|
+| Shell  | sh | Eshell | eshell |
 | Gnuplot| gnuplot| Haskell| haskell|
 | Java   | java   | Javascript | js |
 | LaTeX  | latex  | Ledger | ledger |
diff --git a/lisp/ob-eshell.el b/lisp/ob-eshell.el
new file mode 100644
index 0..1553ebdb2
--- /dev/null
+++ b/lisp/ob-eshell.el
@@ -0,0 +1,100 @@
+;;; ob-eshell.el --- Babel Functions for Eshell-*- lexical-binding: t; -*-
+
+;; Copyright (C) 2009-2018 Free Software Foundation, Inc.
+
+;; Author: stardiviner 
+;; Keywords: literate programming, reproducible research
+;; Homepage: https://orgmode.org
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see .
+
+;;; Commentary:
+
+;; Org-Babel support for evaluating Eshell source code.
+
+;;; Code:
+(require 'ob)
+(require 'eshell)
+
+(defvar org-babel-default-header-args:eshell '())
+
+(defun org-babel-execute:eshell (body params)
+  "Execute a block of Eshell code.
+This function is called by `org-babel-execute-src-block'."
+  (let* ((session (org-babel-eshell-initiate-session
+		   (cdr (assq :session params
+	 (full-body (org-babel-expand-body:generic
+		 body params (org-babel-variable-assignments:eshell params
+(if session
+	(progn
+	  (with-current-buffer session
+	(dolist (line (split-string full-body "\n"))
+	  (goto-char eshell-last-output-end)
+	  (insert line)
+	  (eshell-send-input))
+	;; get output of last input
+	;; TODO: collect all output instead of last command's output.
+	(goto-char eshell-last-input-end)
+	(buffer-substring-no-properties (point) eshell-last-output-start)))
+  (with-temp-buffer
+	(eshell-command full-body t)
+	(buffer-string)
+
+(defun org-babel-prep-session:eshell (session params)
+  "Prepare SESSION according to the header arguments specified in PARAMS."
+  (let* ((session (org-babel-eshell-initiate-session session))
+	 ;; Eshell session buffer is read from variable `eshell-buffer-name'.
+	 (eshell-buffer-name session)
+	 (var-lines (org-babel-variable-assignments:eshell params)))
+(call-interactively 'eshell)
+(dolist (var-line var-lines)
+  (eshell-command var-line))
+session))
+
+(defun ob-eshell-session-live-p (session)
+  "Detect Eshell SESSION exist."
+  (and (get-buffer session) t))
+
+(defun org-babel-eshell-initiate-session ( session params)
+  "Initiate a session named SESSION according to PARAMS."
+  (when (and session (not (string= session "none")))
+(save-window-excursion
+  (or (ob-eshell-session-live-p session)
+	  (progn
+	(let ((eshell-buffer-name session))
+	  (eshell))
+	(get-buffer (current-buffer)
+session))
+
+(defun org-babel-variable-assignments:eshell (params)
+  "Convert ob-eshell :var specified variables into Eshell variables assignments."
+  (mapcar
+   (lambda (pair)
+ (format "(setq %s %S)" (car pair) (cdr pair)))
+   (org-babel--get-vars params)))
+
+(defun 

Re: [O] [PATCH] Add support for Babel with Eshell, and some questions

2018-04-21 Thread stardiviner
Ahh, forgot include my patches.

From 132c94b9b40fd9ba694fa4338f325582771c53ec Mon Sep 17 00:00:00 2001
From: stardiviner 
Date: Sun, 22 Apr 2018 09:37:40 +0800
Subject: [PATCH] ob-eshell.el: Add Eshell support for Babel.

* lisp/ob-eshell.el (org-babel-execute:eshell): Execute Eshell code in Babel.
(org-babel-prep-session:eshell):
(ob-eshell-session-live-p):
(org-babel-eshell-initiate-session):
(org-babel-variable-assignments:eshell):
(org-babel-load-session:eshell):

* testing/test-ob-eshell.el: Write test for ob-eshell.

* doc/org-manual.org (Languages): Add document for ob-eshell.
---
 doc/org-manual.org |  1 +
 lisp/ob-eshell.el  | 98 ++
 testing/lisp/test-ob-eshell.el | 73 +
 3 files changed, 172 insertions(+)
 create mode 100644 lisp/ob-eshell.el
 create mode 100644 testing/lisp/test-ob-eshell.el

diff --git a/doc/org-manual.org b/doc/org-manual.org
index 0ffa73911..38a6e8fa4 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -17579,6 +17579,7 @@ Code blocks in the following languages are supported.
 | D  | d  | ditaa  | ditaa  |
 | Graphviz   | dot| Emacs Calc | calc   |
 | Emacs Lisp | emacs-lisp | Fortran| fortran|
+| Shell  | sh | Eshell | eshell |
 | Gnuplot| gnuplot| Haskell| haskell|
 | Java   | java   | Javascript | js |
 | LaTeX  | latex  | Ledger | ledger |
diff --git a/lisp/ob-eshell.el b/lisp/ob-eshell.el
new file mode 100644
index 0..25e52e9e8
--- /dev/null
+++ b/lisp/ob-eshell.el
@@ -0,0 +1,98 @@
+;;; ob-eshell.el --- Babel Functions for Eshell-*- lexical-binding: t; -*-
+
+;; Copyright (C) 2009-2018 Free Software Foundation, Inc.
+
+;; Author: stardiviner 
+;; Keywords: literate programming, reproducible research
+;; Homepage: https://orgmode.org
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see .
+
+;;; Commentary:
+
+;; Org-Babel support for evaluating Eshell source code.
+
+;;; Code:
+(require 'ob)
+(require 'eshell)
+
+(defvar org-babel-default-header-args:eshell '())
+
+(defun org-babel-execute:eshell (body params)
+  "Execute a block of Eshell code.
+This function is called by `org-babel-execute-src-block'."
+  (let* ((session (org-babel-eshell-initiate-session
+		   (cdr (assq :session params
+	 (full-body (org-babel-expand-body:generic
+		 body params (org-babel-variable-assignments:eshell params
+(if session
+	(progn
+	  (with-current-buffer session
+	(goto-char eshell-last-output-end)
+	(dolist (line (split-string full-body))
+	  (insert line))
+	(eshell-send-input)
+	;; get output of last input
+	(goto-char eshell-last-input-end)
+	(buffer-substring-no-properties (point) eshell-last-output-start)))
+  (with-temp-buffer
+	(eshell-command full-body t)
+	(buffer-string)
+
+(defun org-babel-prep-session:eshell (session params)
+  "Prepare SESSION according to the header arguments specified in PARAMS."
+  (let* ((session (org-babel-eshell-initiate-session session))
+	 ;; Eshell session buffer is read from variable `eshell-buffer-name'.
+	 (eshell-buffer-name session)
+	 (var-lines (org-babel-variable-assignments:eshell params)))
+(call-interactively 'eshell)
+(dolist (var-line var-lines)
+  (eshell-command var-line))
+session))
+
+(defun ob-eshell-session-live-p (session)
+  "Detect Eshell SESSION exist."
+  (and (get-buffer session) t))
+
+(defun org-babel-eshell-initiate-session ( session params)
+  "Initiate a session named SESSION according to PARAMS."
+  (when (and session (not (string= session "none")))
+(save-window-excursion
+  (or (ob-eshell-session-live-p session)
+	  (progn
+	(let ((eshell-buffer-name session))
+	  (eshell))
+	(get-buffer (current-buffer)))
+
+(defun org-babel-variable-assignments:eshell (params)
+  "Convert ob-eshell :var specified variables into Eshell variables assignments."
+  (mapcar
+   (lambda (pair)
+ (format "(setq %s %S)" (car pair) (cdr pair)))
+   (org-babel--get-vars params)))
+
+(defun org-babel-load-session:eshell (session body params)
+  "Load BODY into SESSION with PARAMS."
+  (save-window-excursion
+(let ((buffer 

[O] [PATCH] Add support for Babel with Eshell, and some questions

2018-04-21 Thread stardiviner
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

I added ob-eshell.el and documentation.

I got some questions:

When I run `make test`, found some babel languages are missing dependency.
What does that mean? and my ob-eshell is missing dependency too.

,
| Code block evaluation complete.
|passed  136/796  ob-vala/static-output (0.803677 sec)
|failed  137/796  org-missing-dependency/test-ob-R (0.000377 sec)
|failed  138/796  org-missing-dependency/test-ob-eshell (0.000403 sec)
|failed  139/796  org-missing-dependency/test-ob-lua (0.000460 sec)
|failed  140/796  org-missing-dependency/test-ob-maxima (0.000320 sec)
|failed  141/796  org-missing-dependency/test-ob-plantuml (0.000304 sec)
|failed  142/796  org-missing-dependency/test-ob-ruby (0.000354 sec)
|failed  143/796  org-missing-dependency/test-ob-scheme (0.000307 sec)
|failed  144/796  org-missing-dependency/test-ob-sqlite (0.000320 sec)
|failed  145/796  org-missing-dependency/test-org-protocol (0.000304 sec)
|passed  146/796  test-ob-exp/org-babel-exp-src-blocks/w-no-file (0.034372 
sec)
|passed  147/796  test-ob-exp/org-babel-exp-src-blocks/w-no-headers 
(0.031144 sec)
|passed  148/796  test-ob-exp/org-babel-exp-src-blocks/w-no-headers2 
(0.665415 sec)
`

I have not found place for write doc for a specific Babel langauge for
ob-eshell under "* Languages" or other places. So I write document for
ob-eshell in Worg. Will push after this PATCH merged.

Question does all Babel languages document goes to Worg?

- --
[ stardiviner ] don't need to convince with trends.
   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
-BEGIN PGP SIGNATURE-

iQEzBAEBCAAdFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAlrb7KwACgkQG13xyVro
msMzhQgAupTo7ARKakj5jUwhDIU2VBJkFIWg48kwaEKGItL5rPehsI4t4oWe3xEY
FMqwUtXePbOP0cTipwECspURda4i3tbhQQRvsj+eB9csK7EBojNJYZE9oZPEezmE
TgY/1fmgXkdMcbBe+4ZO9yS6/nepPO1AjsrFCN5vWyf2/AQDvVVi0VUFeXmNbPdd
HxY55oP8X99EDiJW6NB+matWa/fwX47Yd/86L+WRdtTSVNRFg0QBD3hDxi3vwTF6
aG1Fd8bBj30Wu3zxNDnRZJCJkRWb5rA3R/h7AP4o33HkI5Ob1ALpR2loiLAU9Pg1
2jpmBjfMmyorSSvqE39dCTlzonv2sg==
=w16j
-END PGP SIGNATURE-



[O] How to pass table range fields to TBLFM Elisp function?

2018-04-21 Thread stardiviner
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

In this question's second answer:

https://emacs.stackexchange.com/questions/32895/how-to-feed-range-from-org-table-filled-with-strings-to-code-block-via-tblfm

It gives out another solution:

,
| #+name: el-concat-str
| #+begin_src emacs-lisp :var x="hello"
| (mapconcat #'identity x "")
| #+end_src
| 
| | foo | bar | zoo | #ERROR |
| #+TBLFM: $4='(org-sbe el-concat-str (x (list $1..$3)))
`

But I found the commit is reverted in master branch:

,
| 8c9ebc81f087a30c84e6333e133c17ffc27e40ed
| Parent: 9e70db6ba Revert "ob-table: Fix org-sbe's handling of list 
arguments"
`
Any other solution on this?

- -- 
[ stardiviner ] don't need to convince with trends.
   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
  
-BEGIN PGP SIGNATURE-

iQEzBAEBCAAdFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAlrb1ckACgkQG13xyVro
msNjywf7BZhPsYWmrHMAEWeGPgwqGlCo6k1+iwSSfrOoE3d9cKiwtN79XgSkfCH/
nAgwFAyVzZdcHEOCHkORPXgsi2nq6TJN/mn/2BFoyYnpr00U6muMGDqzk7NiPqZv
KTzoJoHdk6d1YE9AVJYh5a4jD3t49gtKTHZFB05qyClBUnicgwtpQDoY/xpQavHJ
PHwj2BF5F5YCFwy1AgysntSdkYUu76Mk+GWGhv3mwg1Ks3AKnYQM3g63bmJoIjdn
YuHQnVnCBP2dF3tiYEjGwR+s2srdA3V79A3DkzU/rM2dfXy8B5OM1wIeZrbXRY23
fURRBoyQBaMciPDfcYc9HREK8tS0LQ==
=GtrO
-END PGP SIGNATURE-



Re: [O] Bug: org-capture template expansion "%x" stopped working

2018-04-21 Thread Brady Trainor

Nicolas Goaziou  writes:


I think this is now fixed. Thank you.


Yes, I see it as fixed, tested with git clone which gave me:

Org mode version 9.1.10 (release_9.1.10-619-g02e290 @ 
/Users/iam/.emacs.d/lisp/org-mode/lisp/)


Thank you.

--
Brady



[O] aligning images, html attributes ignored when exporting to html (longish, sorry)

2018-04-21 Thread Andreas Reuleaux
Hi,

following this tutorial

  https://orgmode.org/worg/org-tutorials/images-and-xhtml-export.html

I am trying to export some sample.org file to html, and have the images
floated to the right, with no success however.

to that end ATTR_HTML is used in the tutorial and in my sample.org:
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat. 
#+ATTR_HTML: style="float:right;"
[[./img/org-mode-unicorn.png]]
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est
laborum.
#+ATTR_HTML: style="float:right;"
[[./img/org-mode-unicorn.png]]
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Elementum
eu facilisis sed odio morbi quis. 
-

but no matter how I export this sample.org snippet, the html attributes 
(ATTR_HTML)
are ignored. - below is an emacs bash script that I use for the export
(making my results reproducible hopefully).

all I get is the plain html image tags, no style attributes:


---



Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est
laborum.



Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Elementum
eu facilisis sed odio morbi quis. 

...
---

I have no idea why these attributes are ignored, or how to make them appear:

- attr_html seems a fairly standard mechanism, and works for
  everybody but me ?, cf eg.

https://linevi.ch/en/org-link-extra-attrs.html

- I have tried with different export options, but of course there
  are endless possibilies / combinations, and I have no
  clue here.

  I have tried to keep my export script below simple, but
  have kept a few lines as comments (or not) to more easily experiment
  with different export setting, like

  (setq org-html-head-include-default-style nil)
  (setq org-html-head-include-scripts nil)
  (setq org-html-doctype "html5")
  (setq org-html-html-fancy t)
  ;; (setq org-html-htmlize-output-type 'css)

  with no impact for the export of my html attributes however.

- maybe the org mode syntax / behaviour has changed ? - however
  I have tried both:

  - org version 9.1.9 - as comes with my debian elpa-org package

  - and org version 8.2.10 - as comes with my emacs 25.2.2 on debian
buster.

  I can can choose either one be commenting / uncommenting the first
  few lines in my export script below

  
(let ((package-dir (car (file-expand-wildcards (concat
   "/usr/share/"
   ;; emacs25
   (symbol-name debian-emacs-flavor)
   "/site-lisp/elpa/org-*")))
   ))

  (when (file-directory-p package-dir)
(add-to-list 'load-path package-dir)
(add-to-list 'auto-mode-alist '("\\.org\\(-mode\\)?\\'" . org-mode))
)
  )
  
  ie. I try to load from "/usr/share/emacs25/site-lisp/elpa/org-*" if not
  commented out.

  the script will respond by printing either org mode version:

org version 8.2.10
org version 9.1.9


- I *can* have extra style config added at the beginning of my export with

  
  #+html_head: 
  #+html_head:
  #+html_head: 
  

  but in general don't want *all* my images floated to the right:
  I want to be able to assign attributes to individual images:
  one image floated to the right, say, another one to the left.
  and of course I may want to assign other attributes (besides float) 
  as well.


OK, thanks in advance. Find my export script below, and call with
  
  $ ./exporthtml.el sample.org sample.html

or 

  $ ./exporthtml.el sample.org

that way either org-html-export-as-html or org-html-export-to-html
gets used.

-Andreas


exporthtml.el
-
:;exec /usr/bin/env emacs -batch -Q -l "$0" -f main "$@"



(let ((package-dir (car (file-expand-wildcards (concat
   "/usr/share/"
   ;; emacs25
   (symbol-name debian-emacs-flavor)
   "/site-lisp/elpa/org-*")))
   ))

  (when (file-directory-p package-dir)
(add-to-list 'load-path package-dir)
(add-to-list 'auto-mode-alist '("\\.org\\(-mode\\)?\\'" . org-mode))
)
  )



(require 'cl)
(toggle-debug-on-error)



;; (require 'cask "~/cfg/emacs/cask/cask.el")
;; (cask-initialize)




(defun main ()
  (interactive)
  
  (destructuring-bind (org-file  outfile) 

[O] Patch: Document undocumented behavior in `org-timestamp-up'

2018-04-21 Thread Andrew Eggenberger
Please disregard. I sent an expanded version after joining the list. That
on has already been applied.
-- 

*Andrew Eggenberger*


Re: [O] org-note-abort

2018-04-21 Thread Nicolas Goaziou
Hello,

Brad Knotwell  writes:

> Good day all--
> Earlier, I had written about the unreliability of adding
> a table-line.  Well, I ran into a similar problem with the
> (significantly simpler) entry capability.  Unlike the table-line, this
> was an easier debug and I determined that org-note-abort was set to
> t which ensures capture will always fail.
> While I don't know exactly how I did it, I suspect it was something
> like the following:* edit a template, test it and find it isn't quite
> what you want* make an (incorrect) change that sets breaks on
> insertion, sets org-note-abort to t and you're stuck until you reset
> it to nil by hand (remarkably, I've had to do the same thing with
> inhibit-trace as well).
> Searching the mailing list and looking at Google hasn't been any more
> illuminating on this.  It's important to note that while
> org-capture-kill sets org-note-abort to t, it's reset correctly when
> used in the normal way.
> Version: 9.1.7
> Thx and I'm guessing something similar happened with the table-line
> issue.

I pushed a fix in maint. Could you test it and report if it solves your
issue ?

Regards,

-- 
Nicolas Goaziou



[O] [SOLVED :padline no] (was: org-babel-trangle, proble when loop is interrupted by documentation)

2018-04-21 Thread Uwe Brauer
>>> "Uwe" == Uwe Brauer  writes:

   >> Hello,
   >> Uwe Brauer  writes:


   >> I guess you have to set `org-src-preserve-indentation' globally, or use
   >> "-i" flag for the block, which is locally equivalent.

I think I found it:

* A test example

#+BEGIN_SRC matlab :tangle test.m :padline no
function [ll x]=mitest(A0,x0)
% initialization 
format long
epsi=1.e-3;
nit=0;
nmaxit=200;
Delta=10;
A=A0;
while Delta>epsi & nit

Re: [O] org-babel-trangle, proble when loop is interrupted by documentation

2018-04-21 Thread Uwe Brauer

   > Hello,
   > Uwe Brauer  writes:


   > I guess you have to set `org-src-preserve-indentation' globally, or use
   > "-i" flag for the block, which is locally equivalent.

Great that does it.

However there is still an empty line generated. Any possibility get rid
of this as well, I look a bit in the org-src.el and could no find
anything.

Regards





Re: [O] Release Org 9.2 soon ?

2018-04-21 Thread Rasmus
Nicolas Goaziou  writes:

> Hello,
>
> Bastien  writes:
>
>> yes, let's move forward.
>>
>> I'm back from a few days off, I'll be able to make the 9.2 release
>> at the end of next week.  I've released 9.1.10 in the meantime.
>
> Great.
>
> I suggest to release Org 9.1.11 by the beginning of the next week, and
> merge in into Emacs. Hopefully, this will be the last update included in
> Emacs 26.

Fine by me, but we’d need to clear the merge with upstream beforehand.

What is the best way to make a CHANGELOG from 9.1.9 to 9.1.11?  Should I
just copy the git log?

Rasmus

-- 
This message is brought to you by the department of redundant departments




Re: [O] Release Org 9.2 soon ?

2018-04-21 Thread Nicolas Goaziou
Hello,

Bastien  writes:

> yes, let's move forward.
>
> I'm back from a few days off, I'll be able to make the 9.2 release
> at the end of next week.  I've released 9.1.10 in the meantime.

Great.

I suggest to release Org 9.1.11 by the beginning of the next week, and
merge in into Emacs. Hopefully, this will be the last update included in
Emacs 26.

WDYT?

Regards,

-- 
Nicolas Goaziou0x80A93738



Re: [O] Release Org 9.2 soon ?

2018-04-21 Thread Bastien
Hi Nicolas,

yes, let's move forward.

I'm back from a few days off, I'll be able to make the 9.2 release
at the end of next week.  I've released 9.1.10 in the meantime.

Thanks,

-- 
 Bastien



Re: [O] Release Org 9.2 soon ?

2018-04-21 Thread Nicolas Goaziou
Hello,

Samuel Wales  writes:

> :tags:in:the:agenda:
>
> look:like:this
>
> is this deliberate?

No, it isn't.

Fixed. Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] Should wip-cite branch be merged to master?

2018-04-21 Thread Christian Moe

I have no opinion on whether it's time for a merge or not, but please
don't wait up for me.

Nicolas Goaziou writes:

> I also remember that Christian Moe suggested an alternate syntax for
> citations. He might want to point out what is missing from @cite syntax
> and if he still prefers his idea.

I did, but my suggestions did not get any traction back when a native
citation syntax was first being discussed on the list. Regrettably, I
have not managed to follow up my proposal properly, then or now -- not
even to the point of updating my own sample code after a Zotero
development broke it last year -- and I probably won't in the
foreseeable near future. So I wouldn't want to hold back a
community-developed solution on account that I had a different idea.

My proposal was for a different approach (parsing a "natural-looking"
citation syntax like (Smith 1990: p.3)), which I thought could be both
more user-friendly and more aesthetically pleasing in plain text.  It
was not for improvements to the @cite syntax, so I don't actually know
what is missing from the latter, if anything. I was very excited about
the citeproc contributon, but I have not found the time to test it out.



Re: [O] Bug: org-capture template expansion "%x" stopped working

2018-04-21 Thread Nicolas Goaziou
Hello,

Brady Trainor  writes:

> The issue at following thread seems to have resurfaced
>
> https://lists.gnu.org/archive/html/emacs-orgmode/2016-07/msg00490.html
>
> If I run the following
>
> emacs -Q -nw --eval "(progn (setq org-capture-templates '((\"t\" 
> \"Task\" entry (file \"/tmp/test.org\") \"%x\"))) (org-capture nil 
> \"t\"))"
>
> I see in Messages
>
> org-capture: Capture abort: (wrong-type-argument char-or-string-p 
> nil)
>
>
> Emacs and org versions
>
> GNU Emacs 27.0.50 (build 1, x86_64-apple-darwin17.4.0, NS 
> appkit-1561.20 Version 10.13.3 (Build 17D102)) of 2018-04-11
> Org mode version 9.1.9 (release_9.1.9-65-g5e4542 @ 
> /usr/local/Cellar/emacs/HEAD-57442b6/share/emacs/27.0.50/lisp/org/)

I think this is now fixed. Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] org-babel-trangle, proble when loop is interrupted by documentation

2018-04-21 Thread Nicolas Goaziou
Hello,

Uwe Brauer  writes:

> Please consider the following test org file
> * A test example
> ,
> | #+BEGIN_SRC matlab :tangle test.m 
> | function [ll x]=mitest(A0,x0)
> | % initialization 
> | format long
> | epsi=1.e-3;
> | nit=0;
> | nmaxit=200;
> | Delta=10;
> | A=A0;
> | while Delta>epsi & nit | nit=nit+1; % counter
> | #+END_SRC
> | Some explanation...
> | #+BEGIN_SRC matlab :tangle test.m 
> | y=A*x0;
> | end
> | #+END_SRC
> | The basic idea is.
> `
>
>
> I have interrupted the while loop by some text, when I now toggle, the
> indentation  is broken as you can see.
>
> ,
> | function [ll x]=mitest(A0,x0)
> | % initialization 
> | format long
> | epsi=1.e-3;
> | nit=0;
> | nmaxit=200;
> | Delta=10;
> | A=A0;
> | while Delta>epsi & nit | nit=nit+1; % counter
> | 
> | y=A*x0;
> | end
> `
>
> There is an empty line and
> y=A*x0 is not indented.
>
> How can this behavior be avoided?

I guess you have to set `org-src-preserve-indentation' globally, or use
"-i" flag for the block, which is locally equivalent.

Regards,

-- 
Nicolas Goaziou



Re: [O] [PATCH] ox-md.el: fixed an issue where exporting markdown ToC would fail if heading numbering is not enabled

2018-04-21 Thread Nicolas Goaziou
Hello,

Yue Zhu  writes:

> When exporting markdown with ToC, if heading numbering is not enabled, it
> would fail with the attached backtrace. The cause is that the function
> `org-md--build-toc' in `ox-md.el' does not properly handle this case which
> effectively results in a function call `(format "%d." nil)'. In my patch,
> when exporting markdown with ToC, if heading numbering is not enabled, ToC
> will be shown as an unordered list.

Applied. Thank you.

Regards,

-- 
Nicolas Goaziou



[O] org-babel-trangle, proble when loop is interrupted by documentation

2018-04-21 Thread Uwe Brauer
Hi

Please consider the following test org file
* A test example
,
| #+BEGIN_SRC matlab :tangle test.m 
| function [ll x]=mitest(A0,x0)
| % initialization 
| format long
| epsi=1.e-3;
| nit=0;
| nmaxit=200;
| Delta=10;
| A=A0;
| while Delta>epsi & nitepsi & nit

[O] org-mime-htmlize transforms ' into ? in gmail_quote

2018-04-21 Thread Joseph Vidal-Rosset
Hello,

I meet a problem with a transformation of ' into ? with French emails in
gnus. I guess that is a bug in org-mime-htmlize. Here is an example: 

Le   ven.20   avril   2018à   09:43:54   ,G.  D.
 a envoyé ce message:

> Possibilité d'utiliser son propre matériel ou d'en louer sur place...

Of course the ? in this gmail_quote are incorrect.

Your help is welcome. 

 Best wishes,
-- 
Jo.

[O] 3 manuals fail to export to PO (gnus, idlwave, org)

2018-04-21 Thread Jean-Christophe Helary
3 manuals distributed with emacs fail to export to po format when using the 
following command:

po4a-gettextize -f texinfo -M utf8 -m name.texi -p name.texi.fr.po

gnus.texi

Use of uninitialized value $newfilepath in string eq at 
/opt/local/lib/perl5/5.24/Locale/Po4a/TeX.pm line 961.
po4a::tex: Can't find gnus.texi with kpsewhich

idlwave.texi

idlwave.texi:370: (po4a::tex)
unmatched end of environment 'html'
idlwave.texi:1242: (po4a::tex)
unmatched end of environment 'html'
idlwave.texi:2964: (po4a::tex)
unmatched end of environment 'html'
idlwave.texi:3101: (po4a::tex)
unmatched end of environment 'html'
idlwave.texi:3497: (po4a::tex)
unmatched end of environment 'html'
idlwave.texi:3559: (po4a::tex)
unmatched end of environment 'html'
idlwave.texi:4021: (po4a::tex)
unmatched end of environment 'html'
idlwave.texi:4078: (po4a::tex)
unmatched end of environment 'html'
idlwave.texi:4088: (po4a::tex)
un-balanced { in 'Whenever an IDL error occurs or a breakpoint is hit, I get'

org.texi

perl just keeps churning data without outputting anything.


A number of other manuals output errors but are properly exported to po:

emacs-lisp-intro.texi:214: (po4a::tex)
unmatched end of environment 'html'

cmdargs.texi:726: (po4a::tex)
unmatched end of environment 'vtable'

emacs.texi:126: (po4a::tex)
unmatched end of environment 'html'

frames.texi:1284: (po4a::tex)
unmatched end of environment 'vtable'

flymake.texi:249: (po4a::tex)
unmatched end of environment 'vtable'
flymake.texi:730: (po4a::tex)
unmatched end of environment 'vtable'

info.texi:1253: (po4a::tex)
unmatched end of environment 'vtable'

mh-e.texi:80: (po4a::tex)
unmatched end of environment 'html'
mh-e.texi:85: (po4a::tex)
unmatched end of environment 'html'
mh-e.texi:94: (po4a::tex)
unmatched end of environment 'html'
mh-e.texi:198: (po4a::tex)
unmatched end of environment 'html'
mh-e.texi:1272: (po4a::tex)
unmatched end of environment 'vtable'
mh-e.texi:1322: (po4a::tex)
unmatched end of environment 'vtable'
mh-e.texi:1394: (po4a::tex)
unmatched end of environment 'vtable'
mh-e.texi:1403: (po4a::tex)
unmatched end of environment 'vtable'
mh-e.texi:1939: (po4a::tex)
unmatched end of environment 'vtable'
mh-e.texi:1952: (po4a::tex)
unmatched end of environment 'vtable'
mh-e.texi:1989: (po4a::tex)
unmatched end of environment 'vtable'
mh-e.texi:2232: (po4a::tex)
unmatched end of environment 'html'
mh-e.texi:3385: (po4a::tex)
unmatched end of environment 'vtable'
mh-e.texi:3419: (po4a::tex)
unmatched end of environment 'vtable'
mh-e.texi:3472: (po4a::tex)
unmatched end of environment 'vtable'
mh-e.texi:3964: (po4a::tex)
unmatched end of environment 'vtable'
mh-e.texi:3980: (po4a::tex)
unmatched end of environment 'vtable'
mh-e.texi:4711: (po4a::tex)
unmatched end of environment 'vtable'
mh-e.texi:4731: (po4a::tex)
unmatched end of environment 'vtable'
mh-e.texi:4738: (po4a::tex)
unmatched end of environment 'vtable'
mh-e.texi:5772: (po4a::tex)
unmatched end of environment 'vtable'
mh-e.texi:5780: (po4a::tex)
unmatched end of environment 'vtable'
mh-e.texi:6076: (po4a::tex)
unmatched end of environment 'vtable'
mh-e.texi:6337: (po4a::tex)
unmatched end of environment 'vtable'
mh-e.texi:6354: (po4a::tex)
unmatched end of environment 'vtable'
mh-e.texi:6456: (po4a::tex)
unmatched end of environment 'vtable'
mh-e.texi:6633: (po4a::tex)
unmatched end of environment 'vtable'
mh-e.texi:6640: (po4a::tex)
unmatched end of environment 'vtable'
mh-e.texi:6647: (po4a::tex)
unmatched end of environment 'vtable'
mh-e.texi:7107: (po4a::tex)
unmatched end of environment 'vtable'
mh-e.texi:7388: (po4a::tex)
unmatched end of environment 'vtable'
mh-e.texi:7395: (po4a::tex)
unmatched end of environment 'vtable'
mh-e.texi:7590: (po4a::tex)
unmatched end of environment 'vtable'
mh-e.texi:7602: (po4a::tex)
unmatched end of environment 'vtable'
mh-e.texi:7614: (po4a::tex)
unmatched end of environment 'vtable'
mh-e.texi:7624: (po4a::tex)
unmatched end of environment 'vtable'
mh-e.texi:7978: (po4a::tex)
unmatched end of environment 'ftable'
mh-e.texi:8082: (po4a::tex)
unmatched end of environment 'vtable'
mh-e.texi:8226: (po4a::tex)
unmatched end of environment 'vtable'
mh-e.texi:8394: (po4a::tex)
unmatched end of environment 'vtable'
mh-e.texi:8448: (po4a::tex)
unmatched end of environment 'vtable'
mh-e.texi:8658: (po4a::tex)
unmatched end of environment 'vtable'

octave-mode.texi:170: (po4a::tex)
unmatched end of environment 'vtable'
octave-mode.texi:343: (po4a::tex)
unmatched end of environment 'vtable'

ses.texi:512: (po4a::tex)
unmatched end of environment 'ftable'

widget.texi:690: (po4a::tex)
unmatched end of environment 'deffn'

woman.texi:868: (po4a::tex)
unmatched end of environment 'vtable'
woman.texi:1115: (po4a::tex)
unmatched end of environment 'vtable'
woman.texi:1158: (po4a::tex)
unmatched end of environment 'vtable'
woman.texi:1193: (po4a::tex)
unmatched end of environment 'vtable'
woman.texi:1228: (po4a::tex)
unmatched end of environment 'vtable'


Re: [O] 3 manuals fail to export to PO (gnus, idlwave, org)

2018-04-21 Thread Jean-Christophe Helary


> On Apr 16, 2018, at 0:00, Eli Zaretskii  wrote:
> 
>> 3 manuals distributed with emacs fail to export to po format when using the 
>> following command:
>> 
>> po4a-gettextize -f texinfo -M utf8 -m name.texi -p name.texi.fr.po
>> 
>> gnus.texi
>> 
>> Use of uninitialized value $newfilepath in string eq at 
>> /opt/local/lib/perl5/5.24/Locale/Po4a/TeX.pm line 961.
>> po4a::tex: Can't find gnus.texi with kpsewhich
> 
> I don't understand what this error message means, in terms of the
> Texinfo sources.  Can you explain, please?  Taken at face value, it
> looks like a bug in TeX.pm, whereby a variable is not initialized.

I just sent the report, my idea is that it's po4a issues but the po4a-devel 
list doesn't respond.

Jean-Christophe 

> 
>> idlwave.texi
>> 
>> idlwave.texi:370: (po4a::tex)
>> unmatched end of environment 'html'
>> idlwave.texi:1242: (po4a::tex)
>> unmatched end of environment 'html'
>> idlwave.texi:2964: (po4a::tex)
>> unmatched end of environment 'html'
>> idlwave.texi:3101: (po4a::tex)
>> unmatched end of environment 'html'
>> idlwave.texi:3497: (po4a::tex)
>> unmatched end of environment 'html'
>> idlwave.texi:3559: (po4a::tex)
>> unmatched end of environment 'html'
>> idlwave.texi:4021: (po4a::tex)
>> unmatched end of environment 'html'
>> idlwave.texi:4078: (po4a::tex)
>> unmatched end of environment 'html'
> 
> These all seem bogus, because the source looks correct to me.  Here's
> the first instance:
> 
>  @html
>  
>  @end html
> 
> I see nothing wrong here; do you?
> 
> (Maybe you are using an old version of the manual; I looked in what's
> currently on the emacs-26 branch of the Emacs Git repository.)
> 
>> idlwave.texi:4088: (po4a::tex)
>> un-balanced { in 'Whenever an IDL error occurs or a breakpoint is hit, I get'
> 
> Nothing wrong here, either:
> 
>  @enumerate
> 
>  @item @strong{Whenever an IDL error occurs or a breakpoint is hit, I get
>  errors or strange behavior when I try to type anything into some of my
>  IDLWAVE buffers.}
> 
> The Texinfo manual says it's okay to have multi-line text after @item:
> 
> Write the text of the enumerated list in the same way as an itemized
>  list: write a line starting with '@item' at the beginning of each item
>  in the enumeration.  It is ok to have text following the '@item', and
>  the text for an item can continue for several paragraphs.
> 
> Looks like po4a doesn't support this feature of the Texinfo language?
> 
>> org.texi
>> 
>> perl just keeps churning data without outputting anything.
> 
> Hard to do anything with this, without more diagnostic data.
> 
>> A number of other manuals output errors but are properly exported to po:
> 
> These looks bogus as well.  E.g.:
> 
>> cmdargs.texi:726: (po4a::tex)
>> unmatched end of environment 'vtable'
> 
> There's a matching "@vtable @env" on line 674.
> 
> So I submit these problems are bugs in po4a, and the Emacs manuals are
> OK.
> 
> Thanks.

Jean-Christophe Helary
---
http://mac4translators.blogspot.com @brandelune




[O] Bug: org-capture template expansion "%x" stopped working

2018-04-21 Thread Brady Trainor

The issue at following thread seems to have resurfaced

https://lists.gnu.org/archive/html/emacs-orgmode/2016-07/msg00490.html

If I run the following

--8<---cut here---start->8---
emacs -Q -nw --eval "(progn (setq org-capture-templates '((\"t\" 
\"Task\" entry (file \"/tmp/test.org\") \"%x\"))) (org-capture nil 
\"t\"))"

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

I see in Messages

--8<---cut here---start->8---
org-capture: Capture abort: (wrong-type-argument char-or-string-p 
nil)

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

Emacs and org versions

--8<---cut here---start->8---
GNU Emacs 27.0.50 (build 1, x86_64-apple-darwin17.4.0, NS 
appkit-1561.20 Version 10.13.3 (Build 17D102)) of 2018-04-11
Org mode version 9.1.9 (release_9.1.9-65-g5e4542 @ 
/usr/local/Cellar/emacs/HEAD-57442b6/share/emacs/27.0.50/lisp/org/)

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

Thank you,

--
Brady



[O] Patch: Document undocumented behavior in `org-timestamp-up'

2018-04-21 Thread Andrew Eggenberger
>From 7b2dd929cc7f94a7162429b698f23245d7d7d3c0 Mon Sep 17 00:00:00 2001
From: Andrew Eggenberger 
Date: Mon, 16 Apr 2018 19:07:41 -0500
Subject: [PATCH] Document undocumented org-timestamp-up behavior.

* org.el (org-timestamp-up): Document undocumented behavior.
(org-timestamp-up): The function changes the timestamp type when
the point is on the enclosing bracket.  The documentation now
reflects that behavior.

TINYCHANGE
---
 lisp/org.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index 01149ed..40f785b 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -17260,7 +17260,8 @@ NODEFAULT, hour and minute fields will be nil if
not given."
 (defun org-timestamp-up ( arg)
   "Increase the date item at the cursor by one.
 If the cursor is on the year, change the year.  If it is on the month,
-the day or the time, change that.
+the day or the time, change that.  If the cursor is on the enclosing
+bracket, change the timestamp type.
 With prefix ARG, change by that many units."
   (interactive "p")
   (org-timestamp-change (prefix-numeric-value arg) nil 'updown))
-- 
2.10.1 (Apple Git-78)



*Andrew Eggenberger*


[O] [PATCH] org-compat: Allow imenu items without hierarchy

2018-04-21 Thread Michael Hendricks
* lisp/org-compat.el (org-imenu-flat): New custom variable.
(org-imenu-get-tree): Skip hierarchical item structure if
org-imenu-flat is true.

Many of my Org files have deep hierarchies, but few total headings.
For those files, I find that navigating a flat menu structure is more
effective than navigating many nested menus.

A flat imenu structure also works well with packages, such as idomenu,
which navigate imenu items via search.
---
 lisp/org-compat.el | 17 +
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/lisp/org-compat.el b/lisp/org-compat.el
index e7ea4153e..cb9419857 100644
--- a/lisp/org-compat.el
+++ b/lisp/org-compat.el
@@ -600,6 +600,12 @@ This also applied for speedbar access."
   :group 'org-imenu-and-speedbar
   :type 'integer)
 
+(defcustom org-imenu-flat nil
+  "Non-nil creates index items at the top level.  The default is
+for the index hierarchy to match the buffer's hierarchy."
+  :group 'org-imenu-and-speedbar
+  :type 'boolean)
+
  Imenu
 
 (defvar-local org-imenu-markers nil
@@ -618,6 +624,7 @@ This also applied for speedbar access."
   (setq org-imenu-markers nil)
   (let* ((case-fold-search nil)
 (n org-imenu-depth)
+(flat org-imenu-flat)
 (re (concat "^" (org-get-limited-outline-regexp)))
 (subs (make-vector (1+ n) nil))
 (last-level 0)
@@ -632,10 +639,12 @@ This also applied for speedbar access."
 (setq head (org-link-display-format head0)
   m (org-imenu-new-marker))
 (org-add-props head nil 'org-imenu-marker m 'org-imenu t)
-(if (>= level last-level)
-(push (cons head m) (aref subs level))
-  (push (cons head (aref subs (1+ level))) (aref subs level))
-  (cl-loop for i from (1+ level) to n do (aset subs i nil)))
+(if flat
+(push (cons head m) (aref subs 1))
+  (if (>= level last-level)
+  (push (cons head m) (aref subs level))
+(push (cons head (aref subs (1+ level))) (aref subs level))
+(cl-loop for i from (1+ level) to n do (aset subs i nil
 (setq last-level level
 (aref subs 1)))
 
-- 
2.14.2



Re: [O] Should wip-cite branch be merged to master?

2018-04-21 Thread Nicolas Goaziou
Hello,

tumashu  writes:

> There is a package which support wip-cite: 
> https://github.com/andras-simonyi/citeproc-org, should wip-cite branch
> be merged to master now?

Merging wip-cite branch with master, and integration of citeproc-org
into Org core, could be discussed with the author of the library, and,
of course, with anyone interested in using the @cite syntax. For
example, I need to know if that syntax, along with citeproc-org, covers
enough use-cases for citations, if it brings more value than using,
e.g., Org Ref, which already exists, how it could be improved, etc.

I also remember that Christian Moe suggested an alternate syntax for
citations. He might want to point out what is missing from @cite syntax
and if he still prefers his idea.

I have the feeling that it is a bit early for Org 9.2. Anyway, I'm
Cc'ing András and John for their opinion about it. I'd love to hear from
everyone involved in the last round of discussion about the subject,
too.

Regards,

-- 
Nicolas Goaziou