unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Philip Kaludercic <philipk@posteo.net>
Cc: 69606@debbugs.gnu.org
Subject: bug#69606: [PATCH] Ensure default-directory exists when generating diff
Date: Sat, 09 Mar 2024 17:45:56 +0100	[thread overview]
Message-ID: <8734szz73v.fsf@gmx.de> (raw)
In-Reply-To: <87sf115fn2.fsf@posteo.net> (Philip Kaludercic's message of "Fri,  08 Mar 2024 07:47:29 +0000")

Philip Kaludercic <philipk@posteo.net> writes:

Hi Philip,

> The reason I was thinking about a more general solution, is that
> something like
>
> (let ((default-directory "/this/does/not/exists"))
>   (make-process :command '("true")))
>
> will always fail, even though "true" doesn't use the current working
> directory.  I think it would be useful to have some :fallback option for
> these situations, to ensure that if `default-directory' doesn't exist,
> any other directory should be used instead.

This is a more general request than just make it work for "diff".

Well, there is a reason that `default-directory' isn't set to something
else behind your back, if it doesn't exist. Processes can use relative
file names as arguments, and it is always better to fail with an error
message instead of doing something unexpected you even don't know about.

Best regards, Michael.





      reply	other threads:[~2024-03-09 16:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-07  9:27 bug#69606: [PATCH] Ensure default-directory exists when generating diff Philip Kaludercic
2024-03-07 10:19 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-08  7:47   ` Philip Kaludercic
2024-03-09 16:45     ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors [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=8734szz73v.fsf@gmx.de \
    --to=bug-gnu-emacs@gnu.org \
    --cc=69606@debbugs.gnu.org \
    --cc=michael.albinus@gmx.de \
    --cc=philipk@posteo.net \
    /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).