Re: A small contribution to the doc

2023-12-24 Thread Pedro Andres Aranda Gutierrez
It's just for illustration purposes. One could also use backend=bibtex ;-)

Best, /PA

On Sun, 24 Dec 2023 at 20:01, Ihor Radchenko  wrote:

> András Simonyi  writes:
>
> >> > Just to submit a small addition to the org-mode documentation. This
> not
> >> > being the best of times, I would have needed this pointer,
> >>
> >> Thanks!
> >> Applied, onto main, adding a commit message.
> >
> > just out of curiosity: isn't the "backend=biber" option unnecessary,
> > as the default backend of biblatex is biber?
>
> For the purposes of the manual, it is a good illustration.
> So, it is not important if backend=biber is necessary or not from my
> point of view :)
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>


-- 
Fragen sind nicht da, um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet


Re: [PATCH] Highlight ANSI sequences in the whole buffer (was [PATCH] ANSI color on example blocks and fixed width elements)

2023-12-24 Thread Nathaniel Nicandro


Matt  writes:

> Thank you for bringing this to my attention and thank you Nathaniel for your 
> work on this.

No problem, I'm glad to contribute to Org :)

> Nathaniel, if you and I happen to cross paths in one of Ihor's "office
> hours," I would enjoy learning more about what you're doing.

Sure.

With this patch I'm attempting to fontify the regions bounded by ANSI
escape sequences (just the color codes) in an Org buffer using the
built-in ansi-color package to do the processing of the sequences.  The
challenge, for me, seems to be making ansi-color aware of Org
element/object boundaries.

I am aware of other ANSI escape codes that would be useful to process
such as the carriage return and which appear, as you mentioned, when
dealing with progress bars in a shell session. Those escape codes are
not being handled at the moment. Although, I do have some experience in
processing them in an Org buffer when developing my Emacs-Jupyter
project. I would be glad to attempt handling these kinds of sequences in
Org proper as well.

-- 
Nathaniel



Re: [PATCH] Highlight ANSI sequences in the whole buffer (was [PATCH] ANSI color on example blocks and fixed width elements)

2023-12-24 Thread Nathaniel Nicandro


Ihor Radchenko  writes:

> It runs fine on my side, although I am not sure if things are working as
> expected for all the cases. For example, headlines never got fontified
> on my side when I tried your patch on top of the latest main branch.

Yes, the headlines are currently not fontified since, with this patch, I
was mainly looking to satisfy the initial set of rules you laid out
which didn't mention headlines as being a fontifiable element for ANSI
sequences, or at least I didn't get that from my reading of them.

It does make sense, however, to be able to add headlines to the
`org-ansi-highlightable-elements` variable so that they are fontified if
the user wishes.  Although doing so with this patch wouldn't work.

> Also, it looks like you simply made the ASCII sequences invisible, which
> causes funky behaviour when trying to edit the text around. What we may
> need instead is something similar to hidden parts of the links that get
> revealed when we try to edit the invisible text. See
> `org-catch-invisible-edits' variable and the functions that examine it.

I agree that we should reveal the invisible sequence when trying to edit
it.

Thanks for the tip about `org-catch-invisible-edits', it led me to
`org-fold-show-set-visibility' which I think is the appropriate place to
reveal a hidden sequence.

> You may use `org-fontify-extend-region' to handle such scenarios if you
> mark the ANSI highlights with a special text property.

Thanks for the tip, I'll look into it.

-- 
Nathaniel



Re: A small contribution to the doc

2023-12-24 Thread Ihor Radchenko
András Simonyi  writes:

>> > Just to submit a small addition to the org-mode documentation. This not
>> > being the best of times, I would have needed this pointer,
>>
>> Thanks!
>> Applied, onto main, adding a commit message.
>
> just out of curiosity: isn't the "backend=biber" option unnecessary,
> as the default backend of biblatex is biber?

For the purposes of the manual, it is a good illustration.
So, it is not important if backend=biber is necessary or not from my
point of view :)

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



Re: A small contribution to the doc

2023-12-24 Thread András Simonyi
Dear All,

On Sun, 24 Dec 2023 at 19:12, Ihor Radchenko  wrote:
>
> Pedro Andres Aranda Gutierrez  writes:
>
> > Just to submit a small addition to the org-mode documentation. This not
> > being the best of times, I would have needed this pointer,
>
> Thanks!
> Applied, onto main, adding a commit message.

just out of curiosity: isn't the "backend=biber" option unnecessary,
as the default backend of biblatex is biber?

best wishes,
András



Re: A small contribution to the doc

2023-12-24 Thread Ihor Radchenko
Pedro Andres Aranda Gutierrez  writes:

> Just to submit a small addition to the org-mode documentation. This not
> being the best of times, I would have needed this pointer,

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

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



A small contribution to the doc

2023-12-24 Thread Pedro Andres Aranda Gutierrez
Hi,

Just to submit a small addition to the org-mode documentation. This not
being the best of times, I would have needed this pointer,

Best,/PA

-- 
Fragen sind nicht da, um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet
From e52155528cfc97de27592ec1707e4612b43afd1c Mon Sep 17 00:00:00 2001
From: "Pedro A. Aranda" 
Date: Sun, 24 Dec 2023 17:15:26 +0100
Subject: [PATCH] Add comment on the biblatex bibliography exporter

---
 doc/org-manual.org | 8 
 1 file changed, 8 insertions(+)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index ae4c4235e..7db69cbb6 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -17348,6 +17348,14 @@ conformant to the Harvard style and the specification of the
 Wolkers-Kluwer publisher; since it relies on the ~bibtex~ processor of
 your LaTeX installation, it won't export to anything but PDF.
 
+: #+cite_export: biblatex backend=biber
+
+#+texinfo: @noindent
+specifies the =biblatex= export processor, using the =biber= backend.
+More options can be specified. Consult the documentation of the
+~biblatex~ package. It will only export to PDF, since it relies on the
+~biblatex~ processor of your LaTeX installation;
+
 ** Bibliography printing
 
 The =PRINT_BIBLIOGRAPHY= keyword specifies where the bibliography
-- 
2.34.1



Re: How to execute Lisp code /after/ a capture template has been filled before it is finalized?

2023-12-24 Thread Tim Landscheidt
Ihor Radchenko  wrote:

> […]

> %(...) expansion is executed _before_ capture template is fully
>  calculated. It is generally not designed to side-effect functions.

> You can instead use template-local hooks, introduced in Org 9.6. See
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/tree/etc/ORG-NEWS#n1270

I'm using Emacs 28.3, so that is something for the future.
But your pointer made me read the source and adjust my men-
tal picture: I had always thought that capturing opened a
window showing a narrowed section of the buffer, invoked
org-capture-mode-hook, then inserted the template and went
on from there.

Instead (CMIIW), the template is evaluated in a temporary
buffer, the result is pasted in the capture buffer, and then
org-capture-mode-hook is invoked.  That means inter alia
that org-capture-mode-hook can work on the "completed" tem-
plate.

For my problem, I thus first (partly) replicated Org 9.6's
behaviour by adding:

| (lambda nil
|(if
|(version< org-version "9.6")
|(let
|((hook
|  (org-capture-get :hook)))
|  (if
|  (functionp hook)
|  (funcall hook)
|(mapc #'funcall hook)

to org-capture-mode-hook.

Then I thought about using org-table-map-tables to call
org-table-recalculate on all tables in the capture buffer to
avoid having to figure out where my table was.  But
org-table-map-tables unfortunately widens the buffer before
iterating, so this was no option.

Therefore, to keep it simple, I amended my template by add-
ing "%?" to the cell where the sum is put in and setting the
:hook property to org-table-recalculate.  (I also added
";%.2f" to the formula for formatting.)  In the end, this
works very nicely.

Thanks!
Tim



Re: *doc/org-manual.org: Fix the description for "Internal Link" in the org-mode manual

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

> In summary, there is no _bug_ on Org side here. However, the behavior is
> indeed not very intuitive. This kind of scenario should probably be
> added to org-lint, so that users can be warned about assigning
> attributes to src block results.

Now, we have org-lint reporting this scenario.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=b8b02e3da
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=e9ae9dbc5

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



Re: strange error exporting to ascii

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

> "Fraga, Eric"  writes:
>
>> So there seems to be some compilation bug maybe?  I will build Emacs
>> from git as the version I'm using was built in September (I don't update
>> during term time as I depend on Emacs and org for my teaching).  I'll
>> report back after doing so.
>
> This is most likely a bug with internal dependencies.
> I need some time to figure out how to approach it.

Should work now. I reverted the problematic commit.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=cee9b6abc

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



Re: [PATCH] * doc/org-manual.org: Fix typo

2023-12-24 Thread Ihor Radchenko
Morgan Smith  writes:

> doc/org-manual.org: 'org-hierarchical-checkbox-statistics' ->
> 'org-checkbox-hierarchical-statistics'

Applied, onto bugfix.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=086752fb3

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



Re: [PATCH] lisp/org-agenda.el: Check agenda type earlier

2023-12-24 Thread Ihor Radchenko
Morgan Smith  writes:

> lisp/org-agenda.el (org-agenda-goto-date): Check agenda type earlier.
> Also remove redundant error.
>
> When this function is run on a todo agenda the user is given the
> undescriptive error "(wrong-type-argument listp "todo")" because we
> attempt to parse the 'org-last-args text-property prematurely.  With
> this change users will get the much better error "Not allowed in
> 'todo'-type agenda buffer or component".

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

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