[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#66638: 29.1; `file-relative-name' and symbolic links
From: |
Eli Zaretskii |
Subject: |
bug#66638: 29.1; `file-relative-name' and symbolic links |
Date: |
Thu, 19 Oct 2023 17:12:39 +0300 |
tags 66638 notabug
thanks
> From: Bogdan Ruslanovich Drozd <bogdan.ruslanovich.drozd@yandex.com>
> Date: Thu, 19 Oct 2023 16:36:20 +0300
>
> How I found the bug: LaTeX previews were not displayed in Org mode
> because the path where the file lies contains a symbolic link
> (e.g. `/home/user/docs/org' directory where `/home/user/docs' is a
> symbolic link to a directory).
>
> Bug description: `file-relative-name' (in `files.el') doesn't take into
> account symbolic links.
>
> How to reproduce:
>
> 1. Run `mkdir -p ~/a_dir/org'.
>
> 2. Run `ln -s ~/a_dir/org ~/docs'.
>
> 3. Run `emacs -Q ~/docs/example.org'.
>
> 4. Insert into the file "$2+2=4$", press `C-c C-x C-l', and see that it
> does not work.
>
> 5. Kill emacs.
>
> 6. Run `emacs -Q ~/a_dir/org/example.org'.
>
> 7. Insert into the file "$2+2=4$, press `C-c C-x C-l', and see LaTeX
> preview.
This is not a bug. If you want to resolve symlinks in a file name,
use file-truename before calling file-relative-name. The latter is
purely a syntactic function which merely analyzes its file name
argument, and should not hit the disk.