Re: noweb multiple block together

2019-11-24 Thread Sebastian Miele
Hi Ken,

Ken Mankoff  writes:

> When tangling blocks, I can tangle multiple blocks by setting a
> (sub)-tree level property, or ":tangle foo" in multiple headers. Is
> there a way to achieve the same thing with noweb?
>
> I've tried giving multiple blocks the same "+name:" and then <>,
> but only one seems to be included. Does this feature exist through
> some mechanism?

A block named by #+name: should always be unique per file. Otherwise the
Org tangling code that I looked at until now (which is most or even all
in the master branch) just uses the first one found, without checking
for duplicates.

On the other hand there is the possibility to give a common name to
multiple blocks via the header arg :noweb-ref. That works in the way you
looking for.

There is a further difference between these two kinds of naming: With
blocks named by :noweb-ref it is not possible to do something like
<>. Only <>, i.e. plain inclusion, is possible.

Best wishes
Sebastian



noweb multiple block together

2019-11-24 Thread Ken Mankoff
Hello,

When tangling blocks, I can tangle multiple blocks by setting a (sub)-tree 
level property, or ":tangle foo" in multiple headers. Is there a way to achieve 
the same thing with noweb?

I've tried giving multiple blocks the same "+name:" and then <>, but only 
one seems to be included. Does this feature exist through some mechanism?

Thanks,

  -k.



Re: Opening org Agenda whenever opening GNUs:

2019-11-24 Thread Eric Abrahamsen
Spenser Truex  writes:

> Email is something I check often (with Gnus), so attaching my agenda to
> it is a good way to stay on track.
>
> (defun my-instant-agenda ()
>   (org-agenda-list nil))
> (add-hook 'gnus-before-startup-hook 'my-instant-agenda)
>
> I'd like to be able to have it split vertically, since it otherwise
> obscures my view. How can I do that?
>
>
> =ACTUAL SETUP=
> +--+
> | Gnus |
> |org-mailing list  |
> +--|
> |  |
> |  |
> |  ORG AGENDA  |
> |TODO: everything  |
> |DONE: nothing |
> |  |
> |  |
> |  |
> +--+
> =GOAL EMACS ARANGEMENT=
> +--+
> | Gnus  |  ORG AGENDA  |
> |  org-mailing list |   DONE: everything   |
> |  Mom  |   TODO: other stuff  |
> |  alt.sex  |  |
> |   |  |
> |   |  |
> |   |  |
> |   |  |
> |   |  |
> |   |  |
> |   |  |
> |   |  |
> |   |  |
> |   |  |
> +---

What's your value of gnus-use-full-window? It defaults to t, and I
wouldn't have expected that even your "actual setup" above would work.
If you set that to nil, and then manually create the side-by-side layout
with "C-x 3", is it preserved?

I wrote a package called Gnorb that attempts to integrate Gnus and Org
(and BBDB) a little more closely together, so this is something that I'm
interested in. Gnorb can't currently do this sort of display, in part
because Gnus's window management is gnarly, but it does provide for
tagging Gnus messages with Org tags, and popping up agendas relevant to
messages. I'll be curious to see how you progress with this...




Re: Question: export with tags but hide "export" tag

2019-11-24 Thread wry

On 11/24, Fraga, Eric wrote:

You could maybe use this hook:

,[ C-h v org-export-before-processing-hook RET ]
| org-export-before-processing-hook is a variable defined in ‘ox.el’.
|
| Documentation:
| Hook run at the beginning of the export process.
|
| This is run before include keywords and macros are expanded and
| Babel code blocks executed, on a copy of the original buffer
| being exported.  Visibility and narrowing are preserved.  Point
| is at the beginning of the buffer.
|
| Every function in this hook will be called with one argument: the
| back-end currently used, as a symbol.
`

*if* it is invoked after the tag selection is done (I'm not sure if it
is or not).  You would have to write some emacs lisp to remove the
:export: tags.


Thanks, I'll look into it. Probably should brush up on my elisp anyway

Nick



Re: [PATCH] ob-plantuml: Support for plantuml as well as the current java+jar solution

2019-11-24 Thread Terje Larsen
Nicolas Goaziou  writes:

Hello and thank you for the feedback, made me learn a few things and
make some improvements. I have made the suggested changes (see
attachment).

>From e3c46993714234c0290f3100683cbec3c0d5f056 Mon Sep 17 00:00:00 2001
From: Terje Larsen 
Date: Fri, 8 Nov 2019 10:25:49 +0100
Subject: [PATCH] ob-plantuml: Add support for plantuml executable

* lisp/ob-plantuml (org-babel-variable-assignments:plantuml): Support
using plantuml executable instead of jar.

Some systems come with an executable for plantuml instead of a specific
JAR file. This adds support for two different modes:
- jar :: using java together with a JAR (previous behavior)
- plantuml :: using a PlantUML executable

The PlantUML executable can be configured via
`org-plantuml-executable-path` and also the arguments that will be given
via `org-plantuml-executable-args`.
---
 etc/ORG-NEWS|  5 +++
 lisp/ob-plantuml.el | 94 +
 2 files changed, 65 insertions(+), 34 deletions(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 689a07871..2cce7dd41 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -19,6 +19,11 @@ just as if it was at outline level 0.  Inheritance for properties will
 work also for this level.  In other words; defining things in a
 property drawer before the first headline will make them "inheritable"
 for all headlines.
+*** Babel
+ ob-plantuml now supports using PlantUML executable to generate diagrams
+Set =org-plantuml-exec-mode= to ='plantuml= in order to use the
+executable instead of JAR. Executable mode can be configured via:
+=org-plantuml-executable-path= and =org-plantuml-executable-args=.
 
 * Version 9.3
 
diff --git a/lisp/ob-plantuml.el b/lisp/ob-plantuml.el
index 09c9a3334..aeea1802f 100644
--- a/lisp/ob-plantuml.el
+++ b/lisp/ob-plantuml.el
@@ -31,7 +31,7 @@
 ;;; Requirements:
 
 ;; plantuml | http://plantuml.sourceforge.net/
-;; plantuml.jar | `org-plantuml-jar-path' should point to the jar file
+;; plantuml.jar | `org-plantuml-jar-path' should point to the jar file (when exec mode is `jar')
 
 ;;; Code:
 (require 'ob)
@@ -46,6 +46,31 @@
   :version "24.1"
   :type 'string)
 
+(defcustom org-plantuml-exec-mode 'jar
+  "Method to use for PlantUML diagram generation.
+`jar' means to use java together with the JAR.
+The JAR can be configured via `org-plantuml-jar-path'.
+
+`plantuml' means to use the PlantUML executable.
+The executable can be configured via `org-plantuml-executable-path'.
+You can also configure extra arguments via `org-plantuml-executable-args'."
+  :group 'org-babel
+  :package-version '(Org . "9.4")
+  :type 'symbol
+  :options '(jar plantuml))
+
+(defcustom org-plantuml-executable-path "plantuml"
+  "File name of the PlantUML executable."
+  :group 'org-babel
+  :package-version '(Org . "9.4")
+  :type 'string)
+
+(defcustom org-plantuml-executable-args (list "-headless")
+  "The arguments passed to plantuml executable when executing PlantUML."
+  :group 'org-babel
+  :package-version '(Org . "9.4")
+  :type '(repeat string))
+
 (defun org-babel-variable-assignments:plantuml (params)
   "Return a list of PlantUML statements assigning the block's variables.
 PARAMS is a property list of source block parameters, which may
@@ -82,40 +107,41 @@ This function is called by `org-babel-execute-src-block'."
 	 (cmdline (cdr (assq :cmdline params)))
 	 (in-file (org-babel-temp-file "plantuml-"))
 	 (java (or (cdr (assq :java params)) ""))
+	 (executable (cond ((eq org-plantuml-exec-mode 'plantuml) org-plantuml-executable-path)
+			   (t "java")))
+	 (executable-args (cond ((eq org-plantuml-exec-mode 'plantuml) org-plantuml-executable-args)
+((string= "" org-plantuml-jar-path)
+ (error "`org-plantuml-jar-path' is not set"))
+((not (file-exists-p org-plantuml-jar-path))
+ (error "Could not find plantuml.jar at %s" org-plantuml-jar-path))
+(t (list java
+	 "-jar"
+	 (shell-quote-argument (expand-file-name org-plantuml-jar-path))
 	 (full-body (org-babel-plantuml-make-body body params))
-	 (cmd (if (string= "" org-plantuml-jar-path)
-		  (error "`org-plantuml-jar-path' is not set")
-		(concat "java " java " -jar "
-			(shell-quote-argument
-			 (expand-file-name org-plantuml-jar-path))
-			(if (string= (file-name-extension out-file) "png")
-			" -tpng" "")
-			(if (string= (file-name-extension out-file) "svg")
-			" -tsvg" "")
-			(if (string= (file-name-extension out-file) "eps")
-			" -teps" "")
-			(if (string= (file-name-extension out-file) "pdf")
-			" -tpdf" "")
-			(if (string= (file-name-extension out-file) "tex")
-			" -tlatex" "")
-			(if (string= (file-name-extension out-file) "vdx")
-			" -tvdx" "")
-			(if (string= (file-name-extension out-file) "xmi")
-			" -txmi" "")
-			(if (string= (file-name-extension out-file) "scxml")
-			" -tscxml" "")
-			(if (string= (file-name-extension out-file) "html")
-			" -thtml" "")
-			(if (string= (file-name-extension 

org-enable-table-editor is removed since 9.1

2019-11-24 Thread Tomasz Piotrowski
Hi,

If I try to edit a table in org-mode, e.g., add a row to it, I get a
message

"eval: Symbol’s value as variable is void: org-enable-table-editor".

This is in line with changes made in version 9.1:
https://orgmode.org/Changes_old.html#org8981857

This makes the manual for editing tables:
https://orgmode.org/manual/Built_002din-table-editor.html

unusable for me. Indeed, I get the same message:

"eval: Symbol’s value as variable is void: org-enable-table-editor"

when I tried to submit the bug using:

M-x org-submit-bug-report 

I am on version 9.2.6, but I think all versions since 9.1 are affected.

How to edit tables in org-mode?

Tomasz Piotrowski



bug#37338: Org-mode manual sec 11.8.2 out of date

2019-11-24 Thread Michael Wu
No, I cannot. Perhaps my version is out of date.

On Sat, Nov 23, 2019 at 11:49 AM Nicolas Goaziou 
wrote:

> Hello,
>
> Michael Wu  writes:
>
> > C-c C-x C-l is what removes the preview images, not C-c C-c as suggested
> in
> > the info note.
>
> I cannot find the paragraph you're talking about. Can you see it in the
> manual at ?
>
> Thank you.
>
> Regards,
>
> --
> Nicolas Goaziou
>


Opening org Agenda whenever opening GNUs:

2019-11-24 Thread Spenser Truex
Email is something I check often (with Gnus), so attaching my agenda to
it is a good way to stay on track.

(defun my-instant-agenda ()
  (org-agenda-list nil))
(add-hook 'gnus-before-startup-hook 'my-instant-agenda)

I'd like to be able to have it split vertically, since it otherwise
obscures my view. How can I do that?


=ACTUAL SETUP=
+--+
| Gnus |
|org-mailing list  |
+--|
|  |
|  |
|  ORG AGENDA  |
|TODO: everything  |
|DONE: nothing |
|  |
|  |
|  |
+--+
=GOAL EMACS ARANGEMENT=
+--+
| Gnus  |  ORG AGENDA  |
|  org-mailing list |   DONE: everything   |
|  Mom  |   TODO: other stuff  |
|  alt.sex  |  |
|   |  |
|   |  |
|   |  |
|   |  |
|   |  |
|   |  |
|   |  |
|   |  |
|   |  |
|   |  |
+---
--
Spenser Truex
spensertruex.com
SFSU Computer Science



org 9.2.6 and org 9.1.9

2019-11-24 Thread Jean-Christophe Helary
org 9.1.9 is a built-in

but org 9.2.6 comes as a dependency to some packages and having both installed 
creates conflicts.

Why does that happen ?

Can't 9.2.6 override 9.1.9 ? It's not the first time I have issues with that 
situation and that's extremely confusing. What is the best way to solve that ?



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





Agenda initial state

2019-11-24 Thread Michael Brand
Hi all

I would like to ask for some help with the setup of
~org-agenda-start-with-log-mode~ and
~org-agenda-start-with-clockreport-mode~.

With the minimal setup below I can see the effect of
~org-agenda-clockreport-parameter-plist~ but when I open the agenda
with ~x~ the log and clockreport are not enabled initially, only after
typing ~l~ and ~R~. I tried several web searches and Worg to find an
answer but failed. Org mode version is a recent master.

#+begin_src emacs-lisp
  (setq
   org-agenda-custom-commands
   '(("x" "Log and report of clocking"
  ((agenda
"" ((org-agenda-files '("~/d/clock.org"))
(org-agenda-start-with-log-mode t)
(org-agenda-start-with-clockreport-mode t)
(org-agenda-clockreport-parameter-plist
 '(:hidefiles t :maxlevel 3 :narrow 25
#+end_src

Michael



Re: Question: export with tags but hide "export" tag

2019-11-24 Thread Fraga, Eric
On Saturday, 23 Nov 2019 at 11:59, w...@mm.st wrote:
> Any ideas about how to export using this workflow without showing
> the "export" tag?

You could maybe use this hook:

,[ C-h v org-export-before-processing-hook RET ]
| org-export-before-processing-hook is a variable defined in ‘ox.el’.
| 
| Documentation:
| Hook run at the beginning of the export process.
| 
| This is run before include keywords and macros are expanded and
| Babel code blocks executed, on a copy of the original buffer
| being exported.  Visibility and narrowing are preserved.  Point
| is at the beginning of the buffer.
| 
| Every function in this hook will be called with one argument: the
| back-end currently used, as a symbol.
`

*if* it is invoked after the tag selection is done (I'm not sure if it
is or not).  You would have to write some emacs lisp to remove the
:export: tags.
 
-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.2.6-552-g8c5a78


Re: Editting from the agenda view

2019-11-24 Thread Shérab
Hi,

"Éibhear" (2019/11/22 17:30 -):
> 
> Hi,
> 
> Have a look at the agenda columns view in the documentation. I find it
> very useful for editing items in situ in the agenda.

Thanks. Will do, but usually columns are not very handy for me -- I'm
blind and using a braille terminal. In such a context linearity matters
quite a lot.

Best wishes,

Shérab.



Re: Editting from the agenda view

2019-11-24 Thread Shérab
Hi,

Pankaj Jangid (2019/11/22 17:12 +):
> Shérab  writes:
> >> I usually press Enter on the entry, which takes you to the file from
> >> where it came, and you can edit it there.
> > I tried and it worked, thanks! Does this leave the agenda view and you
> > then return to it as you enter it the fiirst time, e.g. C-c a a ?
> No. It comes to the same state where you left. It is a buffer. It won't
> change until you press 'g'.

Okay, thanks.

Shérab.



Re: Editting from the agenda view

2019-11-24 Thread Shérab
Hello Eric, many thanks for your help!

Eric Abrahamsen (2019/11/22 09:07 -0800):
> Shérab  writes:
> 
> > Hi Diego, many thanks for your prompt response!
> >
> > Diego Zamboni (2019/11/22 16:55 +0100):
> >> Hi Shérab,
> >> 
> >> I usually press Enter on the entry, which takes you to the file from where
> >> it came, and you can edit it there.
> >
> > I tried and it worked, thanks! Does this leave the agenda view and you
> > then return to it as you enter it the fiirst time, e.g. C-c a a ?
> >
> > Is there a way to return to the agenda view exactly where one was when
> > pressing enter?
> 
> If you use  instead of , the underlying org file will be
> popped up next to the agenda, instead of replacing it.

Yes, that worked, thanks!

> When you're done
> editing use `other-window' to get back to the agenda, then "o" to close
> other windows.

To go back to the other window (the agenda view) I used C-x o and that
worked but the agenda view had not been updated and it didn't get
updated when I then pressed 'o' to close other windows. IS that the
expected behaviour? Somehow I'd like that the agenda view gets refreshed
automatically at some point, if that's possible?

Thanks again Eric, it does help!

Shérab.



Re: [PATCH] COMMENT and noweb-ref

2019-11-24 Thread Nicolas Goaziou
Hello,

Sebastian Miele  writes:

> Sorry. I messed up the previous mail. Please ignore it.

Applied. Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [PATCH] ob-plantuml: Support for plantuml as well as the current java+jar solution

2019-11-24 Thread Nicolas Goaziou
Hello,

Terje Larsen  writes:

> And also see attached within this mail.

Thank you. 

Could you rebase it on top of "next" branch and add an entry in
ORG-NEWS, section "Org 9.4" about it?

> +(defcustom org-plantuml-exec-mode 'jar
> +  "Method to use for PlantUML diagram generation.
> +`jar' means to use java together with the JAR.
> +The JAR can be configured via `org-plantuml-jar-path'.
> +
> +`plantuml' means to use the PlantUML executable.
> +The executable can be configured via `org-plantuml-executable-path'.
> +You can also configure extra arguments via `org-plantuml-executable-args'."
> +  :group 'org-babel
> +  :version "24.1"

Please use 

  :package-version '(Org . "9.4")

instead.

> +(defcustom org-plantuml-executable-path "plantuml"
> +  "Path to the PlantUML executable."

File name of the PlantUML executable.

> +(defcustom org-plantuml-executable-args (list "-headless")
> +  "The arguments passed to plantuml executable when executing PlantUML."
> +  :group 'org-babel
> +  :version "24.1"

See above.

> +  (executable-args (cond ((eq org-plantuml-exec-mode 'plantuml) 
> org-plantuml-executable-args)
> + (t (cond ((string= "" org-plantuml-jar-path)
> +   (error "`org-plantuml-jar-path' is 
> not set"))
> +  ((not (file-exists-p 
> org-plantuml-jar-path))
> +   (error "Could not find plantuml.jar 
> at %s" org-plantuml-jar-path))
> +  (t (list java
> +   "-jar"
> +   (shell-quote-argument
> +(expand-file-name 
> org-plantuml-jar-path

Could you merge the two `cond' in `executable-args'?

> +  (cmd (string-join
> +(append
> + (list executable)
> + executable-args
> + (cond ((string= (file-name-extension out-file) "png") 
> '("-tpng"))
> +   ((string= (file-name-extension out-file) "svg") 
> '("-tsvg"))
> +   ((string= (file-name-extension out-file) "eps") 
> '("-teps"))
> +   ((string= (file-name-extension out-file) "pdf") 
> '("-tpdf"))
> +   ((string= (file-name-extension out-file) "tex") 
> '("-tlatex"))
> +   ((string= (file-name-extension out-file) "vdx") 
> '("-tvdx"))
> +   ((string= (file-name-extension out-file) "xmi") 
> '("-txmi"))
> +   ((string= (file-name-extension out-file) "scxml") 
> '("-tscxml"))
> +   ((string= (file-name-extension out-file) "html") 
> '("-thtml"))
> +   ((string= (file-name-extension out-file) "txt") 
> '("-ttxt"))
> +   ((string= (file-name-extension out-file) "utxt") 
> '("-utxt")))

Could you use 

   (pcase (file-name-extension out-file)
("png" ...)
...)

instead?

Regards,

-- 
Nicolas Goaziou



Re: [PATCH] ob-java.el: Add header argument to pass command line args

2019-11-24 Thread Nicolas Goaziou
Hello,

Jarmo Hurri  writes:

> Any hope of this super tiny patch being applied? It addresses the
> problem I brought up in another thread: it is currently not possible to
> pass command line arguments to a java program.

Org 9.3 is feature frozen for the time being. Do you think this
qualifies as a bugfix or as a new feature? In the latter case, could you
rebase it on top of "next" branch and add an entry in ORG-NEWS, under
"Org 9.4" section?

Thank you!

Regards,

-- 
Nicolas Goaziou