GNU bug report logs - #66638
29.1; `file-relative-name' and symbolic links

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Bogdan Ruslanovich Drozd <bogdan.ruslanovich.drozd@HIDDEN>; Keywords: notabug; dated Thu, 19 Oct 2023 13:38:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Added tag(s) notabug. Request was from Eli Zaretskii <eliz@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 66638 <at> debbugs.gnu.org:


Received: (at 66638) by debbugs.gnu.org; 19 Oct 2023 14:13:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 19 10:13:22 2023
Received: from localhost ([127.0.0.1]:37381 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qtTm6-00069W-5l
	for submit <at> debbugs.gnu.org; Thu, 19 Oct 2023 10:13:22 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:46914)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>)
 id 1qtTm3-00069E-Iz; Thu, 19 Oct 2023 10:13:20 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1qtTlX-00068R-5e; Thu, 19 Oct 2023 10:12:47 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=pZJgLc1J9XFVtvQCl7EAQE6tn3YnzFJSG0fxPMVdQQs=; b=QCMLzr/PX8uR
 Mv4L/HaVH2J7XAKIktqevTqaoks6u8XsjLLrrXiZMbWRAGk462B8ZjaxIj7+a5f84ZbcQXWELsXxP
 H4J4I4WCkDDJoBuYe3cWCOSBdRAS6Qgvi2SF6T+cPEJT2FbfjPf4wHLgY3CwApJppvIM/tBZl916c
 blehz3F4e3lSx9fj5/YBcVRcHMCQuxr5dTj4njEzOJ50G0eI23tDU/Fl2Lusg3FHgQp+6p/HTqfFh
 ankHz8lbmopRRokOjlI0MSgj5Is5d88dFKu8zHtF4pOL6xRfXovkc9bhf+SsynFmR58SrmiZ2P8w6
 Qz+N3GRLl5RpElZXPTLeRA==;
Date: Thu, 19 Oct 2023 17:12:39 +0300
Message-Id: <83fs26u2eg.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Bogdan Ruslanovich Drozd <bogdan.ruslanovich.drozd@HIDDEN>
In-Reply-To: <87a5sed99n.fsf@HIDDEN> (message from Bogdan Ruslanovich
 Drozd on Thu, 19 Oct 2023 16:36:20 +0300)
Subject: Re: bug#66638: 29.1; `file-relative-name' and symbolic links
References: <87a5sed99n.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 66638
Cc: 66638 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

tags 66638 notabug
thanks

> From: Bogdan Ruslanovich Drozd <bogdan.ruslanovich.drozd@HIDDEN>
> 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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#66638; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 19 Oct 2023 13:38:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 19 09:37:59 2023
Received: from localhost ([127.0.0.1]:36114 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qtTDr-0004ZC-83
	for submit <at> debbugs.gnu.org; Thu, 19 Oct 2023 09:37:59 -0400
Received: from lists.gnu.org ([2001:470:142::17]:41574)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bogdan.ruslanovich.drozd@HIDDEN>)
 id 1qtTD7-0004Xw-Vt
 for submit <at> debbugs.gnu.org; Thu, 19 Oct 2023 09:37:15 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <bogdan.ruslanovich.drozd@HIDDEN>)
 id 1qtTCW-0002hl-N9
 for bug-gnu-emacs@HIDDEN; Thu, 19 Oct 2023 09:36:37 -0400
Received: from forward101b.mail.yandex.net ([178.154.239.148])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <bogdan.ruslanovich.drozd@HIDDEN>)
 id 1qtTCS-0001e3-MN
 for bug-gnu-emacs@HIDDEN; Thu, 19 Oct 2023 09:36:35 -0400
Received: from mail-nwsmtp-smtp-production-main-60.sas.yp-c.yandex.net
 (mail-nwsmtp-smtp-production-main-60.sas.yp-c.yandex.net
 [IPv6:2a02:6b8:c14:150a:0:640:1aa5:0])
 by forward101b.mail.yandex.net (Yandex) with ESMTP id 7967060ABC
 for <bug-gnu-emacs@HIDDEN>; Thu, 19 Oct 2023 16:36:22 +0300 (MSK)
Received: by mail-nwsmtp-smtp-production-main-60.sas.yp-c.yandex.net
 (smtp/Yandex) with ESMTPSA id LamJJU6Wra60-AAzhnfl8; 
 Thu, 19 Oct 2023 16:36:21 +0300
X-Yandex-Fwd: 1
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.com; s=mail;
 t=1697722582; bh=Z/4qMCyBN9OxmdZIYgEk/UmmBfRhPUNKMBIMdNEwg00=;
 h=Message-ID:Date:Subject:To:From;
 b=ielrGwMaTAKwh19nmyaBsLW77s7DBg6SnRnshqucF05Mxb+DH9VigsQa+t0u5kdu2
 0Ea+4+sooqmGrGnZGGbDr7hqYAHUj3o2DgyhBWElnB2BAGtUGeuLMVFhh23XSTE+lE
 thFO4zJ1DVimQBiSV1O2bhvoIZK9QfHj7E0wtZ3E=
Authentication-Results: mail-nwsmtp-smtp-production-main-60.sas.yp-c.yandex.net;
 dkim=pass header.i=@yandex.com
From: Bogdan Ruslanovich Drozd <bogdan.ruslanovich.drozd@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 29.1; `file-relative-name' and symbolic links
Date: Thu, 19 Oct 2023 16:36:20 +0300
Message-ID: <87a5sed99n.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=178.154.239.148;
 envelope-from=bogdan.ruslanovich.drozd@HIDDEN;
 helo=forward101b.mail.yandex.net
X-Spam_score_int: 9
X-Spam_score: 0.9
X-Spam_bar: /
X-Spam_report: (0.9 / 5.0 requ) AC_FROM_MANY_DOTS=2.999, BAYES_00=-1.9,
 DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 3.0 (+++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  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 symb [...] 
 Content analysis details:   (3.0 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (bogdan.ruslanovich.drozd[at]yandex.com)
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
 1.0 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
 2.0 SPOOFED_FREEMAIL       No description available.
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Thu, 19 Oct 2023 09:37:58 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

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.

In GNU Emacs 29.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38,
 cairo version 1.17.8) of 2023-09-30 built on localhost
Windowing system distributor 'The X.Org Foundation', version 11.0.12101008
System Description: Gentoo Linux

Configured using:
 'configure --prefix=/usr --build=x86_64-pc-linux-gnu
 --host=x86_64-pc-linux-gnu --mandir=/usr/share/man
 --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc
 --localstatedir=/var/lib --datarootdir=/usr/share
 --disable-silent-rules --docdir=/usr/share/doc/emacs-29.1-r1
 --htmldir=/usr/share/doc/emacs-29.1-r1/html --libdir=/usr/lib64
 --program-suffix=-emacs-29 --includedir=/usr/include/emacs-29
 --infodir=/usr/share/info/emacs-29 --localstatedir=/var
 --enable-locallisppath=/etc/emacs:/usr/share/emacs/site-lisp
 --without-compress-install --without-hesiod --without-pop
 --with-file-notification=inotify --with-pdumper --enable-acl
 --with-dbus --with-modules --without-gameuser --with-libgmp --with-gpm
 --with-native-compilation=aot --with-json --without-kerberos
 --without-kerberos5 --with-lcms2 --with-xml2 --without-mailutils
 --without-selinux --with-sqlite3 --with-gnutls --with-libsystemd
 --with-threads --with-tree-sitter --without-wide-int --with-sound=alsa
 --with-zlib --with-x --without-pgtk --without-ns --without-gconf
 --without-gsettings --without-toolkit-scroll-bars --with-xpm --with-xft
 --with-cairo --with-harfbuzz --without-libotf --without-m17n-flt
 --with-x-toolkit=gtk3 --without-xwidgets --with-gif --with-jpeg
 --with-png --with-rsvg --with-tiff --with-webp --with-imagemagick
 --with-dumping=pdumper 'CFLAGS=-O2 -pipe' 'LDFLAGS=-Wl,-O1
 -Wl,--as-needed''

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM HARFBUZZ IMAGEMAGICK
JPEG JSON LCMS2 LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY
PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TREE_SITTER WEBP X11
XDBE XIM XINPUT2 XPM GTK3 ZLIB

Important settings:
  value of $LC_COLLATE: C.utf8
  value of $LC_MONETARY: en_GB.utf8
  value of $LANG: en_US.utf8
  locale-coding-system: utf-8-unix




Acknowledgement sent to Bogdan Ruslanovich Drozd <bogdan.ruslanovich.drozd@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#66638; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 19 Oct 2023 14:15:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.