[O] Bug: Matching tags: results incomplete when mixing group tags and their ancestors [9.1.7 (9.1.7-12-g74f6ed-elpaplus @ /home/martin/.emacs.d/elpa/org-plus-contrib-20180305/)]

2018-03-12 Thread Martin Kampas
Hi,

Here is an example Org file:


#+TAGS: [ tag1 : tag2 ] [ tag2 : tag3 ] [ tag3 : tag4 ]
* Tag1   :tag1:
* Tag2   :tag2:
* Tag3   :tag3:
* Tag4   :tag4:


Searching headlines by tags works well unless you combine a group tag together 
with some of its ancestor tags in the query.

1) GOOD - Searching for "tag1" marks all four headlines.
2) GOOD - Searching for "tag3" marks headlines "Tag3" and "Tag4".
3) BAD - Searching for "tag1+tag3" marks just headline "Tag3" providing an 
incomplete result. Expected result: headlines "Tag3" and "Tag4" are marked.

With more complex tag set it may happen quite easily that such a search is done.

The bug seems to be in org-tags-expand.

(org-tags-expand "tag1")
#("{\\<\\(?:tag[1-4]\\)\\>}" 0 20 (grouptag t))
(org-tags-expand "tag3")
#("{\\<\\(?:tag[34]\\)\\>}" 0 19 (grouptag t))
(org-tags-expand "tag1+tag3")
#("{\\<\\(?:tag[1-4]\\)\\>}+tag3" 0 20 (grouptag t))

In the third invocation "tag3" was left unexpanded.

Best regards,
Martin


Emacs  : GNU Emacs 25.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.26)
 of 2018-02-09
Package: Org mode version 9.1.7 (9.1.7-12-g74f6ed-elpaplus @ 
/home/martin/.emacs.d/elpa/org-plus-contrib-20180305/)






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

2018-03-12 Thread stardiviner

I added org-mode babel ob-js.el header argument :session.

Following packages :session are supported:

- skewer-mode

- js-comint

- Indium

>From 2cdf05cf2fe3e0740997d9861c8ff8f81c163750 Mon Sep 17 00:00:00 2001
From: stardiviner 
Date: Fri, 9 Mar 2018 00:10:54 +0800
Subject: [PATCH 3/3] * ob-js.el: add :session support with js-comint.

---
 lisp/ob-js.el | 13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/lisp/ob-js.el b/lisp/ob-js.el
index d2fc5e29c..126685813 100644
--- a/lisp/ob-js.el
+++ b/lisp/ob-js.el
@@ -59,6 +59,7 @@
   :version "24.1"
   :type '(choice (const "node")
 		 (const "mozrepl")
+		 (const "js-comint")
 		 (const "skewer-mode"))
   :safe #'stringp)
 
@@ -159,7 +160,17 @@ specifying a variable of the same value."
 then create.  Return the initialized session."
   (unless (string= session "none")
 (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)
+	  (sit-for .5)
+	  session-buffer)))
+ ((string= "*skewer-repl*" session) ; `skewer-mode'
   (require 'skewer-repl)
   (let ((session-buffer (get-buffer "*skewer-repl*")))
 	(if (and (org-babel-comint-buffer-livep (get-buffer session-buffer))
-- 
2.16.2

>From 4eef9f4fc9534ac45b5d98ba8eab36f764cd7518 Mon Sep 17 00:00:00 2001
From: stardiviner 
Date: Thu, 8 Mar 2018 23:15:16 +0800
Subject: [PATCH 2/3] * ob-js.el: support :session for Indium Node.js REPL.

---
 lisp/ob-js.el | 29 +++--
 1 file changed, 19 insertions(+), 10 deletions(-)

diff --git a/lisp/ob-js.el b/lisp/ob-js.el
index e2a2a9cec..d2fc5e29c 100644
--- a/lisp/ob-js.el
+++ b/lisp/ob-js.el
@@ -70,21 +70,30 @@
   "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))
+		 (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)
+(mapc	; FIXME: stack on this scope when `skewer-eval'
+ (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
-- 
2.16.2

>From 9c3a57107e4ed598ca24582fa330fe698829b61e Mon Sep 17 00:00:00 2001
From: stardiviner 
Date: Thu, 8 Mar 2018 17:15:58 +0800
Subject: [PATCH] * ob-js.el: support use skewer-mode as session support.

---
 lisp/ob-js.el | 22 +-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/lisp/ob-js.el b/lisp/ob-js.el
index 38c8c39ac..e2a2a9cec 100644
--- a/lisp/ob-js.el
+++ b/lisp/ob-js.el
@@ -27,6 +27,11 @@
 ;;
 ;; This certainly isn't optimally robust, but it seems to be working
 ;; for the basic use cases.
+;;
+;; `skewer-mode' session support:
+;; #+begin_src js :session *skewer-repl*
+;; console.log("chris");
+;; #+end_src
 
 ;;; Requirements:
 
@@ -52,7 +57,10 @@
   "Name of command used to evaluate js blocks."
   :group 'org-babel
   :version "24.1"
-  :type 'string)
+  :type '(choice (const "node")
+		 (const "mozrepl")
+		 (const "skewer-mode"))
+  :safe #'stringp)
 
 (defvar org-babel-js-function-wrapper
   "require('sys').print(require('sys').inspect(function(){\n%s\n}()));"
@@ -142,6 +150,18 @@ specifying a variable of the same value."
 then create.  Return the initialized session."
   (unless (string= session "none")
 (cond
+ ((string= "*skewer-repl*" session)
+  (require 'skewer-repl)
+  (let ((session-buffer (get-buffer "*skewer-repl*")))
+	(if (and (org-babel-comint-buffer-livep (get

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

2018-03-12 Thread Eric S Fraga
On Friday,  9 Mar 2018 at 17:30, Samuel Wales wrote:
> On 3/9/18, Eric S Fraga  wrote:
>> Type C-h v org-latex-classes RET for the full description.  The
>> header-string can include those particular indent and skip settings
>> along with other bits.
>
> i consulted the docstring and the manual.  the description was greek
> to me and there was no reference to qa term you used afaict.

Apologies for this.  Try the following (after loading org):

#+begin_src emacs-lisp
  (add-to-list 'org-latex-classes
   '("article" "\\documentclass{scrartcl}
\[DEFAULT-PACKAGES]
\[PACKAGES]
\[EXTRA]
   \\setlength{\\parindent}{0pt}
   \\setlength{\\parskip}{6pt}
  "
 ("\\section{%s}" . "\\section*{%s}")
 ("\\subsection{%s}" . "\\subsection*{%s}")
 ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
 ("\\paragraph{%s}" . "\\paragraph*{%s}")
 ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
#+end_src 

This should then work for default LaTeX export.


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


signature.asc
Description: PGP signature


[O] Structured links to headings with endless depth

2018-03-12 Thread ST
Hi,

after reading the manual I didn't find a way to construct structured
links referring to headings with endless depth, like:

having an file.org:

* 1
** 1
** 2
*** 1
<---link here

with the link:
[[path/to/file.org::*1:2:1]]

Is this possible or should I file it as feature request?

PS: It should work also with link abbreviations:
#+LINK: file path/to/file.org::*%s
[[file:1:2:1]]

Thank you!





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

2018-03-12 Thread Eric S Fraga
On Monday, 12 Mar 2018 at 12:09, ST wrote:
> Hi,
>
> after reading the manual I didn't find a way to construct structured
> links referring to headings with endless depth, like:

I'm not entirely sure what your use case is but could you use a target,
i.e. something like <>, to indicate where you want to link to?
Cf. section 4.2 of org manual on internal links.

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


signature.asc
Description: PGP signature


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

2018-03-12 Thread ST
Adding an extra <> is not an option, as it will make the text
less readable, and there is no need in this, as the headings tree
structure is already there:

* 1
** 1
** 2
*** 1

Why should I turn it into the following

* 1
** 1
** 2
*** 1
<<1>>

and then link with [[file:1]]?!... This both:
a) adds unnecessary information into the text making it less readable
b) those who read the org file as simple text without the ability to
click the link will not know where it goes... while the link
[[file:1:2:1]] makes it quite clear even without clicking it.

Example use case: scriptures with well known structure, e.g. the Bible. 


On Mon, 2018-03-12 at 10:29 +, Eric S Fraga wrote:
> On Monday, 12 Mar 2018 at 12:09, ST wrote:
> > Hi,
> >
> > after reading the manual I didn't find a way to construct structured
> > links referring to headings with endless depth, like:
> 
> I'm not entirely sure what your use case is but could you use a target,
> i.e. something like <>, to indicate where you want to link to?
> Cf. section 4.2 of org manual on internal links.
> 




Re: [O] Ridiculously long (2 minutes) startup time for org agenda

2018-03-12 Thread JI Xiang
I finally found out the problem. I've been using Spacemacs and the 
`spell-checking` layer would automatically initiate flyspell on each org 
file, resulting in tremendous delay. If I disable flyspell from being 
automatically activated, the agenda is shown in a few seconds.



On 26.02.2018 17:29, Daniel Clemente wrote:
It can be many things. My emacs was taking 6 minutes to open for some 
years, due to many reasons: a slow computer, many org files and very 
large (>100 files, >25 Mb in total), lack of optimizations from my 
side and from org-mode's side. I got used to it but it's a very bad 
experience, specially when it crashes (and I made it crash a lot).
Now org-mode has improved and I disabled the slow parts, and it opens 
very fast (<20 seconds). I still open large files.


The problem may not only be in org but in emacs (e.g. vc-mode can be 
slow), though from the instrumentation you send, it doesn't seem to be 
the case because it doesn't spend time opening the files.


org-agenda-prepare-buffers is the slow function, so it's the one you 
should check. Try to use edebug in it (C-u M-C-x) and run it slowly to 
see in which section it's the slowest. Then optimize that part. You'll 
see many optimization there (ignore properties, etc.). I had to 
disable many slow things, like <<>> (when you use a lot, e.g. 
1000 per file, it's too slow and even crashes), I think that these 
radio targets were the main reason of the slowness.


Try creating a very large file and then check opening it, to see if 
it's also slow.
Try things in a clean emacs (e.g. starting with: emacs -Q), because 
you may have some other mode enabled that wants to do lots of things 
when you open the files.


You can test many more things. But keep testing, because it's possible 
to make it work faster.



On Mon, Feb 19, 2018 at 3:00 AM, JI Xiang > wrote:


Hello, first time posting on the mailing list. I encountered a
problem where my agenda view (|C-c a a|) is taking ridiculously
long (nearly 2 minutes) to be shown the first time. From the
second time onwards, the time is about 11 seconds, which is still
very long by any means.

I wondered whether it has something to do with me having many
files in the agenda list, so I tried to restrict the list to just
one file. But still the first call to org-agenda-list took 12
seconds. This shouldn’t be normal, right?

The following are shown in the |Messages| buffer during the call.

|Press key for agenda command: Restoring clock data Loading
/home/jx/.emacs.d/.cache/org-clock-save.el (source)...done [yas]
Prepared just-in-time loading of snippets successfully.
Importmagic and/or epc not found. importmagic.el will not be
working. Setting up indent for shell type zsh Indentation
variables are now local. Indentation setup for shell type zsh
Using vacuous schema Shell native completion is disabled, using
fallback |

I’m not sure why they would be there, especially the “using
vacuous schema” and “shell native completion” part. Are the
messages related to some |#BEGIN_SRC| blocks in the org files? I
don’t think I would ever need source code blocks when I’m viewing
an agenda buffer?

I posted the question on Emacs.SE


and somebody suggested me use |elp-instrument| to perform a
profiling. The results are as follows:

|Function Name, Call Count, Elapsed Time, Average Time org-agenda 1
116.6048159 116.6048159 org-agenda-list 1 116.29427357
116.29427357 org-agenda-prepare 1 109.15345470 109.15345470
org-agenda-prepare-buffers 1 108.98258905 108.98258905
org-agenda-get-day-entries 1288 7.0089191339 0.0054417074
org-agenda-get-scheduled 1288 3.726361062 0.0028931374
org-agenda-get-deadlines 1288 2.1579713230 0.0016754435
org-agenda--timestamp-to-absolute 14544 1.1317418120 7.781...e-05
org-agenda-get-timestamps 1288 0.3673404320 0.0002852021
org-agenda-get-sexps 1288 0.3438970410 0.0002670008
org-agenda-get-restriction-and-command 1 0.310503975 0.310503975
org-agenda-get-blocks 1288 0.3083237900 0.0002393818
org-agenda-prepare-window 1 0.157091024 0.157091024
org-agenda-skip 8624 0.0781296389 9.059...e-06 org-agenda-files 49
0.026090686 0.0005324629 org-agenda-finalize 1 0.013325178
0.013325178 org-agenda-mode 1 0.009848546 0.009848546
org-agenda-finalize-entries 23 0.006178961 0.0002686504
org-agenda-today-p 2604 0.0061717839 2.370...e-06
org-agenda-skip-eval 16968 0.0052723920 3.107...e-07
org-agenda-highlight-todo 112 0.0039840550 3.557...e-05
org-agenda-format-item 112 0.0038309749 3.420...e-05
org-agenda-new-marker 208 0.0031529359 1.515...e-05
org-agenda-format-date-aligned 28 0.0007373120 2.633...e-05
org-agenda-add-time-grid-maybe 28 0.0003810809 1.361...e-05

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

2018-03-12 Thread ST
PS: It doesn't have to be Bible. Links in form of citations, like
[[MyBook:Chapter 1:Section 5:Subsection 3]]

Is quite useful in general. Where

#+LINK: MyBook path/to/MyBook.org::*%s

It is both readable as raw text and clickable.

Maybe it will be a good idea to be able to also add a <> at the
end of the tree, like: 

[[MyBook:Chapter 1:Section 5:Subsection 3:target]]

* Chapter 1
...
** Section 5
...
*** Subsection 3
...
<>
...

-

Adding an extra <> is not an option, as it will make the text
less readable, and there is no need in this, as the headings tree
structure is already there:

* 1
** 1
** 2
*** 1

Why should I turn it into the following

* 1
** 1
** 2
*** 1
<<1>>

and then link with [[file:1]]?!... This both:
a) adds unnecessary information into the text making it less readable
b) those who read the org file as simple text without the ability to
click the link will not know where it goes... while the link
[[file:1:2:1]] makes it quite clear even without clicking it.

Example use case: scriptures with well known structure, e.g. the Bible. 


On Mon, 2018-03-12 at 10:29 +, Eric S Fraga wrote:
> On Monday, 12 Mar 2018 at 12:09, ST wrote:
> > Hi,
> >
> > after reading the manual I didn't find a way to construct structured
> > links referring to headings with endless depth, like:
> 
> I'm not entirely sure what your use case is but could you use a target,
> i.e. something like <>, to indicate where you want to link to?
> Cf. section 4.2 of org manual on internal links.
> 





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

2018-03-12 Thread Christian Moe

ST writes:

> Adding an extra <> is not an option, as it will make the text
> less readable, and there is no need in this, as the headings tree
> structure is already there:

Adding targets, CUSTOM_IDs or IDs are all options. You may not like them.

> * 1
> ** 1
> ** 2
> *** 1
>
> Why should I turn it into the following
>
> * 1
> ** 1
> ** 2
> *** 1
> <<1>>

With a fixed structure, you wouldn't; you'd use e.g. <<1:2:1>>.

> and then link with [[file:1]]?!... This both:
> a) adds unnecessary information into the text making it less readable

Let's not exaggerate the readability cost. And it does add information.

> b) those who read the org file as simple text without the ability to
> click the link will not know where it goes... while the link
> [[file:1:2:1]] makes it quite clear even without clicking it.

But so does the link [[1:2:1]] to the target <<1:2:1>>.

also, c): Adding a target like <<1:2:1>> to a section preserves
information about the location of that section in the source document if
you later cut that part out and insert it somewhere else. This
information is not contained in your headlines.

> Example use case: scriptures with well known structure, e.g. the Bible.

Fair enough.

But typical Org use will quickly break links like that, since Org shines
as an organizer for drafting and easily restructuring text. I don't
think Org needs a link type that would encourage people to make easily
breakable links.

I acknowledge that a separate target or CUSTOM_ID for every verse in the
Bible seems a bit heavy; if that's what you need, it might be better
solved by a custom link type.

Yours,
Christian

>
> On Mon, 2018-03-12 at 10:29 +, Eric S Fraga wrote:
>> On Monday, 12 Mar 2018 at 12:09, ST wrote:
>> > Hi,
>> >
>> > after reading the manual I didn't find a way to construct structured
>> > links referring to headings with endless depth, like:
>>
>> I'm not entirely sure what your use case is but could you use a target,
>> i.e. something like <>, to indicate where you want to link to?
>> Cf. section 4.2 of org manual on internal links.
>>



[O] Export to LaTeX buffer

2018-03-12 Thread Hoffmann, Jobst
Hello to all users of this list, this is my first posting.

The org-mode manual version Release 9.1.6 (release 9.1.6-567-gbb5e79)
says on page 159, that export of an org file to a LaTeX buffer is doneby C-c 
C-e l L. 

This ends in a message

"Autoloading failed to define function turn-on-orgstruct"

A little bit of googling tells me, that "[O] [ANN] OrgStruct is dead.
Long live Orgalist."

So I can't go on with my usual work flow, but what should I do instead?
Do I have to write an elisp function, which opens the file generated by
C-c C-e l l and deletes all the document stuff surrounding the contents?
I'm interested only in the bare (LaTeX-prepared) content, because I
continue processing the the contents in my own environment.

Any help is appreciated, thanks in advance
Jobst
-- 
Prof. Dr. Jobst HoffmannTel:   +49 (2461) 99-31 59
Fachhochschule Aachen Abt. Jülich   Fax:   +49 (2461) 99-31 89
Fachbereich 3   email: j.hoffm...@fh-aachen.de

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

2018-03-12 Thread ST
Thank you for your reply.

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

Thank you!


On Mon, 2018-03-12 at 14:08 +0100, Christian Moe wrote:
> ST writes:
> 
> > Adding an extra <> is not an option, as it will make the text
> > less readable, and there is no need in this, as the headings tree
> > structure is already there:
> 
> Adding targets, CUSTOM_IDs or IDs are all options. You may not like them.
> 
> > * 1
> > ** 1
> > ** 2
> > *** 1
> >
> > Why should I turn it into the following
> >
> > * 1
> > ** 1
> > ** 2
> > *** 1
> > <<1>>
> 
> With a fixed structure, you wouldn't; you'd use e.g. <<1:2:1>>.
> 
> > and then link with [[file:1]]?!... This both:
> > a) adds unnecessary information into the text making it less readable
> 
> Let's not exaggerate the readability cost. And it does add information.
> 
> > b) those who read the org file as simple text without the ability to
> > click the link will not know where it goes... while the link
> > [[file:1:2:1]] makes it quite clear even without clicking it.
> 
> But so does the link [[1:2:1]] to the target <<1:2:1>>.
> 
> also, c): Adding a target like <<1:2:1>> to a section preserves
> information about the location of that section in the source document if
> you later cut that part out and insert it somewhere else. This
> information is not contained in your headlines.
> 
> > Example use case: scriptures with well known structure, e.g. the Bible.
> 
> Fair enough.
> 
> But typical Org use will quickly break links like that, since Org shines
> as an organizer for drafting and easily restructuring text. I don't
> think Org needs a link type that would encourage people to make easily
> breakable links.
> 
> I acknowledge that a separate target or CUSTOM_ID for every verse in the
> Bible seems a bit heavy; if that's what you need, it might be better
> solved by a custom link type.
> 
> Yours,
> Christian
> 
> >
> > On Mon, 2018-03-12 at 10:29 +, Eric S Fraga wrote:
> >> On Monday, 12 Mar 2018 at 12:09, ST wrote:
> >> > Hi,
> >> >
> >> > after reading the manual I didn't find a way to construct structured
> >> > links referring to headings with endless depth, like:
> >>
> >> I'm not entirely sure what your use case is but could you use a target,
> >> i.e. something like <>, to indicate where you want to link to?
> >> Cf. section 4.2 of org manual on internal links.
> >>




Re: [O] Export to LaTeX buffer

2018-03-12 Thread Nicolas Goaziou
Hello,

"Hoffmann, Jobst"  writes:

> The org-mode manual version Release 9.1.6 (release 9.1.6-567-gbb5e79)
> says on page 159, that export of an org file to a LaTeX buffer is doneby C-c 
> C-e l L. 
>
> This ends in a message
>
> "Autoloading failed to define function turn-on-orgstruct"
>
> A little bit of googling tells me, that "[O] [ANN] OrgStruct is dead.
> Long live Orgalist."
>
> So I can't go on with my usual work flow, but what should I do instead?
> Do I have to write an elisp function, which opens the file generated by
> C-c C-e l l and deletes all the document stuff surrounding the contents?
> I'm interested only in the bare (LaTeX-prepared) content, because I
> continue processing the the contents in my own environment.

This looks like a mixed installation. "turn-on-orgstruct" does not exist
in master branch, which you seem to be using.

I suggest making sure you properly load Org from the git repository
instead of some other location.

Regards,

-- 
Nicolas Goaziou



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

2018-03-12 Thread Nicolas Goaziou
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,

-- 
Nicolas Goaziou



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

2018-03-12 Thread ST
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] buffer-file-name in [* Org src *] buffers

2018-03-12 Thread Nicolas Goaziou
Hello,

Clément Pit-Claudel  writes:

> TL;DR: why does org-src-mode-configure-edit-buffer set
> buffer-file-name to a non-nil value?
> https://code.orgmode.org/bzg/org-mode/commit/4b6988bf36cb458c9d113ee4332e016990c1eb04#diff-ea848b037ba2c0bf95915700bb6f4e539d80d8cR486

[...]

> Why is that?

The explanation is here:



AFAIU, this was needed so that Emacs would warn when closing a remote
editing buffer with C-x k. This feature doesn't appear to be functional
at the moment, tho.

Regards,

-- 
Nicolas Goaziou



[O] ical2org ready

2018-03-12 Thread Robert Horn

Version 0.97 of ical2org is available at
https://github.com/rjhorniii/ical2org-go.  It converts from Ical format,
e.g., .ics files, into an org-mode file.

It is feature complete.  It has been tested with ICal files from several
sources, and it is successfully processing my personal Google calendar
with a regular repeating automatic download.  It's ready for wider use.
After a few weeks use without problems reported, I'll make it a release.

For mu4e users, I've tested using attachment pipe processing with it.
It does correctly convert ics files that are attached to emails, but the
process is awkward.  There is a lot of typing.  Creating a little lisp
command for mu4e is likely the right solution.

--
Robert Horn
rjhorn...@gmail.com



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

2018-03-12 Thread stardiviner

Add a more better way to open src block.

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

---
 lisp/org-src.el | 6 ++
 1 file changed, 6 insertions(+)

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] [ORG] [FEATURE] ob-js.el support :session for all existing JS packages

2018-03-12 Thread Nick Dokos
"numbch...@gmail.com"  writes:

> After add more code, not it supports `js-comint`, `skewer-mode`, `Indium`.
>
> Waited many days, still no response. Anyone want to review this code?
>
> Recently view Org-mode mailing list, many threads has response. Why my post 
> does not have any response?
>

Because reviewing code is hard: in this case, one needs some expertise
in org, but also in JS and its supporting packages in emacs. Speaking
for myself, I have some (rather rusty at this point) expertise in org,
but none in the other areas; I also have no time. I suspect that one
or more of these reasons are shared by most people on the list. The
wonder of it is that many questions *do* get answered, but in many
cases, they tend to be a short question-answer sequence. OTOH, there
are topics that go on for years with no resolution in sight despite
extended discussion. And there are certainly lots that fall by the
wayside.

So do not expect miracles, but if after a sufficient period of time,
things seem to have fallen into the cracks and forgotten, then a bump
might be warranted. But patience is a virtue!

-- 
Nick




[O] Soft return in footnote text?

2018-03-12 Thread Lawrence Bottorff
I'm getting carried away with a footnote and want to have it be many
paragraphs long when I export it to HTML. I can put in latex math formulae,
and that breaks things up. But is there a way to simply have separate text
paragraph in an org-mode footnote?

LB


Re: [O] Soft return in footnote text?

2018-03-12 Thread Nicolas Goaziou
Hello,

Lawrence Bottorff  writes:

> I'm getting carried away with a footnote and want to have it be many
> paragraphs long when I export it to HTML. I can put in latex math formulae,
> and that breaks things up. But is there a way to simply have separate text
> paragraph in an org-mode footnote?

A footnote definition can contain paragraphs. Simply insert a blank
line, like you would for regular paragraphs.

Regards,

-- 
Nicolas Goaziou



Re: [O] Soft return in footnote text?

2018-03-12 Thread Samuel Wales
On 3/12/18, Lawrence Bottorff  wrote:
> I'm getting carried away with a footnote and want to have it be many
> paragraphs long when I export it to HTML. I can put in latex math formulae,
> and that breaks things up. But is there a way to simply have separate text
> paragraph in an org-mode footnote?

footnotes can be separate or inline.  i think you are using inline.

inline is really good because it keeps the thing referred to with the
thing that is referring to it.  this shared locality helps prevent
footnotes from getting out of sync due to edits.  for this reason, i
use inline footnotes exclusively.

i too use multiple paragraphs in inline footnotes.  in principle, i
think you can use \par or something like that, but that's ugly.  your
idea of soft newlines is really interesting.  i don't recall their
behavior, so i can't answer.

this might be what you are doing?  i much prefer it:

ad faksdn kfsd kfjans kdfn kasdfn kasf kasf [fn::first par

second par.] rest of same paragraph.

however, org no longer supports this directly as of the new org parser.

what i do is use a filter function, which uses the new parser.  this
is slightly modified from something nicolas posted.

  (add-hook 'org-export-before-parsing-hook 'my-org-export-par-in-inline-fn)
  (defun my-org-export-par-in-inline-fn (backend)
"Fix inline footnote paragraphs."
(with-no-warnings
  (unless (org-export-derived-backend-p backend 'latex)
(org-footnote-normalize)
;; =alpha i guess it sticks \par in there for you
(while (re-search-forward "par\\s-*" nil t)
  (replace-match "\n\n")

this works for me.  it restores the previous behavior that i like.

the future concern is fontification.  currently this works perfectly.
however, if the org fontifier starts using the new parser, and does
not accommodate this style, then the inline footnote will not be
fontified correctly.  this has not occurred.

if such a future fontifier accommodates this style, no problem.

dunno if soft newlines for inline footnote paragraphs could fix that
or be possible.

-- 
The Kafka Pandemic: 

The disease DOES progress. MANY people have died from it. And ANYBODY
can get it at any time.

"You’ve really gotta quit this and get moving, because this is murder
by neglect." ---
.



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

2018-03-12 Thread ST
Hello,

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

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"

Will the links be clickable?

Thank you!




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

2018-03-12 Thread Samuel Wales
thank you.

i will try it.



Re: [O] Export to LaTeX buffer

2018-03-12 Thread Samuel Wales
On 3/12/18, Nicolas Goaziou  wrote:
> This looks like a mixed installation. "turn-on-orgstruct" does not exist
> in master branch, which you seem to be using.
>
> I suggest making sure you properly load Org from the git repository
> instead of some other location.

in addition, i find it useful to have a single location for load-path.
otherwise requires and autoloads can do strange things.

-- 
The Kafka Pandemic: 

The disease DOES progress. MANY people have died from it. And ANYBODY
can get it at any time.

"You’ve really gotta quit this and get moving, because this is murder
by neglect." ---
.



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

2018-03-12 Thread David Belohrad
Dear all,

I have upgraded after some time org-plus-contrib through elpa to version 
20180312, and quite some things stopped working. Most of them I have found, and 
have been related to usage of sexp in capture template, but there's one I'm 
struggling to find.

My org-agenda now displays incorrectly the timestamps, which have only one 
bound. So if I make timestamp like:

Entered on <2018-03-12 Mon 23:21-23:59>

that timestamp is correctly displayed in the agenda, however when I make only 
this one:

Entered on <2018-03-12 Mon 23:21>

this one displays the starting time, followed by combination of useless 
letters, partly arabic, japanese and completely breaks the appearance of the 
agenda.

What did I forget to migrate when upgrading org-mode? I don't find anything 
related to such behaviour in the changelog.

many thanks

.d.



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

2018-03-12 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.

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

> Will the links be clickable?

Yes.

Regards,

-- 
Nicolas Goaziou



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

2018-03-12 Thread Nicolas Goaziou
Hello,

Vladimir Panteleev  writes:

> * ob-table.el (org-sbe): (org-sbe func (x $ "a\"b\"c")) did the wrong

The dollar character looks strange. What syntax is that?

> -  (quote (format "\"%s\"" el))
> +  (quote (format "%S" el))

OK.

> +#+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 ...)) ?

Regards,

-- 
Nicolas Goaziou



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

2018-03-12 Thread Samuel Wales
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.



Re: [O] Soft return in footnote text?

2018-03-12 Thread Samuel Wales
another workaround is to use \\ instead of \par.



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

2018-03-12 Thread Nick Dokos
David Belohrad  writes:

> Dear all,
>
> I have upgraded after some time org-plus-contrib through elpa to
> version 20180312, and quite some things stopped working. Most of them
> I have found, and have been related to usage of sexp in capture
> template, but there's one I'm struggling to find.
>
> My org-agenda now displays incorrectly the timestamps, which have only one 
> bound. So if I make timestamp like:
>
> Entered on <2018-03-12 Mon 23:21-23:59>
>
I don't think this format is legal for a timestamp.

> that timestamp is correctly displayed in the agenda, however when I make only 
> this one:
>
> Entered on <2018-03-12 Mon 23:21>
>
> this one displays the starting time, followed by combination of useless 
> letters, partly arabic, japanese and completely breaks the appearance of the 
> agenda.
>
> What did I forget to migrate when upgrading org-mode? I don't find anything 
> related to such behaviour in the changelog.

What happens if you start with 'emacs -q -l /path/to/minimal/init.el' (i.e. 
bypassing most of your init file)?

-- 
Nick




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

2018-03-12 Thread Samuel Wales
locale?



Re: [O] [ORG] [FEATURE] ob-js.el support :session for all existing JS packages

2018-03-12 Thread stardiviner

Aha, I see now. thanks for your answer. @Nick


On 03/13/2018 01:54 AM, Nick Dokos wrote:

"numbch...@gmail.com"  writes:


After add more code, not it supports `js-comint`, `skewer-mode`, `Indium`.

Waited many days, still no response. Anyone want to review this code?

Recently view Org-mode mailing list, many threads has response. Why my post 
does not have any response?


Because reviewing code is hard: in this case, one needs some expertise
in org, but also in JS and its supporting packages in emacs. Speaking
for myself, I have some (rather rusty at this point) expertise in org,
but none in the other areas; I also have no time. I suspect that one
or more of these reasons are shared by most people on the list. The
wonder of it is that many questions *do* get answered, but in many
cases, they tend to be a short question-answer sequence. OTOH, there
are topics that go on for years with no resolution in sight despite
extended discussion. And there are certainly lots that fall by the
wayside.

So do not expect miracles, but if after a sufficient period of time,
things seem to have fallen into the cracks and forgotten, then a bump
might be warranted. But patience is a virtue!