From unknown Thu Jun 19 14:00:37 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#71270 <71270@debbugs.gnu.org> To: bug#71270 <71270@debbugs.gnu.org> Subject: Status: 30.0.50; Execute dired-do-shell-command will encounter 'wrong-type-argument stringp nil' error Reply-To: bug#71270 <71270@debbugs.gnu.org> Date: Thu, 19 Jun 2025 21:00:37 +0000 retitle 71270 30.0.50; Execute dired-do-shell-command will encounter 'wrong= -type-argument stringp nil' error reassign 71270 emacs submitter 71270 Yuwei Tian severity 71270 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Thu May 30 02:25:05 2024 Received: (at submit) by debbugs.gnu.org; 30 May 2024 06:25:05 +0000 Received: from localhost ([127.0.0.1]:48150 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sCZDk-0005bo-Vi for submit@debbugs.gnu.org; Thu, 30 May 2024 02:25:05 -0400 Received: from lists.gnu.org ([209.51.188.17]:37672) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sCZDh-0005bY-VX for submit@debbugs.gnu.org; Thu, 30 May 2024 02:25:03 -0400 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 1sCZDX-0003iM-96 for bug-gnu-emacs@gnu.org; Thu, 30 May 2024 02:24:51 -0400 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sCZDV-0004b9-Hw for bug-gnu-emacs@gnu.org; Thu, 30 May 2024 02:24:51 -0400 Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-57863a8f4b2so501033a12.0 for ; Wed, 29 May 2024 23:24:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717050287; x=1717655087; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=ISOO9slEkYnc8OmYp28tz0m5sjYFYUGT2wg5MFzROSM=; b=bUqXKYnIeuIh0I504aQZfeY09M8oQQFQ8dI32o4bOqQe9H57Kaqmmzj+Cl4C5eL1Bm Zw87biPAHwWTwblTKuDNRzuN7W5OGYR6fc7CuyzX6STptJuuEgYFfMwtAwhVX0liSlHd 9blKIceFh0Hj9J3+SrhLQJv7g1mDwAzButpmhe5kosh3lxKT/IwFgZFOuoSP18Tzeuv3 PYRvHIQimMRYdq13i/jTLznMjg3nsD7kUNRUJk5LBtRExf1kiUeci++Cvb7mi/KsJSPL 8UARvt81yaP53nEkQ6jP2fjn8TZ0+cV59E6EwJ8xCT9rhaxqtgnO4C/NtK4NmtA0Fbuw aD9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717050287; x=1717655087; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ISOO9slEkYnc8OmYp28tz0m5sjYFYUGT2wg5MFzROSM=; b=TBAA/S03lgpeYqCX4laKciEjrxTRVZwqQQsTOGe6jOP1MAv5xLMZGiOG3NZypbC3Qi 0pBg/gXmFTPOj/11fb2rq5qcxkUgrMC+RJjd6v7BMFSMM/jHEjmqgKPAKdPEHV2PDkLx iX5pTG+1gXz5PEzP2oPaL94dXR1N1672seGmYabNaHCpm81X81cwZd+JTuTebRJUyMLW kp1Hr9or1hBOxarqVLgF8R8dGnAylkb0bUrcoakrZKmWdOPtyl186OCePSynAKDZr90v WUstsF9FGGPeGpK0Ivp/ukP0peV4Mxy+55ZaLxeEpX+yuz1jnxrb/1hNDvwgA5DElpej 5sGA== X-Gm-Message-State: AOJu0YzEhPVHX/2fxHiio4hYybaq1qpxcyrWtTWmP8wcBeitLjW6JTb+ vxODxwViT8mviCkRjy59X1g8pv0N5Wk9iO4a7z3yuoh/vtyv24B1hAmMAxaB52iBJafZwgPbDdA Rf32hSpVyFPsZ1hCAiOZ1ql++B1Zrqs2s X-Google-Smtp-Source: AGHT+IHyYMf5+d7ZS1B7kL6OG9zDAFz0sGC4k+3/1xeu7hW5zs36wV9dNhTcgOHydMrCalduoawhyQ7zSIwHdclYLqk= X-Received: by 2002:a05:6402:901:b0:572:4702:2227 with SMTP id 4fb4d7f45d1cf-57a17918b6fmr654533a12.35.1717050287092; Wed, 29 May 2024 23:24:47 -0700 (PDT) MIME-Version: 1.0 From: Yuwei Tian Date: Thu, 30 May 2024 14:24:35 +0800 Message-ID: Subject: 30.0.50; Execute dired-do-shell-command will encounter 'wrong-type-argument stringp nil' error To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2a00:1450:4864:20::52c; envelope-from=fishtai0@gmail.com; helo=mail-ed1-x52c.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) 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. In GNU Emacs 30.0.50 (build 1, x86_64-apple-darwin23.5.0, NS appkit-2487.60 Version 14.5 (Build 23F79)) of 2024-05-30 built on fishtai0-mac.local Windowing system distributor 'Apple', version 10.3.2487 System Description: macOS 14.5 Configured using: 'configure --disable-dependency-tracking --disable-silent-rules --enable-locallisppath=/usr/local/share/emacs/site-lisp --infodir=/usr/local/Cellar/emacs-plus@30/30.0.50/share/info/emacs --prefix=/usr/local/Cellar/emacs-plus@30/30.0.50 --with-xml2 --with-gnutls --without-compress-install --without-dbus --without-imagemagick --with-modules --with-rsvg --with-webp --with-ns --disable-ns-self-contained 'CFLAGS=-Os -w -pipe -march=westmere -mmacosx-version-min=14 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -DFD_SETSIZE=10000 -DDARWIN_UNLIMITED_SELECT' 'CPPFLAGS=-I/usr/local/opt/icu4c/include -I/usr/local/opt/sqlite/include -I/usr/local/opt/readline/include -F/usr/local/Frameworks -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk' 'LDFLAGS=-L/usr/local/opt/icu4c/lib -L/usr/local/opt/sqlite/lib -L/usr/local/opt/readline/lib -L/usr/local/lib -F/usr/local/Frameworks -Wl,-headerpad_max_install_names -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk'' Configured features: ACL GIF GLIB GMP GNUTLS JPEG LCMS2 LIBXML2 MODULES NOTIFY KQUEUE NS PDUMPER PNG RSVG SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM ZLIB Important settings: value of $LC_CTYPE: UTF-8 value of $LANG: en_US.UTF-8 locale-coding-system: utf-8 Major mode: Debugger Minor modes in effect: winner-mode: t recentf-mode: t delete-selection-mode: t auto-image-file-mode: t server-mode: t savehist-mode: t global-so-long-mode: t desktop-save-mode: t which-key-mode: t eldoc-in-minibuffer-mode: t global-subword-mode: t subword-mode: t lisp-extra-font-lock-global-mode: t auto-compile-on-load-mode: t auto-compile-on-save-mode: t yas-global-mode: t yas-minor-mode: t global-auto-revert-mode: t save-place-mode: t global-hl-line-mode: t global-hl-todo-mode: t electric-pair-mode: t windmove-mode: t override-global-mode: t tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t minibuffer-regexp-mode: t buffer-read-only: t column-number-mode: t line-number-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t auto-save-visited-mode: t Load-path shadows: ... Features: (... emacs) Memory information: ((conses 16 705553 1556771) (symbols 48 73143 53) (strings 32 201452 108982) (string-bytes 1 5941470) (vectors 16 82573) (vector-slots 8 880792 726985) (floats 8 835 1609) (intervals 56 5527 1489) (buffers 992 20)) From debbugs-submit-bounces@debbugs.gnu.org Thu May 30 02:50:50 2024 Received: (at 71270) by debbugs.gnu.org; 30 May 2024 06:50:50 +0000 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 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 Received: by mail.gandi.net (Postfix) with ESMTPSA id 547E6E0003; Thu, 30 May 2024 06:50:09 +0000 (UTC) From: Juri Linkov To: Yuwei Tian Subject: Re: bug#71270: 30.0.50; Execute dired-do-shell-command will encounter 'wrong-type-argument stringp nil' error In-Reply-To: (Yuwei Tian's message of "Thu, 30 May 2024 14:24:35 +0800") Organization: LINKOV.NET References: Date: Thu, 30 May 2024 09:46:17 +0300 Message-ID: <86y17rg5hq.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 71270 Cc: 71270@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) 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. From debbugs-submit-bounces@debbugs.gnu.org Thu May 30 02:52:25 2024 Received: (at 71270) by debbugs.gnu.org; 30 May 2024 06:52:25 +0000 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 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 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==; Date: Thu, 30 May 2024 09:52:05 +0300 Message-Id: <86wmnbrduy.fsf@gnu.org> From: Eli Zaretskii To: Yuwei Tian , Juri Linkov In-Reply-To: (message from Yuwei Tian on Thu, 30 May 2024 14:24:35 +0800) Subject: Re: bug#71270: 30.0.50; Execute dired-do-shell-command will encounter 'wrong-type-argument stringp nil' error References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71270 Cc: 71270@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > 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. From unknown Thu Jun 19 14:00:37 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 27 Jun 2024 11:24:10 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator