unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: dalanicolai <dalanicolai@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 66542-done@debbugs.gnu.org
Subject: bug#66542: Fix: locate-dominating-file predicate should receive dir not file
Date: Thu, 26 Oct 2023 15:27:54 +0200	[thread overview]
Message-ID: <CACJP=3=VA-VEc06ZvjnYNZUm_tc2vjUSvSrTdHPUtBkOjm6G3g@mail.gmail.com> (raw)
In-Reply-To: <834jiekflf.fsf@gnu.org>

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

Thank you Eli!

On Wed, 25 Oct 2023 at 15:15, Eli Zaretskii <eliz@gnu.org> wrote:

> > From: dalanicolai <dalanicolai@gmail.com>
> > Date: Sat, 21 Oct 2023 17:39:17 +0200
> > Cc: 66542@debbugs.gnu.org
> >
> > You are right (of course :)
> > So I have attached another patch which only strips the file name
> (applies file-name-directory) if the file
> > is not a directory.
> >
> > If the file is not a directory, then that stripped name should also be
> returned by the function, i.e. in the
> > 'cond`, root should be set to the stripped file name. Therefore, the
> patched version simply 'checks
> > and sets' the file name first inside the setq.
> >
> > Also, now we can remove the check in the first clause of the 'if' (of
> 'setq try'), because 'file' is
> > guaranteed to be a directory name, and the existence of the directory
> name is already checked by
> > the 'file-exists-p'.
> >
> > This change does not affect other parts of the function (except that it
> speeds it up a little, because it
> > excludes the cycles, that only strip the file names in case file is a
> 'real' file.
> > Indeed, the function should only check for 'parent directories' (not
> files).
>
> Thanks, installed on master, and closing the bug.
>

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

      reply	other threads:[~2023-10-26 13:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-14 15:11 bug#66542: Fix: locate-dominating-file predicate should receive dir not file dalanicolai
2023-10-14 15:46 ` Eli Zaretskii
2023-10-21 15:39   ` dalanicolai
2023-10-25 13:15     ` Eli Zaretskii
2023-10-26 13:27       ` dalanicolai [this message]

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='CACJP=3=VA-VEc06ZvjnYNZUm_tc2vjUSvSrTdHPUtBkOjm6G3g@mail.gmail.com' \
    --to=dalanicolai@gmail.com \
    --cc=66542-done@debbugs.gnu.org \
    --cc=eliz@gnu.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).