From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs 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 Organization: LINKOV.NET Message-ID: <86y17rg5hq.fsf@mail.linkov.net> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7829"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: 71270@debbugs.gnu.org To: Yuwei Tian Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 30 08:51:10 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sCZd0-0001tj-RY for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 30 May 2024 08:51:10 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCZck-0000t2-1a; Thu, 30 May 2024 02:50:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCZci-0000ri-Rt for bug-gnu-emacs@gnu.org; Thu, 30 May 2024 02:50:52 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sCZci-00013I-Jn for bug-gnu-emacs@gnu.org; Thu, 30 May 2024 02:50:52 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sCZcs-0006UD-FR for bug-gnu-emacs@gnu.org; Thu, 30 May 2024 02:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 30 May 2024 06:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71270 X-GNU-PR-Package: emacs Original-Received: via spool by 71270-submit@debbugs.gnu.org id=B71270.171705185024896 (code B ref 71270); Thu, 30 May 2024 06:51:02 +0000 Original-Received: (at 71270) by debbugs.gnu.org; 30 May 2024 06:50:50 +0000 Original-Received: from localhost ([127.0.0.1]:49001 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sCZcf-0006TS-Qj for submit@debbugs.gnu.org; Thu, 30 May 2024 02:50:50 -0400 Original-Received: from relay4-d.mail.gandi.net ([217.70.183.196]:36125) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sCZcd-0006T3-8L; Thu, 30 May 2024 02:50:47 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 547E6E0003; Thu, 30 May 2024 06:50:09 +0000 (UTC) In-Reply-To: (Yuwei Tian's message of "Thu, 30 May 2024 14:24:35 +0800") X-GND-Sasl: juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:286198 Archived-At: 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.