From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii 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:52:05 +0300 Message-ID: <86wmnbrduy.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17682"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 71270@debbugs.gnu.org To: Yuwei Tian , Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 30 08:53:11 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 1sCZew-0004P2-CT for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 30 May 2024 08:53:10 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCZef-0001RK-9Q; Thu, 30 May 2024 02:52:53 -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 1sCZee-0001R8-6p for bug-gnu-emacs@gnu.org; Thu, 30 May 2024 02:52: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 1sCZed-0001bX-UJ for bug-gnu-emacs@gnu.org; Thu, 30 May 2024 02:52:51 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sCZeo-0006Yw-6h for bug-gnu-emacs@gnu.org; Thu, 30 May 2024 02:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 30 May 2024 06:53: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.171705194525157 (code B ref 71270); Thu, 30 May 2024 06:53:02 +0000 Original-Received: (at 71270) by debbugs.gnu.org; 30 May 2024 06:52:25 +0000 Original-Received: from localhost ([127.0.0.1]:49078 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sCZeD-0006Xg-IC for submit@debbugs.gnu.org; Thu, 30 May 2024 02:52:25 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:46994) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sCZeB-0006XM-IZ for 71270@debbugs.gnu.org; Thu, 30 May 2024 02:52:24 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCZdv-0001Gs-Lk; Thu, 30 May 2024 02:52:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=JoG+xSQF1H4q1i7tfAeJ5f4Up6jfckyXbH51tIT7XOg=; b=XOZX/JtZKv49 1WHBSEBr4+24CIzqlE/FyKKbfHBXAd03zNIFuqKPb0WbksHu3g1RxmoAfd4aUHBOPuz+e4Lq6P9Dq 37HDEqMfCOEqz0zjkdOzz3VyMhUinl/mASlAZkycF0AI6w3w7RtGF5VE0LOzT48PwRgtXg9KPfxKz ZsQ5/vvf7h4pFzHq7KnULEi8Br9toGHrSIF6TQfuyEPTGfpiXtzG+IdAr0F/BBbPnRxeO5mlk+6y9 dKViH/sc/nMROkMKpgttyD4fS0/K1AL5D+2+kVTcIrhhNjjHEVi28nAbYbC2aanVczTgq36cU9mE4 ERjGR8FnXwf1gYlIRaRGHw==; In-Reply-To: (message from Yuwei Tian on Thu, 30 May 2024 14:24:35 +0800) 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:286199 Archived-At: > From: Yuwei Tian > Date: Thu, 30 May 2024 14:24:35 +0800 > > 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: > > (defun shell-command-guess-xdg (commands files) > "Populate COMMANDS by XDG configuration for FILES." > (require 'xdg) > (let* ((xdg-mime (when (executable-find "xdg-mime") > (string-trim-right > (shell-command-to-string > (concat "xdg-mime query filetype " > (shell-quote-argument (car files))))))) > (xdg-mime-apps (unless (string-empty-p xdg-mime) > (xdg-mime-apps xdg-mime))) > (xdg-commands > (mapcar (lambda (desktop) > (setq desktop (xdg-desktop-read-file desktop)) > (propertize > (replace-regexp-in-string > " .*" "" (gethash "Exec" desktop)) > 'name (gethash "Name" desktop))) > xdg-mime-apps))) > (append xdg-commands commands))) > > xdg-mime will be nil if xdg-mime not found, string-empty-p returns > nil and xdg-mime-apps will be called with nil. Thanks, I'm adding Juri to this discussion.