Supersedes: https://list.orgmode.org/[email protected]

This might actually be a bug, not a feature request as Reza has reported
that 'org-export-dispatch' worked until Emacs 31.1 where it stopped
working.  However, we never promised that this type of setup would work
so maybe it's a feature request.

I might get around to working on this eventually as I would like this to
work but others are free to step in and take this :)

I have experimented with these sorts of Emacs packages previously.  If I
recall correctly they use something like 'hack-local-variables' to set
environment variables on a per buffer basis.

If our features (org-babel, latex export, etc...) don't properly inherit
the environment from the base buffer, then obviously they won't work
properly.

Ideally we should write some tests.



Reza's thread:

"Pedro A. Aranda" <[email protected]> writes:

> Hi Reza,
>
> (adding the orgmode list for reference)...
>
> On 15/11/26 10:44, Reza wrote:
>> Hi Pedro
>> No worries, thanks for your help!
>> Exporting this block with latex gives me:
>> \begin{verbatim}
>> ("latexmk -f -pdf -%latex -shell-escape -interaction=nonstopmode 
>> -output-directory=%o %f")
>> ("/home/reza/.guix-home/profile/bin/" "/home/reza/.guix-home/profile/sbin/"
>> "/run/privileged/bin/" "/home/reza/.config/guix/current/bin/"
>> "/home/reza/.guix-profile/bin/" "/run/current-system/profile/bin/"
>> "/run/current-system/profile/sbin/"
>> "/gnu/store/jqfh11h819s0356xvzqfk1cgwrqqan2p-emacs-31.1/libexec/emacs/31.1/x86_64-pc-linux-gnu/")
>> nil
>> nil
>> \end{verbatim}
>> The path to the guix profile I defined in my .envrc is definitely
>> missing in exec-path. Somehow the envrc-mode is not active anymore in
>> the export, is this related to changes in emacs or org-mode?
>> Best,
>> Reza
>
> The way to find the executable in org-mode is with (executable-find), with is
> an Emacs Lisp function. It looks like your Emacs setup and the way it 
> interacts
> with envrc is to blame.
>
> Sorry I can't help you further,
> Best, /PA
>
>>> HI, sorry for this taking a bit longer...
>>>
>>> Try to execute the following in an Org buffer and send me the results:
>>>
>>>
>>> #+BEGIN_SRC emacs-lisp :results var :exports results
>>> (let (var)
>>>    (setq var
>>>          (concat
>>>           (prin1-to-string org-latex-pdf-process) "\n"
>>>           (prin1-to-string (exec-path)) "\n"
>>>           (prin1-to-string (executable-find "latexmk")) "\n"
>>>           (prin1-to-string (executable-find "perl")) "\n"))
>>>    var)
>>> #+END_SRC
>>>
>>> The first one is to check ox-latex and the rest is to look into Emacs
>>> internals...
>>>
>>> Thx for the patience, /PA
>>>
>>>
>>> On Thu, 12 Nov 2026 at 19:19, Reza <[email protected]> wrote:
>>>
>>>> latexmk is also defined in the eshell, the problem seems to be only the
>>>> export. Just to iterate, this was working before the emacs upgrade,
>>>> therefore I assume the culprit is not envrc, but I may be mistaken.
>>>>
>>>>> Hmmm... what about eshell inside emacs?
>>>>> I'm not using guix, sorry. That's why I ask specifically about executing
>>>>> eshell....
>>>>>
>>>>> Thx, /PA
>>>>>
>>>>> On 12/11/26 14:20, Reza wrote:
>>>>>> Hi Pedro
>>>>>>
>>>>>> "which latexmk" returns the correct latexmk defined in the .envrc file
>>>>>> (/gnu/store/ziyaiivhq2yy84j6lp329srfbhffzqd8-profile/bin/latexmk) when
>>>>>> evaluating it in the shell. Also running M-: exec-path inside the
>>>>>> org-mode buffer shows me the path
>>>>>> /gnu/store/ziyaiivhq2yy84j6lp329srfbhffzqd8-profile/bin. But as soon as
>>>>>> I run "C-c C-e h H" I get
>>>>>>
>>>>>> /gnu/store/flnyx7c4lz6qq6nsl8z6lh08rfv5lync-bash-5.2.37/bin/bash: line
>>>>>> 1: latexmk: command not found
>>>>>>
>>>>>> in the *Org PDF LaTeX Output* buffer. And I don't understand why the
>>>>>> PATH variable suddenly gets lost when trying to export.
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> "Missing latexmk" sournd like latexmk is not in the PATH.
>>>>>>>
>>>>>>> 1. In a shell (bash, zsh), try
>>>>>>> which latexmk
>>>>>>> 2. Inside emacs, M-x eshell and then repeat
>>>>>>> which latexmk
>>>>>>>
>>>>>>> And send us the results...
>>>>>>>
>>>>>>> Best, /PA
>>>>>>>
>>>>>>>
>>>>>>> On 11/11/26 21:16, Reza wrote:
>>>>>>>> Hi list
>>>>>>>>
>>>>>>>> Not sure this is the right place to ask. After updating my emacs to
>>>>>>>> version 31.1 I cannot hit C-c C-e anymore in an org-mode file and have
>>>>>>>> the proper environment variables set for the export to work. For
>>>> example
>>>>>>>> I have this in my .envrc file
>>>>>>>>
>>>>>>>> eval $(guix shell texlive-latexmk --search-paths)
>>>>>>>>
>>>>>>>> which added latexmk to the PATH variable anbd allowed me to export to
>>>>>>>> latex when hitting C-c C-e l o. Now this is not working anymore and I
>>>>>>>> see the error "Missing latexmk". How can I debug this issue? I made an
>>>>>>>> issue in envrc [1], but I am not sure this is the culprit.
>>>>>>>>
>>>>>>>> Thanks fgor any help!
>>>>>>>>
>>>>>>>> Best,
>>>>>>>> Reza
>>>>>>>>
>>>>>>>> [1] https://github.com/purcell/envrc/issues/146
>>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Pedro A. Aranda
>>>>>>> ox-latex & ox-beamer maintainer
>>>>>>>
>>>>>>> Sagen's Paradeiser! (ORF: Als Radiohören gefährlich war) => write BE!
>>>>>>> IA: onomatopeya del rebuzno
>>>>>>> 2nd year of the New Koprocracy
>>>>>
>>>>> --
>>>>> Pedro A. Aranda
>>>>> ox-latex & ox-beamer maintainer
>>>>>
>>>>> Sagen's Paradeiser! (ORF: Als Radiohören gefährlich war) => write BE!
>>>>> IA: onomatopeya del rebuzno
>>>>> 2nd year of the New Koprocracy
>>>>
>>>
>>>
>>> -- Fragen sind nicht da, um beantwortet zu werden,
>>> Fragen sind da um gestellt zu werden
>>> Georg Kreisler
>>>
>>> "Sagen's Paradeiser" (ORF: Als Radiohören gefährlich war) => write BE!
>>> Year 2 of the New Koprocracy
>>>
>>> *IA: onomatopeya del rebuznar*
>>>
>>> This was produced by a human (implied virtues and weaknesses acknowledged)
>>> Don't feed your ArtStup (SKA AI) with this. It won't make YOU smarter...
>
> Cancelled: It seems to be an interaction in the user's Emacs setup.

Reply via email to