Selection owner couldn’t convert: STRING

2022-08-27 Thread Sharon Kimble
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512


I've found a problem with Imenu and org-mode, and the error report says -

=
Selection owner couldn’t convert: STRING
Error in menu-bar-update-hook (imenu-update-menubar): (wrong-type-argument 
char-or-string-p nil)
=

And its locking all of the menu-bar up such that nothing on it can be used!

I've rebuilt emacs twice, which also included deleting my git repo of it, and 
re-downloading emacs from git and rebuilding. But its made no difference!   
 

I've also re-downloading org-mode and rebuilt it, still with no solution!

My Imenu configuration hasn't changed since January 2021, so please, how can I 
get Imenu working properly again?

(I'm sending this to the org-mode mailing list because the problem only occurs 
in org-mode.)

Thanks
Sharon.
- -- 
A taste of linux = http://www.sharons.org.uk
TGmeds = http://www.tgmeds.org.uk
DrugFacts = https://www.drugfacts.org.uk
Debian 11.4, fluxbox 1.3.7, emacs 29.0.50, org 9.5.4 
-BEGIN PGP SIGNATURE-

iQJRBAEBCgA7FiEELSc/6QwVBIYugJDbNoGAGQr4g1sFAmMKEbEdHGJvdWRpY2Nh
c0Bza2ltYmxlMDkucGx1cy5jb20ACgkQNoGAGQr4g1v8lA/7Bbx2+nYCyZHO520H
gx01ZbIp5K/LsMNrxqH29k3TWCBLiBTqYIzrtUP2hr6HFj+a0rnYGWrfRs05kEi5
t2vCroDX4To3LevTZk0owVL7LUcLf4BhtPhVGrnS4njtkuGNwI6BCv8pqdICjnSC
5WVI3I8pCu+EBHFrQdVDvDPFgaZBPflgr/3BN7eiM8mb4LFBbWEuPm4DEiLWynlU
XaFc3Jbq1z4+ofuJYq7QESlmzEoYxzh+/8VMZ5nT6WDT7U/Nxt/Jx8sl67HdIpFJ
j8RAlyjZZ6ub56+GsPzOSV+LQ4dlcc3kwfPrtJkp/hculpVGXolHiEnqEVxySk0c
b69unbZ5wYZQMKkBuRrYKQdWDs8UnWEwhuqBOskr/qWTzKGsErO5uZyw24Z2mo5B
/AbN4FcU0mWsCKXWCeFcqi4Rq5l37aTsyryp+tMAtLrRHtKu5gKrWNeR+zmg87Xh
wd6hyiD3k3yh6Cqd4D6vjn7osJZYXnHDHDGP2x9q52jbqxWcr+O4FDLUfW4l2ZgA
ukQT4dAgtn3aNsXOu5SAMOaXyY1SVZweSgT/PQg03SGtTdPr59v8S4UpVWXzf5ME
umJ09V/XBjXUZmf04UsKs8e7UzfsaGmuDPzJPxa0u3dfueI0CCbH6tWgvKl3/XW3
vlARRULFDadZh+3mbXSZJrcm0cM=
=yXvu
-END PGP SIGNATURE-



bug#50514: 28.0.50; org inline call to python src block req C-g to break

2022-08-27 Thread Lars Ingebrigtsen
Ihor Radchenko  writes:

> Lars Ingebrigtsen  writes:
>
>> The bug on the Emacs side was fixed by Augusto's patch, I think, but
>> there's a remaining problem in ob-python, so I'm reassigning this bug
>> report to org-mode.
>
> Could you please elaborate what the problem is?
> There have been multiple issues in this thread and the one previously
> reported to Org ML is solved on Emacs side.

It's this bit:

> So I found if I extend the sleep-for in ob-python from 10 ms to 90 ms,
> my initialization problem is “fixed”.

The sleep is still 10ms in the in-tree ob-python, at least.






Re: Selection owner couldn’t convert: STRING

2022-08-27 Thread Ihor Radchenko
Sharon Kimble  writes:

> I've found a problem with Imenu and org-mode, and the error report says -
>
> =
> Selection owner couldn’t convert: STRING
> Error in menu-bar-update-hook (imenu-update-menubar): (wrong-type-argument 
> char-or-string-p nil)
> =

Are you able to reproduce starting from emacs -Q?
See https://orgmode.org/manual/Feedback.html

> And its locking all of the menu-bar up such that nothing on it can be used!
>
> I've rebuilt emacs twice, which also included deleting my git repo of it, and 
> re-downloading emacs from git and rebuilding. But its made no difference! 
>

Does it mean that you are using Emacs 29 (master branch)? Does the same
problem appear in Emacs 28?

> I've also re-downloading org-mode and rebuilt it, still with no solution!

Are you using main branch? bugfix? ELPA version?

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92



bug#50514: 28.0.50; org inline call to python src block req C-g to break

2022-08-27 Thread Ihor Radchenko
Lars Ingebrigtsen  writes:

>> Could you please elaborate what the problem is?
>> There have been multiple issues in this thread and the one previously
>> reported to Org ML is solved on Emacs side.
>
> It's this bit:
>
>> So I found if I extend the sleep-for in ob-python from 10 ms to 90 ms,
>> my initialization problem is “fixed”.
>
> The sleep is still 10ms in the in-tree ob-python, at least.

10ms magic constant is indeed not great.
However, I am unable to reproduce the original bug on my system.
I tried to draft an alternative patch. See the attached.

Mark, would you mind testing the patch?

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92


>From d5347c688d2fb8037116d82fa7987e9e6690ae66 Mon Sep 17 00:00:00 2001
Message-Id: 
From: Ihor Radchenko 
Date: Sat, 27 Aug 2022 22:06:11 +0800
Subject: [PATCH] ob-python: Fix Emacs bug#50514 when Python loads slowly

* lisp/ob-python.el (org-babel-python-initiate-session): Wait until
python process is initialized.
(org-babel-python-initiate-session-by-key): Do not rely on 10ms delay
to initialize Python.
---
 lisp/ob-python.el | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lisp/ob-python.el b/lisp/ob-python.el
index 932aca08e..2ad907bd8 100644
--- a/lisp/ob-python.el
+++ b/lisp/ob-python.el
@@ -197,8 +197,7 @@ (defun org-babel-python-initiate-session-by-key (&optional session)
 	  (setq py-buffer (org-babel-python-with-earmuffs session)))
 	(let ((python-shell-buffer-name
 	   (org-babel-python-without-earmuffs py-buffer)))
-	  (run-python cmd)
-	  (sleep-for 0 10)))
+	  (run-python cmd)))
((and (eq 'python-mode org-babel-python-mode)
 	 (fboundp 'py-shell)) ; python-mode.el
 	(require 'python-mode)
@@ -225,8 +224,9 @@ (defun org-babel-python-initiate-session-by-key (&optional session)
 (defun org-babel-python-initiate-session (&optional session _params)
   "Create a session named SESSION according to PARAMS."
   (unless (string= session "none")
-(org-babel-python-session-buffer
- (org-babel-python-initiate-session-by-key session
+(let ((session (org-babel-python-session-buffer
+(org-babel-python-initiate-session-by-key session)
+(org-babel-comint-wait-for-output session)))
 
 (defvar org-babel-python-eoe-indicator "org_babel_python_eoe"
   "A string to indicate that evaluation has completed.")
-- 
2.35.1



[PATCH] org.el: Fix percent substitutions in `org-open-file'

2022-08-27 Thread Max Nikulin

On 21/03/2021 19:36, Maxim Nikulin wrote:

On 13/02/2021 11:38, Kyle Meyer wrote:

+(defun org--open-file-format-spec (format specification)
+  (with-temp-buffer
+    (insert format)
+    (goto-char (point-min))
+    (while (search-forward "%" nil t)
+  (cond ((eq (char-after) ?%)
+ (delete-char 1))
+    ((looking-at "[s0-9]")
+ (replace-match
+  (or (cdr (assoc (match-string 0) specification))
+  (error "Invalid format string"))
+  'fixed-case 'literal)
+ (delete-region (1- (match-beginning 0)) (match-beginning 
0)))


It's pity that this issue has not fix yet. I have tried to implement 
another helper function. It is hardly usable outside of `org-open-file' 
(perhaps it is still suitable to make mailcap commands), but separate 
function makes the code testable. I hope, the attached patch fixes the 
problems with multiple regexp groups and with percent characters in 
replacement string. Notice that "\%", not "%%" is used to escape percent 
in mailcap, anyway neither variant was supported before.From 2f2850dcdc0cba8cfc6c0e21fc893c4e664d575c Mon Sep 17 00:00:00 2001
From: Max Nikulin 
Date: Sat, 27 Aug 2022 23:51:24 +0700
Subject: [PATCH] org.el: Fix percent substitutions in `org-open-file'

* lisp/org.el (org--open-file-format-command): New function with better
coverage of mailcap RFC 1524 syntax.  Do not replace percent character
in file name or link component, fix substitution of multiple regular
expression groups matched in the link target.
(org-open-file): Use `org--open-file-format-command' instead of inline
code.
* testing/lisp/test-org.el (org-test/org--open-file-format-command):
Tests for `org--open-file-format-command'.

The primary goal of moving code outside of `org-open-file' function is to
make it testable.

It should fix the following issues:
- Maxim Nikulin. greedy substitution in org-open-file.
  Wed, 20 Jan 2021 23:08:35 +0700.
  https://list.orgmode.org/ru9ki4$t5e$1...@ciao.gmane.io
- Rodrigo Morales. Org mode links: Open a PDF file at a given page
  and highlight a given string. Tue, 02 Mar 2021 15:07:32 -0500.
  https://list.orgmode.org/87lfb5pbej@gmail.com
---
 lisp/org.el  |  95 +---
 testing/lisp/test-org.el | 132 +++
 2 files changed, 206 insertions(+), 21 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 858123e67..e94ec02d9 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -8012,6 +8012,78 @@ opened in Emacs."
(when add-auto-mode
  (mapcar (lambda (x) (cons (car x) 'emacs)) auto-mode-alist
 
+(defun org--open-file-format-command
+(mailcap-command file link match-data)
+  "Format MAILCAP-COMMAND to launch viewer for FILE.
+
+Command may be an entry from the `org-file-apps' list or from
+mailcap file, for details see RFC 1524 A User Agent Configuration
+Mechanism For Multimedia Mail Format Information
+, man mailcap(5), and Info
+node `(emacs-mime) mailcap'.  Only a part of mailcap specification
+is supported.
+
+The following substitutions are interpolated in the MAILCAP-COMMAND
+string:
+- \"%s\" to FILE name passed through `convert-standard-file-name',
+  so it must be absolute path,
+- \"%1\" to \"%9\" groups from MATCH-DATA found in the LINK string
+  by the regular expression in the `org-file-apps' entry key
+  (performed by caller).
+
+Use backslash \"\\\" to quote percent \"%\" or any other character
+including backslash itself.
+
+In addition, each argument is passed through `shell-quote-argument',
+so quotes around substitutions should not be used.  For compliance
+with mailcap files single or double quotes around substitutions
+are stripped.
+
+For example, to specify particular location withing a PDF file,
+`org-file-apps' list may have the following entries (order is important):
+
+;; Page and search string,
+;; e.g. .
+(\".pdf::([0-9]+)::(.+)\\='\"
+. \"okular --page %1 --find %2 %s\")
+;; Internal anchor and search string,
+;; e.g. .
+(\".pdf::(.+)::(.+)\\='\"
+. \"okular --find %2 file://%s#%1\")
+;; Page number, e.g. .
+(\".pdf::([0-9]+)\\='\" . \"okular --page %1 %s\")
+;; Internal reference, e.g. .
+(\".pdf::(.+)\\='\" . \"okular file://%s#%1\")
+;; No location within the file, optionally followed by \"::\",
+;; e.g. .
+(\".pdf(?:::)?\\='\" . \"okular %s\")
+
+Side note: perhaps you would prefer to read the same bash manual used in the
+example as Info node `(bash) Redirections' (Org link: )."
+  (let ((spec (list (cons ?s  (convert-standard-filename file
+(ngroups (min 9 (- (/ (length match-data) 2) 1
+(when (> ngroups 0)
+  (set-match-data match-data)
+  (dolist (i (number-sequence 1 ngroups))
+(push (cons (+ ?0 i) (match-string-no

bug#50514: 28.0.50; org inline call to python src block req C-g to break

2022-08-27 Thread Barton, Mark


On Aug 27, 2022, at 7:11 AM, Ihor Radchenko 
mailto:yanta...@gmail.com>> wrote:

---
lisp/ob-python.el | 8 
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lisp/ob-python.el b/lisp/ob-python.el
index 932aca08e..2ad907bd8 100644
--- a/lisp/ob-python.el
+++ b/lisp/ob-python.el
@@ -197,8 +197,7 @@ (defun org-babel-python-initiate-session-by-key (&optional 
session)
  (setq py-buffer (org-babel-python-with-earmuffs session)))
(let ((python-shell-buffer-name
   (org-babel-python-without-earmuffs py-buffer)))
-   (run-python cmd)
-   (sleep-for 0 10)))
+   (run-python cmd)))
   ((and (eq 'python-mode org-babel-python-mode)
 (fboundp 'py-shell)) ; python-mode.el
(require 'python-mode)
@@ -225,8 +224,9 @@ (defun org-babel-python-initiate-session-by-key (&optional 
session)
(defun org-babel-python-initiate-session (&optional session _params)
  "Create a session named SESSION according to PARAMS."
  (unless (string= session "none")
-(org-babel-python-session-buffer
- (org-babel-python-initiate-session-by-key session
+(let ((session (org-babel-python-session-buffer
+(org-babel-python-initiate-session-by-key session)
+(org-babel-comint-wait-for-output session)))

(defvar org-babel-python-eoe-indicator "org_babel_python_eoe"
  "A string to indicate that evaluation has completed.")
--
2.35.1

I get the following in the Messages:
org-babel-comint-wait-for-output: Buffer python-chain does not exist or has no 
process

Note that python-chain is the name of my session passed to the python blocks as 
shown in the following line within my org file.

#+PROPERTY: header-args:python :session python-chain :exports results :results 
raw file :file-ext table

Thanks,

Mark



bug#50514: 28.0.50; org inline call to python src block req C-g to break

2022-08-27 Thread Mark Barton


> On Aug 27, 2022, at 11:59 AM, Barton, Mark  wrote:
> 
>  
> 
>> On Aug 27, 2022, at 7:11 AM, Ihor Radchenko  wrote:
>> 
>> ---
>> lisp/ob-python.el | 8 
>> 1 file changed, 4 insertions(+), 4 deletions(-)
>> 
>> diff --git a/lisp/ob-python.el b/lisp/ob-python.el
>> index 932aca08e..2ad907bd8 100644
>> --- a/lisp/ob-python.el
>> +++ b/lisp/ob-python.el
>> @@ -197,8 +197,7 @@ (defun org-babel-python-initiate-session-by-key 
>> (&optional session)
>>(setq py-buffer (org-babel-python-with-earmuffs session)))
>>  (let ((python-shell-buffer-name
>> (org-babel-python-without-earmuffs py-buffer)))
>> -  (run-python cmd)
>> -  (sleep-for 0 10)))
>> +  (run-python cmd)))
>>((and (eq 'python-mode org-babel-python-mode)
>>   (fboundp 'py-shell)) ; python-mode.el
>>  (require 'python-mode)
>> @@ -225,8 +224,9 @@ (defun org-babel-python-initiate-session-by-key 
>> (&optional session)
>> (defun org-babel-python-initiate-session (&optional session _params)
>>   "Create a session named SESSION according to PARAMS."
>>   (unless (string= session "none")
>> -(org-babel-python-session-buffer
>> - (org-babel-python-initiate-session-by-key session
>> +(let ((session (org-babel-python-session-buffer
>> +(org-babel-python-initiate-session-by-key session)
>> +(org-babel-comint-wait-for-output session)))
>> 
>> (defvar org-babel-python-eoe-indicator "org_babel_python_eoe"
>>   "A string to indicate that evaluation has completed.")
>> -- 
>> 2.35.1
> 
> I get the following in the Messages:
> org-babel-comint-wait-for-output: Buffer python-chain does not exist or has 
> no process
> 
> Note that python-chain is the name of my session passed to the python blocks 
> as shown in the following line within my org file.
> 
> #+PROPERTY: header-args:python :session python-chain :exports results 
> :results raw file :file-ext table
> 
> Thanks,
> 
> Mark
> 
I will work on getting more details this weekend. It looked like the buffer 
passed to org-babel-comint-wait-for-output was missing the "earmuffs". I tried 
adding the earmuffs with the org function for that but although I got passed 
that error, I messed up my python session and the following python blocks were 
not aware of the imports in the first block.

Mark

 

bug#50514: 28.0.50; org inline call to python src block req C-g to break

2022-08-27 Thread Barton, Mark

I will work on getting more details this weekend. It looked like the buffer 
passed to org-babel-comint-wait-for-output was missing the "earmuffs". I tried 
adding the earmuffs with the org function for that but although I got passed 
that error, I messed up my python session and the following python blocks were 
not aware of the imports in the first block.

Mark



I tried something that was suggested last September 14th by Augusto Stoffel. I 
had not tried it because changing the sleep from 10 to 90 was my workaround.
One thing that might work is to block until the shell is ready with something 
like

(run-python)
(with-current-buffer *the-shell-buffer*
  (while (not python-shell--first-prompt-received)
(accept-process-output (get-buffer-process (current-buffer)

The patch that is working for me now is:

modified   lisp/org/ob-python.el
@@ -198,7 +198,10 @@ org-babel-python-initiate-session-by-key
  (let ((python-shell-buffer-name
(org-babel-python-without-earmuffs py-buffer)))
   (run-python cmd)
-  (sleep-for 0 10)))
+  (with-current-buffer py-buffer
+(while (not python-shell--first-prompt-received)
+  (accept-process-output (get-buffer-process (current-buffer)
+  ))
((and (eq 'python-mode org-babel-python-mode)
  (fboundp 'py-shell)) ; python-mode.el
  (require 'python-mode)



bug#50514: 28.0.50; org inline call to python src block req C-g to break

2022-08-27 Thread Ihor Radchenko
"Barton, Mark"  writes:

> I tried something that was suggested last September 14th by Augusto Stoffel. 
> I had not tried it because changing the sleep from 10 to 90 was my workaround.
> One thing that might work is to block until the shell is ready with something 
> like
>
> (run-python)
> (with-current-buffer *the-shell-buffer*
>   (while (not python-shell--first-prompt-received)
> (accept-process-output (get-buffer-process (current-buffer)

Thanks, but it is not a good solution. Org cannot rely on internal
variables inside python.el (python-shell--first-prompt-received is an
internal variable). Internal variables are a subject of change without
notice.

May you instead try the attached alternative patch?

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92

>From 06373a64387330d5bbdcbb3417cea7c2638713df Mon Sep 17 00:00:00 2001
Message-Id: <06373a64387330d5bbdcbb3417cea7c2638713df.1661650102.git.yanta...@gmail.com>
From: Ihor Radchenko 
Date: Sat, 27 Aug 2022 22:06:11 +0800
Subject: [PATCH v2] ob-python: Fix Emacs bug#50514 when Python loads slowly

* lisp/ob-python.el (org-babel-python-initiate-session-by-key): Do not
rely on 10ms delay to initialize Python.  Wait until python process is
initialized using `org-babel-comint-wait-for-output'.
---
 lisp/ob-python.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/ob-python.el b/lisp/ob-python.el
index 932aca08e..e50a7c2e2 100644
--- a/lisp/ob-python.el
+++ b/lisp/ob-python.el
@@ -197,8 +197,7 @@ (defun org-babel-python-initiate-session-by-key (&optional session)
 	  (setq py-buffer (org-babel-python-with-earmuffs session)))
 	(let ((python-shell-buffer-name
 	   (org-babel-python-without-earmuffs py-buffer)))
-	  (run-python cmd)
-	  (sleep-for 0 10)))
+	  (run-python cmd)))
((and (eq 'python-mode org-babel-python-mode)
 	 (fboundp 'py-shell)) ; python-mode.el
 	(require 'python-mode)
@@ -217,6 +216,8 @@ (defun org-babel-python-initiate-session-by-key (&optional session)
 	  (py-shell nil nil t org-babel-python-command py-buffer nil nil t nil)))
(t
 	(error "No function available for running an inferior Python")))
+  ;; Wait until Python initializes.
+  (org-babel-comint-wait-for-output py-buffer)
   (setq org-babel-python-buffers
 	(cons (cons session py-buffer)
 		  (assq-delete-all session org-babel-python-buffers)))
-- 
2.35.1



bug#50514: 28.0.50; org inline call to python src block req C-g to break

2022-08-27 Thread Barton, Mark


On Aug 27, 2022, at 6:30 PM, Ihor Radchenko 
mailto:yanta...@gmail.com>> wrote:

* lisp/ob-python.el (org-babel-python-initiate-session-by-key): Do not
rely on 10ms delay to initialize Python.  Wait until python process is
initialized using `org-babel-comint-wait-for-output'.
---
lisp/ob-python.el | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/ob-python.el b/lisp/ob-python.el
index 932aca08e..e50a7c2e2 100644
--- a/lisp/ob-python.el
+++ b/lisp/ob-python.el
@@ -197,8 +197,7 @@ (defun org-babel-python-initiate-session-by-key (&optional 
session)
  (setq py-buffer (org-babel-python-with-earmuffs session)))
(let ((python-shell-buffer-name
   (org-babel-python-without-earmuffs py-buffer)))
-   (run-python cmd)
-   (sleep-for 0 10)))
+   (run-python cmd)))
   ((and (eq 'python-mode org-babel-python-mode)
 (fboundp 'py-shell)) ; python-mode.el
(require 'python-mode)
@@ -217,6 +216,8 @@ (defun org-babel-python-initiate-session-by-key (&optional 
session)
  (py-shell nil nil t org-babel-python-command py-buffer nil nil t nil)))
   (t
(error "No function available for running an inferior Python")))
+  ;; Wait until Python initializes.
+  (org-babel-comint-wait-for-output py-buffer)
  (setq org-babel-python-buffers
(cons (cons session py-buffer)
  (assq-delete-all session org-babel-python-buffers)))
--
2.35.1

That works for me. I'm using a series of python blocks to create org tables to 
be inserted in specific places in the document. So each block is named for that 
reason.

Do we need to worry about the note about not appropriate for large blocks of 
code or does that not apply in this case with the way you implemented it.
(org-babel-comint-wait-for-output BUFFER)

Wait until output arrives from BUFFER.
Note: this is only safe when waiting for the result of a single
statement (not large blocks of code).

Mark


bug#50514: 28.0.50; org inline call to python src block req C-g to break

2022-08-27 Thread Ihor Radchenko
"Barton, Mark"  writes:

> Do we need to worry about the note about not appropriate for large blocks of 
> code or does that not apply in this case with the way you implemented it.
> (org-babel-comint-wait-for-output BUFFER)
>
> Wait until output arrives from BUFFER.
> Note: this is only safe when waiting for the result of a single
> statement (not large blocks of code).

It should not be a problem. org-babel-python-initiate-session-by-key is
creating a new python session---no actual code blocks are passed to
python; just the python command is executed.

Fixed on main via 06373a643.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=06373a64387330d5bbdcbb3417cea7c2638713df

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92





Re: [BUG] org babel python execute from local buffer to remote session [9.5.4 (9.5.4-ge0b05b @ /home/moutsopoulosg/.emacs.d/elpa/org-9.5.4/)]

2022-08-27 Thread Ihor Radchenko
George Moutsopoulos  writes:

> Hi all. I often need to run some code on a remote ssh session, because
> only there I can access a database and the environment is hard to
> replicate, while I want to keep the code I run on my local machine.
>
> The remote session is initialised with run-python after I change
> default-directory and use pythonic-activate. Sending commands from a
> local python buffer using python.el works without issues. It would be nice
> if I can do
> the same from a local org-mode buffer from a python source block.

Could you please elaborate how you change the default-directory?
The canonical way to tell Org babel which directory to use is :dir
header argument. AFAIK, python process and files should all be created
in the right context then.

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92



Re: Improve the docstring for 'org-html-mathjax-options'

2022-08-27 Thread Ihor Radchenko
> Subject: [PATCH] Fix incorrectly documented MathJax options

I am going through some old bug reports and there was another related
report about this docstring.

Rudolf, since you are probably more familiar with MathJax, may you
please take a look at the report below and tell us if the suggestions
are sensible?

https://orgmode.org/list/m2lf0j77jh@ego.team
Y. E. via "General discussions about Org-mode."  
(2021-12-17) (2021 emacs-orgmode.gnu.org inbox maillist)
Subject: [BUG] org-html-mathjax-options docstring [9.5.1 
(release_9.5.1-11-g96d91b @ /emacs-28.0.90/lisp/org/)]

It seems the docstring of org-html-mathjax-options may need to be
updated.

I tried setting 'autonumber' to "None", as the docstring suggests, but
only the lower-cased "none" worked fine.

Also, MathJax documentation for 2.7 (the version I've got HTML rendered
with by org-mode) mentions "AMS", not "AMS Math"
(http://docs.mathjax.org/en/v2.7-latest/tex.html).

Another option that needs attention is 'indent'. The docstring contains
the phrase 'Valid values are "left" and "right"'. This phrase should be
changed to something like 'An example of a valid value is "2em"' or
simply removed, I think.


-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92



Re: [BUG] Manual links to MathJax documentation [9.5.1 (release_9.5.1-11-g96d91b @ /emacs-28.0.90/lisp/org/)]

2022-08-27 Thread Ihor Radchenko
Y. E. via "General discussions about Org-mode." 
writes:

> I noticed the links in the footnotes 131 and 132 are broken at
> https://orgmode.org/manual/Math-formatting-in-HTML-export.html
>
> I suppose the following links may be used instead:
> 131: http://docs.mathjax.org/en/v2.7-latest/tex.html
>
> 132: http://docs.mathjax.org/en/v2.7-latest/tex.html#tex-and-latex-extensions

For record, this has been fixed on main via 8d93f9b6b.

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92