Re: [PATCH] Set Python shell in Org edit buffer

2023-12-05 Thread Liu Hui
Ihor Radchenko  于2023年12月5日周二 19:48写道:
>
> Liu Hui  writes:
>
> > When editing python src block using C-c ', the python shell is not set
> > in Org edit buffer according to the :session header argument of the
> > block. Consequently, commands such as python-shell-send-region cannot
> > send python code to the correct python process. To address this, the
> > attached patch defines org-babel-edit-prep:python in ob-python.el.
>
> Makes sense.
> I think we may drop a note about this new feature in ORG-NEWS.

Thanks, I have added it in the attached patch.

> > In addition, I tried to use org-src-associate-babel-session at first,
> > but found it doesn't work because it is called when enabling
> > org-src-mode, where org-src--babel-info is still nil. It seems it has
> > stopped working since 203bf5870, and I think it is safe to remove it
> > and related stuffs to avoid confusion.
>
> I do not see it being used much, except
> https://github.com/frederic-santos/ob-ess-julia and
> https://github.com/alphapapa/outshine
> Although, ob-ess-julia is deprecated and outshine only mentions this in
> "TODO" comment.
>
> To be safe, I'd prefer to mark `org-src-associate-babel-session'
> obsolete and mention the removal in ORG-NEWS, pointing users to
> `org-babel-edit-prep:..' instead.

Fine by me.
From 295b28fece2f2125b40635118a5a705af4c8ce74 Mon Sep 17 00:00:00 2001
From: Liu Hui 
Date: Tue, 5 Dec 2023 11:40:38 +0800
Subject: [PATCH] Set Python shell in Org edit buffer

* lisp/ob-python.el (org-babel-edit-prep:python): New function.
* etc/ORG-NEWS (ob-python now sets ~python-shell-buffer-name~ in Org
edit buffers): Announce the change.
---
 etc/ORG-NEWS  | 6 ++
 lisp/ob-python.el | 7 +++
 2 files changed, 13 insertions(+)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index aef7e1184..826ea3526 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -640,6 +640,12 @@ return a matplotlib Figure object to plot. For output results, the
 current figure (as returned by =pyplot.gcf()=) is cleared before
 evaluation, and then plotted afterwards.
 
+*** ob-python now sets ~python-shell-buffer-name~ in Org edit buffers
+
+When editing a Python src block, the editing buffer is now associated
+with the Python shell specified by the src block's ~:session~ header
+argument.
+
 *** =ob-maxima.el=: Support for ~batch~ and ~draw~
 
 =ob-maxima= has two new header arguments: ~:batch~ and
diff --git a/lisp/ob-python.el b/lisp/ob-python.el
index 6c568a36d..8ff2c7a1d 100644
--- a/lisp/ob-python.el
+++ b/lisp/ob-python.el
@@ -67,6 +67,13 @@ (defcustom org-babel-python-None-to 'hline
   :package-version '(Org . "8.0")
   :type 'symbol)
 
+(defun org-babel-edit-prep:python (info)
+  "Set Python shell in Org edit buffer according to INFO."
+  (let ((session (cdr (assq :session (nth 2 info)
+(when (and session (not (string= session "none")))
+  (setq-local python-shell-buffer-name
+  (org-babel-python-without-earmuffs session)
+
 (defun org-babel-execute:python (body params)
   "Execute Python BODY according to PARAMS.
 This function is called by `org-babel-execute-src-block'."
-- 
2.25.1



Re: Syncing orgcard.tex with upstream Emacs (was: bug#64578: orgcard.tex fixes to allow PDF rendering to be used as a triptych.)

2023-12-05 Thread Kyle Meyer
Ihor Radchenko writes:

> Kyle Meyer  writes:
>
>> Here is the difference between the two cards, as of the last sync:
>>
>>   -\input org-version.tex
>>   +\def\orgversionnumber{9.6.11}
>>   +\def\versionyear{2023}  % latest update
>>   +\input emacsver.tex
>> ...
>>   +\centerline{For more Emacs documentation, and the \TeX{} source for this 
>> card, see}
>>   +\centerline{the Emacs distribution, or {\tt 
>> https://www.gnu.org/software/emacs}}
>>   +
>
> Aside: It appears to be only partially documented in
> https://orgmode.org/worg/org-maintenance.html#emacs-sync. In particular,
> the last two lines.

I'm happy to clarify or add to those docs.  I didn't write them, but I
did go through them somewhat recently to better align them with the
actual porting/syncing process.

With respect to the emacs-sync branch, that page currently says

  Typically, Org can be synchronized by copying over files from the
  emacs-sync branch of the Org repository to the master branch of Emacs
  repository. The emacs-sync branch has a few extra changes compared
  with the bugfix branch

Would you like me to add more details about why the branch exists?  How
it's managed?  Something else?

> May we just add
>
>>   +\centerline{For more Emacs documentation, and the \TeX{} source for this 
>> card, see}
>>   +\centerline{the Emacs distribution, or {\tt 
>> https://www.gnu.org/software/emacs}}
>
> to Org repo?

These lines (or rather what became these lines) were added in Emacs's
4af5981dc75 (Add a comment in generated refcards about the source,
2016-11-17).  I decided to port that commit to emacs-sync rather than a
primary Org branch because I felt it only applied to the Org card
distributed as part of the Emacs tree.  From my notes [*]:

  I'm skipping this because it isn't true when the card is from the Org
  mode repo.

However, if you prefer to include those lines in Org's copy, that's fine
by me.


[*] 
https://git.kyleam.com/orgmode-backport-notes/tree/orgmode-backports.org?id=35eaf5a21dc776c9f7a880d0a4bf9ffc48213985#n3464



Re: What is the status of ob-maxima.el? Is this a bug?

2023-12-05 Thread Leo Butler
On Tue, Dec 05 2023, "Fraga, Eric"  wrote:

> On Tuesday,  5 Dec 2023 at 16:59, Leo Butler wrote:
>> You mentioned returning a value from a maxima code block. 
>
> By this, I mean the value of the last sexp as some other src blocks do
> (elisp? octave? Not sure which...).  It's what I would expect to see if
> I were to specify ":results value".

I think it should be easy to provide this for a few data types (matrix,
string, maybe list), but I think the conversion from a Lisp sexp to an
ELisp sexp will need a lot of assumptions. E.g. how to convert the
Maxima list:

[[a,b],[c,d,[e,f]]]

Or maybe such cases are not important?

Also, what would we do with an arbitrary mathematical expression? Return
a printed representation?

>
> And your improvements definitely look good!  Thanks.  I use maxima a lot
> for teaching so will need to reconsider the material on some of my
> slides (next year... :-)).
>
> I also use embedded Calc as it's easier to incorporate directly in text,
> especially in org, but Calc is not quite as capable as maxima as a
> computer algebra system.

Thanks.

I have used Calc, but never really got the hang of it.

Developing a working session for maxima would make it more feasible to
use it directly in text, as you are using Calc.

Leo


Re: [BUG] Table alignment fails for long lines [9.6.12 ( @ /home/rst/.emacs.d/elpa/org-9.6.12/)]

2023-12-05 Thread Raffael Stocker


Ihor Radchenko  writes:

> Fixed, on bugfix and on main.
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=4a7a1f2fe
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=f2cb64579

Great, Thanks!



Re: What is the status of ob-maxima.el? Is this a bug?

2023-12-05 Thread Fraga, Eric
On Tuesday,  5 Dec 2023 at 16:59, Leo Butler wrote:
> You mentioned returning a value from a maxima code block. 

By this, I mean the value of the last sexp as some other src blocks do
(elisp? octave? Not sure which...).  It's what I would expect to see if
I were to specify ":results value".

And your improvements definitely look good!  Thanks.  I use maxima a lot
for teaching so will need to reconsider the material on some of my
slides (next year... :-)).

I also use embedded Calc as it's easier to incorporate directly in text,
especially in org, but Calc is not quite as capable as maxima as a
computer algebra system.

-- 
: Eric S Fraga, with org release_9.6.7-661-g34ee6f in Emacs 30.0.50


Re: What is the status of ob-maxima.el? Is this a bug?

2023-12-05 Thread Leo Butler
On Tue, Dec 05 2023, "Fraga, Eric"  wrote:

> On Tuesday,  5 Dec 2023 at 16:42, Leo Butler wrote:
>> With recent versions of ob-maxima.el, you can set header arguments to
>> get the behaviour Eduardo expected:
>
> Thank you.  This is great news.
>
> I'm going to have to upgrade as the version I'm currently using (from
> 1-2 months ago, I think) doesn't seem to pay attention to :cmdline
> --quiet and/or :results raw.

Yes, it is relatively recent work (see below).

You mentioned returning a value from a maxima code block. I wonder if
you could elaborate? I could imagine either the lisp sexp of the last
expression or the printed representation (e.g. in linear/1d form). But
maybe you have something else in mind?

Leo


#+begin_src elisp :exports results
  (org-version)
#+end_src

#+RESULTS:
: 9.7-pre

#+NAME: batch-quiet-maxima
#+HEADER: :batch batch
#+HEADER: :exports results
#+HEADER: :results raw
#+HEADER: :wrap example
#+HEADER: :cmdline --quiet
#+BEGIN_SRC maxima
  rat(1/(x+1) + x/(x-1));
#+END_SRC

#+RESULTS: batch-quiet-maxima
#+begin_example
(%i1) rat(1/(x+1)+x/(x-1))
  2
 x  + 2 x - 1
(%o1)/R/ 
 2
x  - 1
#+end_example


Re: What is the status of ob-maxima.el? Is this a bug?

2023-12-05 Thread Fraga, Eric
On Tuesday,  5 Dec 2023 at 16:42, Leo Butler wrote:
> With recent versions of ob-maxima.el, you can set header arguments to
> get the behaviour Eduardo expected:

Thank you.  This is great news.

I'm going to have to upgrade as the version I'm currently using (from
1-2 months ago, I think) doesn't seem to pay attention to :cmdline
--quiet and/or :results raw.

-- 
: Eric S Fraga, with org release_9.6.7-661-g34ee6f in Emacs 30.0.50


Re: What is the status of ob-maxima.el? Is this a bug?

2023-12-05 Thread Leo Butler
On Tue, Dec 05 2023, "Fraga, Eric"  wrote:

> I think ob-maxima will only output the actual explicit "output" of the
> script, so something like
>
> #+begin_src maxima
> print(2+3);
> #+end_src
>
> should work.

With recent versions of ob-maxima.el, you can set header arguments to
get the behaviour Eduardo expected:

#+NAME: batch-quiet-maxima
#+HEADER: :batch batch
#+HEADER: :results raw
#+HEADER: :wrap example
#+HEADER: :cmdline --quiet
#+BEGIN_SRC maxima
  rat(1/(x+1) + x/(x-1));
#+END_SRC

See "An example with line numbering" at
https://orgmode.org/worg//org-contrib/babel/languages/ob-doc-maxima.html

Leo


Re: [BUG] org-element-cache (Org parser error "Invalid search bound (wrong side of point) [9.7 (9.7-??-e90a8a69a @ /home/ajensen...@ad.ufl.edu/.emacs.d/.local/straight/build-29.1/org/)]

2023-12-05 Thread Ihor Radchenko
Andrew Jensen  writes:

> I no longer see the issue after updating. Thanks a ton!

Thanks for testing!
Closing.
Canceled.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] org-element-cache (Org parser error "Invalid search bound (wrong side of point) [9.7 (9.7-??-e90a8a69a @ /home/ajensen...@ad.ufl.edu/.emacs.d/.local/straight/build-29.1/org/)]

2023-12-05 Thread Andrew Jensen
I no longer see the issue after updating. Thanks a ton!

On 12/5/23 10:31 AM, Ihor Radchenko wrote:
> Andrew Jensen  writes:
>
>> Emacs : GNU Emacs 29.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version
>> 3.24.33, cairo version 1.16.0)
>> of 2023-11-27
>> Package: Org mode version 9.7 (9.7-??-e90a8a69a @
>> /home/ajensen...@ad.ufl.edu/.emacs.d/.local/straight/build-29.1/org/)
> Thanks for reporting!
> Do you still see the error if you update to the latest main?
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 




Re: [BUG] subheadings disappear from buffer [9.6.6 (release_9.6.6 @ /opt/local/share/emacs/29.1/lisp/org/)]

2023-12-05 Thread Peter Mao
On Tue, Dec 5, 2023 at 4:27 AM Ihor Radchenko  wrote:

> Peter Mao  writes:
>
> > This is an incomplete initial bug report.  I don't have time right now to
> > chase down all the details.
> >
> > A couple of times in the past month, the subheadings in the org file I'm
> > working on (with lots of org-babel code blocks) disappear.   does
> not
> > fold or unfold those headings, although the indicator (...) still shows.
> > ...
> > summary:
> > 1. subheading text disappears from org file, even in fundamental
> > 2. saving the buffer shows that the disappearance is cosmetic only
> > 3. I have not established reproducible conditions for this yet.
>
> Might be yet another problem with isearch + folding via text properties.
> You may try to set `org-fold-core-style' to 'overlays.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>

Thanks, Ihor.  I was suspecting isearch, but I can't chase reproducibility
yet.  I'll try out your suggestion.

Peter


Re: Bug: event with two dates displays wrong in org-agenda

2023-12-05 Thread Ihor Radchenko
rameik...@posteo.net writes:

> I have the following entry in one of my org files:
>
> ** party <2023-12-02 Sat>. Meet Jack <2023-12-02 Sat 16:15>
>
> This appears in my org agenda twice, both times at 16:15. I would expect 
> it should appear once at 16:15 and once as a general event for the day!

This is because by default Org agenda searches for even time in the
heading:

org-agenda-search-headline-for-time is a variable defined in ‘org-agenda.el’.

Its value is t

Non-nil means search headline for a time-of-day.
If the headline contains a time-of-day in one format or another, it will
be used to sort the entry into the time sequence of items for a day.

Some people have time stamps in the headline that refer to the creation

time or so, and then this produces an unwanted side effect.  If this is
the case for your, use this variable to turn off searching the headline
for a time.

Not a bug.
Canceled.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] Table alignment fails for long lines [9.6.12 ( @ /home/rst/.emacs.d/elpa/org-9.6.12/)]

2023-12-05 Thread Ihor Radchenko
Raffael Stocker  writes:

> org tables with long text in a field (longer than window width) don't get
> aligned correctly.  This seems to be due to the missing X-LIMIT argument to
> ‘window-text-pixel-size’.  That is, the current usage is something like:
>
> (car (window-text-pixel-size
>  nil (line-beginning-position) (point-max)))
>
> If I change that to
>
> (car (window-text-pixel-size
>  nil (line-beginning-position) (point-max) t))
>
> things work correctly as lines are not truncated to the visible portion.
>
> This bug also exists in the 9.7-pre version if ‘buffer-text-pixel-size’ is
> unbound.

Thanks for reporting!
Fixed, on bugfix and on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=4a7a1f2fe
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=f2cb64579

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] org-element-cache (Org parser error "Invalid search bound (wrong side of point) [9.7 (9.7-??-e90a8a69a @ /home/ajensen...@ad.ufl.edu/.emacs.d/.local/straight/build-29.1/org/)]

2023-12-05 Thread Ihor Radchenko
Andrew Jensen  writes:

> Emacs : GNU Emacs 29.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 
> 3.24.33, cairo version 1.16.0)
> of 2023-11-27
> Package: Org mode version 9.7 (9.7-??-e90a8a69a @ 
> /home/ajensen...@ad.ufl.edu/.emacs.d/.local/straight/build-29.1/org/)

Thanks for reporting!
Do you still see the error if you update to the latest main?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Tags right alignment with font-lock

2023-12-05 Thread Nicolas P. Rougier (inria)



Hello,

I'm using font lock to have tags right aligned with the following 
code:


;; Right alignment (char wise)
(add-to-list 'font-lock-extra-managed-props 'display)
(font-lock-add-keywords 'org-mode
 `(("^\\*+.*?\\( \\)\\(:[[:alnum:]_@#%:]+:\\)$"
(1 `(face nil
  display (space :align-to (- right 3
  ,(org-string-width 
  (match-string 2)

   prepend))) t)

;; Right alignment (pixel wise)
;;(font-lock-add-keywords 'org-mode
;;   `(("^\\*+.*?\\( \\)\\(:[[:alnum:]_@#%:]+:\\)$"
;;  (1 `(face nil
;;display (space :align-to (- right 3
;;(,(org-string-width 
 (match-string 2) 
 t)

;; prepend))) t)

I've not tested it thoroughly but it seems to be working 
reasonably well on my machine. It is pretty similar to the code 
posted by Ihor Radchenko (thread on "variable-pitch-mode misaligns 
org-mode heading tags") and I wonder if there are any drawback 
with such techniques (too slow? does not work on all situations?)


Nicolas

--
Nicolas P. Rougier —— www.labri.fr/perso/nrougier
Institute of Neurodegenerative Diseases, Bordeaux



[BUG] Table alignment fails for long lines [9.6.12 ( @ /home/rst/.emacs.d/elpa/org-9.6.12/)]

2023-12-05 Thread Raffael Stocker


Hello Org-mode,

org tables with long text in a field (longer than window width) don't get
aligned correctly.  This seems to be due to the missing X-LIMIT argument to
‘window-text-pixel-size’.  That is, the current usage is something like:

(car (window-text-pixel-size
 nil (line-beginning-position) (point-max)))

If I change that to

(car (window-text-pixel-size
 nil (line-beginning-position) (point-max) t))

things work correctly as lines are not truncated to the visible portion.

This bug also exists in the 9.7-pre version if ‘buffer-text-pixel-size’ is
unbound.

Regards,
Raffael

Emacs  : GNU Emacs 29.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, 
cairo version 1.17.8)
Package: Org mode version 9.6.12 ( @ /home/rst/.emacs.d/elpa/org-9.6.12/)



Bug: event with two dates displays wrong in org-agenda

2023-12-05 Thread rameiko87

I have the following entry in one of my org files:

** party <2023-12-02 Sat>. Meet Jack <2023-12-02 Sat 16:15>

This appears in my org agenda twice, both times at 16:15. I would expect 
it should appear once at 16:15 and once as a general event for the day!





OrgMode Agenda empty if one of files is missing

2023-12-05 Thread Ali M.
Hi ,

If a file added on my agenda list is deleted, Org Mode Agenda list comes
back empty

for example my org agenda have two files
 '(org-agenda-files
   '("c:/dev/projects/one/one.org"  "c:/dev/projects/two/two.org"  ))

Now I deleted folder two , so the folder  c:/dev/projects/two/ and its
content is also deleted

Now when I try C-ca and select any of the option to list my scheduled todos
I get an empty *Org Agenda* buffer

Removing the deleted folder from my org-agenda-files, fixes the issue

I think the Agenda buffer should still show me the todo items from the
available files, and maybe just warn me about the delete file, or at least
show nothing, but warn me about the issue

Thanks
Ali


[BUG] org-element-cache (Org parser error "Invalid search bound (wrong side of point) [9.7 (9.7-??-e90a8a69a @ /home/ajensen...@ad.ufl.edu/.emacs.d/.local/straight/build-29.1/org/)]

2023-12-05 Thread Andrew Jensen



Remember to cover the basics, that is, what you expected to happen and
what in fact did happen. You don't know how to make a good report? See

https://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org mailing list.




Emacs : GNU Emacs 29.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 
3.24.33, cairo version 1.16.0)
of 2023-11-27
Package: Org mode version 9.7 (9.7-??-e90a8a69a @ 
/home/ajensen...@ad.ufl.edu/.emacs.d/.local/straight/build-29.1/org/)

current state:
==
(setq
org-link-elisp-confirm-function nil
org-directory "~/org/"
org-cite-insert-processor 'citar
org-after-todo-state-change-hook '((closure (t) nil
(if (equal org-state "DONE") (progn (my/org-roam-copy-todo-to-today
)
org-after-refile-insert-hook '(save-buffer)
org-indirect-buffer-display 'current-window
org-roam-db-gc-threshold 2305843009213693951
org-crypt-key nil
org-bibtex-headline-format-function 'org-bibtex-headline-format-default
org-log-done 'time
org-roam-mode-hook '(+org-roam-detach-magit-section-mode-map-h 
turn-on-visual-line-mode)
org-agenda-custom-commands '(("r" "Research View"
((agenda ""
((org-super-agenda-groups
'((:name none) (:discard (:not (:file-path "research.org")))
(:discard (:todo "WAIT")) (:auto-property "ProjectID"))
)
)
)
(todo ""
((org-agenda-overriding-header
"Research 
Projects")
(org-super-agenda-groups
'((:name none) (:discard (:not (:file-path "research.org")))
(:discard (:todo "WAIT")) (:auto-property "ProjectID") (:discard 
(:anything t)))
)
)
)
)
)
("w" "Work View"
((agenda ""
((org-super-agenda-groups
'((:name none) (:discard (:not (:file-path "work.org"))) (:discard 
(:todo "WAIT"))
(:auto-property "ProjectID"))
)
)
)
(todo ""
((org-agenda-overriding-header
"Work 
Projects")
(org-super-agenda-groups
'((:name none) (:discard (:not (:file-path "work.org"))) (:discard 
(:todo "WAIT"))
(:auto-property "ProjectID") (:discard (:anything t)))
)
)
)
)
)
("e" "Extra-curricular"
((agenda ""
((org-super-agenda-groups
'((:name none) (:discard (:not (:file-path "extra-curricular.org")))
(:discard (:todo "WAIT")) (:auto-property "ProjectID"))
)
)
)
(todo ""
((org-agenda-overriding-header
"Extra Curricular 
Projects")
(org-super-agenda-groups
'((:name none) (:discard (:not (:file-path "extra-curricular.org")))
(:discard (:todo "WAIT")) (:auto-property "ProjectID") (:discard 
(:anything t)))
)
)
)
)
)
("p" "Personal Todos"
((agenda ""
((org-super-agenda-groups
'((:name none :time-grid t) (:discard (:not (:file-path "main.org")))
(:discard (:todo "WAIT")) (:auto-property "ProjectID"))
)
)
)
(todo ""
((org-agenda-overriding-header
"Personal 
Projects")
(org-super-agenda-groups
'((:name none) (:discard (:not (:file-path "main.org"))) (:discard 
(:todo "WAIT"))
(:auto-property "ProjectID") (:discard (:anything t)))
)
)
)
)
)
("u" "All Projects View"
((agenda ""
((org-super-agenda-groups '((:name "Today" :time-grid t) (:discard 
(:todo "WAIT"))
(todo ""
((org-agenda-overriding-header
"Projects")
 

(org-super-agenda-groups
'((:name none) (:discard (:todo "WAIT")) (:auto-property "ProjectID")
(:discard (:anything t)))
)
)
)
)
)
)
org-load-hook '(+org-init-org-directory-h +org-init-appearance-h 
+org-init-agenda-h +org-init-attachments-h
+org-init-babel-h +org-init-babel-lazy-loader-h 
+org-init-capture-defaults-h +org-init-capture-frame-h
+org-init-custom-links-h +org-init-export-h +org-init-habit-h 
+org-init-hacks-h +org-init-keybinds-h
+org-init-popup-rules-h +org-init-smartparens-h +org-init-roam-h)
org-startup-folded nil
org-babel-after-execute-hook 
'(+org-redisplay-inline-images-in-babel-result-h)
org-link-abbrev-alist '(("doomdir" . 
"/home/ajensen...@ad.ufl.edu/.doom.d/%s")
("emacsdir" . "/home/ajensen...@ad.ufl.edu/.emacs.d/%s")
("doom-repo" . "https://github.com/doomemacs/doomemacs/%s;)
("wolfram" . "https://wolframalpha.com/input/?i=%s;)
("wikipedia" . "https://en.wikipedia.org/wiki/%s;)
("duckduckgo" . "https://duckduckgo.com/?q=%s;) ("gmap" . 
"https://maps.google.com/maps?q=%s;)
("gimages" . "https://google.com/images?q=%s;) ("google" . 
"https://google.com/search?q=;)
("youtube" . "https://youtube.com/watch?v=%s;) ("github" . 
"https://github.com/%s;))
org-agenda-skip-scheduled-if-done t
org-agenda-files 
'("/home/ajensen...@ad.ufl.edu/org/roam/main/jacobian.org" 
"~/org/agenda/main.org")
org-capture-templates '(("t" "Personal todo" entry (file+headline 
+org-capture-todo-file "Inbox") "* [ ] %?\n%i\n%a"
:prepend t)
("n" "Personal notes" entry (file+headline +org-capture-notes-file 
"Inbox") "* %u %?\n%i\n%a"
:prepend t)
("j" 

[FR] Please add custom command variable to org-latex-footnote-reference

2023-12-05 Thread Alexander Gogl
Hello,

some LaTeX classes define their own footnote commands. For example, kaobook 
(https://github.com/fmarotta/kaobook/blob/master/example_and_documentation.pdf) 
has \footnotes and \sidenotes, whereby sidenotes (notes are put into the outter 
margin) are the dominant form of putting notes in kaobook.

It would be great if you could make the footnote command in the footnote 
function customizable. It could look like this:

;; Replace footnote function to make the latex footnote command customizable
(setq org-latex-footnote-command "\\footnote{%s%s}")

(defun org-latex-footnote-reference (footnote-reference _contents info)
"Transcode a FOOTNOTE-REFERENCE element from Org to LaTeX.
CONTENTS is nil.  INFO is a plist holding contextual information."
(let ((label (org-element-property :label footnote-reference)))
(concat
;; Insert separator between two footnotes in a row.
(let ((prev (org-export-get-previous-element footnote-reference info)))
(when (eq (org-element-type prev) 'footnote-reference)
(plist-get info :latex-footnote-separator)))
(cond
;; Use `:latex-footnote-defined-format' if the footnote has
;; already been defined.
((not (org-export-footnote-first-reference-p footnote-reference info))
(format (plist-get info :latex-footnote-defined-format)
(org-latex--label
(org-export-get-footnote-definition footnote-reference info)
info t)))
;; Use \footnotemark if reference is within another footnote
;; reference, footnote definition, table cell, verse block, or
;; item's tag.
((or (org-element-lineage footnote-reference
'(footnote-reference footnote-definition
table-cell verse-block))
(eq 'item (org-element-type
(org-export-get-parent-element footnote-reference
"\\footnotemark")
;; Otherwise, define it with \footnote command.
(t
(let ((def (org-export-get-footnote-definition footnote-reference info)))
(concat
(format org-latex-footnote-command (org-trim (org-export-data def info))
;; Only insert a \label if there exist another
;; reference to def.
(cond ((not label) "")
((org-element-map (plist-get info :parse-tree)
'footnote-reference
(lambda (f)
(and (not (eq f footnote-reference))
(equal (org-element-property :label f) label)
(org-trim (org-latex--label def info t t
info t))
(t "")))
;; Retrieve all footnote references within the footnote and
;; add their definition after it, since LaTeX doesn't support
;; them inside.
(org-latex--delayed-footnotes-definitions def info


Best,

Alexander



Re: oeg-add-note and double backslash ?

2023-12-05 Thread Ihor Radchenko
David Masterson  writes:

>> To prevent fill-region from concatenating the auto-generated text in the
>> first line and the user input in the following lines.
>
> Ah.  Is that mentioned somewhere in the Org manual?  I don't mean the
> details of filll-region, but a little something to answer "why is that
> there?" by new users.

No, AFAIK, the exact format of notes is not described in the manual.
We do not describe every single detail in the manual.
I believe that the exact wording of the notes is not something we have
to describe.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Links & images with different attributes in the same paragraph

2023-12-05 Thread Ihor Radchenko
Max Nikulin  writes:

> I raised this topic earlier. It seems, there is a rather generic 
> workaround that may help.
>
> Sometimes it is necessary to assign specific export attributes to some 
> links in a paragraph while others should get another set of them. Inline 
> images should have different alt text.
>
> --- 8< ---
> Text with <> in a paragraph.
>
> Any link types are supported including
> [[wrap::href "anchor"][internal]] ones.
> Attributes may be added selectively:
> https://microsoft.com/; :attr_html ":class external \
> :title Link that does not increase target page rank \
> :noreferrer 1" :attr_html ":nofollow 1 :noopener 1">
> ...
> An example of earlier discussion:
> https://list.orgmode.org/t8q71r$mgv$1...@ciao.gmane.io/
> Max Nikulin. [BUG] manual: confusing example of adding attributes to a 
> link (affiliated keywords). Mon, 20 Jun 2022 23:25:29 +0700

We definitely need something to fine-tune export properties inline.
However, I am skeptical about using links for this purpose in Org
proper, not individual user configs.

This is because link description cannot contain arbitrary objects. In
particular, one cannot put other links, radio-targets, line-breaks,
citations, etc.
I believe that the right way to go here is what we previously discussed
as inline special block equivalent. That way, we will not need to create
workarounds with special link type.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: What is the status of ob-maxima.el? Is this a bug?

2023-12-05 Thread Fraga, Eric
On Tuesday,  5 Dec 2023 at 08:34, Eduardo Ochs wrote:
> Ouch! I'm so used to using Maxima from its REPL that I forgot to test
> that... thanks and sorry! =/

No apology required.  It would be good if ob-maxima had implemented the
concept of returning the last value, as some other language
implementations do, but my elisp-fu (and maxima-fu) was not up to the
challenge when I wrote the initial version of ob-maximal.el (much
improved later by Eric Shulte).

And having it output everything that maxima actually outputs in the REPL
I considered to be too overwhelming.  Hence the "--very-quiet" option
passed to maxima on execution.

-- 
: Eric S Fraga, with org release_9.6.7-661-g34ee6f in Emacs 30.0.50


Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-12-05 Thread Visuwesh
[ஞாயிறு நவம்பர் 05, 2023] Ihor Radchenko wrote:

> Po Lu  writes:
>
>> I have now installed an interface to this end into Emacs 30.  The
>> pertinent documentation is under the ``Drag and Drop'' node in the Lisp
>> reference manual.
>
> Thanks!
>
> [...]
>
> Visuwesh, do you want to update your patch accordingly?

I have now adjusted the patch to insert a space between links when the
Emacs version in <30, and when more than one file is dropped.

>From 93db10f9f0c618be5512fbd67cd7b7676d6b1b0c Mon Sep 17 00:00:00 2001
From: Visuwesh 
Date: Fri, 22 Sep 2023 20:11:41 +0530
Subject: [PATCH] Add support for yank-media and DND

* lisp/org.el (org-mode): Call the setup function for yank-media and
DND.
(org-setup-yank-dnd-handlers): Register yank-media-handler and DND
handler.
(org-yank-image-save-method, org-yank-image-file-name-function)
(org-yank-dnd-method, org-yank-dnd-default-attach-method): New
defcustoms.
(org--image-yank-media-handler, org--copied-files-yank-media-handler)
(org--dnd-rmc, org--dnd-multi-local-file-handler)
(org--dnd-local-file-handler, org--dnd-attach-file, org--dnd-xds-method)
(org--dnd-xds-function): Add yank-media and DND handlers.

* doc/org-manual.org: (Drag and Drop & ~yank-media~): Describe the new
feature in the manual.

* etc/ORG-NEWS: Advertise the new features.
---
 doc/org-manual.org |  45 
 etc/ORG-NEWS   |  24 +
 lisp/org.el| 248 -
 3 files changed, 316 insertions(+), 1 deletion(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index 3e9d42f55..7b14eb937 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -21095,6 +21095,51 @@ most recent since the mobile application searches files that were last
 pulled.  To get an updated agenda view with changes since the last
 pull, pull again.
 
+** Drag and Drop & ~yank-media~
+:PROPERTIES:
+:DESCRIPTION: Dropping and pasting files and images
+:END:
+
+#+cindex: dropping files
+#+cindex: dragging files
+#+cindex: drag and drop
+#+cindex: dnd
+#+vindex: org-yank-dnd-method
+Org mode supports drag and drop (DnD) of files.  By default, Org asks
+the user what must be done with the dropped file: attach it, insert
+=file:= link, or open the file.  Customize ~org-yank-dnd-method~ to
+set the default DnD action.
+
+When DnD method is "attach", Org mode first consults DnD metadata to
+decide the attach method.  For example, when file/files are dragged
+from a file manager, Org may attach by copying or by moving.
+
+#+vindex: org-yank-dnd-default-attach-method
+If Org cannot figure out which attachment method to use from the
+metadata, it defaults to ~org-yank-dnd-default-attach-method~ [fn::By
+default, ~org-yank-dnd-default-attach-method~ is set to nil -- use the same
+value as ~org-attach-method~ (~cp~ by default).]
+
+#+cindex: pasting files, images from clipboard
+Starting from Emacs 29, Org mode supports ~yank-media~ command to yank
+images from the clipboard and files from a file manager.
+
+#+vindex: org-yank-image-save-method
+When yanking images from clipboard, Org saves the image on disk and
+inserts the image link to Org buffer.  Images are either saved as
+attachments to heading (default) or to a globally defined directory.
+The save location is controlled by ~org-yank-image-save-method~.
+
+#+vindex: org-yank-image-file-name-function
+The yanked images are saved under automatically generated name.  You
+can customize ~org-yank-image-file-name-function~ to make Org query
+the image names or change the naming scheme.
+
+When yanking files copied from a file manager, Org respects the value
+of ~org-yank-dnd-method~.  Image files pasted this way also respect
+the value of ~org-yank-image-save-method~ when the action to perform
+is =attach=.
+
 * Hacking
 :PROPERTIES:
 :DESCRIPTION: How to hack your way around.
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 252c5a9f9..7c40ec0fe 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -596,6 +596,30 @@ return a matplotlib Figure object to plot. For output results, the
 current figure (as returned by =pyplot.gcf()=) is cleared before
 evaluation, and then plotted afterwards.
 
+*** Images and files in clipboard can be pasted
+
+Org asks the user what must be done when pasting images and files
+copied to the clipboard from a file manager using the ~yank-media~
+command.  The default action can be set by customizing
+~org-yank-dnd-method~.  The ~yank-media~ command was added in Emacs
+29.
+
+Images can be saved to a separate directory instead of being attached,
+customize ~org-yank-image-save-method~.
+
+Image filename chosen can be customized by setting
+~org-yank-image-file-name-function~ which by default autogenerates a
+filename based on the current time.
+
+*** Files and images can be attached by dropping onto Emacs
+
+By default, Org asks the user what to do with the dropped file like
+for pasted files.  The same user option ~org-yank-dnd-method~ is
+respected.
+
+Images dropped also respect the value of 

Re: [PATCH] [DISCUSSION] Force `tab-width' to be 8 in Org mode (was: COUNTER-SET for alphabetical ordered lists ignored for utf-8 exporter)

2023-12-05 Thread Ihor Radchenko
Ihor Radchenko  writes:

>> Absolute madness! I always considered tab-width to be a personal aesthetic 
>> choice and not something that would functionally change how documents other 
>> people wrote will be parsed.
>
> I agree.
> See the attached tentative patches for Org mode and org-syntax.
>
> This is a breaking change, so I encourage people who might be affected
> reply if they have objections.
>
> Subject: [PATCH] * lisp/org.el (org-mode): Force `tab-width' to be 8

Applied, onto main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=315417582

Also, adjusted org-syntax document.
https://git.sr.ht/~bzg/worg/commit/72134bba

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: ODT export failing

2023-12-05 Thread Fraga, Eric
On Tuesday,  5 Dec 2023 at 12:54, Ihor Radchenko wrote:
> Still fine on my side...

Okay, thank you.  Strange but one of those mysteries, I guess.  If I run
into this again, I'll explore more fully.

-- 
: Eric S Fraga, with org release_9.6.7-661-g34ee6f in Emacs 30.0.50


Re: ODT export failing

2023-12-05 Thread Ihor Radchenko
"Fraga, Eric"  writes:

> Ummm, okay.  Maybe with a .pdf extension?
>
> (I was under deadline pressure so once I got it working, I didn't explore any 
> further!)

Still fine on my side...

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: ODT export failing

2023-12-05 Thread Fraga, Eric
On Tuesday,  5 Dec 2023 at 12:11, Ihor Radchenko wrote:

Ummm, okay.  Maybe with a .pdf extension?

(I was under deadline pressure so once I got it working, I didn't explore any 
further!)


-- 
Eric S Fraga, https://profiles.ucl.ac.uk/5958-eric-fraga

PhD studentship in optimization and molecular dynamics:
https://ucl-epsrc-dtp.github.io/2024-25-project-catalogue/projects/2228cd1281.html
Apply through
https://www.ucl.ac.uk/epsrc-doctoral-training/prospective-students/apply-ucl-epsrc-dtp-studentship


Re: [BUG] error: Invalid search bound [9.6.11 ( @ /home/nikratio/.emacs.d/elpa/28.2/develop/org-9.6.11/)]

2023-12-05 Thread Ihor Radchenko
"Nikolaus Rath"  writes:

>> May you please try the latest bugfix branch and let us know if you are
>> still seeing the warning?
>
> Thanks for the quick response! Could you point me in the direction of how to 
> do that? I'm a bit confused by the layering of Emac's builtin-org, the Elpa 
> installed one (which I seem to be using) and Spacemacs (whih I think takes 
> over management of Emacs packages). 
>
> Should it work to clone the git branch and do "(add-to-list 'load-path 
> "~/src/org-mode/lisp") or will this result in some terrible mess?

If you are using ELPA-devel, it will be enough to update Org mode.

Otherwise, (add-to-list 'load-path "~/src/org-mode/lisp") should do as
long as you put it early enough in your config, so that built-in Org
version is not yet loaded.
Also, see https://orgmode.org/manual/Installation.html

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] Hard lockup on org-display-inline-images

2023-12-05 Thread Ihor Radchenko
JD Smith  writes:

> ...  Eli fixed the introduced bug quite quickly in:
>
> http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=7a7d41e07c4627c5de08a66368309b478c88edfc

Ok. Closing.
Canceled.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Org contributors: Typo in a heading

2023-12-05 Thread Ihor Radchenko
Rudolf Adamkovič  writes:

> A quick heads-up about a typo at
>
>   https://orgmode.org/worg/contributors.html
>
> Actual heading:
>
>   Current contributors with FSF assignement
>
> Expected heading:
>
>   Current contributors with FSF assignment

Thanks!
Fixed, on master.
https://git.sr.ht/~bzg/worg/commit/70cfb528

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] Hard lockup on org-display-inline-images

2023-12-05 Thread JD Smith


> On Dec 5, 2023, at 7:26 AM, Ihor Radchenko  wrote:
> 
> JD Smith  writes:
> 
>> Eli and I recently patched a problem 
>>  with pixel position 
>> reporting with inline images (which I had discovered in a large org buffer 
>> with latex-preview).  With this patch installed, now on master as of this 
>> evening, org-display-inline-images freezes emacs when a larger image is 
>> included in an org file, if org-indent is enabled. 
>> 
>> I’ve confirmed such images are fine in regular buffers by text-property or 
>> overlay, so I suspect this is a “revealed bug” in org-indent or the element 
>> cache.
> 
> I just tried to create a simple Org file with a png image link (on
> main, latest Emacs master), enabled org-indent-mode, and displayed the
> images. I see no problem.
> 
> Please provide more detailed instructions to reproduce the problem.


Apologies for not following up.  The problem was in recent display code 
improvements.  Eli fixed the introduced bug quite quickly in:

http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=7a7d41e07c4627c5de08a66368309b478c88edfc

Syncing orgcard.tex with upstream Emacs (was: bug#64578: orgcard.tex fixes to allow PDF rendering to be used as a triptych.)

2023-12-05 Thread Ihor Radchenko
Kyle Meyer  writes:

> Here is the difference between the two cards, as of the last sync:
>
>   -\input org-version.tex
>   +\def\orgversionnumber{9.6.11}
>   +\def\versionyear{2023}  % latest update
>   +\input emacsver.tex
> ...
>   +\centerline{For more Emacs documentation, and the \TeX{} source for this 
> card, see}
>   +\centerline{the Emacs distribution, or {\tt 
> https://www.gnu.org/software/emacs}}
>   +

Aside: It appears to be only partially documented in
https://orgmode.org/worg/org-maintenance.html#emacs-sync. In particular,
the last two lines.

May we just add

>   +\centerline{For more Emacs documentation, and the \TeX{} source for this 
> card, see}
>   +\centerline{the Emacs distribution, or {\tt 
> https://www.gnu.org/software/emacs}}

to Org repo?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] subheadings disappear from buffer [9.6.6 (release_9.6.6 @ /opt/local/share/emacs/29.1/lisp/org/)]

2023-12-05 Thread Ihor Radchenko
Peter Mao  writes:

> This is an incomplete initial bug report.  I don't have time right now to
> chase down all the details.
>
> A couple of times in the past month, the subheadings in the org file I'm
> working on (with lots of org-babel code blocks) disappear.   does not
> fold or unfold those headings, although the indicator (...) still shows.
> ...
> summary:
> 1. subheading text disappears from org file, even in fundamental
> 2. saving the buffer shows that the disappearance is cosmetic only
> 3. I have not established reproducible conditions for this yet.

Might be yet another problem with isearch + folding via text properties.
You may try to set `org-fold-core-style' to 'overlays.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Bug in org-insert-link?

2023-12-05 Thread Ihor Radchenko
Guillaume MULLER  writes:

> The problem is still here, and I managed to find the actual problem.
>
> The problem happens when I do the "C-C C-l file:" then select a file. The 
> root cause is that the mini-buffer then lists all the files in the current 
> directory, and when there are many, the mini-buffer becomes quite big. Thus, 
> the current buffer gets its size reduced, and when the cursor was very low in 
> the buffer frame/window(?), the cursor "magically" jumps to a new position, 
> in the part of the buffer that remained visible.
>
> It is now perfectly reproducible on my side.

If you can, please provide the detailed instructions how to reproduce
the problem on other PC. Ideally, without Doom.
See https://orgmode.org/manual/Feedback.html#Feedback

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] Hard lockup on org-display-inline-images

2023-12-05 Thread Ihor Radchenko
JD Smith  writes:

> Eli and I recently patched a problem 
>  with pixel position 
> reporting with inline images (which I had discovered in a large org buffer 
> with latex-preview).  With this patch installed, now on master as of this 
> evening, org-display-inline-images freezes emacs when a larger image is 
> included in an org file, if org-indent is enabled. 
>
> I’ve confirmed such images are fine in regular buffers by text-property or 
> overlay, so I suspect this is a “revealed bug” in org-indent or the element 
> cache.

I just tried to create a simple Org file with a png image link (on
main, latest Emacs master), enabled org-indent-mode, and displayed the
images. I see no problem.

Please provide more detailed instructions to reproduce the problem.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: ODT export failing

2023-12-05 Thread Ihor Radchenko
"Fraga, Eric"  writes:

> On Monday, 27 Nov 2023 at 19:49, Ihor Radchenko wrote:
>> AFAIU, that message is for fuzzy and id links that do not point to
>> heading or target - such links are not supported.
>
> I've had this before when the target (i.e. the label within the org
> file) did not exist.  I have never seen this with a missing file, as in
> pointing to ~theimage~ where
>
> #+name: theimage
> [[file:thisimagedoesnotexist]]
>
> To solve the problem, I just had to create the file
> "thisimagedoesnotexist".  I guess it is sort of the same issue as
> missing link target so maybe it makes sense even though it is not an id
> link or fuzzy?

I do not see any error when trying to export the above org file to ODT.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] org-babel-load-file, org-babel-tangle-use-relative-file-links and :tangle header [9.6.11 (release_9.6.11 @ /opt/emacs/share/emacs/30.0.50/lisp/org/)]

2023-12-05 Thread Ihor Radchenko
TAKAHASHI Yoshio  writes:

> When org-babel-tangle-use-relative-file-links is t (default),
> org-babel-load-file ignores any source block that does not have `:tangle
> "yes"' or `:tangle filepath' header.
>
> Even if org-babel-default-header-args is changed like
>   (setq org-babel-default-header-args
> (cons '(:tangle . "yes")
>   (assq-delete-all :noweb org-babel-default-header-args)))
> , the result is same.

This is because the default value of `org-babel-default-header-args'
already contains (:tangle . "no"). So, you end up with:

( (:tangle . "yes")
(:session . "none") (:results . "replace") (:exports . "code")
(:cache . "no") (:hlines . "no")
  (:tangle . "no"))

As internal implementation detail, Org babel prefers the _last_ header
arg value in the above list. Which is why you end up seeing what you are seeing.

Not a bug.
Canceled.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [PATCH] Set Python shell in Org edit buffer

2023-12-05 Thread Ihor Radchenko
Liu Hui  writes:

> When editing python src block using C-c ', the python shell is not set
> in Org edit buffer according to the :session header argument of the
> block. Consequently, commands such as python-shell-send-region cannot
> send python code to the correct python process. To address this, the
> attached patch defines org-babel-edit-prep:python in ob-python.el.

Makes sense.
I think we may drop a note about this new feature in ORG-NEWS.

> In addition, I tried to use org-src-associate-babel-session at first,
> but found it doesn't work because it is called when enabling
> org-src-mode, where org-src--babel-info is still nil. It seems it has
> stopped working since 203bf5870, and I think it is safe to remove it
> and related stuffs to avoid confusion.

I do not see it being used much, except
https://github.com/frederic-santos/ob-ess-julia and
https://github.com/alphapapa/outshine
Although, ob-ess-julia is deprecated and outshine only mentions this in
"TODO" comment.

To be safe, I'd prefer to mark `org-src-associate-babel-session'
obsolete and mention the removal in ORG-NEWS, pointing users to
`org-babel-edit-prep:..' instead.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: What is the status of ob-maxima.el? Is this a bug?

2023-12-05 Thread Eduardo Ochs
Ouch! I'm so used to using Maxima from its REPL that I forgot to test
that... thanks and sorry! =/
  Eduardo

On Tue, 5 Dec 2023 at 07:36, Fraga, Eric  wrote:
>
> I think ob-maxima will only output the actual explicit "output" of the
> script, so something like
>
> #+begin_src maxima
> print(2+3);
> #+end_src
>
> should work.
>
> --
> : Eric S Fraga, with org release_9.6.7-661-g34ee6f in Emacs 30.0.50



Re: [BUG] org-babel-tangle may fail due to (org-babel-tangle-collect-blocks lang-re tangle-file) [9.6.9 ( @ /home/andrea/.emacs.d/elpa/org-9.6.9/)]

2023-12-05 Thread Ihor Radchenko
Andrea  writes:

> Sorry Ihor for the long delay.
> I got the error again for the second source block in the attached file.
> That is a sample of my configuration.

Oddly, I am unable to reproduce the problem using your file.
I tried built-in Org version for Emacs 30, Org main branch, and Org
bugfix branch.

I did:

1. cd /path/to/org/repo
2. make repro REPRO_ARGS="/tmp/example.org"
3. Move to the #+begin_src line of the second code block
4. M-: (org-babel-get-src-block-info 'no-eval)
5. I observe return value

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Citation bug: cite/a does not work with basic

2023-12-05 Thread Ihor Radchenko
William Denton  writes:

> Make an Org file with three lines, using cite/a to get the author citation:
>
> ┌
> │ #+bibliography: Test.bib
> │ #+cite_export: basic author author-year
> │ [cite/a:@test2023]
> └
>
> Try to export it to LaTeX with "C-c C-e l l" and we get this error:
>
> Wrong type argument: characterp, raw

Fixed, on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=23378177c

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: What is the status of ob-maxima.el? Is this a bug?

2023-12-05 Thread Fraga, Eric
I think ob-maxima will only output the actual explicit "output" of the
script, so something like

#+begin_src maxima
print(2+3);
#+end_src

should work.

-- 
: Eric S Fraga, with org release_9.6.7-661-g34ee6f in Emacs 30.0.50


[PATCH] Set Python shell in Org edit buffer

2023-12-05 Thread Liu Hui
Hi,

When editing python src block using C-c ', the python shell is not set
in Org edit buffer according to the :session header argument of the
block. Consequently, commands such as python-shell-send-region cannot
send python code to the correct python process. To address this, the
attached patch defines org-babel-edit-prep:python in ob-python.el.

In addition, I tried to use org-src-associate-babel-session at first,
but found it doesn't work because it is called when enabling
org-src-mode, where org-src--babel-info is still nil. It seems it has
stopped working since 203bf5870, and I think it is safe to remove it
and related stuffs to avoid confusion.


Best,
Liu Hui
From c8b9c174cf643bd625cedc311d2604e6fc3bb83a Mon Sep 17 00:00:00 2001
From: Liu Hui 
Date: Tue, 5 Dec 2023 11:40:38 +0800
Subject: [PATCH] Set Python shell in Org edit buffer

* lisp/ob-python.el (org-babel-edit-prep:python): New function.
---
 lisp/ob-python.el | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/lisp/ob-python.el b/lisp/ob-python.el
index 6c568a36d..8ff2c7a1d 100644
--- a/lisp/ob-python.el
+++ b/lisp/ob-python.el
@@ -67,6 +67,13 @@ (defcustom org-babel-python-None-to 'hline
   :package-version '(Org . "8.0")
   :type 'symbol)
 
+(defun org-babel-edit-prep:python (info)
+  "Set Python shell in Org edit buffer according to INFO."
+  (let ((session (cdr (assq :session (nth 2 info)
+(when (and session (not (string= session "none")))
+  (setq-local python-shell-buffer-name
+  (org-babel-python-without-earmuffs session)
+
 (defun org-babel-execute:python (body params)
   "Execute Python BODY according to PARAMS.
 This function is called by `org-babel-execute-src-block'."
-- 
2.25.1

From f3c0d401de55d7ad8873c18658abd1d9f6b49d77 Mon Sep 17 00:00:00 2001
From: Liu Hui 
Date: Tue, 5 Dec 2023 11:36:07 +0800
Subject: [PATCH] Remove 'org-src-babel-configure-edit-buffer' and related
 stuffs

The functionality has stopped working since 203bf5870.
org-babel-edit-prep:lang should be used instead.

* lisp/org-src.el (org-src-associate-babel-session):
(org-src-babel-configure-edit-buffer):
* lisp/ob-R.el (org-babel-R-associate-session): Remove.
---
 lisp/ob-R.el|  8 
 lisp/org-src.el | 23 ---
 2 files changed, 31 deletions(-)

diff --git a/lisp/ob-R.el b/lisp/ob-R.el
index c48b2cdb7..f3cce20b7 100644
--- a/lisp/ob-R.el
+++ b/lisp/ob-R.el
@@ -294,14 +294,6 @@ (defun org-babel-R-initiate-session (session params)
 	   (buffer-name
 	  (current-buffer))
 
-(defun org-babel-R-associate-session (session)
-  "Associate R code buffer with an R session.
-Make SESSION be the inferior ESS process associated with the
-current code buffer."
-  (setq ess-local-process-name
-	(process-name (get-buffer-process session)))
-  (ess-make-buffer-current))
-
 (defvar org-babel-R-graphics-devices
   '((:bmp "bmp" "filename")
 (:jpg "jpeg" "filename")
diff --git a/lisp/org-src.el b/lisp/org-src.el
index 866ff2dbf..6406b8d29 100644
--- a/lisp/org-src.el
+++ b/lisp/org-src.el
@@ -914,29 +914,6 @@ (defun org-src-mode-configure-edit-buffer ()
 
 (add-hook 'org-src-mode-hook #'org-src-mode-configure-edit-buffer)
 
-
-
-;;; Babel related functions
-
-(defun org-src-associate-babel-session (info)
-  "Associate edit buffer with comint session.
-INFO should be a list similar in format to the return value of
-`org-babel-get-src-block-info'."
-  (interactive)
-  (let ((session (cdr (assq :session (nth 2 info)
-(and session (not (string= session "none"))
-	 (org-babel-comint-buffer-livep session)
-	 (let ((f (intern (format "org-babel-%s-associate-session"
-  (nth 0 info)
-   (and (fboundp f) (funcall f session))
-
-(defun org-src-babel-configure-edit-buffer ()
-  "Configure src editing buffer."
-  (when org-src--babel-info
-(org-src-associate-babel-session org-src--babel-info)))
-
-(add-hook 'org-src-mode-hook #'org-src-babel-configure-edit-buffer)
-
 
 ;;; Public API
 
-- 
2.25.1



Re: [BUG] error: Invalid search bound [9.6.11 ( @ /home/nikratio/.emacs.d/elpa/28.2/develop/org-9.6.11/)]

2023-12-05 Thread Nikolaus Rath



On Mon, 4 Dec 2023, at 14:53, Ihor Radchenko wrote:
> "Nikolaus Rath"  writes:
>
>> When running org-agenda and pressing "x" (see below for configuration), I am 
>> occasionally getting the following error:
>>
>> Warning (org-element-cache): org-element--cache: Added org-data parent to 
>> non-headline element:
>> ...
>>
>> Emacs  : GNU Emacs 28.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.37, 
>> cairo version 1.16.0)
>> of 2023-05-14, modified by Debian
>> Package: Org mode version 9.6.11 ( @ 
>> /home/nikratio/.emacs.d/elpa/28.2/develop/org-9.6.11/)
>
> May you please try the latest bugfix branch and let us know if you are
> still seeing the warning?

Thanks for the quick response! Could you point me in the direction of how to do 
that? I'm a bit confused by the layering of Emac's builtin-org, the Elpa 
installed one (which I seem to be using) and Spacemacs (whih I think takes over 
management of Emacs packages). 

Should it work to clone the git branch and do "(add-to-list 'load-path 
"~/src/org-mode/lisp") or will this result in some terrible mess?

Best,
-Nikolaus