all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Al Petrofsky <al@petrofsky.org>
To: 64102@debbugs.gnu.org,
	Jacob Burckhardt <jacob@teamconnectusa.com>,
	Eli Zaretskii <eliz@gnu.org>, Paul Eggert <eggert@cs.ucla.edu>,
	Lars Ingebrigtsen <larsi@gnus.org>
Subject: bug#64102: 28.2; fails to find pathname with a sub dir as symlink and with parent dir ('..')
Date: Sun, 18 Jun 2023 16:13:16 -0400	[thread overview]
Message-ID: <CAPMQwz4nWyUYEOVfsSQn4jyp9DTiNzPwtQNo5+M=aUZ4A11uHw@mail.gmail.com> (raw)
In-Reply-To: <SJ0PR13MB5474AA2778DC60B7CC3112D3D4569@SJ0PR13MB5474.namprd13.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 2365 bytes --]

Jacob:
> cat /tmp/lib2/gcc/x86_64-linux-gnu/12/../../../../include/test.h
> emacs -q /tmp/lib2/gcc/x86_64-linux-gnu/12/../../../../include/test.h

> Emacs failed to display the content of that file in a buffer.  Since
> the above cat command shows the contents, Emacs should be able to show
> it as well.

Paul:
> Emacs's behavior is well-documented and longstanding. It's also wrong,
> in that it disagrees with almost every other program and it therefore
> confuses users, particularly non-experts.
>
> One possible way out would be to add a user-settable flag to select the
> longstanding Emacs behavior, or the behavior of most other programs. We
> could document that the default might change in the future. Of course
> this approach would have its own problems.

Eli:
> My take from the description of the issue is that we'd need to change
> expand-file-name to follow symlinks, i.e. hit the disk, something that
> it never did, at least not on Posix platforms.  If this is what is
> needed, it would have serious implications, at least performance-wise,
> because expand-file-name is called everywhere in Emacs where we deal
> with file names.

Perhaps another approach would be that Emacs continues to have its own
idiosyncratic understanding of pathnames internally, but pathnames
that come in from external sources are interpreted correctly according
to the rules of the external environment.

That seems to be the approach that was taken by Lars in 2021 to fix
bug 8035 (referenced by Jacob in the first message of the current
bug).  See the patch that added file-truename calls to compile.el:


http://git.savannah.gnu.org/cgit/emacs.git/commit/lisp/progmodes/compile.el?id=ee2ffd9c9eb33a17307f36ff58caec1ba79878d2

As far as I can tell, that change was made without adding a
user-settable flag to select the old behavior, nor with any
announcement in NEWS or in the manual.  Are any problems known to have
arisen yet?

The current bug could similarly be fixed by making any filename that
is obtained from the argv of emacs or emacsclient be passed through
file-truename.  I don't know how much work that would be to implement,
or how many user-confusing situations would remain and/or be created,
but at least I don't see it being a performance problem, as the cost
of an exec of emacs or emacsclient would likely dwarf the cost of the
truename calls.

[-- Attachment #2: Type: text/html, Size: 2801 bytes --]

  parent reply	other threads:[~2023-06-18 20:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-15 22:25 bug#64102: 28.2; fails to find pathname with a sub dir as symlink and with parent dir ('..') Jacob Burckhardt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-16  7:11 ` Eli Zaretskii
2023-06-18  8:53   ` Eli Zaretskii
2023-06-18 18:03     ` Paul Eggert
2023-06-18 18:25       ` Eli Zaretskii
2023-06-18 18:43         ` Paul Eggert
2023-06-18 20:13 ` Al Petrofsky [this message]
2023-06-19 19:03   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPMQwz4nWyUYEOVfsSQn4jyp9DTiNzPwtQNo5+M=aUZ4A11uHw@mail.gmail.com' \
    --to=al@petrofsky.org \
    --cc=64102@debbugs.gnu.org \
    --cc=eggert@cs.ucla.edu \
    --cc=eliz@gnu.org \
    --cc=jacob@teamconnectusa.com \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.