emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] org-macs: Fix incorrect use of relative paths in org-compile


From: Ihor Radchenko
Subject: Re: [PATCH] org-macs: Fix incorrect use of relative paths in org-compile-file
Date: Sat, 05 Aug 2023 10:23:59 +0000

Roshan Shariff <roshan.shariff@gmail.com> writes:

> * org-macs.el (org-compile-file, org-compile-file-commands): Avoid
> converting the source path to be relative to the default-directory,
> which breaks for absolute source paths when the current directory is a
> symlink.
>
> Commit 5a8a1d4ff [1] changed org-compile-file to use
> `file-relative-name` for the source argument. This was intended to fix
> bug [2] by expanding ~ directories in the source path, like a shell.

Thanks for the report and for providing a detailed explanation with a
patch!

I have a few comments.

First, minor one: please put two spaces between sentences in the commit
message. It is our convention.

> -         (output (expand-file-name (concat (file-name-base source) "." ext)
> -                                   (file-name-directory source)))
> +         (output (file-name-concat (file-name-directory source)
> +                                   (concat (file-name-base source) "." ext)))

`file-name-concat' is only available since Emacs 28.
Please use `org-file-name-concat'.

> -                          (?f . ,(shell-quote-argument relative-name))
> +                          (?f . ,(shell-quote-argument source))

This will break user expectations.
The PROCESS argument can, for example, be `org-latex-pdf-process', which
promises that "%f in the command will be replaced by the relative file
name" (see the docstring).

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]