Clarification of patch

2024-06-07 Thread Pedro Andres Aranda Gutierrez
Hi,

I was reading through patch
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=212237bdbd6b5f372d11de5d1f8db12dcf649682
and reading:

+ ) ; Inside a block, where the chances to have heading a slim.

I can't make out what "to have heading a slim" means...

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


Re: Slowdowns and hangs when loading org from elpa

2024-06-05 Thread Pedro Andres Aranda Gutierrez
On Wed, 5 Jun 2024 at 17:00, Ihor Radchenko  wrote:

> Pedro Andres Aranda Gutierrez  writes:
>
> > Background: the origin for bug #71356 was that I was trying to get org
> > installed from elpa, which apparently didn't work and Emacs (master) took
> > the bundled mode instead.
> >
> > Observation: loading org from elpa with M-x p-l-p leads to errors and
> > emacs(master) freezing for a long time. When looking at the *Warnings*
> > buffer, I see:
> >
> > Warning (comp): org-clock.el:2635:23: Warning: the function
> > ‘org-add-archive-files’ is not known to be defined.
> > ⛔ Warning (comp): org-clock.el:962:40: Warning: the function
> > ‘org-element-at-point’ is not known to be defined.
>
> I am on Emacs master 2b7056 (CommitDate: Sat Jun 1 15:41:54 2024 +0800)
>
> I am unable to reproduce doing the following:
>
> 1. Clear elpa dir
> 2. emacs -Q
> 3. M-x package-list-packages
> 4. Click on "org"
> 5. Install the version from Elpa
> 6. Open an Org file
> 7. Observe native compilation finishing without warnings
>
> Your commit is slightly newer - 2024-06-02 22:33:54 -0700
>
> I know, I recompile master every now and then, so I'll keep updating on
the situation.
Vaeat: This post may become a blog ;-)

> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>
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


Slowdowns and hangs when loading org from elpa

2024-06-05 Thread Pedro Andres Aranda Gutierrez
Hi,

Background: the origin for bug #71356 was that I was trying to get org
installed from elpa, which apparently didn't work and Emacs (master) took
the bundled mode instead.

Observation: loading org from elpa with M-x p-l-p leads to errors and
emacs(master) freezing for a long time. When looking at the *Warnings*
buffer, I see:

Warning (comp): org-clock.el:2635:23: Warning: the function
‘org-add-archive-files’ is not known to be defined.
⛔ Warning (comp): org-clock.el:962:40: Warning: the function
‘org-element-at-point’ is not known to be defined.
⛔ Warning (comp): org-clock.el:753:30: Warning: the function
‘org-duration-from-minutes’ is not known to be defined.
⛔ Warning (comp): org-clock.el:751:36: Warning: the function
‘org-duration-to-minutes’ is not known to be defined.
⛔ Warning (comp): org-attach.el:759:20: Warning: the function
‘org-element-context’ is not known to be defined.
⛔ Warning (comp): org-agenda.el:10271:6: Warning: the function
‘org-clock-cancel’ is not known to be defined.
⛔ Warning (comp): org-agenda.el:10258:11: Warning: the function
‘org-clock-out’ is not known to be defined.
⛔ Warning (comp): org-agenda.el:10229:8: Warning: the function
‘org-clock-in’ is not known to be defined.
⛔ Warning (comp): org-agenda.el:6242:23: Warning: the function
‘org-duration-from-minutes’ is not known to be defined.
⛔ Warning (comp): org-agenda.el:5684:61: Warning: the function
‘org-duration-to-minutes’ is not known to be defined.
⛔ Warning (comp): org-agenda.el:4564:30: Warning: the function
‘org-clock-get-clocktable’ is not known to be defined.
⛔ Warning (comp): org-agenda.el:2541:51: Warning: the function
‘org-mobile-push’ is not known to be defined.
⛔ Warning (comp): org-agenda.el:2540:51: Warning: the function
‘org-mobile-pull’ is not known to be defined.
⛔ Warning (comp): org-agenda.el:2538:47: Warning: the function
‘org-timer-stop’ is not known to be defined.
⛔ Warning (comp): org-agenda.el:2537:39: Warning: the function
‘org-timer-set-timer’ is not known to be defined.
⛔ Warning (comp): org-agenda.el:2512:50: Warning: the function
‘org-clock-goto’ is not known to be defined.
⛔ Warning (comp): org-agenda.el:2494:46: Warning: the function ‘org-attach’
is not known to be defined.
⛔ Warning (comp): org-id.el:736:16: Warning: the function
‘org-element-cache-reset’ is not known to be defined.
⛔ Warning (comp): org-id.el:577:33: Warning: the function
‘org-element-at-point’ is not known to be defined.

I do have native compilation enabled on my Emacs on Linux

I don't know if there are other people experiencing issues like this... but
I think we need to investigate this

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


Re Using Org-mode macros as LaTeX macros

2024-06-01 Thread Pedro Andres Aranda Gutierrez
Hi Sebastien,

maybe the idea is that you redefine the \maketitle command to fit your
needs in a .tex file (maybe new_title.tex) and then
#+LATEX_HEADER: \input{new_title}
For this, you will need to go through the manual of the class you use for
your documents.

This is my way of solving this challenge when I publish materials for my
students.

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


Re: Managing acronyms in an Org-mode document

2024-05-28 Thread Pedro Andres Aranda Gutierrez
Thanks for the pointers.

This is a bit like using the full glossaries package versus the
acronyms package in LaTeX, I fear :-)
And I've used acronyms a lot and developed sort of an allergy to glossaries
:-D

But I will take the summer to try and learn ... promise :-)

Bs

On Tue, 28 May 2024 at 13:34, John Kitchin  wrote:

> org-ref supports acronyms and glossaries:
> https://github.com/jkitchin/org-ref/blob/master/org-ref-glossary.el.
> There is a video of it at
> https://www.youtube.com/live/sebs2vSIEk4?si=XUfT4KIuCF0PxlnN. It sounds
> close to what you want.
>
> On Mon, May 27, 2024 at 5:04 AM Pedro Andres Aranda Gutierrez <
> paag...@gmail.com> wrote:
>
>>
>> Sébastien writes:
>> >  Hello,
>>
>> Hi, answers inline
>>
>> > Is there a way to manage acronyms in an Org-mode document ?
>>
>> Currently I'm using acronyms in Documents which I handle with *TeX as my
>> background processor. So, it's basically embedding the LaTeX \ac* commands
>> in the org-file. But I'm thinking of a module to do this in org-native
>> mode.
>>
>> > For example:
>> >
>> > 1. I write a list of acronyms and their definition inside a "List of
>> >acronyms" heading
>> >
>> > 2. In my document, when I simply write the acronyms in my text
>> >
>> > 3. When I export my Org-mode document, the first time that an acronym is
>> >written, it appear in full version and all the other times it appear
>> >in acronym version
>>
>> Most of what you say is already there in e.g. the acronyms package in
>> LaTeX and I have an ancient attempt at this written in C which made it's
>> way to the venerable latex2rtf program. It could make a nice summer
>> project. I could share the notes I have taken until now with basic ideas.
>>
>> 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
>>
>>
>
> --
> John
>
> ---
> Professor John Kitchin (he/his)
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> https://kitchingroup.cheme.cmu.edu
> https://pointbreezepubs.gumroad.com/ pycse bookstore
>


-- 
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: Managing acronyms in an Org-mode document

2024-05-27 Thread Pedro Andres Aranda Gutierrez
Sébastien writes:
>  Hello,

Hi, answers inline

> Is there a way to manage acronyms in an Org-mode document ?

Currently I'm using acronyms in Documents which I handle with *TeX as my
background processor. So, it's basically embedding the LaTeX \ac* commands
in the org-file. But I'm thinking of a module to do this in org-native
mode.

> For example:
>
> 1. I write a list of acronyms and their definition inside a "List of
>acronyms" heading
>
> 2. In my document, when I simply write the acronyms in my text
>
> 3. When I export my Org-mode document, the first time that an acronym is
>written, it appear in full version and all the other times it appear
>in acronym version

Most of what you say is already there in e.g. the acronyms package in LaTeX
and I have an ancient attempt at this written in C which made it's way to
the venerable latex2rtf program. It could make a nice summer project. I
could share the notes I have taken until now with basic ideas.

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


Re: Re: [External] : Re: Adding custom providers for thingatpt.el (was: [PATCH] Add support for 'thing-at-point' to get URL at point)

2024-05-08 Thread Pedro Andres Aranda Gutierrez
H, Drew
Hmmm... thanks for the clarification. That's going to be extremely helpful
once I'm back on track after the "grading season" ;-) All this started, at
least for me, when I was trying to write a simple interactive function to
copy the contents of the cell the point is in to the kill-ring (and
eventually to the clipboard). I eventually came up with a simple solution.
This make org-mode tables very comfortable for longer Web formularies with
complex data, like bank accounts.

Best, /PA

On Wed, 8 May 2024 at 20:14, Drew Adams  wrote:

> >> At the risk of veering off-topic (I mainly care about adding
> >> 'bounds-of-thing-at-point-provider-alist' and
> >> 'forward-thing-provider-alist'), would adding a new optional STRICT
> >> argument to 'thing-at-point' and friends be an ok resolution for
> >> everyone? This argument would enable Drew's proposed behavior. That way,
> >> users get all the nice behavior by default just like today, and
> >> programmers who require strict correctness in their code also have an
> >> option.
> >
> > 1+ if STRICT means thing starting at point
> > and without it we may need to look for the
> > beginning of the thing (lazy point setting)
>
> Why "starting" at point?  STRICT shouldn't mean
> checking whether a THING starts at point.
>
> The "strict" behavior that's needed is checking
> _whether_ there is a THING at point, that is,
> checking whether the char at point (which really
> means just after point) is on/inside a THING.
>
> That's for `bounds-of-thing-at-point' etc.  For
> thing-at-point etc., IF there's a THING at point
> then that THING is the non-nil value returned.
>
> In terms of implementation, I suggest you take
> a look at the code in thingatpt+.el.  Look at
> functions `tap-bounds-of-thing-at-point' and
> `tap-thing-at-point'.  Just remove the `tap-'
> prefix for code that DTRT.  The file Commentary
> explains things in detail.
>
> My code adds an optional arg SYNTAX-TABLE, but
> you need not bother with that.  Elisp now has
> `with-syntax-table', which can be used as a
> workaround if there's no such argument.
>
> In the end, `bounds-of-thing-at-point' and
> `thing-at-point' should return nil if there's
> no THING at the char at point.
>
> For "lax" behavior that corresponds to the
> current vanilla behavior, if the strict
> behavior would return nil then they return
> what the strict behavior would return at
> (1- point).
>
> But really such a lax behavior is pretty lame.
> What's needed, for trying to grab a THING near
> point is not just checking backward one char
> but checking backward, forward, up, and down
> N chars, where N determines what "near" means.
>
> thingatpt+.el provides two user options,
> `tap-near-point-x-distance' and
> `tap-near-point-y-distance', the max number of
> chars from point to check for a THING (for X:
> left and right, for Y: up and down).  Setting
> the Y value to zero constrains search to the
> same line as point.
>


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


[PATCH] copy cell contents to kill-ring. WAS [FR]: thing-at-point 'org-table-cell

2024-05-04 Thread Pedro Andres Aranda Gutierrez
Hi,

I needed this function to copy contents from an org spreadsheet to a Web
page and I see it may be useful to others. Take a look and if you find it
useful, I'll add the changelog stuff.

Thanks for the guidance ;-)
Best, /PA

On Fri, 3 May 2024 at 21:50, Ihor Radchenko  wrote:

> Pedro Andres Aranda Gutierrez  writes:
>
> >>> It would be great to have a thing-at-point handler that returns a cell
> in
> >>> and org table. The most simple use case is to have a table in an
> org-file
> >>> with data that you need to transfer to an online Web page. Being able
> to
> >>> (copy-as-kill ...) a cell's contents could speed up the whole
> process...
> >>
> >> May you please elaborate on how exactly `thing-at-point' will help
> copy-as-kill?
> > 
> > Hi Ihor, of course this was just an example. The thing-at-point would
> make it easier to write a copy-as-kill-cell function.
>
> Then, you can just use `org-element-context' and/or `org-element-at-point'.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>


-- 
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 545f6e26ba4fa29fedbb38ccc26e6018774ae63e Mon Sep 17 00:00:00 2001
From: "Pedro A. Aranda" 
Date: Sat, 4 May 2024 09:09:43 +0200
Subject: [PATCH] org-table: add copy cell contents to kill ring

---
 etc/ORG-NEWS  |  6 ++
 lisp/org-table.el | 22 ++
 2 files changed, 28 insertions(+)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 99dd8839c..b4cacb2ce 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -1520,6 +1520,12 @@ optional argument =NEW-HEADING-CONTAINER= specifies where in the
 buffer it will be added.  If not specified, new headings are created
 at level 1 at the end of the accessible part of the buffer, as before.
 
+*** New interactive function ~org-table-copy-cell-as-kill~
+
+This function copies the contents of a table cell to the kill-ring as
+a string without properties. Prints the contents copied to the
+kill-ring if called with an argument.
+
 ** Miscellaneous
 *** =org-crypt.el= now applies initial visibility settings to decrypted entries
 
diff --git a/lisp/org-table.el b/lisp/org-table.el
index 0c2dc27ed..f02ea9243 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -6425,6 +6425,28 @@ This function is generated by a call to the macro `org-define-lookup-function'."
 (org-define-lookup-function last)
 (org-define-lookup-function all)
 
+;;;###autoload
+(defun org-table-copy-cell-as-kill (verbose)
+  "Copy the contents of the current cell to the kill buffer.
+Print a message when verbose is not nil.
+
+hlines are not considered table cells"
+  (interactive "P")
+  ;; Check we are in a table cell that is not an hline
+  (unless (and (org-at-table-p)
+   (not (org-at-table-hline-p)))
+(error "Not on a table cell"))
+  ;; if so, get the cell contents
+  (let ((content (org-table-get nil nil)))
+(unless (and content
+ (length> content 0))
+  (error "Empty cell"))
+;; This is a non-empty cell, extract the string
+(let ((cell-val (substring-no-properties content)))
+  (when verbose
+(message "Copied `%s'" cell-val))
+  (kill-new cell-val
+
 (provide 'org-table)
 
 ;; Local variables:
-- 
2.34.1



Re: PATCH] Auto-complete PRINT_BIBLIOGRAPHY with a trailing colon

2024-05-03 Thread Pedro Andres Aranda Gutierrez
> From: Rudolf Adamkovič 
> To: emacs-orgmode@gnu.org
> Cc: Rudolf Adamkovič 
> Subject: [PATCH] Auto-complete PRINT_BIBLIOGRAPHY with a trailing
> colon
> Message-ID: <20240502162033.16420-1-rud...@adamkovic.org>
>
> * lisp/org.el (org-options-keywords): Add a trailing colon to the
> 'PRINT_BIBLIOGRAPHY' keyword to avoid unnecessary user confusion.

Hi Rudolf,

I don't see any confusion by not having a trailing colon in
#+print_bibliography. Where would there be? (I'm asking, because I'm
tutoring a couple novel users and it would be good to have an answer ready
if they ask ;-) )

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


Re: [FR]: thing-at-point 'org-table-cell

2024-05-03 Thread Pedro Andres Aranda Gutierrez

Hi Ihor, of course this was just an example. The thing-at-point would make it 
easier to write a copy-as-kill-cell function.

Best,/PA

Enviado desde mi iPhone

> El 3 may 2024, a las 13:17, Ihor Radchenko  escribió:
> 
> Pedro Andres Aranda Gutierrez  writes:
> 
>> It would be great to have a thing-at-point handler that returns a cell in
>> and org table. The most simple use case is to have a table in an org-file
>> with data that you need to transfer to an online Web page. Being able to
>> (copy-as-kill ...) a cell's contents could speed up the whole process...
> 
> May you please elaborate on how exactly `thing-at-point' will help 
> copy-as-kill?
> 
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>



[FR]: thing-at-point 'org-table-cell

2024-05-02 Thread Pedro Andres Aranda Gutierrez
Hi,

It would be great to have a thing-at-point handler that returns a cell in
and org table. The most simple use case is to have a table in an org-file
with data that you need to transfer to an online Web page. Being able to
(copy-as-kill ...) a cell's contents could speed up the whole process...

Thx, /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


Re: PATCH allow explicit style= in #+cite_export: biblatex

2024-04-24 Thread Pedro Andres Aranda Gutierrez
Hopefully all remarks addressed..
Best, /PA

On Wed, 24 Apr 2024 at 19:05, Ihor Radchenko  wrote:

> Pedro Andres Aranda Gutierrez  writes:
>
> > Oops, you are right. My local copy got a bit messed up.
> >
> > Here is a hopefully clean patch. I have tried it out on a local
> test-patch
> > branch of current main and it applied.
>
> Thanks!
> May you also add NEWS entry?
>
> Also, a few comments inline.
>
> > Subject: [PATCH] Allow biblatex package options natively
>
> Please, prefix the first line with oc-biblatex library name.
>
> > lisp/oc-biblatex.el: detect and allow biblatex package options
> >   in key=val,key=val,... format. 

Re: PATCH allow explicit style= in #+cite_export: biblatex

2024-04-21 Thread Pedro Andres Aranda Gutierrez
Hi Ihor,



On Sun, 21 Apr 2024 at 15:20, Ihor Radchenko  wrote:

> Pedro Andres Aranda Gutierrez  writes:
>
> > +: #+cite_export: biblatex backend=bibtex,style=numeric
>
> What about something like
>
> #+cite_export: biblatex backend=bibtex,bibstyle=numeric
>

Just tested on a work document. It generates
\usepackage[backend=bibtex,bibstyle=numeric]{biblatex}
which is a perfectly valid options string for biblatex and yes,
the PDF is generated without errors ;-)


>
> > BTW, I was thinking that maybe "\\`[^=]+=" may be better than matching
> > style= anywhere in the options string...
> > Open to discuss it...
>
> May you elaborate what exactly will be improved?
>

IMHO, the current solution of prepending "style=" forces the option string
to be

Re: Re: [FR] Please add custom command variable to org-latex-footnote-refere

2024-04-20 Thread Pedro A. Aranda

/Hi, Alexander Gogl  writes: /> ox-latex: New option 
to customize LaTeX footnote command

I hope you are aware that with your patch you are not going to be aware to pass
extra options to your foot or side notes, right? And since I'm not familiar with
kaobook, just a question. Are you sure that the foot and side notes will not 
choke
at a \label{} inside the text?
//> PS: I have a hard time to setup an environment to test the patch because

my Spacemacs configuration conflicts with the Org mode development
version. Can anyone provide me a link to a ressource that describes the
procedure?


I'm running on a vanilla Emacs and

---cut here --
(let ((org-devel-path (expand-file-name "~/Devel/org-mode/lisp")))
  (when (file-directory-p org-devel-path)
;; (message "Adding %s to load-path" org-devel-path)
(add-to-list 'load-path  org-devel-path)))
---cut here --

in my .emacs.d/early-init.el does the job. I have a general Devel directyl for 
my development jobs.

Hope it helps, /PA

PS: Cool kaobook. I've used koma-script for most of my LaTeX work in the last 
15 years +/- ;-) though.




Re: PATCH allow explicit style= in #+cite_export: biblatex

2024-04-17 Thread Pedro Andres Aranda Gutierrez
BTW, I was thinking that maybe "\\`[^=]+=" may be better than matching
style= anywhere in the options string...
Open to discuss it...
/PA

On Wed, 17 Apr 2024 at 09:00, Pedro Andres Aranda Gutierrez <
paag...@gmail.com> wrote:

> Stop the press... I discovered a small bug in the last patch.
> Attached is a new version.
>
> /PA
>
> On Wed, 17 Apr 2024 at 08:22, Pedro Andres Aranda Gutierrez <
> paag...@gmail.com> wrote:
>
>> Hi again
>>
>> Rationale of the patch:
>> Currently, when the options to biblatex are _not_ xxx/xxx format, a
>> style= is prepended, because
>> it is assumed that it will be a biblatex options string starting with a
>> style.
>> With the proposed patch, I add the possibility of using a biblatex
>> options string where style= is stated
>> explicitly (anywhere in the string). This adds congruency WRT
>> the ~org-cite-biblatex-options~ variable.
>>
>> Best, /PA
>>
>> On Sun, 14 Apr 2024 at 09:16, Pedro Andres Aranda Gutierrez <
>> paag...@gmail.com> wrote:
>>
>>> HI, full answer...
>>>
>>> In the original code, that section prepends "style=" in some cases. I
>>> have stumbled across
>>> instances where the options started with style= because they were taken
>>> directly from LaTeX
>>> and the generated code ended by like:
>>> \usepackage[style=style=numeric,backend=biber]{biblatex}
>>> for
>>> #+cite_export: biblatex style=numeric,backend=biber
>>> which, BTW, is something someone used the LaTeX may parse as correct.
>>> I was just trying to cater for this case.
>>>
>>> Best, /PA
>>>
>>>
>>> On Sun, 14 Apr 2024 at 07:30, Pedro Andres Aranda Gutierrez <
>>> paag...@gmail.com> wrote:
>>>
>>>> Sorry... I was not right... You are right. I'll take a look at it again.
>>>> /PA
>>>>
>>>> On Sun, 14 Apr 2024 at 07:22, Pedro Andres Aranda Gutierrez <
>>>> paag...@gmail.com> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> Maybe not... because style= is a keyword for the biblatex package,
>>>>> while bibstyle or citestyle aren't.
>>>>>
>>>>> Best, /PA
>>>>>
>>>>> On Sat, 13 Apr 2024 at 16:32, Ihor Radchenko 
>>>>> wrote:
>>>>>
>>>>>> Pedro Andres Aranda Gutierrez  writes:
>>>>>>
>>>>>> > HI,
>>>>>> > Attached is a small patch to allow explicitly adding style= in the
>>>>>> biblatex export options, to increase consistency with
>>>>>> > Customisation variables.
>>>>>>
>>>>>> Thanks!
>>>>>>
>>>>>> >  (style-options
>>>>>> >   (cond
>>>>>> >((null style) nil)
>>>>>> > +  ;; allow the user to include "style=" anywhere in the
>>>>>> style options
>>>>>> > +  ((string-match "\\(^s\\|,s\\)tyle=" style) (list style))
>>>>>> >((not (string-match "/" style)) (list (concat "style="
>>>>>> style)))
>>>>>> >(t
>>>>>> > (list (concat "bibstyle=" (substring style nil
>>>>>> (match-beginning 0)))
>>>>>>
>>>>>> If we allow style=..., may as well allow bibstyle= and citestyle=.
>>>>>>
>>>>>> --
>>>>>> Ihor Radchenko // yantar92,
>>>>>> Org mode contributor,
>>>>>> Learn more about Org mode at <https://orgmode.org/>.
>>>>>> Support Org development at <https://liberapay.com/org-mode>,
>>>>>> or support my work at <https://liberapay.com/yantar92>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> 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
>>>>>
>>>>>
>>>>
>>>> --
>>>> 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
>>>>
>>>>
>>>
>>> --
>>> 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
>>>
>>>
>>
>> --
>> 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
>>
>>
>
> --
> 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
>
>

-- 
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 allow explicit style= in #+cite_export: biblatex

2024-04-17 Thread Pedro Andres Aranda Gutierrez
Stop the press... I discovered a small bug in the last patch.
Attached is a new version.

/PA

On Wed, 17 Apr 2024 at 08:22, Pedro Andres Aranda Gutierrez <
paag...@gmail.com> wrote:

> Hi again
>
> Rationale of the patch:
> Currently, when the options to biblatex are _not_ xxx/xxx format, a style=
> is prepended, because
> it is assumed that it will be a biblatex options string starting with a
> style.
> With the proposed patch, I add the possibility of using a biblatex options
> string where style= is stated
> explicitly (anywhere in the string). This adds congruency WRT
> the ~org-cite-biblatex-options~ variable.
>
> Best, /PA
>
> On Sun, 14 Apr 2024 at 09:16, Pedro Andres Aranda Gutierrez <
> paag...@gmail.com> wrote:
>
>> HI, full answer...
>>
>> In the original code, that section prepends "style=" in some cases. I
>> have stumbled across
>> instances where the options started with style= because they were taken
>> directly from LaTeX
>> and the generated code ended by like:
>> \usepackage[style=style=numeric,backend=biber]{biblatex}
>> for
>> #+cite_export: biblatex style=numeric,backend=biber
>> which, BTW, is something someone used the LaTeX may parse as correct.
>> I was just trying to cater for this case.
>>
>> Best, /PA
>>
>>
>> On Sun, 14 Apr 2024 at 07:30, Pedro Andres Aranda Gutierrez <
>> paag...@gmail.com> wrote:
>>
>>> Sorry... I was not right... You are right. I'll take a look at it again.
>>> /PA
>>>
>>> On Sun, 14 Apr 2024 at 07:22, Pedro Andres Aranda Gutierrez <
>>> paag...@gmail.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> Maybe not... because style= is a keyword for the biblatex package,
>>>> while bibstyle or citestyle aren't.
>>>>
>>>> Best, /PA
>>>>
>>>> On Sat, 13 Apr 2024 at 16:32, Ihor Radchenko 
>>>> wrote:
>>>>
>>>>> Pedro Andres Aranda Gutierrez  writes:
>>>>>
>>>>> > HI,
>>>>> > Attached is a small patch to allow explicitly adding style= in the
>>>>> biblatex export options, to increase consistency with
>>>>> > Customisation variables.
>>>>>
>>>>> Thanks!
>>>>>
>>>>> >  (style-options
>>>>> >   (cond
>>>>> >((null style) nil)
>>>>> > +  ;; allow the user to include "style=" anywhere in the
>>>>> style options
>>>>> > +  ((string-match "\\(^s\\|,s\\)tyle=" style) (list style))
>>>>> >((not (string-match "/" style)) (list (concat "style="
>>>>> style)))
>>>>> >(t
>>>>> > (list (concat "bibstyle=" (substring style nil
>>>>> (match-beginning 0)))
>>>>>
>>>>> If we allow style=..., may as well allow bibstyle= and citestyle=.
>>>>>
>>>>> --
>>>>> Ihor Radchenko // yantar92,
>>>>> Org mode contributor,
>>>>> Learn more about Org mode at <https://orgmode.org/>.
>>>>> Support Org development at <https://liberapay.com/org-mode>,
>>>>> or support my work at <https://liberapay.com/yantar92>
>>>>>
>>>>
>>>>
>>>> --
>>>> 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
>>>>
>>>>
>>>
>>> --
>>> 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
>>>
>>>
>>
>> --
>> 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
>>
>>
>
> --
> Fragen sind nicht 

Re: PATCH allow explicit style= in #+cite_export: biblatex

2024-04-17 Thread Pedro Andres Aranda Gutierrez
Hi again

Rationale of the patch:
Currently, when the options to biblatex are _not_ xxx/xxx format, a style=
is prepended, because
it is assumed that it will be a biblatex options string starting with a
style.
With the proposed patch, I add the possibility of using a biblatex options
string where style= is stated
explicitly (anywhere in the string). This adds congruency WRT
the ~org-cite-biblatex-options~ variable.

Best, /PA

On Sun, 14 Apr 2024 at 09:16, Pedro Andres Aranda Gutierrez <
paag...@gmail.com> wrote:

> HI, full answer...
>
> In the original code, that section prepends "style=" in some cases. I have
> stumbled across
> instances where the options started with style= because they were taken
> directly from LaTeX
> and the generated code ended by like:
> \usepackage[style=style=numeric,backend=biber]{biblatex}
> for
> #+cite_export: biblatex style=numeric,backend=biber
> which, BTW, is something someone used the LaTeX may parse as correct.
> I was just trying to cater for this case.
>
> Best, /PA
>
>
> On Sun, 14 Apr 2024 at 07:30, Pedro Andres Aranda Gutierrez <
> paag...@gmail.com> wrote:
>
>> Sorry... I was not right... You are right. I'll take a look at it again.
>> /PA
>>
>> On Sun, 14 Apr 2024 at 07:22, Pedro Andres Aranda Gutierrez <
>> paag...@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> Maybe not... because style= is a keyword for the biblatex package, while
>>> bibstyle or citestyle aren't.
>>>
>>> Best, /PA
>>>
>>> On Sat, 13 Apr 2024 at 16:32, Ihor Radchenko 
>>> wrote:
>>>
>>>> Pedro Andres Aranda Gutierrez  writes:
>>>>
>>>> > HI,
>>>> > Attached is a small patch to allow explicitly adding style= in the
>>>> biblatex export options, to increase consistency with
>>>> > Customisation variables.
>>>>
>>>> Thanks!
>>>>
>>>> >  (style-options
>>>> >   (cond
>>>> >((null style) nil)
>>>> > +  ;; allow the user to include "style=" anywhere in the
>>>> style options
>>>> > +  ((string-match "\\(^s\\|,s\\)tyle=" style) (list style))
>>>> >((not (string-match "/" style)) (list (concat "style="
>>>> style)))
>>>> >(t
>>>> > (list (concat "bibstyle=" (substring style nil
>>>> (match-beginning 0)))
>>>>
>>>> If we allow style=..., may as well allow bibstyle= and citestyle=.
>>>>
>>>> --
>>>> Ihor Radchenko // yantar92,
>>>> Org mode contributor,
>>>> Learn more about Org mode at <https://orgmode.org/>.
>>>> Support Org development at <https://liberapay.com/org-mode>,
>>>> or support my work at <https://liberapay.com/yantar92>
>>>>
>>>
>>>
>>> --
>>> 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
>>>
>>>
>>
>> --
>> 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
>>
>>
>
> --
> 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
>
>

-- 
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 82f1cecaf5c011506c6cc57cb3835b6f8eba0f6d Mon Sep 17 00:00:00 2001
From: "Pedro A. Aranda" 
Date: Wed, 17 Apr 2024 08:19:22 +0200
Subject: [PATCH] Allow explicit style= in cite_export options

lisp/oc-biblatex.el: Ckech whether the biblatex options include style= explicitly.
doc/org-manual.org: Clarify this in the documentation.


---
 doc/org-manual.org  | 10 +-
 lisp/oc-biblatex.el | 31 +--
 2 files

Re: PATCH allow explicit style= in #+cite_export: biblatex

2024-04-14 Thread Pedro Andres Aranda Gutierrez
HI, full answer...

In the original code, that section prepends "style=" in some cases. I have
stumbled across
instances where the options started with style= because they were taken
directly from LaTeX
and the generated code ended by like:
\usepackage[style=style=numeric,backend=biber]{biblatex}
for
#+cite_export: biblatex style=numeric,backend=biber
which, BTW, is something someone used the LaTeX may parse as correct.
I was just trying to cater for this case.

Best, /PA


On Sun, 14 Apr 2024 at 07:30, Pedro Andres Aranda Gutierrez <
paag...@gmail.com> wrote:

> Sorry... I was not right... You are right. I'll take a look at it again.
> /PA
>
> On Sun, 14 Apr 2024 at 07:22, Pedro Andres Aranda Gutierrez <
> paag...@gmail.com> wrote:
>
>> Hi,
>>
>> Maybe not... because style= is a keyword for the biblatex package, while
>> bibstyle or citestyle aren't.
>>
>> Best, /PA
>>
>> On Sat, 13 Apr 2024 at 16:32, Ihor Radchenko  wrote:
>>
>>> Pedro Andres Aranda Gutierrez  writes:
>>>
>>> > HI,
>>> > Attached is a small patch to allow explicitly adding style= in the
>>> biblatex export options, to increase consistency with
>>> > Customisation variables.
>>>
>>> Thanks!
>>>
>>> >  (style-options
>>> >   (cond
>>> >((null style) nil)
>>> > +  ;; allow the user to include "style=" anywhere in the style
>>> options
>>> > +  ((string-match "\\(^s\\|,s\\)tyle=" style) (list style))
>>> >((not (string-match "/" style)) (list (concat "style="
>>> style)))
>>> >(t
>>> > (list (concat "bibstyle=" (substring style nil
>>> (match-beginning 0)))
>>>
>>> If we allow style=..., may as well allow bibstyle= and citestyle=.
>>>
>>> --
>>> Ihor Radchenko // yantar92,
>>> Org mode contributor,
>>> Learn more about Org mode at <https://orgmode.org/>.
>>> Support Org development at <https://liberapay.com/org-mode>,
>>> or support my work at <https://liberapay.com/yantar92>
>>>
>>
>>
>> --
>> 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
>>
>>
>
> --
> 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
>
>

-- 
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 allow explicit style= in #+cite_export: biblatex

2024-04-13 Thread Pedro Andres Aranda Gutierrez
Sorry... I was not right... You are right. I'll take a look at it again.
/PA

On Sun, 14 Apr 2024 at 07:22, Pedro Andres Aranda Gutierrez <
paag...@gmail.com> wrote:

> Hi,
>
> Maybe not... because style= is a keyword for the biblatex package, while
> bibstyle or citestyle aren't.
>
> Best, /PA
>
> On Sat, 13 Apr 2024 at 16:32, Ihor Radchenko  wrote:
>
>> Pedro Andres Aranda Gutierrez  writes:
>>
>> > HI,
>> > Attached is a small patch to allow explicitly adding style= in the
>> biblatex export options, to increase consistency with
>> > Customisation variables.
>>
>> Thanks!
>>
>> >  (style-options
>> >   (cond
>> >((null style) nil)
>> > +  ;; allow the user to include "style=" anywhere in the style
>> options
>> > +  ((string-match "\\(^s\\|,s\\)tyle=" style) (list style))
>> >((not (string-match "/" style)) (list (concat "style="
>> style)))
>> >(t
>> > (list (concat "bibstyle=" (substring style nil
>> (match-beginning 0)))
>>
>> If we allow style=..., may as well allow bibstyle= and citestyle=.
>>
>> --
>> Ihor Radchenko // yantar92,
>> Org mode contributor,
>> Learn more about Org mode at <https://orgmode.org/>.
>> Support Org development at <https://liberapay.com/org-mode>,
>> or support my work at <https://liberapay.com/yantar92>
>>
>
>
> --
> 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
>
>

-- 
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 allow explicit style= in #+cite_export: biblatex

2024-04-13 Thread Pedro Andres Aranda Gutierrez
Hi,

Maybe not... because style= is a keyword for the biblatex package, while
bibstyle or citestyle aren't.

Best, /PA

On Sat, 13 Apr 2024 at 16:32, Ihor Radchenko  wrote:

> Pedro Andres Aranda Gutierrez  writes:
>
> > HI,
> > Attached is a small patch to allow explicitly adding style= in the
> biblatex export options, to increase consistency with
> > Customisation variables.
>
> Thanks!
>
> >  (style-options
> >   (cond
> >((null style) nil)
> > +  ;; allow the user to include "style=" anywhere in the style
> options
> > +  ((string-match "\\(^s\\|,s\\)tyle=" style) (list style))
> >((not (string-match "/" style)) (list (concat "style="
> style)))
> >(t
> > (list (concat "bibstyle=" (substring style nil
> (match-beginning 0)))
>
> If we allow style=..., may as well allow bibstyle= and citestyle=.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>


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


PATCH allow explicit style= in #+cite_export: biblatex

2024-04-13 Thread Pedro Andres Aranda Gutierrez
HI,
Attached is a small patch to allow explicitly adding style= in the biblatex 
export options, to increase consistency with 
Customisation variables.

Best, /PA



0001-Allow-style-in-cite_export.patch
Description: Binary data
 

Re: Question about citation formatting

2024-03-28 Thread Pedro Andres Aranda Gutierrez
Christian writes:

> Dear org users,
>
> This is my second paper I am formatting with the new citation framework,
> this time using csl for the first time, since basic does not fit the
> bill anymore.
>
> This paper is discussing and comparing translations to the same text. So
> when I mention publications in the text, I want to have the keyword to
> be the translator, rather than the author.

Hi Christian,

just to focus the discussion... if you were to export to LaTeX (just a
hypothesis), would
https://tex.stackexchange.com/questions/381615/citing-a-translator
cover your needs?

Thx, /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


Small patch: add \usepackage{iftex} when exporting to LaTeX

2024-03-23 Thread Pedro Andres Aranda Gutierrez
Hi

attached is a small patch to include package iftex to latex exports. Since
we support several
compilers, it is useful to have this package to detect the compiler in
included latex files.

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 f2d2e3abeb47cebaecec010493939d64a7ac2fd4 Mon Sep 17 00:00:00 2001
From: "Pedro A. Aranda" 
Date: Sat, 23 Mar 2024 08:13:46 +0100
Subject: [PATCH] Add iftex package when ixporting to LaTeX

---

* org.el: Add package iftex to LaTeX preamble. This is useful to detect
  the compiler in customisation LaTeX code included by the user.

etc/ORG-NEWS |  7 +++
 lisp/org.el  | 11 ++-
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index ca744b932..de0c208da 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -945,6 +945,13 @@ even though it does not have its own ID.  By giving files top-level id
 properties, links to headlines in the file can also be made more
 robust by using the file id instead of the file path.

+*** Added package ~iftex~ when exporting LaTeX documents
+
+When exporting LaTeX documents, add =\usepackage{iftex}= at the
+beginning. Since we support several compilers, the user might
+need to detect which one if active in supporting personal TeX
+customisation code.
+
 ** New features
 *** =ob-tangle.el=: New flag to remove tangle targets before writing

diff --git a/lisp/org.el b/lisp/org.el
index 909ce0024..8ac7340c5 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -3445,7 +3445,8 @@ header, or they will be appended."
 	  (default-value var)))

 (defcustom org-latex-default-packages-alist
-  '(;; amsmath before fontspec for lualatex and xetex
+  '(("" "iftex" nil) ;; include iftex when generating documents
+;; amsmath before fontspec for lualatex and xetex
 ("" "amsmath"   t ("lualatex" "xetex"))
 ;; fontspec ASAP for lualatex and xetex
 ("" "fontspec"  t ("lualatex" "xetex"))
@@ -15319,20 +15320,20 @@ INCREMENT-STEP divisor."
 	(setq hour (mod hour 24))
 	(setq pos-match-group 1
   new (format "-%02d:%02d" hour minute)))
-
+
((org-pos-in-match-range pos 6) ;; POS on "dmwy" repeater char.
 	(setq pos-match-group 6
   new (car (rassoc (+ nincrements (cdr (assoc (match-string 6 ts-string) idx))) idx
-
+
((org-pos-in-match-range pos 5) ;; POS on X in "Xd" repeater.
 	(setq pos-match-group 5
   ;; Never drop below X=1.
   new (format "%d" (max 1 (+ nincrements (string-to-number (match-string 5 ts-string)))
-
+
((org-pos-in-match-range pos 9) ;; POS on "dmwy" repeater in warning interval.
 	(setq pos-match-group 9
   new (car (rassoc (+ nincrements (cdr (assoc (match-string 9 ts-string) idx))) idx
-
+
((org-pos-in-match-range pos 8) ;; POS on X in "Xd" in warning interval.
 	(setq pos-match-group 8
   ;; Never drop below X=0.
--
2.34.1


Re: Reproducible work with natively compiled Emacs

2024-03-17 Thread Pedro Andres Aranda Gutierrez
Hi

Bluntly speaking, yes. There is this instance not too long ago where we had the 
slow down and I was trying to isolate the source. One of my possible suspects 
was that I might not have the right version of the eln file, because the 
creation timestamp was seeing with ls-l really made me doubt and I needed a 
state I could understand.

Best,/PA

Enviado desde mi iPhone

> El 17 mar 2024, a las 11:16, Ihor Radchenko  escribió:
> 
> Pedro Andres Aranda Gutierrez  writes:
> 
>> In practice, I was not able to delete the .eln files from a make native.
> 
> I am wondering why you wanted to run make native.
> When I added that target, it was mostly to test inconsistencies between
> make single and make native. However, AFAIU, there should be no
> inconsistencies in practice. So, maybe we can instead just delete make
> native target? Or is there any value in ahead of time native-compilation
> when working with Org git repo?
> 
>> In order to have a more controlled environment, I delete them _before_
>> I refresh my local org-mode/main directory, and then do a make native
>> after refreshing my local copy.
>> 
>> Same happened when testing modifications. When testing a modification
>> I always make cleaneln; make native to test it
>> 
>> Maybe I'm a bit too 'meticulous' but that's me ;-)
> 
> "more controlled environment" does not sound like a real concern caused
> by something breaking. I am joining Max's question on whether you
> encountered any real issue with native compilation.
> 
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>



Re: Reproducible work with natively compiled Emacs

2024-03-17 Thread Pedro Andres Aranda Gutierrez
Hi Ihor.

In practice, I was not able to delete the .eln files from a make native.

In order to have a more controlled environment, I delete them _before_
I refresh my local org-mode/main directory, and then do a make native
after refreshing my local copy.

Same happened when testing modifications. When testing a modification
I always make cleaneln; make native to test it

Maybe I'm a bit too 'meticulous' but that's me ;-)

Best, /PA

On Sat, 16 Mar 2024 at 11:20, Ihor Radchenko  wrote:

> Pedro Andres Aranda Gutierrez  writes:
>
> >> Do I understand correctly that the reason you implemented cleaneln make
> >> target is working around issues with make test/make repro?
> >>
> > Yes, that's one of the reasons. And, also because when I set
> > native.comp-eln-cache-path,
> > anything that is not part of the Emacs distribution gets compiled into
> that
> > directory. For example,
> > the clone of org-mode main as well as the packages from
> elpa/melpa/nungnu.
>
> Sorry, but I do not fully understand.
> May you please explain in more details what kind of problems you
> encountered in practice?
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>


-- 
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: Reproducible work with natively compiled Emacs

2024-03-16 Thread Pedro Andres Aranda Gutierrez
Hi Ihor,

Answer inline...

On Fri, 15 Mar 2024 at 18:08, Ihor Radchenko  wrote:

> Pedro Andres Aranda Gutierrez  writes:
>
> > I have added the eln version to the patch...
> >
> > Best, /PA
> > PS: Just as an example, I recompiled master today and the version number
> > for eln changed, so the 'old' files from yesterday were not removed ;-)
>
> Yeah. Not ideal.
> The whole system with emacs -Q putting things into .emacs.d is not ideal.
>
> Sometimes, when running things like make test we do not even want to
> litter .emacs.d - .eln files generated during make test might correspond
> to the broken versions of Org mode that were being tested. Then, running
> actual working Emacs session might stumble upon these incorrect versions
> of .eln files.
>
> Do I understand correctly that the reason you implemented cleaneln make
> target is working around issues with make test/make repro?
>

Yes, that's one of the reasons. And, also because when I set
native.comp-eln-cache-path,
anything that is not part of the Emacs distribution gets compiled into that
directory. For example,
the clone of org-mode main as well as the packages from elpa/melpa/nungnu.

When refreshing my local copy of the org-mode repo, I start with a make
cleaneln before pulling and then
make native. Thus I get a predictable build.


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

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


Re: Reproducible work with natively compiled Emacs

2024-03-15 Thread Pedro Andres Aranda Gutierrez
HI Igor
having more than one 30.0.50 means that you are trying emacs master as
often as me. Only that I tend to cleanup more often :-D

I think I could make it delete the current version only.
It will not delete the org .eln files shipped with a package you install:
that's what the first line in the foreach and (car ...) take care off,
so it will be only anything created at some point by a make native on an
org-mode cloned from git. Anyhow, let me check...

Best, /PA

/PA

On Fri, 15 Mar 2024 at 12:09, Ihor Radchenko  wrote:

> Pedro Andres Aranda Gutierrez  writes:
>
> > +# This is where Emacs stores the .eln files
> > +ELNDIR  := $(shell $(EMACS) --batch --eval '(when
> (native-comp-available-p) (princ (car native-comp-eln-load-path)))')
> > ...
> > +cleaneln:
> > + @$(foreach elnf,$(patsubst %.eln, %-*.eln, $(LISPN)), \
> > +   $(FIND) $(ELNDIR) -name $(elnf) -exec $(RM) -v {} \; ;)
>
> I think that it will delete too much - (car native-comp-eln-load-path)
> contains multiple directories if several Emacs versions are used in the
> system. So, make cleaneln will not only clean .eln files created by make
> native, but also all .eln files created by other Emacs processes.
>
> For reference, here is what my eln-cache directory contains:
>
> [yantar92:~/.emacs.d/eln-cache] $
> > ls
> 28.2-288c4fd1  30.0.50-394f34f6  30.0.50-464b3753  30.0.50-4f12c581
> 30.0.50-8437a6f7  30.0.50-86834af4
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>


-- 
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: Reproducible work with natively compiled Emacs

2024-03-14 Thread Pedro Andres Aranda Gutierrez
Hi Ihor,

attached is the patch in what I would call the final version. The main
enhancement is that
make native and make cleaneln with exit gracefully on systems where native
compilation is not enabled.

Best, /PA

On Thu, 14 Mar 2024 at 07:49, Pedro Andres Aranda Gutierrez <
paag...@gmail.com> wrote:

> HI,
>
> On Wed, 13 Mar 2024 at 18:13, Ihor Radchenko  wrote:
>
>> Pedro Andres Aranda Gutierrez  writes:
>>
>> > Thanks for the feedback! I'm attaching a unified patch.
>>
>> Thanks!
>> Some more comments.
>>
>> > +# This is where Emacs stores the .eln files
>> > +ELNDIR= $(shell $(EMACS) --batch --eval '(princ (car
>> native-comp-eln-load-path))')
>>
>> Maybe := is better here. Otherwise, we risk invoking emacs multiple times.
>>
> You are right
>
>> > +cleaneln::
>>
>> Why ::?
>>
> You are absolutely right, it's an isolated rule and it doesn't need ::
>
>> --
>> Ihor Radchenko // yantar92,
>> Org mode contributor,
>> Learn more about Org mode at <https://orgmode.org/>.
>> Support Org development at <https://liberapay.com/org-mode>,
>> or support my work at <https://liberapay.com/yantar92>
>>
>
> Patch will follow. I'm testing it against an Emacs WITHOUT native-comp to
> check it there too.
>
> 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
>
>

-- 
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 797a63581bac53f8eb9cba268a975807ec6b841e Mon Sep 17 00:00:00 2001
From: "Pedro A. Aranda" 
Date: Thu, 14 Mar 2024 08:17:11 +0100
Subject: [PATCH] Make cleaneln work, execute cleanly when native comp not
 available.

---
lisp/Makefile: clean .eln files from the directory where the user's natively
compiled files are stored. Detect when native compilation is not available
and exit gracefully in that case

* Makefile: Add help for =make native=
* lisp/Makefile: Implement =make cleaneln=
* mk/targets.mk: Add =cleaneln= target


Makefile  |  1 +
 etc/ORG-NEWS  |  7 +++
 lisp/Makefile | 20 +++-
 mk/targets.mk |  5 -
 4 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index f476a3ea7..b3a167ecb 100644
--- a/Makefile
+++ b/Makefile
@@ -27,6 +27,7 @@ help helpall::
 	$(info make all- ditto)
 	$(info make compile- build Org ELisp files)
 	$(info make single - build Org ELisp files, single Emacs per source)
+	$(info make native - build Org natively compiled Elisp files)
 	$(info make autoloads  - create org-loaddefs.el to load Org in-place)
 	$(info make test   - build Org ELisp files and run test suite)
 	$(info make vanilla- run Emacs with this Org-mode and no personal config)
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index ca73f06e7..cb8ed9b71 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -1281,6 +1281,13 @@ optional argument =NEW-HEADING-CONTAINER= specifies where in the
 buffer it will be added.  If not specified, new headings are created
 at level 1 at the end of the accessible part of the buffer, as before.

+*** ~make cleaneln~ will remove the .eln files from the user emacs configuration
+
+Natively compiled Emacs lisp files generated with ~make native~ are
+now correctly located and deleted with ~make cleaneln~.
+
+*** Add text for =make native= to ~make help~
+
 ** Miscellaneous
 *** =org-crypt.el= now applies initial visibility settings to decrypted entries

diff --git a/lisp/Makefile b/lisp/Makefile
index c570d9cfa..ff49dccff 100644
--- a/lisp/Makefile
+++ b/lisp/Makefile
@@ -11,12 +11,15 @@ LISPF 	:= $(filter-out $(LISPA),$(sort $(wildcard *.el)))
 LISPC 	:= $(filter-out $(LISPB) $(LISPN:%el=%elc),$(LISPF:%el=%elc))
 LISPN 	:= $(filter-out $(LISPB) $(LISPN:%el=%eln),$(LISPF:%el=%eln))
 _ORGCM_ := dirall single native source slint1 slint2
+# This is where Emacs stores the .eln files
+ELNDIR  := $(shell $(EMACS) --batch --eval '(when (native-comp-available-p) (princ (car native-comp-eln-load-path)))')
+
 -include local.mk

 .PHONY:	all compile compile-dirty \
 	$(_ORGCM_) $(_ORGCM_:%=compile-%) \
 	autoloads \
-	install clean cleanauto cleanall cleanelc clean-install
+	install clean cleanauto cleanall cleanelc cleaneln clean-install

 # do not clean here, done in toplevel make
 all compile compile-dirty::	 | autoloads
@@ -52,9 +55,15 @@ slint1:
 	@$(info Compiling single $(abspath $<)...)
 	-@$(ELC) $&l

Re: Reproducible work with natively compiled Emacs

2024-03-13 Thread Pedro Andres Aranda Gutierrez
Hi Ihor,

Thanks for the feedback! I'm attaching a unified patch.

TODO: check that the emacs installed supports native compilation. This is
more for
make native.

Best, /PA


On Wed, 13 Mar 2024 at 13:46, Ihor Radchenko  wrote:

> Pedro Andres Aranda Gutierrez  writes:
>
> >> I have been experiencing some inconsistencies with org-mode, which I
> >> have been able to trace own to using native compilation and not knowing
> >> where the files from main were.
>
> Thanks for the patch!
> See my comments inline.
>
> > +# This is where Emacs stores the .eln files
> > +ELNDIR= $(shell emacs --batch --eval '(princ (car
> native-comp-eln-load-path))')
>
> Please use $(EMACS).
>
> > +cleaneln::
> > + for elnf in $(patsubst %.eln, %-*.eln, $(LISPN)); do \
> > +   find $(ELNDIR) -name $$elnf -exec $(RM) -v {} \; ;\
> > + done
>
> $(FIND).
> Also, avoid using bash as much as possible in favor or GNU make
> constructs. You can use $(foreach ...) here.
>
> >  clean-install:
> >   if [ -d $(DESTDIR)$(lispdir) ] ; then \
> > $(RM) $(DESTDIR)$(lispdir)/org*.el* $(DESTDIR)$(lispdir)/ob*.el*
> $(DESTDIR)$(lispdir)/ol*.el* $(DESTDIR)$(lispdir)/ox*.el* ; \
> > --
> > 2.34.1
> > From 6d98dfb3d72171e0231823260165b23e8b9963ee Mon Sep 17 00:00:00 2001
> > From: "Pedro A. Aranda" 
> > Date: Mon, 11 Mar 2024 09:47:12 +0100
> > Subject: [PATCH 1/3] Add cleaneln target
> >
> > * mk/targets.mk: add the 'cleaneln' target
> >
> > ---
> >  mk/targets.mk | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/mk/targets.mk b/mk/targets.mk
> > index de849c4fb..ab9ec2a1f 100644
> > --- a/mk/targets.mk
> > +++ b/mk/targets.mk
> > @@ -143,6 +143,9 @@ cleanall: cleandirs cleantest
> >  $(CLEANDIRS:%=clean%):
> >   -$(FIND) $(@:clean%=%) \( -name \*~ -o -name \*.elc \) -exec $(RM)
> {} +
> >
> > +cleaneln:
> > + $(MAKE) -C lisp $@
> > +
>
> Should be in .PHONY
>
> > --- a/etc/ORG-NEWS
> > +++ b/etc/ORG-NEWS
> > @@ -11,7 +11,8 @@ See the end of the file for license conditions.
> >
> >  Please send Org bug reports to mailto:emacs-orgmode@gnu.org.
> >
> > -* Version 9.7 (not released yet)
> > +* V
> > +ersion 9.7 (not released yet)
>
> This is a stray newline.
>
> > +*** ~make cleaneln~ will remove the .eln files from the user emacs
> configuration
> > +
> > +Natively compiled Emacs lisp files generated with ~make native~ are
> > +now correctly located and deleted with ~make cleaneln~.
> > +
> >  ** Miscellaneous
> >  *** =org-crypt.el= now applies initial visibility settings to decrypted
> entries
>
> "Add 'native' option to 'make help'" from the previous version of the
> patch still makes sense.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>


-- 
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 52bcbc71c62717e84dd0504ccf37d32668ed3cac Mon Sep 17 00:00:00 2001
From: "Pedro A. Aranda" 
Date: Wed, 13 Mar 2024 17:41:56 +0100
Subject: [PATCH] Clean eln files from the user emacs eln directory

---
lisp/Makefile: clean .eln files from the directory where the user's natively
compiled files are stored

* Makefile: Add help for =make native=
* lisp/Makefile: Implement =make cleaneln=
* mk/targets.mk: Add =cleaneln= target


 Makefile  | 1 +
 etc/ORG-NEWS  | 7 +++
 lisp/Makefile | 9 -
 mk/targets.mk | 5 -
 4 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index f476a3ea7..b3a167ecb 100644
--- a/Makefile
+++ b/Makefile
@@ -27,6 +27,7 @@ help helpall::
 	$(info make all- ditto)
 	$(info make compile- build Org ELisp files)
 	$(info make single - build Org ELisp files, single Emacs per source)
+	$(info make native - build Org natively compiled Elisp files)
 	$(info make autoloads  - create org-loaddefs.el to load Org in-place)
 	$(info make test   - build Org ELisp files and run test suite)
 	$(info make vanilla- run Emacs with this Org-mode and no personal config)
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index ca73f06e7..cb8ed9b71 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -1281,6 +1281,13 @@ optional argument =NEW-HEADING-CONTAINER= specifi

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

2024-03-13 Thread Pedro Andres Aranda Gutierrez
Hi Leo,

I really don't have anything to object to the original patch. I support the
need to circumvent the "\begin-or-end{frame} inside frame" problem and
using orgframe is a clean way of doing so.
My only concern is the _default_ value for `org-beamer-frame-environment'.
If we set it to "frame", we only need to customise it in the file local
variables in files where it needs to be changed and we catch all flies in a
stroke:

Situation 1: presentation has no "\begin-or-end{frame} inside frame" -> no
extra stuff in file local variables AND newenvironment is not generated AND
frames are between \begin{frame} and \end{frame}
Situation 2: presentation needs to circumvent "\begin-or-end{frame} inside
frame" -> set local variable in file AND newenvironment is generated AND
frame is changed where it is strictly necessary,

Cheers, /PA

On Tue, 12 Mar 2024 at 21:32, Leo Butler  wrote:

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

-- 
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: Re: Strange behaviour detected today

2024-03-11 Thread Pedro Andres Aranda Gutierrez
Hi,

> Message: 15
> Date: Mon, 11 Mar 2024 13:53:38 +0100
> From: Detlev Zundel 
> To: emacs-orgmode@gnu.org
> Subject: Re: Strange behaviour detected today
> Message-ID: <87bk7l53ql@member.fsf.org>
> Content-Type: text/plain; charset=utf-8
>
> Hi,
>
> > Thanks a ton. I could bisect the issue and filed a bug yesterday. It
> > seems to be the same commit that broke the themes.
>
> May I ask what the outcome of all this was?  I am now seeing the same
> problem with Emacs from master as of today and wonder about the best way
> to solve this in the short and long term.
>
> Thanks in advance
>   Detlev
>
> [...]
>
> >  On Wed, 13 Dec 2023 at 15:57, William Denton  wrote:
> >
> >  On 13 December 2023, Pedro Andres Aranda Gutierrez wrote:
> >
> >  > I've recompiled emacs master today and when I try to export an org
> >  > presentation to latex and I get the following error:
> >  >
> >  > Exporting to LaTeX [class: beamer]...
> >  > set-face-attribute: Invalid face box: :line-width, 1, :color, grey40
> >  >
> >  > This happens when calling
> >  >
> >  > (org-beamer-export-to-latex)
> >  >
> >  > both from emacs in interactive and in batch mode.
> >
> >  Is that perhaps related to commit
dcd755dabcf9ef95d6d0534c11c668f44c6f89c2, "Fix
> >  validation of :box face attribute"?  It caused similar errors in
solarized-theme
> >  (for example this bug¹).
> >
> >  Bill

Just for the record. The root cause for this problem is a :color definition
with is not a string.
So find the offending face definition and make sure the :color is a string,

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


Re: Reproducible work with natively compiled Emacs

2024-03-11 Thread Pedro Andres Aranda Gutierrez
HI,

nothing like sleeping over a problem. This solution seems to be easier...

/PA

On Sun, 10 Mar 2024 at 12:49, Pedro A. Aranda  wrote:

> Hi,
>
> I have been experiencing some inconsistencies with org-mode, which I
> have been able to trace own to using native compilation and not knowing
> where the files from main were.
>
> Attached is a patch in four parts to make natively compiled orgmode more
> consistent.
>
> This is a first step and I would like reactions to it, before submitting
> a unified patch.
>
> I hope that splitting it up helps understanding the different parts of
> my "solution". Maybe some parts can be cherry picked better this way...
>
> 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 9476898539bd9ad72a5b45bc1625fa398eada879 Mon Sep 17 00:00:00 2001
From: "Pedro A. Aranda" 
Date: Mon, 11 Mar 2024 09:48:10 +0100
Subject: [PATCH 2/3] Clean .eln files from user emacs configuration

* lisp/Makefile: Get the directory where emacs stores the compiled files
  in the user storage and use that to locate the .eln files generated by
  'make native' and delete them

---
 lisp/Makefile | 8 
 1 file changed, 8 insertions(+)

diff --git a/lisp/Makefile b/lisp/Makefile
index c570d9cfa..506aa75e1 100644
--- a/lisp/Makefile
+++ b/lisp/Makefile
@@ -11,6 +11,9 @@ LISPF 	:= $(filter-out $(LISPA),$(sort $(wildcard *.el)))
 LISPC 	:= $(filter-out $(LISPB) $(LISPN:%el=%elc),$(LISPF:%el=%elc))
 LISPN 	:= $(filter-out $(LISPB) $(LISPN:%el=%eln),$(LISPF:%el=%eln))
 _ORGCM_ := dirall single native source slint1 slint2
+# This is where Emacs stores the .eln files
+ELNDIR= $(shell emacs --batch --eval '(princ (car native-comp-eln-load-path))')
+
 -include local.mk

 .PHONY:	all compile compile-dirty \
@@ -79,6 +82,11 @@ cleanauto clean cleanall::
 clean cleanall cleanelc::
 	$(RM) *.elc

+cleaneln::
+	for elnf in $(patsubst %.eln, %-*.eln, $(LISPN)); do \
+	  find $(ELNDIR) -name $$elnf -exec $(RM) -v {} \; ;\
+	done
+
 clean-install:
 	if [ -d $(DESTDIR)$(lispdir) ] ; then \
 	  $(RM) $(DESTDIR)$(lispdir)/org*.el* $(DESTDIR)$(lispdir)/ob*.el* $(DESTDIR)$(lispdir)/ol*.el* $(DESTDIR)$(lispdir)/ox*.el* ; \
--
2.34.1
From 6d98dfb3d72171e0231823260165b23e8b9963ee Mon Sep 17 00:00:00 2001
From: "Pedro A. Aranda" 
Date: Mon, 11 Mar 2024 09:47:12 +0100
Subject: [PATCH 1/3] Add cleaneln target

* mk/targets.mk: add the 'cleaneln' target

---
 mk/targets.mk | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/mk/targets.mk b/mk/targets.mk
index de849c4fb..ab9ec2a1f 100644
--- a/mk/targets.mk
+++ b/mk/targets.mk
@@ -143,6 +143,9 @@ cleanall: cleandirs cleantest
 $(CLEANDIRS:%=clean%):
 	-$(FIND) $(@:clean%=%) \( -name \*~ -o -name \*.elc \) -exec $(RM) {} +

+cleaneln:
+	$(MAKE) -C lisp $@
+
 cleanelc:
 	$(MAKE) -C lisp $@

--
2.34.1
From 0b5d791d32f26698e53299e639d7ef73581a6310 Mon Sep 17 00:00:00 2001
From: "Pedro A. Aranda" 
Date: Mon, 11 Mar 2024 09:56:05 +0100
Subject: [PATCH 3/3] Announce cleaneln

---
 etc/ORG-NEWS | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index abe62daaf..325fd412b 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -11,7 +11,8 @@ See the end of the file for license conditions.
 
 Please send Org bug reports to mailto:emacs-orgmode@gnu.org.
 
-* Version 9.7 (not released yet)
+* V
+ersion 9.7 (not released yet)
 ** Important announcements and breaking changes
 *** When ~org-link-file-path-type~ is a function, its argument is now a filename as it is read by ~org-insert-link~; not an absolute path
 
@@ -1263,6 +1264,11 @@ optional argument =NEW-HEADING-CONTAINER= specifies where in the
 buffer it will be added.  If not specified, new headings are created
 at level 1 at the end of the accessible part of the buffer, as before.
 
+*** ~make cleaneln~ will remove the .eln files from the user emacs configuration
+
+Natively compiled Emacs lisp files generated with ~make native~ are
+now correctly located and deleted with ~make cleaneln~.
+
 ** Miscellaneous
 *** =org-crypt.el= now applies initial visibility settings to decrypted entries
 
-- 
2.34.1



Reproducible work with natively compiled Emacs

2024-03-10 Thread Pedro A. Aranda

Hi,

I have been experiencing some inconsistencies with org-mode, which I 
have been able to trace own to using native compilation and not knowing 
where the files from main were.


Attached is a patch in four parts to make natively compiled orgmode more 
consistent.


This is a first step and I would like reactions to it, before submitting 
a unified patch.


I hope that splitting it up helps understanding the different parts of 
my "solution". Maybe some parts can be cherry picked better this way...


best /PA
From e47289a60f225a0fa6d05efec9d38119d886f4a3 Mon Sep 17 00:00:00 2001
From: "Pedro A. Aranda" 
Date: Sun, 10 Mar 2024 11:23:09 +0100
Subject: [PATCH 1/4] Add 'native' option to 'make help'

---
 Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Makefile b/Makefile
index f476a3ea7..35250eed0 100644
--- a/Makefile
+++ b/Makefile
@@ -27,6 +27,7 @@ help helpall::
 	$(info make all- ditto)
 	$(info make compile- build Org ELisp files)
 	$(info make single - build Org ELisp files, single Emacs per source)
+	$(info make native - build Org natively compiled ELisp)
 	$(info make autoloads  - create org-loaddefs.el to load Org in-place)
 	$(info make test   - build Org ELisp files and run test suite)
 	$(info make vanilla- run Emacs with this Org-mode and no personal config)
-- 
2.34.1

From 2d3c6b45d435a6356f198c421d71743d9b09efca Mon Sep 17 00:00:00 2001
From: "Pedro A. Aranda" 
Date: Sun, 10 Mar 2024 11:26:46 +0100
Subject: [PATCH 2/4] Store .eln files alongside the lisp files

---
 mk/default.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mk/default.mk b/mk/default.mk
index b75aac345..312dbc6aa 100644
--- a/mk/default.mk
+++ b/mk/default.mk
@@ -158,6 +158,7 @@ ELC	= $(BATCHL) \
 
 # How to native-compile a single file
 ELN	= $(BATCHL) \
+	  --eval "(startup-redirect-eln-cache \"$(PWD)/lisp\")" \
 	  --eval '(batch-native-compile)'
 
 # How to make a pdf file from a texinfo file
-- 
2.34.1

From 34787b58add09decbf31e0e583fd315a207ce88d Mon Sep 17 00:00:00 2001
From: "Pedro A. Aranda" 
Date: Sun, 10 Mar 2024 11:44:38 +0100
Subject: [PATCH 3/4] A short doc for reproducible native compilations when
 developing

---
 doc/native-devel.org | 33 +
 1 file changed, 33 insertions(+)
 create mode 100644 doc/native-devel.org

diff --git a/doc/native-devel.org b/doc/native-devel.org
new file mode 100644
index 0..0cc18a6fe
--- /dev/null
+++ b/doc/native-devel.org
@@ -0,0 +1,33 @@
+#+title: A reproducible natively compiled org-mode
+#+subtitle:  Release {{{version}}}
+#+author:The Org Mode Developers
+#+language:  en
+
+* Introduction
+
+In order to develop and test ~org-mode~ when your Emacs editor
+supports native compilation, there are two things to take into
+account:
+
+1. you will need to =make native= to generate the =.eln= files. These
+   will be stored under the ~lisp/~ directory of your development
+   ~org-mode~ directory.
+2. Add the following code in your Emacs ~early-init.el~ file:
+
+#+BEGIN_SRC emacs-lisp
+(let ((org-devel-path (expand-file-name "/lisp")))
+  (when (file-directory-p org-devel-path)
+(when (native-comp-available-p)
+  (let ((first (pop native-comp-eln-load-path)))
+;; put in second place
+(add-to-list 'native-comp-eln-load-path org-devel-path t)
+(add-to-list 'native-comp-eln-load-path first t)))
+(add-to-list 'load-path  org-devel-path)))
+#+END_SRC
+
+putting the correct path for your org-mode development directory. In
+my case, it is =~/Devel/org-mode=, so the first =let= looks like this:
+
+#+BEGIN_SRC emacs-lisp
+(let ((org-devel-path (expand-file-name "~/Devel/org-mode/lisp")))
+#+END_SRC
-- 
2.34.1

From 0f10451eef8d826ffb31f70f8a6c2db36ebc16a5 Mon Sep 17 00:00:00 2001
From: "Pedro A. Aranda" 
Date: Sun, 10 Mar 2024 12:06:28 +0100
Subject: [PATCH 4/4] Add cleaning native compilation

---
 lisp/Makefile | 15 +--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/lisp/Makefile b/lisp/Makefile
index c570d9cfa..1f03539c2 100644
--- a/lisp/Makefile
+++ b/lisp/Makefile
@@ -10,13 +10,16 @@ LISPB 	:= $(LISPA:%el=%elc) org-install.elc
 LISPF 	:= $(filter-out $(LISPA),$(sort $(wildcard *.el)))
 LISPC 	:= $(filter-out $(LISPB) $(LISPN:%el=%elc),$(LISPF:%el=%elc))
 LISPN 	:= $(filter-out $(LISPB) $(LISPN:%el=%eln),$(LISPF:%el=%eln))
+# Should not be empty if lisp//org-lint.eln exists
+# like after a make native
+ELNDIR  := $(shell find . -name org-lint\*.eln -exec dirname {} \;)
 _ORGCM_ := dirall single native source slint1 slint2
 -include local.mk
 
 .PHONY:	all compile compile-dirty \
 	$(_ORGCM_) $(_ORGCM_:%=compile-%) \
 	autoloads \
-	install clean cleanauto cleanall cleanelc clean-install
+	install clean cleanauto cleanall cleanelc cleaneln clean-install
 
 # do not clean here, done in t

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

2024-03-09 Thread Pedro Andres Aranda Gutierrez
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

Best, /PA


On Mon, 4 Mar 2024 at 12:06, Ihor Radchenko  wrote:

> Pedro Andres Aranda Gutierrez  writes:
>
> > Org-lint will signal that… IHvHO that’s more than enough
>
> May you elaborate?
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>


-- 
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: Just thinking...

2024-03-09 Thread Pedro Andres Aranda Gutierrez
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'...

/PA

On Thu, 7 Mar 2024 at 15:10, Ihor Radchenko  wrote:

> Pedro Andres Aranda Gutierrez  writes:
>
> > duplicating export entries for LaTeX and Beamer makes the interface not
> > exactly clean.
> > We do have the LaTeX class, which should be "beamer" (I hope) for Beamer
> > presentations, right?
> >
> > So why not use that to decide internally between (org-latex-export-...)
> and
> > (org-beamer-...) and then have a unified interaction with the user?
>
> I am afraid that implementing this would be a kludge. For technical
> reasons.
>
> For example, Org export parses keywords depending on the selected export
> backend. Selected in advance.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>


-- 
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: Subject: cannot export asynchronously because of org-fold-core--update-buffer-folds

2024-03-08 Thread Pedro Andres Aranda Gutierrez
Hi,

I’m very interested on how your document header looks like. Can you please send 
mee a file with your header
and a couple of dummy slides? I’m not able to reproduce the problem…

Thx, /PA


> El 7 mar 2024, a las 10:42, Alan Schmitt  
> escribió:
> 
> Hi Pedro,
> 
> On 2024-03-07 10:03, Pedro Andres Aranda Gutierrez  writes:
> 
>> could you please try to add
>> 
>> #+LATEX_CLASS: beamer
>> #+LATEX_CLASS_OPTIONS: [presentation,aspectratio=169]
>> 
>> instead of
>> 
>> (require 'ox-latex)
>> 
>> (add-to-list 'org-latex-classes
>> '("my-beamer"
>>   "\\documentclass\[presentation,aspectratio=169\]\{beamer\}
>> [NO-DEFAULT-PACKAGES]"
>>   ("\\section\{%s\}" . "\\section*\{%s\}")
>>   ("\\subsection\{%s\}" . "\\subsection*\{%s\}")
>>   ("\\subsubsection\{%s\}" . "\\subsubsection*\{%s\}")))
>> 
>> and see if that makes any difference?
> 
> Thank you for the suggestion. I tried this and it does not help, I have
> the same error. I do not know how to debug it since the error happens in
> compiled code whose origin is not given…
> 
> The surprising part is that the problematic function was introduced very
> recently
> (https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=87c9f9b5db2e14fe0c5254105b7b90b01bbf8d61)
> but it seems to be used in the asynchronous export that does not load
> any package, so there I should be using the orgmode version shipped with
> emacs…
> 
> Alan




Re: Emacs slow-down

2024-03-07 Thread Pedro Andres Aranda Gutierrez
Hi Bill

another sleepless night. Having something to distract me is helpful. In
this case, one of the root causes for my insufferable slowdown was not
org-mode but jinx (the spell checker). Without it, I do notice a slow down
when going through my slides, but much less.

Going back to ispell...

Best, /PA

On Thu, 7 Mar 2024 at 17:21, William Denton 
wrote:

> On Thursday, March 7th, 2024 at 11:03, Pedro Andres Aranda Gutierrez <
> paag...@gmail.com> wrote:
>
> > Interestingly enough, this redisplay_internal function seems to be the
> real pain. I think we need to switch to the main
> > emacs devel list here...
>
> I wonder if those of us seeing this have something in common about our
> configurations.  Might it be a package that's getting in the way, and a
> change there is causing this?  Or does the profiling show it's in base Org?
>
>
> Bill
>
> --
> William Denton
> https://www.miskatonic.org/
> Librarian, artist and licensed private investigator.
> Toronto, Canada
>
>

-- 
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: Emacs slow-down

2024-03-07 Thread Pedro Andres Aranda Gutierrez
Hi,

my profiling when deleting a line from a table:

 650  43% + redisplay_internal (C function)
 521  35% - command-execute
 470  31%  - byte-code
 470  31%   - read-extended-command
 470  31%- read-extended-command-1
 470  31% - completing-read-default
 443  29%  + redisplay_internal (C function)
  11   0%  - timer-event-handler
  11   0%   - apply
   7   0%+ jinx--timer-handler
   4   0%+ org-element--cache-sync
  51   3%  - funcall-interactively
  34   2%   + org-kill-line
  17   1%   + next-line
 200  13%   Automatic GC
  57   3% + ...
  57   3% + timer-event-handler

Interestingly enough, this redisplay_internal function seems to be the real
pain. I think we need to switch to the main
emacs devel list here...

Best, /PA

On Thu, 7 Mar 2024 at 16:50, Pedro Andres Aranda Gutierrez <
paag...@gmail.com> wrote:

> Hi Ihor,
>
> same here and changing to text-properties didn't help making editing org
> files less bumpy and slow.
> I don't know if 886 lines is really very much... but that's my org-beamer
> size for a double lecture.
>
> Best, /PA
>
> On Thu, 7 Mar 2024 at 15:58, Bruno Cardoso  wrote:
>
>>
>> On 2024-03-07, 13:23 +, Ihor Radchenko  wrote:
>>
>> > This is strange. `org-fold-core--property-symbol-get-create' should be
>> > very fast normally.
>> >
>> > A blind guess: do you have `org-fold-core-style' set to
>> 'text-properties?
>> >
>>
>> Hi Ihor,
>>
>> No, `org-fold-core-style' is set to 'overlays.
>>
>>
>
> --
> 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
>
>

-- 
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: Emacs slow-down

2024-03-07 Thread Pedro Andres Aranda Gutierrez
Hi Ihor,

same here and changing to text-properties didn't help making editing org
files less bumpy and slow.
I don't know if 886 lines is really very much... but that's my org-beamer
size for a double lecture.

Best, /PA

On Thu, 7 Mar 2024 at 15:58, Bruno Cardoso  wrote:

>
> On 2024-03-07, 13:23 +, Ihor Radchenko  wrote:
>
> > This is strange. `org-fold-core--property-symbol-get-create' should be
> > very fast normally.
> >
> > A blind guess: do you have `org-fold-core-style' set to 'text-properties?
> >
>
> Hi Ihor,
>
> No, `org-fold-core-style' is set to 'overlays.
>
>

-- 
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: Subject: cannot export asynchronously because of org-fold-core--update-buffer-folds

2024-03-07 Thread Pedro Andres Aranda Gutierrez
Will try with my setup @home with the main branch of the git to check again.
 /PA
Enviado desde mi iPhone

> El 7 mar 2024, a las 10:42, Alan Schmitt  
> escribió:
> 
> Hi Pedro,
> 
> On 2024-03-07 10:03, Pedro Andres Aranda Gutierrez  writes:
> 
>> could you please try to add
>> 
>> #+LATEX_CLASS: beamer
>> #+LATEX_CLASS_OPTIONS: [presentation,aspectratio=169]
>> 
>> instead of
>> 
>> (require 'ox-latex)
>> 
>> (add-to-list 'org-latex-classes
>> '("my-beamer"
>>   "\\documentclass\[presentation,aspectratio=169\]\{beamer\}
>> [NO-DEFAULT-PACKAGES]"
>>   ("\\section\{%s\}" . "\\section*\{%s\}")
>>   ("\\subsection\{%s\}" . "\\subsection*\{%s\}")
>>   ("\\subsubsection\{%s\}" . "\\subsubsection*\{%s\}")))
>> 
>> and see if that makes any difference?
> 
> Thank you for the suggestion. I tried this and it does not help, I have
> the same error. I do not know how to debug it since the error happens in
> compiled code whose origin is not given…
> 
> The surprising part is that the problematic function was introduced very
> recently
> (https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=87c9f9b5db2e14fe0c5254105b7b90b01bbf8d61)
> but it seems to be used in the asynchronous export that does not load
> any package, so there I should be using the orgmode version shipped with
> emacs…
> 
> Alan



Just thinking...

2024-03-07 Thread Pedro Andres Aranda Gutierrez
Hi,

duplicating export entries for LaTeX and Beamer makes the interface not
exactly clean.
We do have the LaTeX class, which should be "beamer" (I hope) for Beamer
presentations, right?

So why not use that to decide internally between (org-latex-export-...) and
(org-beamer-...) and then have a unified interaction with the user?

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


Re: Subject: cannot export asynchronously because of org-fold-core--update-buffer-folds

2024-03-07 Thread Pedro Andres Aranda Gutierrez
Hi,

could you please try to add

#+LATEX_CLASS: beamer
#+LATEX_CLASS_OPTIONS: [presentation,aspectratio=169]

instead of

(require 'ox-latex)

(add-to-list 'org-latex-classes
 '("my-beamer"
   "\\documentclass\[presentation,aspectratio=169\]\{beamer\}
[NO-DEFAULT-PACKAGES]"
   ("\\section\{%s\}" . "\\section*\{%s\}")
   ("\\subsection\{%s\}" . "\\subsection*\{%s\}")
   ("\\subsubsection\{%s\}" . "\\subsubsection*\{%s\}")))

and see if that makes any difference?

My .2cents, /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


Emacs slow-down

2024-03-06 Thread Pedro Andres Aranda Gutierrez
Hi

is it just me, or have other people also noticed hiccups when editing org
files with org-mode (main from savannah). The moment I revert to the
org-mode shipped with emacs master, editing returns to normal (and fluid).

Would it make sense to take a closer look at this?

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


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

2024-03-02 Thread Pedro Andres Aranda Gutierrez
Org-lint will signal that… IHvHO that’s more than enough 

Enviado desde mi iPhone

> El 2 mar 2024, a las 13:18, Ihor Radchenko  escribió:
> 
> Pedro Andres Aranda Gutierrez  writes:
> 
>> My question to the list is what is more frequent: slides with an \end{frame}
>> that needs to be appear in the slide
>> or slides w/o it.
>> This should guide the final call on the default value for
>> org-beamer-frame-environment.
> 
> We may further constrain `org-beamer-frame-environment' to be used only
> when frame contents actually contains \end{frame}.
> Will it make sense?
> 
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>



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

2024-03-02 Thread Pedro Andres Aranda Gutierrez
Hi again,

Or, if you feel more comfortable with

(if (string= org-beamer-frame-environment "frame") ""
   ... )

My question to the list is what is more frequent: slides with an \end{frame}
that needs to be appear in the slide
or slides w/o it.
This should guide the final call on the default value for
org-beamer-frame-environment.

Thx again for the patience,
Best, /PA

On Sat, 2 Mar 2024 at 07:39, Pedro Andres Aranda Gutierrez <
paag...@gmail.com> wrote:

> To continue... my first reaction to the bug was to
> (setq org-beamer-frame-environment "frame")
> to test. That resulted in
>
> \newenvironment<>{frame}[1][]{\begin{frame}[environment=frame,#1]}{\end{frame}}
> which is somehow weird and wrong.
>
> This is why I propose to wrap the code in an
> (unless (string= org-beamer-frame-environment "frame") ... )
> so we are protected against people like me ;-)
>
> Best, /PA
>
> On Sat, 2 Mar 2024 at 07:24, Pedro Andres Aranda Gutierrez <
> paag...@gmail.com> wrote:
>
>> Hi Leo,
>>
>> Wouldn't it be wiser to combine you fix with mine. I still think that
>> setting org-beamer-frame-environment to "frame" when you don't need the fix
>> and not emitting the extra newenvironment code in that case makes the
>> generated LaTeX easier to read. Whether the default value should be frame
>> org or orgframe is something we can debate.
>>
>> Best, /PA
>>
>> On Sat, 2 Mar 2024 at 00:12, Leo Butler  wrote:
>>
>>> Hello,
>>>
>>> Thanks for the bug report. The definition of the orgframe environment
>>> did not pass the overlay spec to the underlying frame environment. I
>>> believe the attached patch fixes that.
>>>
>>> Attached is an org file that appears to exercise the patch and show that
>>> it is doing the right thing. Could you confirm this, please?
>>>
>>> 
>>> Incidentally, I did propose that we introduce a BEAMER_FRAME property so
>>> that it could be manually set, but Ihor did not like that idea so it got
>>> scrapped.
>>>
>>> Thanks,
>>> Leo
>>>
>>>
>>
>> --
>> 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
>>
>>
>
> --
> 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
>
>

-- 
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: [BUG] Re: The orgframe construct in the Beamer exporter as a default needs a rethink

2024-03-01 Thread Pedro Andres Aranda Gutierrez
To continue... my first reaction to the bug was to
(setq org-beamer-frame-environment "frame")
to test. That resulted in
\newenvironment<>{frame}[1][]{\begin{frame}[environment=frame,#1]}{\end{frame}}
which is somehow weird and wrong.

This is why I propose to wrap the code in an
(unless (string= org-beamer-frame-environment "frame") ... )
so we are protected against people like me ;-)

Best, /PA

On Sat, 2 Mar 2024 at 07:24, Pedro Andres Aranda Gutierrez <
paag...@gmail.com> wrote:

> Hi Leo,
>
> Wouldn't it be wiser to combine you fix with mine. I still think that
> setting org-beamer-frame-environment to "frame" when you don't need the fix
> and not emitting the extra newenvironment code in that case makes the
> generated LaTeX easier to read. Whether the default value should be frame
> org or orgframe is something we can debate.
>
> Best, /PA
>
> On Sat, 2 Mar 2024 at 00:12, Leo Butler  wrote:
>
>> Hello,
>>
>> Thanks for the bug report. The definition of the orgframe environment
>> did not pass the overlay spec to the underlying frame environment. I
>> believe the attached patch fixes that.
>>
>> Attached is an org file that appears to exercise the patch and show that
>> it is doing the right thing. Could you confirm this, please?
>>
>> 
>> Incidentally, I did propose that we introduce a BEAMER_FRAME property so
>> that it could be manually set, but Ihor did not like that idea so it got
>> scrapped.
>>
>> Thanks,
>> Leo
>>
>>
>
> --
> 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
>
>

-- 
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: [BUG] Re: The orgframe construct in the Beamer exporter as a default needs a rethink

2024-03-01 Thread Pedro Andres Aranda Gutierrez
Hi Leo,

Wouldn't it be wiser to combine you fix with mine. I still think that
setting org-beamer-frame-environment to "frame" when you don't need the fix
and not emitting the extra newenvironment code in that case makes the
generated LaTeX easier to read. Whether the default value should be frame
org or orgframe is something we can debate.

Best, /PA

On Sat, 2 Mar 2024 at 00:12, Leo Butler  wrote:

> Hello,
>
> Thanks for the bug report. The definition of the orgframe environment
> did not pass the overlay spec to the underlying frame environment. I
> believe the attached patch fixes that.
>
> Attached is an org file that appears to exercise the patch and show that
> it is doing the right thing. Could you confirm this, please?
>
> 
> Incidentally, I did propose that we introduce a BEAMER_FRAME property so
> that it could be manually set, but Ihor did not like that idea so it got
> scrapped.
>
> Thanks,
> Leo
>
>

-- 
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: The orgframe construct in the Beamer exporter as a default needs a rethink

2024-03-01 Thread Pedro Andres Aranda Gutierrez
A possible way to preserve the feature (which has its merits in some cases) 
would be the patches attached.

Best, /PA



0001-Don-t-create-new-environment-if-org-beamer-frame-env.patch
Description: Binary data


0002-Set-default-value-of-org-beamer-frame-environment-to.patch
Description: Binary data


0003-Document-new-org-beamer-frame-environment.patch
Description: Binary data


> El 1 mar 2024, a las 17:03, Fraga, Eric  escribió:
> 
> On Friday,  1 Mar 2024 at 12:33, Pedro Andres Aranda Gutierrez wrote:
>> I needed to go back to stock org-mode (as included in Emacs) because
>> the ‘orgframe’ as defined right now kills my slide decks.
>> I have been using the construct
>> 
>> ** Title
>>   :PROPERTIES:
>>   :BEAMER_act: 
>>   :END:
> 
> I do similar and hadn't realised that there had been any breaking
> changes as, I guess, I haven't had to create a new slides since the
> orgframe change came through.  This is a rather serious breaking change
> and would affect hundreds of slides for me (two modules I teach not to
> mention research talks).
> 
>> I don’t know how often the orgframe is needed (I haven’t needed it in
>> the last years of making my presentations with org-mode), but wouldn’t
>> it be more sensible to write
>> 
>> ** Title
>>   :PROPERTIES:
>>   :BEAMER_env: orgframe
>>   :END:
> 
> This sounds reasonable (to me).  I didn't follow the orgframe discussion
> closely so cannot say whether this would achieve what motivated the
> changes.
> 
> -- 
> : Eric S Fraga, with org release_9.6.19-1215-g67d937 in Emacs 30.0.50



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

2024-03-01 Thread Pedro Andres Aranda Gutierrez
HI Eric,

Neither did I,  until I had to do my slide decks ;-) 

Anyhow, since this feature solves issues, we could think about another approach.
A quick and dirty fix would be to check whether org-beamer-frame-environment is 
“frame” 
and if so, not redefine the environment.

The second step in this discussion is whether we want 
org-beamer-frame-environment
To be “orgbeamer” or “beamer" by default. The first meaning most of us would 
need to customize it
or redefine it in a local variable. The second would mean that whenever there 
are ‘weird’ slides
you set the value to “orgframe” or whatever, and that would be it. With a big 
CAVEAT: you
Will not be able to do the / trick on them.

Best, /PA


> El 1 mar 2024, a las 17:03, Fraga, Eric  escribió:
> 
> On Friday,  1 Mar 2024 at 12:33, Pedro Andres Aranda Gutierrez wrote:
>> I needed to go back to stock org-mode (as included in Emacs) because
>> the ‘orgframe’ as defined right now kills my slide decks.
>> I have been using the construct
>> 
>> ** Title
>>   :PROPERTIES:
>>   :BEAMER_act: 
>>   :END:
> 
> I do similar and hadn't realised that there had been any breaking
> changes as, I guess, I haven't had to create a new slides since the
> orgframe change came through.  This is a rather serious breaking change
> and would affect hundreds of slides for me (two modules I teach not to
> mention research talks).
> 
>> I don’t know how often the orgframe is needed (I haven’t needed it in
>> the last years of making my presentations with org-mode), but wouldn’t
>> it be more sensible to write
>> 
>> ** Title
>>   :PROPERTIES:
>>   :BEAMER_env: orgframe
>>   :END:
> 
> This sounds reasonable (to me).  I didn't follow the orgframe discussion
> closely so cannot say whether this would achieve what motivated the
> changes.
> 
> -- 
> : Eric S Fraga, with org release_9.6.19-1215-g67d937 in Emacs 30.0.50




The orgframe construct in the Beamer exporter as a default needs a rethink

2024-03-01 Thread Pedro Andres Aranda Gutierrez
Hi,

I needed to go back to stock org-mode (as included in Emacs) because the 
‘orgframe’ as defined right now kills my slide decks.
I have been using the construct

** Title
   :PROPERTIES:
   :BEAMER_act: 
   :END:

For slides I only want in the presentation and

** Title
   :PROPERTIES:
   :BEAMER_act: 
   :END:

For slides I only want in the handout. With the new orgframe environment as of 
now, the argument between the <> is not passed to the frame and therefore lost.

I don’t know how often the orgframe is needed (I haven’t needed it in the last 
years of making my presentations with org-mode), but wouldn’t it be more 
sensible to write

** Title
   :PROPERTIES:
   :BEAMER_env: orgframe
   :END:

When you really do need it?

Just asking… /PA



Re: Retaking AUTO for \usepackage{fontenc}

2024-02-13 Thread Pedro Andres Aranda Gutierrez
Hi Juan,

neither do I, This is why I'm asking for people to tell me what they use ;-)

best, /PA

On Tue, 13 Feb 2024 at 12:57, Juan Manuel Macías 
wrote:

> Pedro Andres Aranda Gutierrez writes:
>
> > Hi,
> >
> > Next step, @all, please help me filling up the list of codings vs.
> > languages. I currently am somehow confident of the following:
> >
> > greek -> LGR
> > russian -> T2A
>
> The information is in the encguide PDF (you can run texdoc fontenc or
> texdoc encguide). You should look especially at section 2.3 256 glyph
> encodings. I don't know if some languages require more than one
> encoding. Cyrillic appears to be T2A, T2B and T2C. T4 is for
>
> "The African Latin fonts contain in their lower half (0–127) the same
> characters as the European Latin (T1-encoded) Fonts, while in their
> upper half (128–255) they contain letters and symbols for African
> languages that use extended Latin alphabets."
>
> etc.
>
> But I can't find a simpler list anywhere.
>
> Best regards,
>
> Juan Manuel
>
> --
> Juan Manuel Macías -- Composición tipográfica, tratamiento de datos,
> diseño editorial y ortotipografía
>
>

-- 
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: Retaking AUTO for \usepackage{fontenc}

2024-02-12 Thread Pedro Andres Aranda Gutierrez
Hi,

Next step, @all, please help me filling up the list of codings vs.
languages. I currently am somehow confident of the following:

greek -> LGR
russian -> T2A

Thanks for contribs, /PA


On Mon, 12 Feb 2024 at 14:57, Ihor Radchenko  wrote:

> Pedro Andres Aranda Gutierrez  writes:
>
> > I'm trying to put together all pieces for this before I actually write
> code.
> >
> > After looking at the current state, I would be lenient to include an
> > additional optional property to `org-latex-language-alist' I would
> directly
> > call `:fontenc'.
> >
> > \usepackage[AUTO]{fontenc}
> > would then take it to replace AUTO. If this property is not present, the
> > default value would be T1.
> >
> > Opinions?
>
> Sounds reasonable.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>


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


Retaking AUTO for \usepackage{fontenc}

2024-02-11 Thread Pedro Andres Aranda Gutierrez
HI again,

I'm trying to put together all pieces for this before I actually write code.

After looking at the current state, I would be lenient to include an
additional optional property to `org-latex-language-alist' I would directly
call `:fontenc'.

\usepackage[AUTO]{fontenc}
would then take it to replace AUTO. If this property is not present, the
default value would be T1.

Opinions?

Thx, /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


Re: New try at multi-lingual export to latex/pdf using pdflatex and babel

2024-02-10 Thread Pedro Andres Aranda Gutierrez
My .2 cents in line,
/PA

On Sat, 10 Feb 2024 at 15:36, Ihor Radchenko  wrote:

> Pedro Andres Aranda Gutierrez  writes:
>
> > yes, you are right. The whole thread went astray.
> > However, I think it might be interesting to keep this as an alternative
> to
> > the AUTO stuff...
> >
> > Anyhow, I'm open to cancelling the patch
>
> From my point of view, you did not address/reply to
>
> "I think this example doesn't take advantage of the AUTO facility, which
>is what the section is about."
>

I agree it does not take advantage of the AUTO facility here, but I
nevertheless think it would
be interesting to show people how to do this. Until we expand the AUTO
facility to cope with
all quirks of multi-language in pdflatex (lualatex and xetex are a
different pair of shoes), a quick
and dirty alternative may be helpful for people. The introductory text
could be

+An alternative approach using ~pdflatex~ and ~babel~ and mixing Latin and
+Greek fonts in the document using the =\PassOptionsToPackage= command
+from =babel= and avoiding the AUTO keyword would be:

instead of:

+Another example using ~pdflatex~ and ~babel~ and mixing Latin and
+Greek fonts in the document using the =\PassOptionsToPackage= command
+from =babel= would be:

Having this example at hand can solve issues until we fully agree on and
implement
AUTO through all the packages involved in multi-language documents in LaTeX.

@Juan: Thanks again for kicking me awake. I'm moving on most of my projects
to
lualatex ;-)

When you do, we can continue moving the proposed patch forward.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>


-- 
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: New try at multi-lingual export to latex/pdf using pdflatex and babel

2024-02-09 Thread Pedro Andres Aranda Gutierrez
Hi Ihor,

yes, you are right. The whole thread went astray.
However, I think it might be interesting to keep this as an alternative to
the AUTO stuff...

Anyhow, I'm open to cancelling the patch

Best, /PA

On Sat, 10 Feb 2024 at 00:07, Ihor Radchenko  wrote:

> Pedro Andres Aranda Gutierrez  writes:
>
> > Subject: [PATCH] org-manual: Add multi-language babel example
> >
> > org-manual.org: Add multi-language babel example
> >
> > * doc/org-manual.org: Add an example for the LaTeX header commands
> > needed to export multi-language documents to pdflatex. In this case
> > we need to use and configure the babel package appropriately.
>
> AFAIU, Juan's questions about the patch have not been addressed, and the
> discussion branched into a slightly different topic (not changes to the
> manual).
>
> Should I cancel this patch?
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>


-- 
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: Another low-hanging fruit

2024-02-04 Thread Pedro Andres Aranda Gutierrez
Fixed!

On Sun, 4 Feb 2024 at 19:36, Ihor Radchenko  wrote:

> Pedro Andres Aranda Gutierrez  writes:
>
> > Next version of the patch. I've done almost everything.
>
> Thanks!
> You dropped Org mailing list from CC. Was it intentional?
>
> > ... Still need to
> > consider the startup options stuff... but will need more time for that.
>
> It is easy.
> Just add
>
> ("fnanon" org-footnote-auto-label 'anonymous)
>
> to `org-startup-options'.
> And, of course, the manual (just a row in table there).
>
> > +*** Add creation of anonymous footnotes
>
> It is not clear what this is about.
>
> Maybe
>
> *** ~org-footnote-new~ can be configured to insert anonymous footnotes by
> default
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>


-- 
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 0767bccaabde21241576eaac1103e917c7649f40 Mon Feb 05 00:00:00 2024
From: "Pedro A. Aranda Gutiérrez" 
Date: Sat, 5 Feb 2024 07:30:00 +0100
Subject: [PATCH] Silent anonymous footnote creation

* lisp/org-footnote.el: Add symbol `anonymous' to `org-footnote-auto-label'.
With this, anonymous footnotes will be created. This is sometimes useful
in long texts. Mimics \footnote{} in LaTeX. Modify `org-footnote-new'
to generate anonymous footnotes directly.

* lisp/org.el: Add `fnanon' to startup options

* testing/lisp/test-org-footnote.el: Add a test for creation of anonymous
footnotes.

* etc/ORG-NEWS: Announce new anonymous footnote support.

* doc/org-manual.el: Document `fnanon' startup option

---
diff --git a/doc/org-manual.org b/doc/org-manual.org
index 06869fd97..2eb991a4a 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -20381,6 +20381,7 @@ changes.
   | =fnconfirm=  | Offer automatic label for editing or confirmation. |
   | =fnadjust=   | Automatically renumber and sort footnotes. |
   | =nofnadjust= | Do not renumber and sort automatically.|
+  | =fnanon= | Create anonymous footnotes with ~org-footnote-new~.|

   #+vindex: org-hide-block-startup
   #+vindex: org-hide-drawer-startup
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 9847083b3..33a9d51b9 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -917,6 +917,11 @@ Completion is enabled for links to man pages added using ~org-insert-link~:
 =C-c C-l man RET emacscl TAB= to get =emacsclient=.  Of course, the ~ol-man~
 library should be loaded first.

+*** ~org-footnote-new~ can be configured to create anonymous footnotes
+
+Add new value ~anonymous~ for ~org-footnote-auto-label~ to create
+anonymous footnotes automatically with ~org-footnote-new~.
+
 ** New functions and changes in function arguments
 *** New API functions to store data within ~org-element-cache~

diff --git a/lisp/org-footnote.el b/lisp/org-footnote.el
index c9584c3b8..16ab7f279 100644
--- a/lisp/org-footnote.el
+++ b/lisp/org-footnote.el
@@ -137,6 +137,7 @@ Possible values are:

 nilPrompt the user for each label.
 t  Create unique labels of the form [fn:1], [fn:2], etc.
+anonymous  Create anonymous footnotes
 confirmLike t, but let the user edit the created value.
The label can be removed from the minibuffer to create
an anonymous footnote.
@@ -146,6 +147,7 @@ random	   Automatically generate a unique, random label."
 	  (const :tag "Prompt for label" nil)
 	  (const :tag "Create automatic [fn:N]" t)
 	  (const :tag "Offer automatic [fn:N] for editing" confirm)
+	  (const :tag "Create anoymous [fn::]" anonymous)
 	  (const :tag "Create a random label" random))
   :safe #'symbolp)

@@ -666,15 +668,16 @@ or new, let the user edit the definition of the footnote."
 (user-error "Cannot insert a footnote here"))
   (let* ((all (org-footnote-all-labels))
 	 (label
-	  (if (eq org-footnote-auto-label 'random)
-	  (format "%x" (abs (random)))
-	(org-footnote-normalize-label
-	 (let ((propose (org-footnote-unique-label all)))
-	   (if (eq org-footnote-auto-label t) propose
-		 (completing-read
-		  "Label (leave empty for anonymous): "
-		  (mapcar #'list all) nil nil
-		  (and (eq org-footnote-auto-label 'confirm) propose
+  (unless (eq org-footnote-auto-label 'anonymous)
+	(if (eq org-footnote-auto-label 'random)
+	(format "%x" (abs (random)))
+	  (org-footnote-normalize-label
+	   (let ((propose (org-footnote-unique-label a

Another low-hanging fruit

2024-02-02 Thread Pedro Andres Aranda Gutierrez
Hi,

This is another low hanging fruit. I was a bit annoyed to have to leave an
empty label for inlined footnotes (à la LaTeX)... I don't know if this
qualifies as a TINYCHANGE...

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 0767bccaabde21241576eaac1103e917c7649f40 Mon Sep 17 00:00:00 2001
From: "Pedro A. Aranda Gutiérrez" 
Date: Sat, 3 Feb 2024 08:12:12 +0100
Subject: [PATCH] Silent anonymous footnote creation

* lisp/org-footnote.el: Add symbol anonymous to `org-footnote-auto-label'.
With this, anonymous footnotes will be created. This is sometimes more
useful in long texts. Mimics \footnote{} in LaTeX.

---
 lisp/org-footnote.el | 21 -
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/lisp/org-footnote.el b/lisp/org-footnote.el
index c9584c3b8..b0b392122 100644
--- a/lisp/org-footnote.el
+++ b/lisp/org-footnote.el
@@ -137,6 +137,7 @@ Possible values are:

 nilPrompt the user for each label.
 t  Create unique labels of the form [fn:1], [fn:2], etc.
+anonymous  Create anonymous labels
 confirmLike t, but let the user edit the created value.
The label can be removed from the minibuffer to create
an anonymous footnote.
@@ -146,6 +147,7 @@ random	   Automatically generate a unique, random label."
 	  (const :tag "Prompt for label" nil)
 	  (const :tag "Create automatic [fn:N]" t)
 	  (const :tag "Offer automatic [fn:N] for editing" confirm)
+	  (const :tag "Create anoymous [fn::]" anonymous)
 	  (const :tag "Create a random label" random))
   :safe #'symbolp)

@@ -666,15 +668,16 @@ or new, let the user edit the definition of the footnote."
 (user-error "Cannot insert a footnote here"))
   (let* ((all (org-footnote-all-labels))
 	 (label
-	  (if (eq org-footnote-auto-label 'random)
-	  (format "%x" (abs (random)))
-	(org-footnote-normalize-label
-	 (let ((propose (org-footnote-unique-label all)))
-	   (if (eq org-footnote-auto-label t) propose
-		 (completing-read
-		  "Label (leave empty for anonymous): "
-		  (mapcar #'list all) nil nil
-		  (and (eq org-footnote-auto-label 'confirm) propose
+  (unless (eq org-footnote-auto-label 'anonymous)
+	(if (eq org-footnote-auto-label 'random)
+	(format "%x" (abs (random)))
+	  (org-footnote-normalize-label
+	   (let ((propose (org-footnote-unique-label all)))
+	 (if (eq org-footnote-auto-label t) propose
+		   (completing-read
+		"Label (leave empty for anonymous): "
+		(mapcar #'list all) nil nil
+		(and (eq org-footnote-auto-label 'confirm) propose)
 (cond ((not label)
 	   (insert "[fn::]")
 	   (backward-char 1))
--
2.34.1


Re: [RFC] LaTeX - automatically configure encoding when exporting non-Latin languages

2024-02-02 Thread Pedro Andres Aranda Gutierrez
Hi,

I’m just trying to cover the “legacy” latex.
I’ve finally migrated to lualatex for my stuff, and it has really been 
worthwhile. But who knows what a conference might want me to use ;-P

Differentiating between pdflatex and lualatex was what my last patch was for.

I also sent a PoC for the fontenc stuff a couple of weeks ago. And I was trying 
to continue this work and collect info needed for handling fontenc when you 
need pdflatex as your latex compiler.

Best, /PA

> El 2 feb 2024, a las 17:18, Juan Manuel Macías  
> escribió:
> 
> Ihor Radchenko writes:
> 
>> #+LANGUAGE: fa
>> #+LaTeX_Header: \usepackage[AUTO]{polyglossia}
>> 
>> #+latex_header: \usepackage[AUTO]{fontspec}
> 
> I think Pedro is referring to fontenc not fontspec. fontenc cannot be
> used in either lualatex or XelaTeX. fontspec is for advanced selection
> of truetype and opentype fonts in XeLatex and LuaLaTeX and setting
> opentype properties. fontenc is for 'pre-Unicode' LaTeX font encoding. I
> would say that what Pedro proposes is limited only to the output in
> pdfTeX.
> 
> -- 
> Juan Manuel Macías -- Composición tipográfica, tratamiento de datos, diseño 
> editorial y ortotipografía
> 




Re: RFI: LaTeX - AUTO for \usepackage{inputenc}

2024-02-01 Thread Pedro Andres Aranda Gutierrez
Yes, indeed...
Thx for pointing out
/PA

On Thu, 1 Feb 2024 at 17:31, Ihor Radchenko  wrote:

> Pedro Andres Aranda Gutierrez  writes:
>
> > some days ago I sent a proof-of-concept for customising the coding for
> the
> > inputenc package. Before continuing with this, I'd like to know what
> other
> > people think and/or need.
>
> Did you mean fontenc?
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>


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


RFI: LaTeX - AUTO for \usepackage{inputenc}

2024-01-31 Thread Pedro Andres Aranda Gutierrez
HI,

some days ago I sent a proof-of-concept for customising the coding for the
inputenc package. Before continuing with this, I'd like to know what other
people think and/or need.

The simplest approach was in the PoC: a custom variable you can set in your
document/workspace/emacs configuration. AN alternative approach would be to
derive it from language.

What would be the best way to go forward?

Thx, /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


Re: An academic journal made entirely in Org-Mode

2024-01-30 Thread Pedro Andres Aranda Gutierrez
Wow! Biggest round of applause :-)

Congrats!, /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


Re: New try at multi-lingual export to latex/pdf using pdflatex and babel

2024-01-29 Thread Pedro Andres Aranda Gutierrez
OK, fine with me...
/PA

On Mon, 29 Jan 2024 at 15:47, Ihor Radchenko  wrote:

> Pedro Andres Aranda Gutierrez  writes:
>
> > Awesome, thanks! Could we back-port that to the emacs-sync tree? The
> sooner
> > we have it emacs for
> > people to use, the better
>
> I do not view this as a trivial or critical change. Hence, for next
> release only.
> See https://orgmode.org/worg/org-maintenance.html#branches
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>


-- 
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: New try at multi-lingual export to latex/pdf using pdflatex and babel

2024-01-29 Thread Pedro Andres Aranda Gutierrez
Awesome, thanks! Could we back-port that to the emacs-sync tree? The sooner
we have it emacs for
people to use, the better

On Mon, 29 Jan 2024 at 14:25, Ihor Radchenko  wrote:

> Pedro Andres Aranda Gutierrez  writes:
>
> > From: "Pedro A. Aranda Gutierrez" 
> > Date: Sun, 28 Jan 2024 17:51:23 +0100
> > Subject: [PATCH] Refine packages for font management
>
> Thanks!
> Applied, onto main. I cleaned up irrelevant whitespace changes and
> amended the commit message, adding double space between sentences,
> fixing the changelog entry, and indicating what part of Org the patch
> changes in the first line.
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=a4a880d1f
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>


-- 
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: New try at multi-lingual export to latex/pdf using pdflatex and babel

2024-01-28 Thread Pedro Andres Aranda Gutierrez
No worries.. next try ;-)

Best, /PA

On Sun, 28 Jan 2024 at 14:43, Ihor Radchenko  wrote:

> Pedro Andres Aranda Gutierrez  writes:
>
> >> "Pedro A. Aranda"  writes:
> >>
> >> > I've been reading a bit. What I propose is an alternative way to
> handle
> >> > all the tricky parts of font and character handling with fontspec in
> >> > lualatex and xetex. This package restricts the use of the ams*
> packages
> >> > to pdflatex, because fontenc handles that internally and produces
> >> > package collisions.
> >>
> >> > Attached is the final version of the patch.
> >>
> >> Thanks!
> >> May you also add a comment to the code explaining the rationale right
> >> there?
>
> > Here you are. I hope the couple of words suffice ;-)
>
> Sorry, I was not clear.
> I did not mean to ask about amending the docstring.
> I meant literal code comments, explaining why we have duplicate amsmath
> entries and why we restrict certain packages to specific compilers.
>
> Also, the above quoted paragraph with rationale of the patch should go
> into the commit message. See
> https://orgmode.org/worg/org-contribute.html#commit-messages
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>


-- 
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 0beed8846195717e6db051033cac8fd942f89c53 Mon Sep 17 00:00:00 2001
From: "Pedro A. Aranda Gutierrez" 
Date: Sun, 28 Jan 2024 17:51:23 +0100
Subject: [PATCH] Refine packages for font management

* lisp/org.el: Change `org-latex-default-packages-alist' to
refine font management depending on the latex compiler.

Differentiate between pdflatex and lualatex/xetex
packages for font management. lualatex/xetex should use
fontspec instead of fontenc/inputenc. When using
fontspec, you need to load amsmath before fontspec 
and you don't need amssymb.
  
---

 lisp/org.el | 26 +-
 1 file changed, 17 insertions(+), 9 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 796545392..539a128f1 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -3421,15 +3421,21 @@ header, or they will be appended."
 	  (default-value var)))
 
 (defcustom org-latex-default-packages-alist
-  '(("AUTO" "inputenc"  t ("pdflatex"))
+  '(;; amsmath before fontspec for lualatex and xetex
+("" "amsmath"   t ("lualatex" "xetex"))
+;; fontspec ASAP for lualatex and xetex
+("" "fontspec"  t ("lualatex" "xetex"))
+;; inputenc and fontenc are for pdflatex only
+("AUTO" "inputenc"  t ("pdflatex"))
 ("T1"   "fontenc"   t ("pdflatex"))
 ("" "graphicx"  t)
 ("" "longtable" nil)
 ("" "wrapfig"   nil)
 ("" "rotating"  nil)
 ("normalem" "ulem"  t)
-("" "amsmath"   t)
-("" "amssymb"   t)
+;; amsmath and amssymb after inputenc/fontenc for pdflatex
+("" "amsmath"   t ("pdflatex"))
+("" "amssymb"   t ("pdflatex"))
 ("" "capt-of"   nil)
 ("" "hyperref"  nil))
   "Alist of default packages to be inserted in the header.
@@ -3440,7 +3446,9 @@ incompatibility with another package you are using.
 The packages in this list are needed by one part or another of
 Org mode to function properly:
 
+- fontspec: for font and character selection in lualatex and xetex
 - inputenc, fontenc:  for basic font and character selection
+  in pdflatex
 - graphicx: for including images
 - longtable: For multipage tables
 - wrapfig: for figure placement
@@ -3448,8 +3456,8 @@ Org mode to function properly:
 - ulem: for underline and strike-through
 - amsmath: for subscript and superscript and math environments
 - amssymb: for various symbols used for interpreting the entities
-  in `org-entities'.  You can skip some of this package if you don't
-  use any of the symbols.
+  in `org-entities'.  You can skip some of this package if you
+  don't use any of the symbols.
 - capt-of: for captions outside of floats
 - hyperref: for cross references
 
@@ -15211,20 +15219,20 @@ INCREMENT-STEP divisor."
 	(set

Re: Re: [BUG] beamer export

2024-01-27 Thread Pedro Andres Aranda Gutierrez
Hi

CAVEAT EMPTOR: Although it’s some years that I have been using org to create my 
slides, I never needed this… Interesting to learn new things ;-) 

I personally would not oppose to have a customizable org-frame-environment 
variable, with its default value being “frame”. 
Then, when actually emitting the code, add something like:

(unless (string= org-frame-environment “frame”
 …)

Which would create the code most of us would expect (i.e. 
\begin{frame}…\end{frame}) in almost any case except when you really need the 
`newenvironment’ construct.

My .02 cents, /PA

> El 27 ene 2024, a las 18:00, emacs-orgmode-requ...@gnu.org escribió:
> 
> Message: 2
> Date: Fri, 26 Jan 2024 20:54:17 +
> From: Leo Butler mailto:leo.but...@umanitoba.ca>>
> To: Ihor Radchenko mailto:yanta...@posteo.net>>
> Cc: Ihor Radchenko mailto:yanta...@gmail.com>>, Daniel 
> Fleischer
>   mailto:danfl...@gmail.com>>, Org Mode Mailing List 
> mailto:emacs-orgmode@gnu.org>>
> Subject: Re: [BUG] beamer export
> Message-ID: <87wmrvlsso@t14.reltub.ca 
> >
> Content-Type: text/plain; charset="iso-8859-1"
> 
> On Fri, Jan 26 2024, Ihor Radchenko  > wrote:
> 
>> Leo Butler mailto:leo.but...@umanitoba.ca>> writes:
>> 
 Apparently, LaTeX has really hard time processing verbatim code inside
 beamer frames.
>>> 
>>> I looked again at the solution here:
>>> https://tex.stackexchange.com/questions/140719/verbatim-in-beamer-showing-error-file-ended-while-scanning-use-of-xverbatim
>>>  
>>> 
>>> 
>>> and it errors out with a recent version of pdflatex:
>>> 
>>>   This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023/Debian) 
>>> (preloaded format=pdflatex)
>>> 
>>> This is, apparently, a known problem:
>>> 
>>> https://github.com/josephwright/beamer/issues/360 
>>> 
>>> 
>>> The end of that issue report includes a work-around that we might apply
>>> in org. I have attached a patch for your feedback. The example that
>>> stimulated this discussion compiles with the patch and the testsuite
>>> shows no errors related to it.
>> 
>> Thanks!
>> I have concerns about your approach though.
>> 
>> You are replacing all the frame environments with custom environment
>> unconditionally. However, custom environment has downsides. For example,
>> \againframe will stop working, as pointed earlier in the linked beamer
>> thread
>> https://github.com/josephwright/beamer/issues/360#issuecomment-708705250 
>> 
> 
> The comment that you are citing shows how to define the custom
> environment so that \againframe works correctly. See the attachment
> `beamer-example-againframe.tex' and pdf. You can see that \againframe
> works with the custom environment.
> 
>> 
>> Since the problem appears only when the frame contents contains
>> \end{frame}, it may be sufficient to replace the standard frame
>> environment with the workaround only in such scenario.
> 
> Yes, that might be true. But my feeling is that it would be simpler and
> more robust to use the custom frame environment in most cases.
> 
>> 
>>> +;; Needed to set-up Beamer export.
>>> +(defconst org-beamer--frame-environment
>>> +  (concat "orgframe" (org-id-uuid))
>>> +  "Name of the beamer frame environment.
>>> +This is randomized to prevent collisions.")
>> 
>> Please use constant name. (org-id-uuid) makes export randomized for no
>> good reason.
> 
> There is a good reason to randomize (or at least make customize-able)
> the environment name: so that beamer code generated by ox-beamer can be
> safely inserted into org files and exported by ox-beamer. With a fixed
> name for the environment, we will have just recreated the original
> source of the bug report. As a compromise, in the attached patch, I have
> made the environment name customize-able.
> 
>> 
>>> ;; Install a default set-up for Beamer export.
>>> (unless (assoc "beamer" org-latex-classes)
>>>   (add-to-list 'org-latex-classes
>>> -  '("beamer"
>>> -"\\documentclass[presentation]{beamer}"
>>> +  `("beamer"
>>> +,(concat "\\documentclass[presentation]{beamer}\n"
>>> +  ;; Define an alias for the beamer frame 
>>> environment
>>> + "\\newenvironment<>{"
>>> + org-beamer--frame-environment
>>> + "}[1][]{\\begin{frame}[environment="
>>> + org-beamer--frame-environment
>>> + ",#1]}{\\end{frame}}")
>> 
>> Please use `org-beamer-template' rather than modifying the class.
>> Modifying the class may confuse users.
> 
> Ok, I have done so.
> 
> The docstring of `org-latex-classes' says:
> 
>The HEADER-STRING is the header that will be 

Re: New try at multi-lingual export to latex/pdf using pdflatex and babel

2024-01-26 Thread Pedro Andres Aranda Gutierrez
Hi,

Here you are. I hope the couple of words suffice ;-)

Best, /PA

On Fri, 26 Jan 2024 at 14:25, Ihor Radchenko  wrote:

> "Pedro A. Aranda"  writes:
>
> > I've been reading a bit. What I propose is an alternative way to handle
> > all the tricky parts of font and character handling with fontspec in
> > lualatex and xetex. This package restricts the use of the ams* packages
> > to pdflatex, because fontenc handles that internally and produces
> > package collisions.
>
> > Attached is the final version of the patch.
>
> Thanks!
> May you also add a comment to the code explaining the rationale right
> there?
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>


-- 
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 cc6ea05f1fc31aafb3db737bf033086422aa770f Mon Sep 17 00:00:00 2001
From: "Pedro A. Aranda" 
Date: Fri, 26 Jan 2024 18:46:14 +0100
Subject: [PATCH] Refine font management for lualatex and xetex

---
 lisp/org.el | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

lisp/org.el: Use fontspec for lualatex and xetex in 
  org-latex-default-packages-alist

diff --git a/lisp/org.el b/lisp/org.el
index 796545392..24ef515f9 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -3421,15 +3421,17 @@ header, or they will be appended."
 	  (default-value var)))
 
 (defcustom org-latex-default-packages-alist
-  '(("AUTO" "inputenc"  t ("pdflatex"))
+  '(("" "amsmath"   t ("lualatex" "xetex"))
+("" "fontspec"  t ("lualatex" "xetex"))
+("AUTO" "inputenc"  t ("pdflatex"))
 ("T1"   "fontenc"   t ("pdflatex"))
 ("" "graphicx"  t)
 ("" "longtable" nil)
 ("" "wrapfig"   nil)
 ("" "rotating"  nil)
 ("normalem" "ulem"  t)
-("" "amsmath"   t)
-("" "amssymb"   t)
+("" "amsmath"   t ("pdflatex"))
+("" "amssymb"   t ("pdflatex"))
 ("" "capt-of"   nil)
 ("" "hyperref"  nil))
   "Alist of default packages to be inserted in the header.
@@ -3440,6 +3442,8 @@ incompatibility with another package you are using.
 The packages in this list are needed by one part or another of
 Org mode to function properly:
 
+- fontspec: for font ans character selection in lualatex and xetex
+if you use fontspec, you need to add amsmath /before/
 - inputenc, fontenc:  for basic font and character selection
 - graphicx: for including images
 - longtable: For multipage tables
-- 
2.34.1



Re: New try at multi-lingual export to latex/pdf using pdflatex and babel

2024-01-25 Thread Pedro A. Aranda

Hi

I've been reading a bit. What I propose is an alternative way to handle 
all the tricky parts of font and character handling with fontspec in 
lualatex and xetex. This package restricts the use of the ams* packages 
to pdflatex, because fontenc handles that internally and produces 
package collisions.


Attached is the final version of the patch.

Best, /PA

On 25/1/24 14:41, Ihor Radchenko wrote:

"Pedro A. Aranda"  writes:


As stated, this was only a PoC. If you find it useful, I would give it a
go in the free window.

I understand.
My question is to clarify how useful it is.
Because I am not deeply familiar with how fontenc works for non-English
languages, it is hard to judge how useful it will be in practice.


... I'm also playing with
org-latex-default-packages-alist, refining it to use fontspec in
lualatex and xetex and restricting inputenc and fontenc to pdflatex only.

Aren't inputenc and fontenc already restricted to pdflatex only?
From 481a35750fcb4098fe469efc80623c5c289b6f9f Mon Sep 17 00:00:00 2001
From: "Pedro A. Aranda" 
Date: Thu, 25 Jan 2024 17:47:15 +0100
Subject: [PATCH] Refine font management for lualatex and xetex

---
 lisp/org.el | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

 lisp/org.el: switch to fontspec for character and font management
   in lualatex and xetex. This implies explicitly importing the
   ams* packages is only needed with pdflatex.

diff --git a/lisp/org.el b/lisp/org.el
index cf9abafac..f50531e7e 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -3402,15 +3402,16 @@ header, or they will be appended."
 	  (default-value var)))

 (defcustom org-latex-default-packages-alist
-  '(("AUTO" "inputenc"  t ("pdflatex"))
+  '(("" "fontspec"  t ("lualatex" "xetex"))
+("AUTO" "inputenc"  t ("pdflatex"))
 ("T1"   "fontenc"   t ("pdflatex"))
 ("" "graphicx"  t)
 ("" "longtable" nil)
 ("" "wrapfig"   nil)
 ("" "rotating"  nil)
 ("normalem" "ulem"  t)
-("" "amsmath"   t)
-("" "amssymb"   t)
+("" "amsmath"   t ("pdflatex"))
+("" "amssymb"   t ("pdflatex"))
 ("" "capt-of"   nil)
 ("" "hyperref"  nil))
   "Alist of default packages to be inserted in the header.
@@ -3421,6 +3422,7 @@ incompatibility with another package you are using.
 The packages in this list are needed by one part or another of
 Org mode to function properly:

+- fontspec: for font ans character selection in lualatex and xetex
 - inputenc, fontenc:  for basic font and character selection
 - graphicx: for including images
 - longtable: For multipage tables
--
2.34.1


Re: New try at multi-lingual export to latex/pdf using pdflatex and babel

2024-01-24 Thread Pedro A. Aranda

Hi again

As stated, this was only a PoC. If you find it useful, I would give it a 
go in the free window. I'm also playing with 
org-latex-default-packages-alist, refining it to use fontspec in 
lualatex and xetex and restricting inputenc and fontenc to pdflatex only.


Best, /PA

On 24/1/24 17:25, Ihor Radchenko wrote:

Pedro Andres Aranda Gutierrez  writes:


Attached is a _proof of concept_ for supporting AUTO in
\usepackage{fontenc}. Just an idea of how things could evolve.
This only uses a variable you can define as directory or file local to
control what is generated in the LaTeX file.
Could be expanded in the future to check #+language:

Thanks!


+(defcustom org-latex-fontenc "T1"
+  "The fontenc for the file. Customise to LGR,T1 when including
+Greek, etc."
+  :group 'org-export-latex
+  :type 'string
+  :safe #'stringp)

Is there a list of available values somewhere?
https://latexref.xyz/fontenc-package.html only lists OT1, OMS, OML, T1,
and TS1. However, many more are clearly available.





Re: New try at multi-lingual export to latex/pdf using pdflatex and babel

2024-01-22 Thread Pedro Andres Aranda Gutierrez
Hi,

Attached is a _proof of concept_ for supporting AUTO in
\usepackage{fontenc}. Just an idea of how things could evolve.
This only uses a variable you can define as directory or file local to
control what is generated in the LaTeX file.
Could be expanded in the future to check #+language:

Best, /PA

On Mon, 22 Jan 2024 at 14:40, Juan Manuel Macías 
wrote:

> Ihor Radchenko writes:
>
> > Juan Manuel Macías  writes:
> >
> >> Pedro Andres Aranda Gutierrez writes:
> >>
> >>> +#+begin_example
> >>> +,#+latex_class_options: [greek,spanish,oneside]
> >>> +,#+language: es
> >>> +,#+latex_header: \PassOptionsToPackage{main=spanish}{babel}
> >>> +,#+latex_header: \usepackage{alphabeta} % to support greek script
> >>> +#+end_example
> >>
> >> I think this example doesn't take advantage of the AUTO facility, which
> >> is what the section is about.
>
> > Do you have any suggestions how to improve the patch?
>
> I would give an example that did include the AUTO 'facility', to unify
> with the rest of the examples in the section:
>
> #+language: es
> #+latex_header: \usepackage[greek,ngerman,AUTO]{babel}
> #+latex_header: \usepackage{alphabeta} % to support greek script
>
> It is also said in the patch that this example is for pdfTeX, but it
> works equally well for LuaTeX and XeTeX, since Babel and alphabeta
> packages support both engines. However, the alphabeta package is not a
> specific package for writing texts in Greek. Rather, according to the
> package documentation: "The alphabeta package makes the standard macros
> for Greek letters in mathematical mode also available in text mode." In
> pdfTeX it is useful because you can enter the Greek input directly in
> Unicode. But in LuaTeX or XeTeX it would be unnecessary, since Greek can
> be written directly, without the help of additional packages.
>
> >> ... Btw, maybe it would be nice to extend ''AUTO'' to
> >> latex_class_options and \PassOptionsToPackage? Something like:
> >
> > It would really be nice to have an ox-latex maintainer who is deeply
> > familiar with LaTeX :)
>
> My knowledge of LaTeX (and Elisp) has huge gaps :-). Of course, I am
> willing to learn everything I can. And, naturally, I would like to help
> in any way I can. But my main problem (currently) is the lack of time to
> dedicate myself to it. My presence on this list is intermittent, and
> that for a maintainer is horrible. Maybe in a few months (spring
> perhaps), when my personal situation stabilizes a little, I could
> consider it...
>
> Best regards,
>
> Juan Manuel
>
>

-- 
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 66634498275a4dbea4cb8dc225db28bdea1bdf1a Mon Sep 17 00:00:00 2001
From: "Pedro A. Aranda" 
Date: Tue, 23 Jan 2024 08:31:46 +0100
Subject: [PATCH] PoC: support AUTO for the fontenc package in LaTeX exports

* lisp/org.el: Add `org-latex-fontenc' to support translation for
  \usepackage[AUTO]{fontenc}

* lisp/ox-latex.el: Implement rudimentary translation for the above

---
 lisp/org.el  | 17 -
 lisp/ox-latex.el | 36 
 2 files changed, 36 insertions(+), 17 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index cf9abafac..d4356e15d 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -3401,9 +3401,16 @@ header, or they will be appended."
 	  x))
 	  (default-value var)))
 
+(defcustom org-latex-fontenc "T1"
+  "The fontenc for the file. Customise to LGR,T1 when including
+Greek, etc."
+  :group 'org-export-latex
+  :type 'string
+  :safe #'stringp)
+
 (defcustom org-latex-default-packages-alist
   '(("AUTO" "inputenc"  t ("pdflatex"))
-("T1"   "fontenc"   t ("pdflatex"))
+("AUTO" "fontenc"   t ("pdflatex"))
 ("" "graphicx"  t)
 ("" "longtable" nil)
 ("" "wrapfig"   nil)
@@ -15159,20 +15166,20 @@ INCREMENT-STEP divisor."
 	(setq hour (mod hour 24))
 	(setq pos-match-group 1
   new (format "-%02d:%02d" hour minute)))
-   
+
((org-pos-in-match-range pos 6) ;; POS on "dmwy" repeater char.
 	(setq pos-match-group 6
   new (car (rassoc (+ nincrements (cdr (assoc (match-string 6 ts-string) idx))) idx
-   
+
((org-pos-in-match-range pos 5) ;; POS on X in "Xd" repeater.
 	(setq pos-match-group 5
   ;; Never drop below X=1.
  

Re: New try at multi-lingual export to latex/pdf using pdflatex and babel

2024-01-21 Thread Pedro Andres Aranda Gutierrez
PS: This is a very limited example. It would be nice to have more control
on fontenc. AFAIK there is not alphabeta for cyrillic encodings and
typesetting 'War and Peace' with its passages in French embedded in the
Russian text is sort of a headache ;-)

/PA

On Mon, 22 Jan 2024 at 07:30, Pedro Andres Aranda Gutierrez <
paag...@gmail.com> wrote:

> HI Juan Manuel,
>
> you are absolutely right. There are many things that should improve in the
> LaTeX exporter and simplifying language treatment is one of them. What I
> show in my example is how to circumvent all the limitations in the exporter
> and give a working example for people who need it.
>
>  Adding AUTO to latex_class_options would be extremely helpful, since then
> you can load babel indicating the main language only and even avoid the
> PassOptions and can live with \usepackage{alphabeta} only.
> This is a MWE for mixing German and Greek which I use to compare with what
> org-mode generates:
>
> ---cut---
> \documentclass[greek,ngerman]{scrartcl}
> %% \documentclass[greek,ngerman]{scrreprt}
> %% \documentclass[greek,ngerman]{scrbook}
> %% \documentclass[greek,ngerman]{article}
> \usepackage[utf8]{inputenc}
> \usepackage[T1]{fontenc}
> \usepackage[ngerman]{babel}
> %% \PassOptionsToPackage{main=ngerman}{babel}
> \usepackage{alphabeta}
>
> \begin{document}
> Ach, unsere Freunde die Griechen: \textgreek{νους} (mit
> \verb|\textgreek{}|).\par
> Ach, unsere Freunde die Griechen: νους (direkt im Text).
> \end{document}
> ---cut---
> The commented document classes are all I had the time to test.
>
> Best, /PA
>
>
> On Sun, 21 Jan 2024 at 18:47, Juan Manuel Macías 
> wrote:
>
>> Pedro Andres Aranda Gutierrez writes:
>>
>> > +#+begin_example
>> > +,#+latex_class_options: [greek,spanish,oneside]
>> > +,#+language: es
>> > +,#+latex_header: \PassOptionsToPackage{main=spanish}{babel}
>> > +,#+latex_header: \usepackage{alphabeta} % to support greek script
>> > +#+end_example
>>
>> I think this example doesn't take advantage of the AUTO facility, which
>> is what the section is about. Btw, maybe it would be nice to extend
>> ''AUTO'' to
>> latex_class_options and \PassOptionsToPackage? Something like:
>>
>> #+latex_class_options: [greek,AUTO,oneside]
>> #+language: es
>> ...
>>
>> However, I would only find the \PassOptionsToPackage command useful in
>> classes that already load babel with a main language. From Org, using
>> just pdfTeX, I think it would be simpler:
>>
>> #+language: es
>> #+latex_header: \usepackage[greek,AUTO]{babel}
>> #+latex_header: \usepackage{alphabeta} % to support greek script
>>
>> or this variant, using babelprovide and an INI file:
>>
>> #+language: es
>> #+latex_header: \usepackage[greek]{babel}
>> #+latex_header: \babelprovide[import,main]{AUTO}
>> #+latex_header: \usepackage{alphabeta}
>>
>> Best regards,
>>
>> Juan Manuel
>>
>>
>>
>
> --
> 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
>
>

-- 
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: New try at multi-lingual export to latex/pdf using pdflatex and babel

2024-01-21 Thread Pedro Andres Aranda Gutierrez
HI Juan Manuel,

you are absolutely right. There are many things that should improve in the
LaTeX exporter and simplifying language treatment is one of them. What I
show in my example is how to circumvent all the limitations in the exporter
and give a working example for people who need it.

 Adding AUTO to latex_class_options would be extremely helpful, since then
you can load babel indicating the main language only and even avoid the
PassOptions and can live with \usepackage{alphabeta} only.
This is a MWE for mixing German and Greek which I use to compare with what
org-mode generates:

---cut---
\documentclass[greek,ngerman]{scrartcl}
%% \documentclass[greek,ngerman]{scrreprt}
%% \documentclass[greek,ngerman]{scrbook}
%% \documentclass[greek,ngerman]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
%% \PassOptionsToPackage{main=ngerman}{babel}
\usepackage{alphabeta}

\begin{document}
Ach, unsere Freunde die Griechen: \textgreek{νους} (mit
\verb|\textgreek{}|).\par
Ach, unsere Freunde die Griechen: νους (direkt im Text).
\end{document}
---cut---
The commented document classes are all I had the time to test.

Best, /PA


On Sun, 21 Jan 2024 at 18:47, Juan Manuel Macías 
wrote:

> Pedro Andres Aranda Gutierrez writes:
>
> > +#+begin_example
> > +,#+latex_class_options: [greek,spanish,oneside]
> > +,#+language: es
> > +,#+latex_header: \PassOptionsToPackage{main=spanish}{babel}
> > +,#+latex_header: \usepackage{alphabeta} % to support greek script
> > +#+end_example
>
> I think this example doesn't take advantage of the AUTO facility, which
> is what the section is about. Btw, maybe it would be nice to extend
> ''AUTO'' to
> latex_class_options and \PassOptionsToPackage? Something like:
>
> #+latex_class_options: [greek,AUTO,oneside]
> #+language: es
> ...
>
> However, I would only find the \PassOptionsToPackage command useful in
> classes that already load babel with a main language. From Org, using
> just pdfTeX, I think it would be simpler:
>
> #+language: es
> #+latex_header: \usepackage[greek,AUTO]{babel}
> #+latex_header: \usepackage{alphabeta} % to support greek script
>
> or this variant, using babelprovide and an INI file:
>
> #+language: es
> #+latex_header: \usepackage[greek]{babel}
> #+latex_header: \babelprovide[import,main]{AUTO}
> #+latex_header: \usepackage{alphabeta}
>
> Best regards,
>
> Juan Manuel
>
>
>

-- 
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: New try at multi-lingual export to latex/pdf using pdflatex and babel

2024-01-21 Thread Pedro Andres Aranda Gutierrez
Thanks for the feedback, attached is a new version

Best, /PA

On Sun, 21 Jan 2024 at 13:59, Ihor Radchenko  wrote:

> Pedro Andres Aranda Gutierrez  writes:
>
> > hopefully this is more informative. It complements the =polyglossia=
> > example with some =babel= that can be compiled with pdflatex.
>
> Thanks!
> Several minor comments.
>
> > From 4d0dcde4f8f149d3d028164c3cd3c8e9bff2a060 Mon Sep 17 00:00:00 2001
> > From: "Pedro A. Aranda" 
> > Date: Sun, 21 Jan 2024 09:39:35 +0100
> > Subject: [PATCH] Add multi-language babel example
>
> Please indicate that the patch deals with the manual in the first line:
>
>   org-manual: Add multi-language babel example
>
> And add the changelog entry.
>
> > +Another example using ~pdflatex~ and ~babel~ and mixing Latin and
>
> =pdflatex= and =babel= I think - we use ~...~ mostly for Elisp code.
>
> > +Greek fonts in the document using the =\PassOptionsToPackage= command
> > +from =babel= would be:
> > +
> > +#+begin_example
> > +,#+latex_class_options: [greek,spanish,oneside]
> > +,#+language: es
> > +,#+latex_header: \PassOptionsToPackage{main=spanish}{babel}
> > +,#+latex_header: \usepackage{alphabeta} % to support greek script
> > +#+end_example
> > +
> > +Note that you can add more options to the ~latex_class_options~.
>
> =#+latex_class_options:=
>
> > +The important thing is that you include the *translated* name
>
> Maybe just /translated/? Bold is usually considered too strong
> typographically.
>
> Also, I do not really understand what you mean by "translated" here.
>
> > +for the =#+language:# you specify in the other commands for
>
> =#+language:=
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>


-- 
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 d540ad65d228bfb31a672cc1f7a771504cb3f58c Mon Sep 17 00:00:00 2001
From: "Pedro A. Aranda" 
Date: Sun, 21 Jan 2024 18:06:19 +0100
Subject: [PATCH] org-manual: Add multi-language babel example

org-manual.org: Add multi-language babel example

* doc/org-manual.org: Add an example for the LaTeX header commands
needed to export multi-language documents to pdflatex. In this case
we need to use and configure the babel package appropriately.

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

diff --git a/doc/org-manual.org b/doc/org-manual.org
index acc6d07ff..71cc8b1a1 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -13925,6 +13925,10 @@ general options (see [[*Export Settings]]).
'("AUTO" "polyglossia" t ("xelatex" "lualatex")))
   #+end_src
 
+  The value used for =babel= or =polyglossia= is set in
+  ~org-export-default-language~. The default value is ~"en"~, which
+  means American English.
+
 - =LATEX_CLASS= ::
 
   #+cindex: @samp{LATEX_CLASS}, keyword
@@ -14079,6 +14083,37 @@ the =\babelprovide= command:
 ,#+LATEX_HEADER: \babelprovide[import, main]{AUTO}
 #+end_example
 
+Another example using =pdflatex= and =babel= and mixing Latin and
+Greek fonts in the document using the =\PassOptionsToPackage= command
+from =babel= would be:
+
+#+begin_example
+,#+latex_class_options: [greek,spanish,oneside]
+,#+language: es
+,#+latex_header: \PassOptionsToPackage{main=spanish}{babel}
+,#+latex_header: \usepackage{alphabeta} % to support greek script
+#+end_example
+
+Note that you can add more options to the ~latex_class_options~.
+You need to include the language resulting from translating the
+=#+language:= statement in the other commands in your LaTeX header.
+In the previous example
+
+#+begin_example
+,#+language: es
+#+end_example
+
+is translated to
+
+#+begin_example
+\usepackage[spanish]{babel}
+#+end_example
+
+and =spanish= is used for the other header commands and in the
+=#+latex_class_options=.
+
+
+
 =Polyglossia=, for this procedure to be effective, must be loaded
 using the same =babel= classic syntax (but note that /this is not/
 the actual polyglossia syntax).  For example, suppose a document
-- 
2.34.1



New try at multi-lingual export to latex/pdf using pdflatex and babel

2024-01-21 Thread Pedro Andres Aranda Gutierrez
Hi,

hopefully this is more informative. It complements the =polyglossia=
example with some =babel= that can be compiled with pdflatex.

Cheers, /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 4d0dcde4f8f149d3d028164c3cd3c8e9bff2a060 Mon Sep 17 00:00:00 2001
From: "Pedro A. Aranda" 
Date: Sun, 21 Jan 2024 09:39:35 +0100
Subject: [PATCH] Add multi-language babel example

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

diff --git a/doc/org-manual.org b/doc/org-manual.org
index acc6d07ff..506b9b844 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -13925,6 +13925,10 @@ general options (see [[*Export Settings]]).
'("AUTO" "polyglossia" t ("xelatex" "lualatex")))
   #+end_src
 
+  The value used for =babel= or =polyglossia= is set in
+  ~org-export-default-language~. The default value is ~"en"~, which
+  means American English.
+
 - =LATEX_CLASS= ::
 
   #+cindex: @samp{LATEX_CLASS}, keyword
@@ -14079,6 +14083,22 @@ the =\babelprovide= command:
 ,#+LATEX_HEADER: \babelprovide[import, main]{AUTO}
 #+end_example
 
+Another example using ~pdflatex~ and ~babel~ and mixing Latin and
+Greek fonts in the document using the =\PassOptionsToPackage= command
+from =babel= would be:
+
+#+begin_example
+,#+latex_class_options: [greek,spanish,oneside]
+,#+language: es
+,#+latex_header: \PassOptionsToPackage{main=spanish}{babel}
+,#+latex_header: \usepackage{alphabeta} % to support greek script
+#+end_example
+
+Note that you can add more options to the ~latex_class_options~.
+The important thing is that you include the *translated* name
+for the =#+language:# you specify in the other commands for
+your LaTeX header.
+
 =Polyglossia=, for this procedure to be effective, must be loaded
 using the same =babel= classic syntax (but note that /this is not/
 the actual polyglossia syntax).  For example, suppose a document
-- 
2.34.1



Re: #+LATEX_HEADER: \usepackage[greek,german]{babel} ??

2024-01-17 Thread Pedro Andres Aranda Gutierrez
Hi Just to document this discussion a bit more:

Ihor writes:
>Horst Leps  writes:
>
>> #+latex_class: koma-article
>
>This is non-standard.
>What is your value of org-latex-classes?

There is a translation from koma-article to scrartcl in the
org-latex-classes, so that is not the problem.

>> Makes:
>> ...
>> \usepackage[germanb]{babel}
>> ...
>> \usepackage[greek,german]{babel}
>> ...
>> ---
>>
>> ! LaTeX Error: Option clash for package babel.
>> ---
>>
>> Only one latex run. Tableofconts Table remains empty.
>>
>> Supposition:
>>
>> 1. The Latex source contains {babel} twice, but only once is allowed.
>
>ox-latex tries hard to not duplicate babel. I am unable to reproduce
>duplication with your file (but with #+latex_class: koma-article removed)

Despite this, there is a repetition, and the clash is because ox-latex
wants ngerman wiith
#+language: de
while Horst wants to use germanb. The clash is between what ox-latex
generates and what Horst tries to add with #+LATEX_HEADER:

Actually, he also needs greek and for that I have recommended to customise
variables so that fontenc is "LGR,T1" and the parameters for babel are
"greek,AUTO", instead of trying to add a #+LATEX_HEADER:
\usepackage[LGR,T1]fontenc, because that also generates a package
option clash.

That is something we might need to explore more, if/when people need/want
to use pdflatex instead of luatex or xelatex.

>> 2. There is an error in my Orgmode code because it exports {babel} once
>> too many
>
>Does the problem persist without #+latex_class: koma-article?
Once again, yes, because it is mainly a matter of #+language.
I think we need the following
1) more docs on #+language
2) more thought on multilingual documents (#+language: gr,de)
3) more though on documents with multiple font encodings.

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


Re: Tableofcontents

2024-01-12 Thread Pedro Andres Aranda Gutierrez
Horst Leps  writes:

> (I use Emacs 28, Mac-Mini Apple M2, Sonoma 14.2.1)
> Since a few days: Orgmode export to Latex only creates one Latex run, so
that the table of contents remains empty and no longer shows any sections. -
> What to do? Horst

Hi,

I'm running on master and my ox-latex config starts like this:

(use-package ox-latex
  :ensure nil
  :after org
  :commands (org-beamer-export-to-pdf org-latex-export-to-pdf)
  :custom
  (org-latex-listings 'listings)
  ;; Make sure you have bibtex integrated in the production loop
  (org-latex-pdf-process
   '("latexmk -bibtex -pdflatex='pdflatex --shell-escape
--interaction=nonstopmode' -pdf -f %f"))
...

And that gets me all the runs that are needed to get toc, acronyms, etc.

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


Re: Re: Adding functionality to org-latex-classes

2024-01-01 Thread Pedro Andres Aranda Gutierrez
Thanks, I'll check it out!
Just a way to get over some sleepless nights...

/PA

On Mon, 1 Jan 2024 at 10:17, Ihor Radchenko  wrote:

> Pedro Andres Aranda Gutierrez  writes:
>
> > Attached is a concept which might be useful. At least it detects when
> > variables are set locally and then doesn't attempt anything.
>
> You may rather need to hack on `org-export-get-environment', possibly
> extending it. For example, we may allow more flexible
> `org-export-options-alist'.
>
> > (defun is-in-local-variable-alists (sym)
> >   "Check if symbol is in any local variable alist"
> >   (when
> >   (or (and (boundp 'connection-local-variables-alist)
> >(assoc sym connection-local-variables-alist))
> >   (and (boundp 'file-local-variables-alist)
> >(assoc sym file-local-variables-alist))
> >   (and (boundp 'dir-local-variables-alist)
> >(assoc sym dir-local-variables-alist)))
> > t))
>
> Note that you can simply use `buffer-local-boundp'.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>


-- 
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: Re: Adding functionality to org-latex-classes

2024-01-01 Thread Pedro Andres Aranda Gutierrez
>Message: 16
>Date: Sun, 31 Dec 2023 14:40:32 +
>From: Ihor Radchenko 
>To: Pedro Andres Aranda Gutierrez 
>Cc: Org Mode List 
>Subject: Re: Adding functionality to org-latex-classes
>Message-ID: <87ttny77vj.fsf@localhost>
>Content-Type: text/plain
>
>Pedro Andres Aranda Gutierrez  writes:
>
>> I was just wondering whether it would be possible to add further
>> functionality to org-latex-classes and would like to start a discussion
;-)
>>
>> My use case is the following:
>>
>> The document class is tightly coupled with  ~org-latex-subtitle-format~
>> and  ~org-latex-subtitle-separate~. Koma-script classes, for example,
need
>> those variables to be defined with file or directory local variables in
>> order to take full profit of the layouts. If we found a way of
>> accommodating them in the class definitions, the fuzz of the extra
>> variables could easily be overcome.
>
>We may extend `org-latex-classes' to allow custom backend option values.
>For example,
>
>  (latex-subtitle-format . value)
>  (latex-subtitle-separate . value)
>
>Then, we can use these values as the overrides when the variables are
>not set explicitly as buffer-locals or as in-buffer/subtree export
>keywords.
>
>--
>Ihor Radchenko // yantar92,
>Org mode contributor,
>Learn more about Org mode at <https://orgmode.org/>.
>Support Org development at <https://liberapay.com/org-mode>,
>or support my work at <https://liberapay.com/yantar92>

Attached is a concept which might be useful. At least it detects when
variables are set locally and then doesn't attempt anything.

Peaceful New Year,
/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
;; This buffer is for text that is not saved, and for Lisp evaluation.
;; To create a file, visit it with 'C-x C-f' and enter text in its buffer.


(defun is-in-local-variable-alists (sym)
  "Check if symbol is in any local variable alist"
  (when
  (or (and (boundp 'connection-local-variables-alist)
   (assoc sym connection-local-variables-alist))
  (and (boundp 'file-local-variables-alist)
   (assoc sym file-local-variables-alist))
  (and (boundp 'dir-local-variables-alist)
   (assoc sym dir-local-variables-alist)))
t))

(defun local-or-latex-class ()
  (interactive)
  ;;
  ;; This would come from ox-latex
  ;;
  (let ((test '((org-latex-subtitle-format . "\\subtitle{%s}")
(org-latex-subtitle-separate . t
(mapcar #'(lambda (element)
(let* ((sym (car element))
   (skip (is-in-local-variable-alists sym))
   (sym-name (symbol-name sym))
   (val (cdr element)))
  ;; (message "--> %s" element)
  ;; (if skip
  ;; (message "%s set as file-local" sym-name)
  ;;   (progn
  ;; (message "Will set %s to %s" sym-name val)
  ;; (eval '(setq sym-name val))
  (unless skip
(eval '(setq sym-name val)
test)
(message "Is separate: %s" org-latex-subtitle-separate)
(message "subtitle: %s" org-latex-subtitle-format))
  )


Re: Adding functionality to org-latex-classes

2023-12-31 Thread Pedro Andres Aranda Gutierrez
That’s what I’m looking at these days :-) 
Just trying to provide a proof of concept 
It helps me coping with my grinchiness 
PA
Enviado desde mi iPhone

> El 31 dic 2023, a las 15:37, Ihor Radchenko  escribió:
> 
> Pedro Andres Aranda Gutierrez  writes:
> 
>> I was just wondering whether it would be possible to add further
>> functionality to org-latex-classes and would like to start a discussion ;-)
>> 
>> My use case is the following:
>> 
>> The document class is tightly coupled with  ~org-latex-subtitle-format~
>> and  ~org-latex-subtitle-separate~. Koma-script classes, for example, need
>> those variables to be defined with file or directory local variables in
>> order to take full profit of the layouts. If we found a way of
>> accommodating them in the class definitions, the fuzz of the extra
>> variables could easily be overcome.
> 
> We may extend `org-latex-classes' to allow custom backend option values.
> For example,
> 
>  (latex-subtitle-format . value)
>  (latex-subtitle-separate . value)
> 
> Then, we can use these values as the overrides when the variables are
> not set explicitly as buffer-locals or as in-buffer/subtree export
> keywords.
> 
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>



Adding functionality to org-latex-classes

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

I was just wondering whether it would be possible to add further
functionality to org-latex-classes and would like to start a discussion ;-)

My use case is the following:

The document class is tightly coupled with  ~org-latex-subtitle-format~
and  ~org-latex-subtitle-separate~. Koma-script classes, for example, need
those variables to be defined with file or directory local variables in
order to take full profit of the layouts. If we found a way of
accommodating them in the class definitions, the fuzz of the extra
variables could easily be overcome.

Default would be the default values from ox-latex.el and both variables
should be handled separately, IMHO.

Any ideas?

Best wishes for 2024, peace everywhere as a result of running a couple of
leader-deposed hooks ;-)

/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


Rewording the biblatex documentation

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

I slept over the comments and came up with a better wording. I hope it adds
more information and is therefore more helpful

Best wishes for 2024
/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 c2373712501805fb0a81d4c34c3127579c5b10c3 Mon Sep 17 00:00:00 2001
From: "Pedro A. Aranda" 
Date: Tue, 26 Dec 2023 19:00:50 +0100
Subject: [PATCH] Reword biblatex documentation

---
 doc/org-manual.org | 12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index 23f250fa7..ff1b9cffb 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -17348,13 +17348,15 @@ 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
+: #+cite_export: biblatex numeric,backend=bibtex
 
 #+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;
+specifies the =biblatex= export processor with the default =numeric=
+style and the =bibtex= backend. Always define the style first and then
+the rest of load-time options for the =biblatex=
+package. Alternatively, use the ~org-cite-biblatex-options~ variable
+in your Emacs configuration. It will only export to PDF, since it
+relies on the ~biblatex~ processor of your LaTeX installation;
 
 ** Bibliography printing
 
-- 
2.34.1



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


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: Strange behaviour detected today

2023-12-13 Thread Pedro Andres Aranda Gutierrez
HiThanks a ton. I could bisect the issue and filed a bug yesterday. It seems to be the same commit that broke the themes./PAEnviado desde mi iPhoneEl 13 dic 2023, a las 18:49, Pedro Andres Aranda Gutierrez  escribió:Thanks a ton, I'm looking into it :-)/PAOn Wed, 13 Dec 2023 at 15:57, William Denton <w...@pobox.com> wrote:On 13 December 2023, Pedro Andres Aranda Gutierrez wrote:

> I've recompiled emacs master today and when I try to export an org
> presentation to latex and I get the following error:
>
> Exporting to LaTeX [class: beamer]...
> set-face-attribute: Invalid face box: :line-width, 1, :color, grey40
>
> This happens when calling
>
> (org-beamer-export-to-latex)
>
> both from emacs in interactive and in batch mode.

Is that perhaps related to commit dcd755dabcf9ef95d6d0534c11c668f44c6f89c2, "Fix 
validation of :box face attribute"?  It caused similar errors in solarized-theme 
(for example this bug¹).

Bill


¹ https://github.com/bbatsov/solarized-emacs/issues/447

--
William Denton
https://www.miskatonic.org/
Librarian, artist and licensed private investigator.
Toronto, Canada
CO₂: 421.99 ppm (Mauna Loa Observatory, 2023-12-12)-- Fragen sind nicht da, um beantwortet zu werden,Fragen sind da um gestellt zu werdenGeorg KreislerHeadaches 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: Strange behaviour detected today

2023-12-13 Thread Pedro Andres Aranda Gutierrez
Thanks a ton, I'm looking into it :-)
/PA

On Wed, 13 Dec 2023 at 15:57, William Denton  wrote:

> On 13 December 2023, Pedro Andres Aranda Gutierrez wrote:
>
> > I've recompiled emacs master today and when I try to export an org
> > presentation to latex and I get the following error:
> >
> > Exporting to LaTeX [class: beamer]...
> > set-face-attribute: Invalid face box: :line-width, 1, :color, grey40
> >
> > This happens when calling
> >
> > (org-beamer-export-to-latex)
> >
> > both from emacs in interactive and in batch mode.
>
> Is that perhaps related to commit
> dcd755dabcf9ef95d6d0534c11c668f44c6f89c2, "Fix
> validation of :box face attribute"?  It caused similar errors in
> solarized-theme
> (for example this bug¹).
>
> Bill
>
>
> ¹ https://github.com/bbatsov/solarized-emacs/issues/447
>
> --
> William Denton
> https://www.miskatonic.org/
> Librarian, artist and licensed private investigator.
> Toronto, Canada
> CO₂: 421.99 ppm (Mauna Loa Observatory, 2023-12-12)



-- 
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: Strange behaviour detected today

2023-12-13 Thread Pedro Andres Aranda Gutierrez
I’ll file a bug when time permits…

Best,//PA
Enviado desde mi iPhone

> El 13 dic 2023, a las 14:04, Ihor Radchenko  escribió:
> 
> "Fraga, Eric"  writes:
> 
>> Just a potential suggestion for the OP: maybe change the line-width
>> attribute to e.g. "(1 . 1)" instead of 1 as all of the faces I have
>> customised (using customize-face) that have :box attributes use a
>> similar construct for the line width argument.  Just to see if maybe the
>> documentation does not reflect reality in the code?
> 
> The documentation explicitly states that :line-width 1 is the same as
> :line-width (1 . 1). I see no reason to change anything on Org side.
> 
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 



Re: Strange behaviour detected today

2023-12-13 Thread Pedro Andres Aranda Gutierrez
Strange… here is the output of calling in batch mode

Emacs -Q -l org-export.el --batch p5.org --eval '(org-beamer-export-to-pdf)'

Error: error ("Invalid face box" :line-width 1 :color grey40)
  mapbacktrace(#f(compiled-function (evald func args flags) #))
  debug-early-backtrace()
  debug-early(error (error "Invalid face box" :line-width 1 :color grey40))
  internal-set-lisp-face-attribute(org-beamer-tag :box (:line-width 1 :color 
grey40) #)
  set-face-attribute(org-beamer-tag # :box 
(:line-width 1 :color grey40))
  apply(set-face-attribute org-beamer-tag # (:box 
(:line-width 1 :color grey40)))
  face-spec-set-2(org-beamer-tag # (:box (:line-width 
1 :color grey40)))
  face-spec-recalc(org-beamer-tag #)
  face-spec-set(org-beamer-tag ((t (:box (:line-width 1 :color grey40 
face-defface-spec)
  custom-declare-face(org-beamer-tag ((t (:box (:line-width 1 :color grey40 
"The special face for beamer tags." :group org-export-beamer)
  (org-beamer-export-to-pdf)
  eval((org-beamer-export-to-pdf) t)
  command-line-1(("-l" "org-export.el" "p5.org" "--eval" 
"(org-beamer-export-to-pdf)"))
  command-line()
  normal-top-level()
Invalid face box: :line-width, 1, :color, grey40
make: *** [p5.pdf] Error 255

With my org-export.el being:

;;
;; Auxiliar script for GNUmakefile
;;  Export to PDF from org
;;  Automatically detects presentations using the beamer class
;;  The rest are assumed to be documents
;;
(require 'org)
(require 'ox-latex)
(require 'ob-python)

(eval-after-load "org"

  (progn
(let ((citeless t)) ;; set to nil if no bibliography in the pptx

  (org-babel-do-load-languages 'org-babel-load-languages
   '((python . t)
 (shell . t)))
  (add-to-list 'org-latex-packages-alist
   '("" "listings"))
  (add-to-list 'org-latex-packages-alist
   '("" "xcolor"))
  (add-to-list 'org-latex-classes
   '("letter"
 "\\documentclass{letter}"))
  ;; Add KOMA script based books
  (add-to-list 'org-latex-classes
   '("scrbook"
 "\\documentclass{scrbook}"
 ("\\chapter{%s}" . "\\chapter*{%s}")
 ("\\section{%s}" . "\\section*{%s}")
 ("\\subsection{%s}" . "\\subsection*{%s}")
 ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
 ("\\paragraph{%s}" . "\\paragraph*{%s}")
 ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
  (add-to-list 'org-latex-classes
   '("scrreprt"
 "\\documentclass{scrreprt}"
 ("\\chapter{%s}" . "\\chapter*{%s}")
 ("\\section{%s}" . "\\section*{%s}")
 ("\\subsection{%s}" . "\\subsection*{%s}")
 ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
 ("\\paragraph{%s}" . "\\paragraph*{%s}")
 ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))

  ;; (add-to-list 'org-export-filter-src-block-functions
  ;;  'my-latex-src-block-filter)

  (if citeless
  (setq org-cite-export-processors nil)
(setq org-cite-export-processors '((beamer . biblatex)
   (latex .  biblatex))
org-cite-biblatex-options

"backend=biber,style=numeric,sorting=none,isbn=false,doi=false,url=true"))
  (setq python-indent-offset 4
org-confirm-babel-evaluate nil
org-src-preserve-indentation t
org-src-fontify-natively t
org-export-latex-listings t
org-latex-listings 'listings
;; Make sure you have bibtex integrated in the production loop
org-latex-pdf-process
'("latexmk -bibtex -pdflatex='pdflatex --shell-escape 
--interaction=nonstopmode' -pdf -f %f")
org-babel-python-command "python3"

(defun org-export ()
  "Save the current buffer and
export it to latex if the underlying file contents
hints a LaTeX document or a Beamer presentation"
  (hack-local-variables)
  ;; (print org-cite-export-processors)
  (goto-char (point-min))
  ;; (print (format "org-cite-export-processors is %s" 
org-cite-export-processors))
  (when (re-search-forward "^#\\+LATEX_CLASS: \\([^ ]+\\)$" (point-max) t 1)
(let ((class (match-string-no-properties 1)))
  (message &qu

Strange behaviour detected today

2023-12-13 Thread Pedro Andres Aranda Gutierrez
Hi

I've recompiled emacs master today and when I try to export an org
presentation to latex and I get the following error:

Exporting to LaTeX [class: beamer]...
set-face-attribute: Invalid face box: :line-width, 1, :color, grey40

This happens when calling

(org-beamer-export-to-latex)

both from emacs in interactive and in batch mode.

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


Re: Re: [FR] org-num-mode inverse defaults

2023-10-19 Thread Pedro Andres Aranda Gutierrez
Yes, very helpful. Thanks a ton!
/PA

On Thu, 19 Oct 2023 at 11:07, Ihor Radchenko  wrote:

> Pedro Andres Aranda Gutierrez  writes:
>
> > I feel the explanation in
> >
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=b223a3cc7
> is
> > a bit fuzzy and may not be correctly understood by newcomers. A pointer
> to
> > a more detailed explanation could help a lot.
>
> I added reference to the manual. Is it better now?
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=c77e7f9c8
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>


-- 
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: Re: [FR] org-num-mode inverse defaults

2023-10-19 Thread Pedro Andres Aranda Gutierrez
Hi

I feel the explanation in
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=b223a3cc7 is
a bit fuzzy and may not be correctly understood by newcomers. A pointer to
a more detailed explanation could help a lot.

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


Re: [Pre-PATCH] Overhaul of the LaTeX preview system

2023-06-04 Thread Pedro Andres Aranda Gutierrez
Ok, so that’s excluded ;-) 

PA

Enviado desde mi iPhone

> El 5 jun 2023, a las 1:29, Rudolf Adamkovič  escribió:
> 
> Pedro Andres Aranda Gutierrez  writes:
> 
>> this might not be completely the case, but I recently reported a bug
>> against native compilation in Emacs. What about trying without netive
>> compilation?
> 
> I have just tried without native compilation.  No luck!  I get the exact
> same error.
> 
> Rudy
> -- 
> "Great minds discuss ideas; average minds discuss events; small minds discuss
> people."
> --- Anna Eleanor Roosevelt (1884-1962)
> 
> Rudolf Adamkovič  [he/him]
> Studenohorská 25
> 84103 Bratislava
> Slovakia



Re: Re: [Pre-PATCH] Overhaul of the LaTeX preview system

2023-06-03 Thread Pedro Andres Aranda Gutierrez
HI,

this might not be completely the case, but I recently reported a bug
against native compilation in Emacs. What about trying without netive
compilation?

Hope it helps!
/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


Re: is it possible to choose a completion engine?

2023-05-22 Thread Pedro Andres Aranda Gutierrez
Tory writes:

> Org currently stands out from my workflow because it does completions its
own way, with lists and number/letter keys. It would be nice if I could
instead have the benefit of vertico, or helm, or whatever else instead. Org
would even benefit from marginalia and embark in some cases. Is there an
easy variable I'm missing to make org use completing-reads instead of the
indexing thing it does?

Hi Tory,

I'm using company-mode and I do have auto-completions without any specific
org configuration. Org is also quite well integrated with jinx as my
spellchecker. Since I mainly use org as a 'high-level' layer for
presentations and documents, I'm well served with that. And it is basically
the same I have for LaTEX and markdown.

Hope it helps,
/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


Re: Friendly exchange of thoughts: citations and LaTeX

2023-05-02 Thread Pedro Andres Aranda Gutierrez
Hi Ihor,

sorry for being so silent, but I'm currently at 300% occupation. And 
statistical mux doesn't work well on human beings...

Marking this as TODO...

thx,/pa

Enviado desde mi iPad

> El 2 may 2023, a las 14:51, Ihor Radchenko  escribió:
> 
> Ihor Radchenko  writes:
> 
>> One reasonable option could be keeping relative paths relative iff the
>> #+BIBLIOGRAPHY is derived from a file inside the same directory with the
>> exported file.
>> 
>> Tentative patch attached.
> 
> I applied an alternative patch that uses the approach from
> `org-export--update-included-link' - relative paths are resolved against
> top-level file dir and absolute paths are kept absolute.
> 
> Handled.
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=5ec364a1a
> 
> -- 
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 



Re: Re: A dream?

2023-04-17 Thread Pedro Andres Aranda Gutierrez
> Jean Louis :
>> Eduardo Ochs  [2023-04-16 01:45]:
>> do you have a page in https://gnu.support/ explaining in detail how
>> you teach Emacs to beginners? It would be nice to have something like
>> that...
>
>I just tell them to do Emacs Tutorial. There is no need for page when
>it is built-in.
>
>I tell them, open Emacs and do the tutorial, then let me know. Later
>we do not talk much, we just do the work.

In addition to that, I have also collected a set of slides with suggestions
and
quick answers to some of the configuration hurdles. That helps a lot (they
say)
In addition, I have an article on org-mode.
I submitted to the (wrong) journal and never got published on paper ,-(
That was a couple of years ago and I have continued to update it for my
personal
reference. When people have specific interest in org-mode I pass
the lastest version in PDF and org for them to play around. The teaser for
this
is any of my lecture handouts.

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


Re: A dream?

2023-04-04 Thread Pedro Andres Aranda Gutierrez
Hi Marko,

I'm teaching myself and have some lectures written with org and
exported through beamer.
It started because it is skeleton mode presentations on steroids and
it saves me a lot of time.

In my case, I don't force emacs+org-mode (as someone has already said,
they google around and desist from even taking a look behind the
scenes). What I do is showcasing. In my Python lectures, modifying the
code and showing the modified results live, both on my emacs and on
the presentation, is sort of a powerful teaser.

I follow with a couple of slides on emacs à la 'configuration for
dummies' and a small zip file with a minimal config for org and LaTeX
for the interested ones.

I can't claim a landslide, but I have a couple of 'adepts' who then go
on to use it in their professional lives every year...

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



Re: Trying to compile emacs master with native compilation fails on org-plot.el

2023-03-30 Thread Pedro Andres Aranda Gutierrez
Yep… this bug is making me understand the gain (or lack of it) or having mating 
compilation ;-)

PA

Enviado desde mi iPhone

> El 30 mar 2023, a las 9:45, Ihor Radchenko  escribió:
> 
> Pedro Andres Aranda Gutierrez  writes:
> 
>> I'm trying to compile org-plot.el from emacs master and it fails with
>> native compilation activated!
>> 
>> #+BEGIN_example
>>  ELC+ELN  org/org-plot.elc
>> 
>> Error: native-ice ("org/org-plot.el" "block does not end with a
> 
> See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=62481
> You need to wait until Emacs devs fix the problem.
> 
> -- 
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>



Trying to compile emacs master with native compilation fails on org-plot.el

2023-03-30 Thread Pedro Andres Aranda Gutierrez
Hi,

I'm trying to compile org-plot.el from emacs master and it fails with
native compilation activated!

#+BEGIN_example
  ELC+ELN  org/org-plot.elc

Error: native-ice ("org/org-plot.el" "block does not end with a
branch" #s(comp-block-lap bb_8 ((comment "LAP TAG 83") (call
helper_unbind_n #s(comp-mvar nil nil ((1 . 1)) nil nil nil)) (setimm
#s(comp-mvar (t) nil nil nil nil 2) make-temp-file) (setimm
#s(comp-mvar (t) nil nil nil nil 3) "org-plot") (set #s(comp-mvar (t)
nil nil nil nil 2) (callref funcall #s(comp-mvar (t) nil nil nil nil
2) #s(comp-mvar (t) nil nil nil nil 3))) (call
record_unwind_protect_excursion) (setimm #s(comp-mvar (t) nil nil nil
nil 3) org-plot/goto-nearest-table) (set #s(comp-mvar (t) nil nil nil
nil 3) (callref funcall #s(comp-mvar (t) nil nil nil nil 3))) (setimm
#s(comp-mvar (t) nil nil nil nil 3) org-table-to-lisp) (set
#s(comp-mvar (t) nil nil nil nil 3) (callref funcall #s(comp-mvar (t)
nil nil nil nil 3))) (call helper_unbind_n #s(comp-mvar nil nil ((1 .
1)) nil nil nil)) (setimm #s(comp-mvar (t) nil nil nil nil 4)
plist-get) (set #s(comp-mvar (t) nil nil nil nil 5) #s(comp-mvar (t)
nil nil nil nil 0)) (setimm #s(comp-mvar (t) nil nil nil nil 6)
:transpose) (set #s(comp-mvar (t) nil nil nil nil 4) (callref funcall
#s(comp-mvar (t) nil nil nil nil 4) #s(comp-mvar (t) nil nil nil nil
5) #s(comp-mvar (t) nil nil nil nil 6))) (set #s(comp-mvar (t) nil nil
nil nil 5) #s(comp-mvar (t) nil nil nil nil 4)) (setimm #s(comp-mvar
(t) nil nil nil nil 6) #s(hash-table size 3 test eq rehash-size 1.5
rehash-threshold 0.8125 purecopy t data (y 105 yes 105 t 105 nil
nil nil nil #s(hash-table size 65 test eql rehash-size 1.5
rehash-threshold 0.8125 data ()) nil nil 1 72 nil nil)
org-plot/gnuplot)
  mapbacktrace(#f(compiled-function (evald func args flags) #))
  debug-early-backtrace()
  debug-early(error (native-ice "org/org-plot.el" "block does not end
with a branch" #s(comp-block-lap :name bb_8 :insns ((comment "LAP TAG
83") (call helper_unbind_n #s(comp-mvar :typeset nil :valset nil
:range ((1 . 1)) :neg nil :id nil :slot nil)) (setimm #s(comp-mvar
:typeset (t) :valset nil :range nil :neg nil :id nil :slot 2)
make-temp-file) (setimm #s(comp-mvar :typeset (t) :valset nil :range
nil :neg nil :id nil :slot 3) "org-plot") (set #s(comp-mvar :typeset
(t) :valset nil :range nil :neg nil :id nil :slot 2) (callref funcall
#s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil
:slot 2) #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id
nil :slot 3))) (call record_unwind_protect_excursion) (setimm
#s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil
:slot 3) org-plot/goto-nearest-table) (set #s(comp-mvar :typeset (t)
:valset nil :range nil :neg nil :id nil :slot 3) (callref funcall
#s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil
:slot 3))) (setimm #s(comp-mvar :typeset (t) :valset nil :range nil
:neg nil :id nil :slot 3) org-table-to-lisp) (set #s(comp-mvar
:typeset (t) :valset nil :range nil :neg nil :id nil :slot 3) (callref
funcall #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id
nil :slot 3))) (call helper_unbind_n #s(comp-mvar :typeset nil :valset
nil :range ((1 . 1)) :neg nil :id nil :slot nil)) (setimm #s(comp-mvar
:typeset (t) :valset nil :range nil :neg nil :id nil :slot 4)
plist-get) (set #s(comp-mvar :typeset (t) :valset nil :range nil :neg
nil :id nil :slot 5) #s(comp-mvar :typeset (t) :valset nil :range nil
:neg nil :id nil :slot 0)) (setimm #s(comp-mvar :typeset (t) :valset
nil :range nil :neg nil :id nil :slot 6) :transpose) (set #s(comp-mvar
:typeset (t) :valset nil :range nil :neg nil :id nil :slot 4) (callref
funcall #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id
nil :slot 4) #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil
:id nil :slot 5) #s(comp-mvar :typeset (t) :valset nil :range nil :neg
nil :id nil :slot 6))) (set #s(comp-mvar :typeset (t) :valset nil
:range nil :neg nil :id nil :slot 5) #s(comp-mvar :typeset (t) :valset
nil :range nil :neg nil :id nil :slot 4)) (setimm #s(comp-mvar
:typeset (t) :valset nil :range nil :neg nil :id nil :slot 6)
#)) :closed nil :in-edges nil
:out-edges nil :idom nil :df #
:post-num nil :final-frame nil :sp 1 :addr 72 :non-ret-insn nil
:no-ret nil) org-plot/gnuplot))
  signal(native-ice ("org/org-plot.el" "block does not end with a
branch" #s(comp-block-lap :name bb_8 :insns ((comment "LAP TAG 83")
(call helper_unbind_n #s(comp-mvar :typeset nil :valset nil :range ((1
. 1)) :neg nil :id nil :slot nil)) (setimm #s(comp-mvar :typeset (t)
:valset nil :range nil :neg nil :id nil :slot 2) make-temp-file)
(setimm #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id
nil :slot 3) "org-plot") (set #s(comp-mvar :typeset (t) :valset nil
:range nil :neg nil :id nil :slot 2) (callref funcall #s(comp-mvar
:typeset (t) :valset nil :range nil :neg nil :id nil :slot 2)
#s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil
:slot 3))) (call 

Re: Friendly exchange of thoughts: citations and LaTeX

2023-03-29 Thread Pedro Andres Aranda Gutierrez
Looks reasonable... we put the .org and .bib file(s) in the same
directory and we can use relative paths... That's what I would do in a
pure LaTeX environment (and in overleaf.com)

Could be expanded to same directory or its leaves... like when I have
the .org file and a bibliography directory in the same directory...
(Just thinking aloud)

Will check tomorrow before starting with /real life/ ;-)

Thx, /PA

On Wed, 29 Mar 2023 at 16:12, Ihor Radchenko  wrote:
>
> Pedro Andres Aranda Gutierrez  writes:
>
> > Having said that, I was also (just a bit) bugged by the fact that
> > bibliography file names are completely expanded when generating LaTeX.
> > Couldn't we avoid that for LaTeX export?
>
> It is in `org-cite-list-bibliography-files'.
> AFIAU, full path is forced there to make #+SETUP containing local
> bibliography path work:
>
>  main.org -
> #+SETUP: settings.org
> -- end 
>
>  ../settings.org -
> #+BIBLIOGRAPHY: local.bib
> --
>
> One reasonable option could be keeping relative paths relative iff the
> #+BIBLIOGRAPHY is derived from a file inside the same directory with the
> exported file.
>
> Tentative patch attached.
>
>
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>



-- 
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: File generation from LaTeX src fails due to temporary PDF in wrong directory

2023-03-29 Thread Pedro Andres Aranda Gutierrez
On Tue, 28 Mar 2023 10:04:24 +0200, Christian Moe  wrote
Hi,

> I'm trying and failing to export images from TikZ code, apparently
> because the temporary PDF is misplaced. Here is a minimal example just
> exporting the PDF:

> #+LATEX_HEADER: \usepackage{tikz}
>
> #+header: :fit yes
> #+begin_src latex :exports results :file ./test-tikz-triangle.png
> \begin{tikzpicture} %
> \draw[draw=black, fill=blue!10] (0,4) -- (3,0) -- (-3,0) -- cycle;
> \end{tikzpicture}
> #+end_src

> Execution fails with an error message like this:
>
> org-compile-file: File "/tmp/babel-Tay2kl/latex-IJVI84.pdf" wasn’t
> produced.  See "*Org PDF LaTeX Output*" for details

Hi Christian,
trying to reproduce this on a master (emacs30.0.50) on Ubuntu. To make it really
lightweight, I'm starting with
emacs -Q
but unfortunately, I'm not able to reproduce it here :(

My emacs:

GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33,
 cairo version 1.16.0) of 2023-03-26

Would you please try again, calling with emacs -Q and giving a couple
clues more of your process to confirm... It may be that I'm too modern
;-)

Thx, /Pedro A.

-- 
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: Friendly exchange of thoughts: citations and LaTeX

2023-03-27 Thread Pedro Andres Aranda Gutierrez
> And often a source of real issues (I
> have this problem sharing with my group where most use Windows... issues
> with paths and upper/lower case names).

I don't know why, but it sounds familiar ;-)

Best, /PA

On Mon, 27 Mar 2023 at 11:34, Fraga, Eric  wrote:
>
> Hi Pedro,
>
> On Monday, 27 Mar 2023 at 11:02, Pedro Andres Aranda Gutierrez wrote:
> > \jobname is the shorthand for ‘the file that you are compiling with
>
> Ah, okay; thank you.
>
> > Re the use of absolute vs relative path when exporting to LaTeX, I
> > might want to export to LaTeX and transfer to overleaf.com and
> > relative paths would make more sense there, wouldn’t they?
>
> Yes, this is a very valid point.  And often a source of real issues (I
> have this problem sharing with my group where most use Windows... issues
> with paths and upper/lower case names).
>
> --
> : Eric S Fraga, with org release_9.6.1-307-gcd2355 in Emacs 30.0.50



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



  1   2   >