Subject: [PATCH] Fix DISPLAY error on exporting org with plantuml to html

2021-10-17 Thread Sun Lin

Hi Bastien,

Please help to review this patch. Thanks

Best Regards

Lin Sun

- Forwarded Message -

From: Sun Lin 
To: emacs-orgmode@gnu.org 
Sent: Saturday, October 16, 2021, 03:25:40 AM UTC
Subject: Subject: [PATCH] Fix DISPLAY error on exporting org with plantuml to 
html


Hi,

When the environment variable "DISPLAY" is invalid, exporting plantuml block in 
org will got error message:
Exception in thread "main" java.awt.AWTError: Can't connect to X11 window 
server using 'localhost:11.0' as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
...
To reproduce this issue, install the plantuml.jar and make sure it work inside 
org-mode.
Then open `/tmp/testing.org` and  input follow plantuml code and 
eval-expression `(progn (setenv "DISPLAY" 
"localhost:90")(org-html-export-to-html))`.
The root cause is org-mord execute the plantuml.jar in command line without 
headless parameter, then plantuml will try read the DISPLAY, it's unnecessary.
(For standalone plantuml, `org-plantuml-executable-args` has default value 
'-headless' to avoid reading DISPLAY).

Please help review the patch. Thanks.

Best Regards
Lin
From 5e04a800691b04edd940dd124987336f6f30dd62 Mon Sep 17 00:00:00 2001
From: Lin Sun 
Date: Sat, 16 Oct 2021 03:01:18 +
Subject: [PATCH] Fix DISPLAY error on exporting org with plantuml to html

* org-babel-execute:plantuml: using headless mode for org calling plantuml for exporting to html
---
 lisp/ob-plantuml.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/ob-plantuml.el b/lisp/ob-plantuml.el
index fc62160..7d92227 100644
--- a/lisp/ob-plantuml.el
+++ b/lisp/ob-plantuml.el
@@ -122,6 +122,7 @@ This function is called by `org-babel-execute-src-block'."
 ((not (file-exists-p org-plantuml-jar-path))
  (error "Could not find plantuml.jar at %s" org-plantuml-jar-path))
 (t (list java
+	 "-Djava.awt.headless=true"
 	 "-jar"
 	 (shell-quote-argument (expand-file-name org-plantuml-jar-path))
 	 (full-body (org-babel-plantuml-make-body body params))
-- 
2.7.0



Re: Subject: [PATCH] Fix DISPLAY error on exporting org with plantuml to html

2021-11-17 Thread Sun Lin
Hi Bastien,

> Hi,
> I will - but please be aware that we have a policy of waiting at least
> one month before bumping a thread:
> https://orgmode.org/worg/org-mailing-list.html#i-didnt-receive-an-answer
> Thanks,
> Bastien

Please help the patch, thanks.

Lin    From 5e04a800691b04edd940dd124987336f6f30dd62 Mon Sep 17 00:00:00 2001
From: Lin Sun 
Date: Sat, 16 Oct 2021 03:01:18 +
Subject: [PATCH] Fix DISPLAY error on exporting org with plantuml to html

* org-babel-execute:plantuml: using headless mode for org calling plantuml for exporting to html
---
 lisp/ob-plantuml.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/ob-plantuml.el b/lisp/ob-plantuml.el
index fc62160..7d92227 100644
--- a/lisp/ob-plantuml.el
+++ b/lisp/ob-plantuml.el
@@ -122,6 +122,7 @@ This function is called by `org-babel-execute-src-block'."
 ((not (file-exists-p org-plantuml-jar-path))
  (error "Could not find plantuml.jar at %s" org-plantuml-jar-path))
 (t (list java
+	 "-Djava.awt.headless=true"
 	 "-jar"
 	 (shell-quote-argument (expand-file-name org-plantuml-jar-path))
 	 (full-body (org-babel-plantuml-make-body body params))
-- 
2.7.0



Re: Subject: [PATCH] Fix DISPLAY error on exporting org with plantuml to html

2021-11-17 Thread Sun Lin
Hi Timothy,

Thank you so much!

B.R.
Lin



Re: Subject: [PATCH] Fix DISPLAY error on exporting org with plantuml to html

2021-11-29 Thread Sun Lin
Hi Timothy,

Thank you! : ) 

I had signed the FSF, RT: 1718442. 

B.R.
 Lin

On Tuesday, November 30, 2021, 04:22:03 AM UTC, Timothy  
wrote: 
> Hi Sun,

> Thanks for not forgetting about this. As I commented before, I this looks
 sensible enough to apply, and so I’ve just pushed it as f9dcc3d with a tweaked
 commit message.

> You’ve also been added to the list of TINYCHANGE contributors on
 . If you submit more than 20
 cumulative lines of non-trivial code, you’ll need to get FSF assignment.

> Thanks for sharing the issue and making a patch for it 🙂 hopefully we’ll see
 you around in the future.



[PATCH] org.el: Make sure (org-agenda-files) search relative file paths in org-directory

2021-05-20 Thread Sun Lin
Hi Nicolas, 

Please help review and merge this patch. Thanks

Best Regards
Sun.Lin
From e963bd5554b076c813cde1f59d75f0686fec8a14 Mon Sep 17 00:00:00 2001
From: Sun Lin 
Date: Thu, 13 May 2021 09:52:33 +
Subject: [PATCH] org-agenda-files: work with relateive file paths.

* lisp/org.el (org-agenda-files): Make sure org-agenda-files work with relative
file paths.
---
 lisp/org.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index b388bca..04e1f80 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -15395,7 +15395,7 @@ used by the agenda files.  If ARCHIVE is `ifmode', do this only if
  (if (file-directory-p f)
  (directory-files
   f t org-agenda-file-regexp)
-   (list f)))
+   (list (expand-file-name f org-directory
 			   files)))
 (when org-agenda-skip-unavailable-files
   (setq files (delq nil
-- 
2.7.0