all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: 60100@debbugs.gnu.org
Subject: bug#60100: 29.0.60; project-current is not resilient
Date: Sun, 18 Dec 2022 10:38:30 +0200	[thread overview]
Message-ID: <865ye9ay0x.fsf@mail.linkov.net> (raw)
In-Reply-To: <525c62db-7562-46e3-b58c-92d97e0a4322@yandex.ru> (Dmitry Gutov's message of "Sun, 18 Dec 2022 02:41:05 +0200")

tags 60100 + notabug
close 60100 29.0.60
quit

>> Is this intentional that
>> ```
>> (project-current nil "/tmp/nonexistent/")
>> ```
>> raises the error
>>    Debugger entered--Lisp error: (file-missing "Opening directory" "No
>> such file or directory" "/tmp/nonexistent")
>> instead of silently returning nil.
>
> I would say this is expected.
>
> How could we avoid this? By adding a file-exists-p check somewhere inside,
> right? And failing silently if it returns nil.
>
> Right now the caller code needs to use that check. Or, more likely, figure
> out why they are passing in a directory that does not exist.

The problem is that callers are unaware that they need to handle this case
until they get the error that then get to use file-exists-p.  But actually
this problem is not specific to project.  Many other commands fail in such
circumstances too.  For example, 'dired-jump' raises an error on a deleted
directory as well:

  (file-missing "Setting current directory" "No such file or directory")

So now closing.





      reply	other threads:[~2022-12-18  8:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-15 19:00 bug#60100: 29.0.60; project-current is not resilient Juri Linkov
2022-12-18  0:41 ` Dmitry Gutov
2022-12-18  8:38   ` Juri Linkov [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

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

  git send-email \
    --in-reply-to=865ye9ay0x.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=60100@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    /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.