org-agenda-skip-function now evaluated on line after headline?

2024-03-12 Thread Sean Whitton
Hello,

It looks like the org-agenda-skip-function is now evaluated with point
on the second line of the subtree, rather than on the headline?

It always used to be evaluated with point on the headline.  Seems like
this might count as a regression?

Thanks.

-- 
Sean Whitton



[PATCH] Allow external libraries (org-roam) to supply org-id locations

2024-03-12 Thread Rick Lupton
Hi all,

Since updating the org-id code [1] to use the standard org-link registered 
functions instead of hard-coding org-id opening, I have a problem using 
org-roam.

org-roam overwrites the :follow function for "id" links from the build-in 
`org-id-open' to its own `org-roam-id-open' 
(https://github.com/org-roam/org-roam/blob/8667e441876cd2583fbf7282a65796ea149f0e5f/org-roam-id.el#L91).
  The only change between these functions is to insert a call to try 
`org-roam-id-find' before trying `org-id-find', which uses org-roam's cached 
sqlite database to find the id 
(https://github.com/org-roam/org-roam/blob/8667e441876cd2583fbf7282a65796ea149f0e5f/org-roam-id.el#L70-L71)

As well as being messy, my specific problem is that the improvements to open 
search strings in org-id links are no longer enabled when org-roam is loaded.

It seems reasonable that a library might want to provide its own way of 
locating org-ids.  The attached patch adds a new hook variable 
`org-id-find-functions` which contains functions doing the same job as 
`org-id-find' that should be tried first.  Then all org-roam needs to do is add 
its `org-roam-id-find' to the hook.

Does this seem like a good idea?

Thanks,
Rick

[1] Link: 
https://list.orgmode.org/118435e8-0b20-46fd-af6a-88de8e19f...@app.fastmail.com/


0001-lisp-org-id.el-add-hook-org-id-find-functions.patch
Description: Binary data


Re: [BUG] [PATCH] org-babel-execute-buffer: Prevent executing non-code blocks [9.6.20 ( @ /home/cassou/.emacs.d/lib/org/lisp/)]

2024-03-12 Thread Ihor Radchenko
Damien Cassou  writes:

> Ihor Radchenko  writes:
>> Thanks for the patch, but it is not obvious that skipping src blocks
>> that cannot be executed is always a good idea.  Consider, for example,
>> that some blocks are used as input for other blocks. Then, failing to
>> execute them means that other blocks may have unpredictable side
>> effects.
>
>
> I don't understand your position. Without this patch, executing
> `org-babel-execute-buffer' will just crash if a block can't be
> executed. What problem can skipping those could cause?

For example, consider

#+begin_src bash
mkdir foo
#+end_src

#+begin_src emacs-lisp
(write-file "foo/result")
#+end_src

The second block relies upon side effects of the first block.
However, if ob-shell is not loaded, with your patch, the side effect
will not happen.

One can construct more nasty examples when not executing prior block
leads to unexpected or even damaging results.

>> May you please provide a concrete use-case when skipping some src code
>> blocks is desired?
>
> I use text-mode blocks to represent output of bash scripts as in:
>
> #+name: repo-test-check
> #+begin_src sh :exports both :results output raw :wrap SRC text
>   git log --oneline
> #+end_src
> 
> #+RESULTS: repo-test-check
> #+begin_SRC text
> cfd2b (HEAD -> main) Empty
> #+end_SRC
>
> The second block can't be executed because no
> `org-babel-execute:text` function exists.

Why not simply adding :eval no header argument?

The problem with testing that `org-babel-execute:' function exists
is that we cannot distinguish between languages that cannot and should
not be executed and babel backends that are not loaded for some reason.

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



Re: org-id-locations as a large-scale database store?

2024-03-12 Thread Ihor Radchenko
Laurence von Bottorff  writes:

> Any docs on what org-id-locations is about, who/what uses it?

It is an internal variable.

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



Re: [BUG] [PATCH] org-babel-execute-buffer: Prevent executing non-code blocks [9.6.20 ( @ /home/cassou/.emacs.d/lib/org/lisp/)]

2024-03-12 Thread Damien Cassou
Hi Ihor,

Ihor Radchenko  writes:
> Thanks for the patch, but it is not obvious that skipping src blocks
> that cannot be executed is always a good idea.  Consider, for example,
> that some blocks are used as input for other blocks. Then, failing to
> execute them means that other blocks may have unpredictable side
> effects.


I don't understand your position. Without this patch, executing
`org-babel-execute-buffer' will just crash if a block can't be
executed. What problem can skipping those could cause?


> May you please provide a concrete use-case when skipping some src code
> blocks is desired?

I use text-mode blocks to represent output of bash scripts as in:

#+name: repo-test-check
#+begin_src sh :exports both :results output raw :wrap SRC text
  git log --oneline
#+end_src

#+RESULTS: repo-test-check
#+begin_SRC text
cfd2b (HEAD -> main) Empty
#+end_SRC

The second block can't be executed because no
`org-babel-execute:text` function exists.

Best

-- 
Damien Cassou

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill



Re: org-id-locations as a large-scale database store?

2024-03-12 Thread Laurence von Bottorff
Any docs on what org-id-locations is about, who/what uses it?

On Tue, Mar 12, 2024 at 1:44 PM Ihor Radchenko  wrote:

> yeti  writes:
>
> >> Does org-brain have anything to do with org-id-locations?
> >
> > I think so...
> >
> > E.g. org-brain.el 788-794:
> >
> > ---8<---
> > (defun org-brain-entry-from-id (id)
> >   "Get entry from ID."
> >   (unless org-id-locations (org-id-locations-load))
> >   (when-let ((path (gethash id org-id-locations)))
> > (list (org-brain-path-entry-name path)
> >   (org-brain-headline-at (org-id-find id t))
> >   id)))
>
> That's redundant. Calling `org-id-find' would suffice (org-id-find
> internally arranges org-id-locations to be updated).
>
> In any case, loading and searching id locations scales well for
> thousands of entries - I currently have 60+k entries there without
> issues.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>
>

-- 
⨽
Lawrence Bottorff
Grand Marais, MN, USA
borg...@gmail.com


Re: [BUG] Re: The orgframe construct in the Beamer exporter as a default needs a rethink

2024-03-12 Thread Leo Butler
On Tue, Mar 12 2024, Ihor Radchenko  wrote:

> Pedro Andres Aranda Gutierrez  writes:
>
>> Jup, of course. If you look in org-lint.el, one of the cases that would
>> trigger a message is when the frame environment uses "frame" directly and
>> there is a \begin{frame} in the org.
>> Line 1522 onwards in org-lint.el
>
> (1)
> Sure, but we should not demand users to run org-lint. Ideally, exporting
> any valid Org file should work.
> The fact that the presence of \begin{frame} breaks beamer is a technical
> detail users should better not be bothered with. That's why we added the
> orgframe construct.
>
> (2)
> On the other hand, it is clear that Org mode users are unwilling to
> tolerate too much of machine generated latex output. So, going further
> and trying to generate unique orgframe environments might not be ideal.
>
> The current approach is a balance between the above considerations.
>
> AFAIU, what you propose is reverting the orgframe code; that goes
> against the first point.

Current git HEAD allows a user like Pedro to effectively turn off the
orgframe code via

(setq org-beamer-frame-environment "frame")

or an equivalent. 

>
> What I proposed is to reduce the amount of machine-generated code by
> using `org-beamer-frame-environment' only when strictly necessary.

Attached is a patch that limits the use of
`org-beamer-frame-environment' to those frames that contain either
\begin{frame} or \end{frame} in their body.

This has the nice side-effect that one can include example frames
generated by Org without causing an error (previously, Org exported
latex that would not compile). See the attachments.

Leo

From cab7cd149868be86f80d2c7bb52e2c09c028d4b1 Mon Sep 17 00:00:00 2001
From: Leo Butler 
Date: Tue, 12 Mar 2024 15:11:27 -0500
Subject: [PATCH] lisp/ox-beamer.el: constrain use of
 org-beamer-frame-environment

* lisp/ox-beamer.el (org-beamer--format-frame): Only use
`org-beamer-frame-environment' when a frame is marked as fragile and
the frame's contents include either \begin{frame} or \end{frame}.

Refs: https://list.orgmode.org/orgmode/87bk7jeik8.fsf@localhost/
https://list.orgmode.org/87a5nux3zr@t14.reltub.ca/T/
---
 lisp/ox-beamer.el | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el
index 4fad37b59..f7e39dde4 100644
--- a/lisp/ox-beamer.el
+++ b/lisp/ox-beamer.el
@@ -429,7 +429,10 @@ used as a communication channel."
 	  ;; among `org-beamer-verbatim-elements'.
 	  (org-element-map headline org-beamer-verbatim-elements 'identity
 			   info 'first-match))
- (frame (or (and fragilep org-beamer-frame-environment)
+ (frame (or (and fragilep
+ (or (string-search "\\begin{frame}" contents)
+ (string-search "\\end{frame}" contents))
+ org-beamer-frame-environment)
 "frame")))
 (concat "\\begin{" frame "}"
 	;; Overlay specification, if any. When surrounded by
-- 
2.43.0

#+startup: beamer
#+LaTeX_CLASS: beamer

* A frame with =orgframe= sample code
#+begin_example
\begin{orgframe}
  Here is a beamer frame.
\end{orgframe}
#+end_example
This is exported in a =frame= environment, although it is marked as fragile.

* A frame with =frame= sample code
#+begin_example
\begin{frame}
  Here is a beamer frame.
\end{frame}
#+end_example
This is exported in an =orgframe= environment, since contains =\begin{frame}= and =\end{frame}=.

* An ordinary frame
\[ z^n = x^n + y^n \]
This is exported in a =frame= environment.

% Created 2024-03-12 Tue 15:28
% Intended LaTeX compiler: pdflatex
\documentclass[presentation]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{capt-of}
\usepackage{hyperref}
\newenvironment<>{orgframe}[1][]{\begin{frame}#2[environment=orgframe,#1]}{\end{frame}}
\usetheme{default}
\date{\today}
\title{}
\hypersetup{
 pdfauthor={},
 pdftitle={},
 pdfkeywords={},
 pdfsubject={},
 pdfcreator={Emacs 29.1 (Org mode 9.7-pre)}, 
 pdflang={English}}
\begin{document}

\begin{frame}{Outline}
\tableofcontents
\end{frame}

\begin{frame}[label={sec:org5fbeeef},fragile]{A frame with \texttt{orgframe} sample code}
 \begin{verbatim}
\begin{orgframe}
  Here is a beamer frame.
\end{orgframe}
\end{verbatim}
This is exported in a \texttt{frame} environment, although it is marked as fragile.
\end{frame}
\begin{orgframe}[label={sec:org500e0c5},fragile]{A frame with \texttt{frame} sample code}
 \begin{verbatim}
\begin{frame}
  Here is a beamer frame.
\end{frame}
\end{verbatim}
This is exported in an \texttt{orgframe} environment, since contains \texttt{\textbackslash{}begin\{frame\}} and \texttt{\textbackslash{}end\{frame\}}.
\end{orgframe}
\begin{frame}[label={sec:orga2d3f31},fragile]{An ordinary frame}
 \[ z^n = x^n + y^n \]
This is exported in a 

Re: Just thinking...

2024-03-12 Thread Ihor Radchenko
Pedro Andres Aranda Gutierrez  writes:

> You are right. It is easy to do from emacs-lisp scripts, looking for
> LATEX_CLASS in a document and then deciding to use the org-latex-... or the
> org-beamer-... functions, but it looks much more difficult in org.el itself
> :(
> It's just that it would look much more elegant to have only one. For me
> Beamer is just a LaTeX 'feature'...

Actually, it should be possible to modify `org-latex-export-as-latex',
`org-latex-export-to-latex', and `org-latex-export-to-pdf' to load
ox-beamer and invoke the beamer-specific export commands.

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



Re: [BUG] Bug Report [9.6.6 (release_9.6.6 @ /usr/share/emacs/29.1/lisp/org/)]

2024-03-12 Thread Ihor Radchenko
[ Adding Org mailing list back to CC. Please use "reply all" to keep the
  conversation public ]

Jerome  writes:

> This specific case (deleting a line and getting a bug) has only happened 
> once. Might also be worth noting that I only ever get bugs in this one org 
> file that I open, never in any others so it might be fairly niche. 

This kind of bugs is indeed fairly niche. The reason why we display the
warning and ask to report is to catch various edge cases users may
encounter. (We have hard time making the relevant code 100% reliable -
it is asynchronous and often depends on details of Org buffer structure
+ editing sequence)

In any case, if you are lucky, updating Org mode to the latest stable
version (Org 9.6.21) or to the latest main (development version Org
9.7-pre) might eliminate the bug.

May you upgrade and report back if you keep seeing problems?

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



Re: org-id-locations as a large-scale database store?

2024-03-12 Thread Ihor Radchenko
yeti  writes:

>> Does org-brain have anything to do with org-id-locations?
>
> I think so...
>
> E.g. org-brain.el 788-794:
>
> ---8<---
> (defun org-brain-entry-from-id (id)
>   "Get entry from ID."
>   (unless org-id-locations (org-id-locations-load))
>   (when-let ((path (gethash id org-id-locations)))
> (list (org-brain-path-entry-name path)
>   (org-brain-headline-at (org-id-find id t))
>   id)))

That's redundant. Calling `org-id-find' would suffice (org-id-find
internally arranges org-id-locations to be updated).

In any case, loading and searching id locations scales well for
thousands of entries - I currently have 60+k entries there without
issues.

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



Re: org-id-locations as a large-scale database store?

2024-03-12 Thread yeti
Ihor Radchenko  writes:

> yeti  writes:
>
>> Laurence von Bottorff  writes:
>>
>>> So again, is this org-brain approach DOA for anything big?
>>
>> I like it, but even my small pool of notes is slow with org-brain.
>>
>> ---8<---
>> ~ $ hash-table-size $org-id-locations
>> 1322
>> --->8---
>
> Does org-brain have anything to do with org-id-locations?

I think so...

E.g. org-brain.el 788-794:

---8<---
(defun org-brain-entry-from-id (id)
  "Get entry from ID."
  (unless org-id-locations (org-id-locations-load))
  (when-let ((path (gethash id org-id-locations)))
(list (org-brain-path-entry-name path)
  (org-brain-headline-at (org-id-find id t))
  id)))
--->8---

-- 
I do not bite, I just want to play.




Re: org-id-locations as a large-scale database store?

2024-03-12 Thread Ihor Radchenko
yeti  writes:

> Laurence von Bottorff  writes:
>
>> So again, is this org-brain approach DOA for anything big?
>
> I like it, but even my small pool of notes is slow with org-brain.
>
> ---8<---
> ~ $ hash-table-size $org-id-locations
> 1322
> --->8---

Does org-brain have anything to do with org-id-locations?

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



Re: `:export' attribute?: Re: Experimental public branch for inline special blocks

2024-03-12 Thread Juan Manuel Macías
Max Nikulin writes:

> It is not clear for me how to achieve the following. Add a link
>
> [[https://youtube.com/...][Org mode in action demo (video)]]
>
> for all backends (EPUB, LaTeX, ODT, text, etc.) besides HTML because
> there is an #+export_html block with player embedded using an iframe.

Sorry, I don't quite understand this. Could you please elaborate?

> Instead of "noexport" and "rest" that may be confused with backend
> names I would consider "+" and "*" without any name. I would consider
> some characters like "-", "_", "!", "~" to express "do not export to
> this and derived backends" and "do not export for specified backend
> only".

how about the following:

- "--" :: do not export

- "**" :: export only the content

- "==" :: rest (full)

- "=*" :: rest (only the content)

- "!backend-name+ :: export this backend (full)

- "!backend-name*" :: export this backend (only the content)

- "!backend-name- :: do not export this backend

?

-- 
Juan Manuel Macías -- Composición tipográfica, tratamiento de datos, diseño 
editorial y ortotipografía




Re: org-id-locations as a large-scale database store?

2024-03-12 Thread Rick Lupton
You might be interested in https://www.orgroam.com/ which is a broadly similar 
idea to org-brain but uses a SQLite database to track id locations and links.



Re: org-id-locations as a large-scale database store?

2024-03-12 Thread yeti
Laurence von Bottorff  writes:

> So again, is this org-brain approach DOA for anything big?

I like it, but even my small pool of notes is slow with org-brain.

---8<---
~ $ hash-table-size $org-id-locations
1322
--->8---

-- 
I do not bite, I just want to play.




Re: `:export' attribute?: Re: Experimental public branch for inline special blocks

2024-03-12 Thread Max Nikulin

On 12/03/2024 20:45, Juan Manuel Macías wrote:


backend-name = full export
backend-name* = only contents
And the "rest" option is introduced, with the same syntax as before.

Examples:


It is not clear for me how to achieve the following. Add a link

[[https://youtube.com/...][Org mode in action demo (video)]]

for all backends (EPUB, LaTeX, ODT, text, etc.) besides HTML because 
there is an #+export_html block with player embedded using an iframe.


Instead of "noexport" and "rest" that may be confused with backend names 
I would consider "+" and "*" without any name. I would consider some 
characters like "-", "_", "!", "~" to express "do not export to this and 
derived backends" and "do not export for specified backend only".






Re: ob-haskell and changing executables?

2024-03-12 Thread Ihor Radchenko
Bruno Barbier  writes:

>> Only for sessions. For src blocks with :session none, we directly call
>> `org-babel-haskell-compiler'.
>
> Good point.  I didn't check that execution path (probably because I
> assumed the OP was speaking only about GHCi).
>
> But, from what I see (function `org-babel-execute:haskell'), for
> Haskell, we switch to the compiler only if explicitly requested
> (':compile' option is "yes").  If not, we use the interpreter for both
> with and without sessions.
>
> Am I missing something ?

Looks like you are right.

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



Re: Table column formula with remote reference

2024-03-12 Thread Ihor Radchenko
Wu Ming  writes:

> Problem solved with
>
> $1 = remote(A,@@#$1)
>
> as described on the manual page 
> https://orgmode.org/manual/References.html#Field-coordinates-in-formulas-1 
> 
>
> Where is the coordinate @@# documented?

I am confused. Isn't it documented in the linked section of the manual?


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



Re: [BUG] ":sep" header argument doesn't work in ob-shell [9.6.21 ( @ /home/aragaer/.config/emacs/elpa/org-9.6.21/)]

2024-03-12 Thread Ihor Radchenko
Ilya Konovalov  writes:

> On current master using ":sep" header argument does not work as
> expected and records are always split on whitespaces. For example:
>
> #+begin_src sh :sep "\t"
>   echo hello world
>   echo test
> #+end_src
>
> #+RESULTS:
> | hello | world |
> | test  |   |

It looks like you are trying to achieve precise control over how
ob-shell interprets the evaluation result.

Note that you can always force :results scalar to interpret the output
as string. Otherwise, Org mode tries to guess the output format.

Since bash does not have a notion of table output, Org's guess is
arbitrary - split multiline result string by line assuming whitespace as
field separator.

So, this is not a bug.
Canceled.

To parse the result as table using custom rules, you can use :post
header argument + custom src block that parser the output string as you
need.

We might consider making ob-shell output handling smarter, as a feature
request.

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



Re: [BUG] ":sep" header argument doesn't work in ob-shell [9.6.21 ( @ /home/aragaer/.config/emacs/elpa/org-9.6.21/)]

2024-03-12 Thread Ihor Radchenko
Matt  writes:

> ...  According to my notes, :sep and :separator don't work for
> anything beyond basic table layout. I'm not familiar with org-table
> and there isn't much documentation on those keywords in the manual.
> The :sep keyword shows up for Texinfo and LaTeX. It looks like :sep is
> used for export? It's not clear to me how they're supposed to work
> with shell block output, or if that was even a consideration at all.
>
> They were added in
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=a60a83fbb65a368bb96ea6aaf1db20706b3e99c5
> claiming "better handling of table in shell scripts" So, it looks like
> their inclusion was intentional.
>
> Maybe someone has deeper insights?

:sep header argument is used to format table result when writing to file:

 By default, Org assumes that a table written to a file has
 TAB-delimited output.  You can choose a different separator with
 the ‘sep’ header argument.

"16.6 Results of Evaluation" section of the manual.
It is only relevant when you have :results file and the evaluation
results are redirected to file instead of Org buffer.

:sep header argument is universal to all babel backends.

:separator argument is used in ob-sqlite and ob-shell.
However, it means different things in ob-sqlite vs. ob-shell.

In ob-sqlite, :separator argument is defining how sqlite formats its
output. AFAIU, it is only needed when sql table data contains "|" - the
default separator.

In ob-shell, :separator argument is _not_ used to format the output.
Instead, it is used to control how ob-shell passes Elisp data shell variables.
However, it is almost never used in practice (also, it is not
documented) - :separator argument only affects how deeply nested Elisp
lists are converted to bash data:

#+begin_src bash :var x='1 1)) 3) (4 5)) :results output :cache no 
:separator "+"
echo keys: ${!x[@]}
echo values: ${x[@]}
#+end_src

#+RESULTS[7de8e7c561edda2dce18a302f4d8beb8a51595df]:
: keys: 4 1+1
: values: 5 3

Normal two-dimentional tables and lists are handled without being
affected by :separator.

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



Re: `:export' attribute?: Re: Experimental public branch for inline special blocks

2024-03-12 Thread Juan Manuel Macías
In the last commit I have introduced some changes. Now this new feature
is no longer hardcoded in each backend but is controlled by an external
function in ox.el. I think this can simplify the implementation for
other backends.

As Stefan Nobis proposed, the "+" sign is now not necessary:

backend-name = full export

backend-name* = only contents

And the "rest" option is introduced, with the same syntax as before.

Examples:

@foo[:export noexport]{lorem ipsum dolor}

==> does not export anything

@foo[:export contents]{lorem ipsum dolor}

==> only contents

@foo[:export latex]{lorem ipsum dolor}

==> exports only to LaTeX

@foo[:export latex odt* html*]{lorem ipsum dolor}

==> exports everything to LaTeX, but to odt and HTML only the content

@foo[:export latex* rest]{lorem ipsum dolor}

==> content to LaTeX but full export to the rest of the backends

@foo[:export latex rest*]{lorem ipsum dolor}

==> the opposite of the above.

-- 
Juan Manuel Macías -- Composición tipográfica, tratamiento de datos, diseño 
editorial y ortotipografía




Re: ob-haskell and changing executables?

2024-03-12 Thread Bruno Barbier


Hi Ihor,

Ihor Radchenko  writes:

> Bruno Barbier  writes:
>
>>> If you've gotten this far you probably know more
>>> about the Haskell Babel situation than you ever wanted to, but maybe you
>>> can sniff out where this hardwire is happening.
>>
>> It's not hard coded (there is quite a lot of code just to guess the
>> right interpreter).  ob-haskell delegates the task to the
>> haskell-mode package; that's where you should be looking for to
>> configure it.
>
> Only for sessions. For src blocks with :session none, we directly call
> `org-babel-haskell-compiler'.

Good point.  I didn't check that execution path (probably because I
assumed the OP was speaking only about GHCi).

But, from what I see (function `org-babel-execute:haskell'), for
Haskell, we switch to the compiler only if explicitly requested
(':compile' option is "yes").  If not, we use the interpreter for both
with and without sessions.

Am I missing something ?

Thanks,

Bruno


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



Re: [BUG] Bug Report [9.6.6 (release_9.6.6 @ /usr/share/emacs/29.1/lisp/org/)]

2024-03-12 Thread Ihor Radchenko
Jerome Siljan  writes:

> I deleted a line in my file and I got this error and the prompt to
> report it
>
> Emacs : GNU Emacs 29.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 
> 3.24.39, cairo version 1.18.0)
> of 2024-01-10
> Package: Org mode version 9.6.6 (release_9.6.6 @ 
> /usr/share/emacs/29.1/lisp/org/)

Thanks for the report!
Do you see the error regularly? Or did it happen just once?

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



Re: [BUG] a bug [9.7-pre (release_9.6.14-1017-g518533 @ /home/saint/.emacs.d/straight/build/org/)]

2024-03-12 Thread Ihor Radchenko
MasterWQ  writes:

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

Thanks for reporting, but may you please provide some details on what
has happened?

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



Re: [PATCH] lisp/ob-shell.el: Also override explicit-shell-file-name

2024-03-12 Thread Ihor Radchenko
Matt  writes:

> Thank you for your report and the patch. 

Matthew, you are free to apply patches relevant to ob-shell to savannah
repository, if you think that they are fine.

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



Re: [PATCH] lisp/oc-basic.el: add missing function declarations

2024-03-12 Thread Ihor Radchenko
Gerard Vermeulen  writes:

> the attached patch adds two missing function declarations to oc-basic.el

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

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



Re: [BUG] [PATCH] Use new face org-caption for #+caption lines [9.6.21 ( @ /home/cassou/.emacs.d/lib/org/lisp/)]

2024-03-12 Thread Ihor Radchenko
Damien Cassou  writes:

> Currently, the caption of a picture (here the text "Description of the
> piture") has the face `org-block':
>
> #+CAPTION: Description of the picture.
> #+RESULTS:
> [[file:./picture.png]]
>
> I don't see any reason for the caption to use the same face as code
> inside blocks as captions are expected to be human-readable text.
>
> Attached patch introduces a new `org-caption' face applied on captions.
> For conservative reasons, the new face inherits from `org-block' but I
> can change that if you want.

Thanks! Ideally, we should fontify caption text as normal Org text and
maybe apply some face on top (but not necessarily).
Postponed after fontification rewrite 
(https://orgmode.org/list/87ee7c9quk.fsf@localhost).

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



Re: [BUG] obscure error for invalid :exports

2024-03-12 Thread Ihor Radchenko
Max Nikulin  writes:

>> See the attached tentative patch.
>
> Thanks, Ihor. With this patch applied, behavior is improved.

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

> Notice however that the *Warnings* buffer may be hidden by export result 
> (e.g. when export to buffer is chosen in the dispatcher).
>
> Almost certainly you already know my opinion (see example of a message 
> link below) that ideally export warnings should be collected with line 
> numbers to a buffer having compilation-minor-mode. Of course, I do not 
> expect that this feature will be implemented as a part of a fix for this 
> bug.

Yes, a better export diagnostics interface (maybe similar to org-lint)
would be nice to have.

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



Re: Warn about shell-expansion in the docstring of org-latex-to-html-convert-command

2024-03-12 Thread Ihor Radchenko
Max Nikulin  writes:

>> Even stripping quotes is unreliable when we use the example from
>> docstring: 'literal:%i'.
>
> My idea is to recognize this case. If stripping is not performed then it 
> is necessary to detect if user command is safe. Otherwise apostrophe in 
> a formula (even after escaping) may cause leaking math to shell. I have 
> not figured out if it is possible to bypass double quotes, but extra 
> slashes may distort math expression.
>
> It is trivial to cause shell failure when single quotes are used around 
> %i. I am in doubts concerning double quotes. Perhaps stripping them is 
> more reliable.

May you list the cases to you propose to recognize?

>> Attaching tentative patch that fixes the problem.
>
> I think it is in the right direction.
> - Manual needs update as well.

Yes,

  #+begin_src emacs-lisp
  (setq org-latex-to-mathml-convert-command
"latexmlmath \"%i\" --presentationmathml=%o")
  #+end_src

example in "LaTeX math snippets" section should be updated. (note to self)

> - I would explicitly stress that quotes causes undefined or even 
> dangerous behavior. See e.g. the last paragraph
> https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s07.html

In ORG-NEWS?

> - I expected it as bugfix.

It is a breaking change.
Also, only users who customized the variable may be prone to unexpected
shell expansion. So, I do not see it as a critical bug.
Hence, not for bugfix.

> I have tried to add some unit tests, but I faced an issue with 
> `org-create-math-formula'. It creates temporary files in 
> `default-directory' and does not remove them on failure. Moreover, it 
> does not work in a container where git is not installed:
> ...
> Debugger entered--Lisp error: (file-missing "Searching for program" "No 
> such file or directory" "git")
>
> that is called from `find-file-hook'.

with emacs -Q?

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



Re: [BUG] org-fold :extend face backgrounds break with trailing newlines [9.7-pre (release_9.6.20-1267-gb0c3c9 @ /home/st/.config/emacs/.local/straight/build-30.0.50/org/)]

2024-03-12 Thread Ihor Radchenko
StrawberryTea  writes:

> I've noticed that when using the :extend face property with org-fold,
> the background color of the headline face will sometimes be left behind
> after unfolding a heading. I have finally determined that this is
> happening when the heading has a trailing newline and the heading is
> after the last non-whitespace character in the heading's body.
>
> Here is a minimal example to reproduce this issue from emacs -Q:

Thanks for reporting, but I am unable to reproduce the problem on my
side using the latest main. May you please provide more detailed
instruction about what exactly do I need fold/unfold to see the problem?

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



Re: Things got very slow: profiler output

2024-03-12 Thread Ihor Radchenko
William Denton  writes:

>> 40255 60% - org-do-latex-and-related
>> 40243 60% re-search-forward
> ...
> I spent a while with git bisect this afternoon and the problem (for me) 
> started here:
>
> commit 5d186b499dde97f59a91dc11f4c4a15113d29f4d
> Author: Ihor Radchenko 
> Date:   Sun Feb 25 11:42:44 2024 +0300
>
> org-fold: Refactor fontifying newlines after folds
>
> That seems to fit with some of what the profiling showed, in that it's
> about font-locking, though why LaTeX is mentioned is beyond me. When I
> was going through the bisect process I wasn't testing on files with
> LaTeX, I was expanding and folding some I regularly use that have some
> code blocks and tables with a few hundred lines.

Profiler data does not make sense here.
In any case, I tried to make fontifying newlines after folds slightly
faster on the latest main:
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=c9b655f27

If you are lucky, it should help.

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



Re: [BUG] Flyspell triggers "Warning (org-element-cache): org-element--cache" [9.6.18 ( @ /home/mwillcock/.emacs.d/elpa/org-9.6.18/)]

2024-03-12 Thread Ihor Radchenko
Morgan Willcock  writes:

>> org-element.el has been changed significantly on main compared to bugfix 
>> branch.
>
> I remained on the release version but the problem has not reappeared.
>
> Given that the development version has significant changes, and I am not
> able to get a handle on what causes the problem (I imagine it is a
> general cache problem and not something caused by flyspell), feel free
> to close the bug report.

Thanks for the update!
Canceled.

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



Re: ob-haskell and changing executables?

2024-03-12 Thread Ihor Radchenko
Bruno Barbier  writes:

>> If you've gotten this far you probably know more
>> about the Haskell Babel situation than you ever wanted to, but maybe you
>> can sniff out where this hardwire is happening.
>
> It's not hard coded (there is quite a lot of code just to guess the
> right interpreter).  ob-haskell delegates the task to the
> haskell-mode package; that's where you should be looking for to
> configure it.

Only for sessions. For src blocks with :session none, we directly call
`org-babel-haskell-compiler'.

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



Re: [BUG] Re: The orgframe construct in the Beamer exporter as a default needs a rethink

2024-03-12 Thread Ihor Radchenko
Pedro Andres Aranda Gutierrez  writes:

> Jup, of course. If you look in org-lint.el, one of the cases that would
> trigger a message is when the frame environment uses "frame" directly and
> there is a \begin{frame} in the org.
> Line 1522 onwards in org-lint.el

(1)
Sure, but we should not demand users to run org-lint. Ideally, exporting
any valid Org file should work.
The fact that the presence of \begin{frame} breaks beamer is a technical
detail users should better not be bothered with. That's why we added the
orgframe construct.

(2)
On the other hand, it is clear that Org mode users are unwilling to
tolerate too much of machine generated latex output. So, going further
and trying to generate unique orgframe environments might not be ideal.

The current approach is a balance between the above considerations.

AFAIU, what you propose is reverting the orgframe code; that goes
against the first point.

What I proposed is to reduce the amount of machine-generated code by
using `org-beamer-frame-environment' only when strictly necessary.

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



Re: [PATCH] Unindentation fixup for code blocks

2024-03-12 Thread Ihor Radchenko
Ihor Radchenko  writes:

> I am attaching an amended patch with modified commit message and
> docstring describing the invisible text is accounted as visible.
> I also added TINYCHANGE cookie as you do not appear to have FSF
> copyright assignment.

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

You are also now listed as Org mode contributor.
https://git.sr.ht/~bzg/worg/commit/beb9318d

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



Re: [BUG] [PATCH] org-babel-execute-buffer: Prevent executing non-code blocks [9.6.20 ( @ /home/cassou/.emacs.d/lib/org/lisp/)]

2024-03-12 Thread Ihor Radchenko
Damien Cassou  writes:

> The command `org-babel-execute-buffer' tries to execute all source code
> blocks of the current buffer. When it encounters a block that is not
> executable the command crashes. The attached patch makes the command ignore
> non-executable blocks and move on.
> ...
> -(org-babel-execute-src-block arg)
> +(let* ((info (org-babel-get-src-block-info))
> +   (lang (nth 0 info))
> +   (cmd (intern (concat "org-babel-execute:" lang
> +  (when (fboundp cmd)
> +(org-babel-execute-src-block arg)))

Thanks for the patch, but it is not obvious that skipping src blocks
that cannot be executed is always a good idea.
Consider, for example, that some blocks are used as input for other
blocks. Then, failing to execute them means that other blocks may have
unpredictable side effects.

May you please provide a concrete use-case when skipping some src code
blocks is desired?

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



Re: [BUG] Org-Agenda leaves frame around [9.7-pre (release_9.6.8-785-g72bbf8.dirty @ /home/bidar/.local/private/etc/emacs/lib/org/lisp/)]

2024-03-12 Thread Ihor Radchenko
Björn Bidar  writes:

>> Fixed, on main.
>> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=fef873b1c
>
> I noticed that `org-insert-structure-template' and possibly others are
> also affected
>
> Is a new bug needed or this one enough?

This one is enough.
Fixed, on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=a1b8554f6

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



Re: ob-haskell and changing executables?

2024-03-12 Thread Ihor Radchenko
Laurence von Bottorff  writes:

> I'm on Debian 12 and I just started using Haskell's ghcup tools, leaving
> the stack tools behind, as advised these days. ghcup puts executables for
> Haskell such as ghc, ghci (REPL), cabal, etc. in its ~/.ghcup/bin
> directory. Next, to stop using the stack tools that have executables in
> /usr/bin/ you must change your PATH to go to ~/.ghcup/bin first. But when I
> try a Babel code block, ob-haskell seems to have the /usr/bin versions
> hardwired somewhere and calls up the old ghci REPL.

They are not hardwired. May you check that PATH inside your Emacs is set
correctly? You can, for example, run
(getenv "PATH") or (shell-command-to-string "whereis ghci")

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



Re: Testing issues for Ada/SPARK support in Babel

2024-03-12 Thread Ihor Radchenko
Francesc Rocher  writes:

> I'm starting from scratch the set of tests for Ada/SPARK support in Babel.
> I've prepared a file with the first example:
>
> ---8<--- testing/examples/ob-ada-spark-test-org ---8<---
> ...
> Then in the file testing/test-ob-ada-spark.el I've defined the following
> test:
>
> (ert-deftest ob-ada-spark/hello-world ()
>   "Test simple Hello world."
>   (org-test-at-id "778e63c2-2644-4a6f-8e7d-f956fa3d9241"

I recommend using `org-test-with-temp-text' when the tested Org snippet
is short. Otherwise, it is harder to read the test.

> $ make BTEST_RE='ob-ada-spark.*' test-dirty
>
> it fails because (org-babel-execute-src-block) returns nil:
>
> Test ob-ada-spark/hello-world condition:
> (wrong-type-argument stringp nil)

Is the file name exactly "ob-ada-spark-test-org"? Without .org extension?
If yes, IDs inside that file may not be indexed properly.

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



Re: [TASK] Please help updating blog generator list on https://orgmode.org/tools.html

2024-03-12 Thread Ihor Radchenko
Bruno Cardoso  writes:

>> If you know any actively developed working blog generators for Org mode,
>> please share them.
> I have in my notes this list of Static Site Generators projects, along with 
> their own descriptions:
> ...

Thanks!
I have updated the tools page.

Handled.

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



Re: [TASK] Please help updating parser list on https://orgmode.org/tools.html

2024-03-12 Thread Ihor Radchenko
Ihor Radchenko  writes:

> Org mode website has a page listing various third-party tools that work
> with Org mode.
>
> However, that page is now severely outdated. There is a number of dead
> links and projects last updated 10+ years ago.

Closed.

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



Re: [BUG] ":sep" header argument doesn't work in ob-shell [9.6.21 ( @ /home/aragaer/.config/emacs/elpa/org-9.6.21/)]

2024-03-12 Thread Ilya Konovalov


I assumed that https://org-babel.readthedocs.io/ is at least somewhat
related to org documentation. Looks like I was wrong.

The :separator parameter seems to be related to how block's :var
arguments are formatted when passing to the shell script.

In most cases separator is not passed to
`org-babel-import-elisp-from-file' -- looks like only some languages set
it to some fixed value.

Matt  writes:

>   On Tue, 12 Mar 2024 10:27:46 +0100  Ilya Konovalov  wrote --- 
>  > 
>  > After some usage I found that this exact patch breaks
>  > `org-babel-import-elisp-from-file's own separator detection. It looks
>  > like it's better to leave it as `nil' unless specified.
>  
> Thanks for taking the time to look into it.  According to my notes,
> :sep and :separator don't work for anything beyond basic table layout.
> I'm not familiar with org-table and there isn't much documentation on
> those keywords in the manual. The :sep keyword shows up for Texinfo
> and LaTeX. It looks like :sep is used for export? It's not clear to me
> how they're supposed to work with shell block output, or if that was
> even a consideration at all.
>
> They were added in
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=a60a83fbb65a368bb96ea6aaf1db20706b3e99c5
> claiming "better handling of table in shell scripts" So, it looks like
> their inclusion was intentional.
>
> Maybe someone has deeper insights?




Re: [BUG] URI handling is overly complicated and nonstandard [9.6.7 (N/A @ /gnu/store/mg7223g8mw90lccp6mm5g6f3mpjk70si-emacs-org-9.6.7/share/emacs/site-lisp/org-9.6.7/)]

2024-03-12 Thread Ihor Radchenko
Ihor Radchenko  writes:

>> I still believe that fallback export should preserve link type. Code 
>> links should define their export functions.
>
> Let's get started on tackling this problem from not stripping the link
> type.
>
> I am attaching tentative patch to that effect, as a first step.

Applied, onto main.

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



Re: [BUG] ":sep" header argument doesn't work in ob-shell [9.6.21 ( @ /home/aragaer/.config/emacs/elpa/org-9.6.21/)]

2024-03-12 Thread Matt
  On Tue, 12 Mar 2024 10:27:46 +0100  Ilya Konovalov  wrote --- 
 > 
 > After some usage I found that this exact patch breaks
 > `org-babel-import-elisp-from-file's own separator detection. It looks
 > like it's better to leave it as `nil' unless specified.
 
Thanks for taking the time to look into it.  According to my notes, :sep and 
:separator don't work for anything beyond basic table layout.  I'm not familiar 
with org-table and there isn't much documentation on those keywords in the 
manual.  The :sep keyword shows up for Texinfo and LaTeX.   It looks like :sep 
is used for export?  It's not clear to me how they're supposed to work with 
shell block output, or if that was even a consideration at all.

They were added in 
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=a60a83fbb65a368bb96ea6aaf1db20706b3e99c5
 claiming "better handling of table in shell scripts"  So, it looks like their 
inclusion was intentional.

Maybe someone has deeper insights?

--
Matt Trzcinski
Emacs Org contributor (ob-shell)
Learn more about Org mode at https://orgmode.org
Support Org development at https://liberapay.com/org-mode





Re: [BUG] ":sep" header argument doesn't work in ob-shell [9.6.21 ( @ /home/aragaer/.config/emacs/elpa/org-9.6.21/)]

2024-03-12 Thread Ilya Konovalov


After some usage I found that this exact patch breaks
`org-babel-import-elisp-from-file's own separator detection. It looks
like it's better to leave it as `nil' unless specified.

Ilya Konovalov  writes:

> On current master using ":sep" header argument does not work as
> expected and records are always split on whitespaces. For example:
>
> #+begin_src sh :sep "\t"
>   echo hello world
>   echo test
> #+end_src
>
> #+RESULTS:
> | hello | world |
> | test  |   |
>
> It looks like the issue is in the org-babel-sh-evaluate function, where
> at the end it passes the result to the org-babel-import-elist-from-file
> function for processing. Replacing the code with the following seems to
> fix the issue:
>
> (let ((tmp-file (org-babel-temp-file "sh-"))
>   (sep (or (cdr (assq :sep params)) "\t")))
>   (with-temp-file tmp-file (insert results))
>   (org-babel-import-elisp-from-file tmp-file sep))
>
> Emacs  : GNU Emacs 29.2 (build 1, x86_64-pc-linux-gnu, X toolkit)
>  of 2024-03-02
> Package: Org mode version 9.6.21 ( @ 
> /home/aragaer/.config/emacs/elpa/org-9.6.21/)




Re: `:export' attribute?: Re: Experimental public branch for inline special blocks

2024-03-12 Thread Stefan Nobis
Juan Manuel Macías  writes:

>>> :export "latex+ html+ rest*"

>> "rest" might be a valid backend name.

> I will try to implement the "rest" option.

What about "others" or even ":others" as a placeholder for any not
explicitly mentioned export backend?

Another quick thought crossing my mind: May make "+" the default (so
"latex" means "latex+" and only use a marker char like '*' for
"content only")?

-- 
Until the next mail...,
Stefan.



Table column formula with remote reference

2024-03-12 Thread Wu Ming
Hello,

#+NAME: A
Table with header row here

#+NAME: B
Table with header row here
#+TBLFML: $1 = remote(A,$1)

Does nothing. 

$1 = remote(A,@0) referring current row w implicit column does not work. Debug 
shows on row 2 of current table it returns the value of row 1, the header, on 
table A. 

Same result as above with @0$1 instead. 

$1 = remote(A,@2$1) does what expected. For every row copies the same value of 
@2$1 from table A to table B. 

Need to refer multiple columns on different tables in a column formula for a 
final table. 

Please advise. Thanks. 




The org--math-p advice around texmathp

2024-03-12 Thread Tony Zorman
Hi,

I recently stumbled upon the fact that Org has some around advice for
texmathp: org--math-p. For reasons that aren't entirely clear to me,
this has some special handling for cdlatex-math-symbol, and recognises
display and inline maths environments on its own, only calling out to
texmathp if it could not find anything. In the former cases, it also
populates the texmathp-why variable, although the position is just
filled in with 0.

I suppose my succinct question is: why? Is there any advantage in
handling inline and display maths in this way, only deferring to
texmathp as a last resort? I'm asking because I wrote a small package to
switch between environments, and the position information that
texmathp-why provides is very useful in choosing the closest
environment.

Thanks!
Tony

-- 
Tony Zorman | https://tony-zorman.com/



[BUG] ":sep" header argument doesn't work in ob-shell [9.6.21 ( @ /home/aragaer/.config/emacs/elpa/org-9.6.21/)]

2024-03-12 Thread Ilya Konovalov
On current master using ":sep" header argument does not work as
expected and records are always split on whitespaces. For example:

#+begin_src sh :sep "\t"
  echo hello world
  echo test
#+end_src

#+RESULTS:
| hello | world |
| test  |   |

It looks like the issue is in the org-babel-sh-evaluate function, where
at the end it passes the result to the org-babel-import-elist-from-file
function for processing. Replacing the code with the following seems to
fix the issue:

(let ((tmp-file (org-babel-temp-file "sh-"))
  (sep (or (cdr (assq :sep params)) "\t")))
  (with-temp-file tmp-file (insert results))
  (org-babel-import-elisp-from-file tmp-file sep))

Emacs  : GNU Emacs 29.2 (build 1, x86_64-pc-linux-gnu, X toolkit)
 of 2024-03-02
Package: Org mode version 9.6.21 ( @ 
/home/aragaer/.config/emacs/elpa/org-9.6.21/)



[BUG] Bug Report [9.6.6 (release_9.6.6 @ /usr/share/emacs/29.1/lisp/org/)]

2024-03-12 Thread Jerome Siljan




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.


I deleted a line in my file and I got this error and the prompt to
report it

Emacs : GNU Emacs 29.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 
3.24.39, cairo version 1.18.0)

of 2024-01-10
Package: Org mode version 9.6.6 (release_9.6.6 @ 
/usr/share/emacs/29.1/lisp/org/)


current state:
==
(setq
org-noter--doc-goto-location-hook '(org-noter-djvu--goto-location 
org-noter-nov--goto-location org-noter-pdf--goto-location)

org-link-elisp-confirm-function 'yes-or-no-p
org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 
"\n\n(fn ENTRY)"]

org-agenda-custom-commands '(("c" "Tasks by context with Agenda"
((agenda "" ((org-agenda-span '7) (org-agenda-overriding-header 
"Agenda"))) (tags-todo "@school" ((org-agenda-overriding-header "Tasks 
@school")))
(tags-todo "@anywhere" ((org-agenda-overriding-header "Tasks 
@anywhere"))) (tags-todo "@home" ((org-agenda-overriding-header "Tasks 
@home")))
(tags-todo "@couch" ((org-agenda-overriding-header "Tasks @couch"))) 
(tags-todo "@waiting" ((org-agenda-overriding-header "Tasks @waiting"

nil nil)
)
org-agenda-files '("/home/jerome/misc/gtd/main.org")
org-persist-after-read-hook '(org-element--cache-persist-after-read)
org-format-latex-options '(:foreground default :background default 
:scale 2.0 :html-foreground "Black" :html-background "Transparent" 
:html-scale 1.0 :matchers

("begin" "$1" "$" "$$" "\\(" "\\["))
org-refile-targets '(("~/misc/gtd/main.org" :maxlevel . 1) 
("~/misc/gtd/diary.org" :maxlevel . 1) ("~/misc/gtd/phone_in.org" 
:maxlevel . 1))

org-export-before-parsing-hook '(org-attach-expand-links)
org-cycle-tab-first-hook '(org-babel-hide-result-toggle-maybe 
org-babel-header-arg-expand)
org-roam-find-file-hook '(org-roam-buffer--setup-redisplay-h 
org-roam--register-completion-functions-h 
org-roam--replace-roam-links-on-save-h

org-roam-db-autosync--setup-update-on-save-h)
org-archive-hook '(org-attach-archive-delete-maybe)
org-noter--pretty-print-location-for-title-hook 
'(org-noter-djvu--pretty-print-location 
org-noter-nov--pretty-print-location 
org-noter-pdf--pretty-print-location-for-title)

org-edit-src-content-indentation 0
org-cycle-hook '(org-cycle-hide-archived-subtrees 
org-cycle-show-empty-lines 
org-cycle-optimize-window-after-visibility-change 
org-cycle-display-inline-images)

org-persist-before-read-hook '(org-element--cache-persist-before-read)
org-link-from-user-regexp "\\"
org-noter--pretty-print-highlight-location-hook 
'(org-noter-pdf--pretty-print-highlight)
org-mode-hook '(er/add-org-mode-expansions #[0 
"\300\301\302\303\304$\207" [add-hook change-major-mode-hook 
org-fold-show-all append local] 5]
#[0 "\300\301\302\303\304$\207" [add-hook change-major-mode-hook 
org-babel-show-result-all append local] 5] org-babel-result-hide-spec 
org-babel-hide-all-hashes
#[0 "\301\211\207" [imenu-create-index-function org-imenu-get-tree] 2] 
org-setup-buffer)
org-babel-load-languages '((C . t) (R . t) (R . t) (emacs-lisp . t) 
(emacs-lisp . t) (plantuml . t) (python . t))

org-roam-ref-annotation-function 'org-roam-ref-read--annotation
org-noter--pretty-print-location-hook 
'(org-noter-djvu--pretty-print-location 
org-noter-nov--pretty-print-location org-noter-pdf--pretty-print-location)

org-roam-db-node-include-function #[0 "\300\207" [t] 1]
org-confirm-shell-link-function 'yes-or-no-p
outline-isearch-open-invisible-function 'outline-isearch-open-invisible
org-plantuml-jar-path "/usr/share/plantuml/lib/plantuml.jar"
org-roam-capture-preface-hook '(org-roam-capture--try-capture-to-ref-h)
org-agenda-before-write-hook '(org-agenda-add-entry-text)
org-capture-prepare-finalize-hook '(org-roam-capture--install-finalize-h)
org-roam-preview-function 'org-roam-preview-default-function
org-babel-tangle-lang-exts '(("python" . "py") ("D" . "d") ("C++" . 
"cpp") ("emacs-lisp" . "el") ("elisp" . "el"))
org-src-mode-hook '(org-src-babel-configure-edit-buffer 
org-src-mode-configure-edit-buffer)

org-confirm-elisp-link-function 'yes-or-no-p
org-log-buffer-setup-hook '(org-roam-log--setup)
org-deadline-warning-days 0
org-roam-capture-new-node-hook '(org-roam-capture--insert-captured-ref-h)
org-noter--show-arrow-hook '(org-noter-pdf--show-arrow)
org-speed-command-hook '(org-speed-command-activate 
org-babel-speed-command-activate)

org-noter--add-highlight-hook '(org-noter-pdf--highlight-location)
org-noter--get-current-view-hook '(org-noter-djvu--get-current-view 
org-noter-nov--get-current-view org-noter-pdf--get-current-view)
org-noter-set-up-document-hook '(org-noter-djvu--setup-handler 
org-noter-nov--setup-handler org-noter-pdf--doc-view-setup-handler 
org-noter-pdf--pdf-view-setup-handler)

[BUG] a bug [9.7-pre (release_9.6.14-1017-g518533 @ /home/saint/.emacs.d/straight/build/org/)]

2024-03-12 Thread MasterWQ
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.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.40, cairo version 1.18.0)
Package: Org mode version 9.7-pre (release_9.6.14-1017-g518533 @
/home/saint/.emacs.d/straight/build/org/)

current state:
==
(setq
 org-link-elisp-confirm-function 'yes-or-no-p
 org-bibtex-headline-format-function 'org-bibtex-headline-format-default
 org-roam-dailies-capture-templates '(("d" "default" entry
   "\n* %<%H:%M>
%?\n:properties:\n:created: %U\n:end:\n" :target
   (file+head "%<%Y-%m-%d>.org"
"#+title: %<%Y-%m-%d>\n#+startup:
showall\n")
   :empty-lines 1)
  )
 org-capture-templates '(("C-i" "Todo" entry (file+headline
"/home/saint/ywq_doc/todo.txt/todo.txt" "Tasks")
  "* TODO %?\n  %i\n  %a" :prepend t
:immediate-finish t :jump-to-captured t
  :empty-lines 1 :empty-lines-before 1 :clock-in t
:clock-keep t :clock-resume t
  :time-prompt t :tree-type week)
 )
 org-roam-node-display-template #("${title:70}${tags:30}${file:48}" 11 21
(face org-tag))
 org-persist-after-read-hook '(org-element--cache-persist-after-read)
 org-export-before-parsing-hook '(org-attach-expand-links)
 org-cycle-tab-first-hook '(org-babel-hide-result-toggle-maybe
org-babel-header-arg-expand)
 org-roam-find-file-hook '(org-roam-buffer--setup-redisplay-h
org-roam--register-completion-functions-h
   org-roam--replace-roam-links-on-save-h
   org-roam-db-autosync--setup-update-on-save-h)
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-cycle-hook '(org-cycle-hide-archived-subtrees
org-cycle-show-empty-lines
  org-cycle-optimize-window-after-visibility-change
org-cycle-display-inline-images)
 org-persist-before-read-hook '(org-element--cache-persist-before-read)
 org-yank-image-file-name-function 'org-yank-image-autogen-filename
 org-mode-hook '(org-clock-load
 #[0 "\300\301\302\303\304$\207"
   [add-hook change-major-mode-hook org-fold-show-all
append local] 5]
 #[0 "\300\301\302\303\304$\207"
   [add-hook change-major-mode-hook
org-babel-show-result-all append local] 5]
 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-roam-ref-annotation-function 'org-roam-ref-read--annotation
 org-roam-directory "~/ywq_doc/"
 org-roam-db-node-include-function #[0 "\300\207" [t] 1]
 org-confirm-shell-link-function 'yes-or-no-p
 outline-isearch-open-invisible-function 'outline-isearch-open-invisible
 org-roam-dailies-directory "journals/"
 org-protocol-protocol-alist '(("org-roam-node" :protocol "roam-node"
:function org-roam-protocol-open-node)
   ("org-roam-ref" :protocol "roam-ref"
:function org-roam-protocol-open-ref))
 org-roam-capture-preface-hook '(org-roam-dailies--override-capture-time-h
 org-roam-capture--try-capture-to-ref-h)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-capture-prepare-finalize-hook '(org-roam-capture--install-finalize-h)
 org-roam-preview-function 'org-roam-preview-default-function
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
org-src-mode-configure-edit-buffer)
 org-roam-db-autosync-mode t
 org-confirm-elisp-link-function 'yes-or-no-p
 org-log-buffer-setup-hook '(org-roam-log--setup)
 org-roam-capture-new-node-hook '(org-roam-capture--insert-captured-ref-h)
 org-speed-command-hook '(org-speed-command-activate
org-babel-speed-command-activate)
 org-fold-core-isearch-open-function 'org-fold-core--isearch-reveal
 org-clock-persist 'history
 org-persist-before-write-hook '(org-element--cache-persist-before-write)
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe
org-babel-header-arg-expand)
 org-link-shell-confirm-function 'yes-or-no-p
 org-babel-pre-tangle-hook '(save-buffer)
 org-agenda-loop-over-headlines-in-active-region nil
 org-occur-hook '(org-first-headline-recenter)
 org-roam-log-setup-hook '(org-roam--register-completion-functions-h)
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-roam-node-annotation-function 'org-roam-node-read--annotation
 org-link-parameters '(("eww" :follow org-eww-open :store
org-eww-store-link)
   ("rmail" :follow org-rmail-open :store
org-rmail-store-link)
   ("mhe" :follow org-mhe-open :store
org-mhe-store-link)
   ("irc" :follow org-irc-visit 

Re: Table column formula with remote reference

2024-03-12 Thread Wu Ming
Problem solved with

$1 = remote(A,@@#$1)

as described on the manual page 
https://orgmode.org/manual/References.html#Field-coordinates-in-formulas-1 


Where is the coordinate @@# documented?


> On 11 Mar 2024, at 18:52, Wu Ming  wrote:
> 
> Hello,
> 
> #+NAME: A
> Table with header row here
> 
> #+NAME: B
> Table with header row here
> #+TBLFML: $1 = remote(A,$1)
> 
> Does nothing. 
> 
> $1 = remote(A,@0) referring current row w implicit column does not work. 
> Debug shows on row 2 of current table it returns the value of row 1, the 
> header, on table A. 
> 
> Same result as above with @0$1 instead. 
> 
> $1 = remote(A,@2$1) does what expected. For every row copies the same value 
> of @2$1 from table A to table B. 
> 
> Need to refer multiple columns on different tables in a column formula for a 
> final table. 
> 
> Please advise. Thanks. 
> 
>