GNU bug report logs -
#71270
30.0.50; Execute dired-do-shell-command will encounter 'wrong-type-argument stringp nil' error
Previous Next
Reported by: Yuwei Tian <fishtai0 <at> gmail.com>
Date: Thu, 30 May 2024 06:26:01 UTC
Severity: normal
Fixed in version 30.0.50
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> From: Yuwei Tian <fishtai0 <at> gmail.com>
> 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.
This bug report was last modified 356 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.