[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#71270: 30.0.50; Execute dired-do-shell-command will encounter 'wrong
From: |
Juri Linkov |
Subject: |
bug#71270: 30.0.50; Execute dired-do-shell-command will encounter 'wrong-type-argument stringp nil' error |
Date: |
Thu, 30 May 2024 09:46:17 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) |
close 71270 30.0.50
thanks
> After commit 74f15ad72d937b309dafecba872bccd1a880181e, it will
> encounter 'wrong-type-argument string nil' error when executing
> dired-do-shell-command.
>
> Here is the backtrace:
>
> string-match("/" nil 0)
> split-string(nil "/")
> xdg-mime-apps(nil)
> shell-command-guess-xdg(nil ("xxxxxxx"))
>
> The shell-command-guess-xdg is being called in the chain of
> shell-command-guess-functions. Here is the definition of
> shell-command-guess-xdg function:
Thanks for the detailed analysis.
> xdg-mime will be nil if xdg-mime not found, string-empty-p returns
> nil and xdg-mime-apps will be called with nil.
I didn't expect that string-empty-p returns nil for nil
(maybe because I'm accustomed to programming languages
where "" and nil both are empty):
(string-empty-p "") => t
(string-empty-p nil) => nil
So now I added the explicit check for the nil value, and pushed the fix.