all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: rpluim@gmail.com,  emacs-devel@gnu.org,  esr@thyrsus.com
Subject: Re: master 400df210ce0: Fix last change of 'delete-file'
Date: Fri, 11 Aug 2023 19:24:25 +0200	[thread overview]
Message-ID: <87ttt5sd9y.fsf@gmx.de> (raw)
In-Reply-To: <834jl5hj9x.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 11 Aug 2023 15:10:18 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

Hi Eli,

> Primitives indeed _must_ call expand-file-name.  And expand-file-name
> does that with default-directory because it accepts a directory as its
> 2nd argument, and that argument defaults to default-directory.

Do you want two different versions of find-file-name-handler? One used
for primitives in C core which doesn't apply expand-file-name, and
another version for file operations in Lisp?

> The addition of expand-file-name to delete-file made that function a
> bit slower, and for local files that is a net loss.  We should extend
> instead find-file-name-handler to work for non-absolute file names to
> avoid this overhead.

It is not a recent addition, it has been there for ages. In Fdelete_file.

I vaguely remember that I've tried that approach many years ago, in my
early years working for Tramp. There were subtle bugs, hard to fix,
because of this. But I don't remember the details.

>> I wouldn't touch this as it works. Improvements in documentation might
>> be appreciated.
>
> Indeed, the fact that find-file-name-handler needs an absolute file
> name is never mentioned anywhere in the documentation.  It is strange
> this didn't pop up earlier.

find-file-name-handler does not need an absolute file name in
general. Several handlers are invoked based on the file name
extensions. It are the remote file names which require absolute file
names.

If we add expand-file-name for cases it isn't applied yet, Emacs might
become slower. And perhaps we introduce new faults by this, because
everybody has arranged with the current behavior.

Best regards, Michael.



  reply	other threads:[~2023-08-11 17:24 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <169133064669.24990.11219399079845613336@vcs2.savannah.gnu.org>
     [not found] ` <20230806140407.09E6BC038BE@vcs2.savannah.gnu.org>
2023-08-10 13:12   ` master 400df210ce0: Fix last change of 'delete-file' Robert Pluim
2023-08-10 13:25     ` Eli Zaretskii
2023-08-10 13:44       ` Robert Pluim
2023-08-10 13:57         ` Eli Zaretskii
2023-08-10 14:41           ` Robert Pluim
2023-08-10 15:00             ` Eli Zaretskii
2023-08-11  7:33               ` Michael Albinus
2023-08-11 10:59                 ` Eli Zaretskii
2023-08-11 11:02                 ` Eli Zaretskii
2023-08-11 11:41                   ` Michael Albinus
2023-08-11 12:10                     ` Eli Zaretskii
2023-08-11 17:24                       ` Michael Albinus [this message]
2023-08-11 17:47                         ` Eli Zaretskii
2023-08-12  9:57                           ` Michael Albinus
2023-08-12 10:36                             ` Eli Zaretskii
2023-08-12 11:03                               ` Michael Albinus

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=87ttt5sd9y.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=esr@thyrsus.com \
    --cc=rpluim@gmail.com \
    /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.