Subject: bug#7027: closed (Re: bug#7027: 24.0.50; Dired error (wrong-type-arg stringp nil) with cons arg with wildcard in name)

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 17 Apr 2020 10:23:02 +0000

Your bug report

#7027: 24.0.50; Dired error (wrong-type-arg stringp nil) with cons arg with wildcard in name

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
7027: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7027
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#7027: 24.0.50; Dired error (wrong-type-arg stringp nil) with cons arg with wildcard in name
From: Stefan Kangas <[email-masked]>
To: Lars Ingebrigtsen <[email-masked]>
Cc: [email-masked], Drew Adams <[email-masked]>
Date: Fri, 17 Apr 2020 12:22:25 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Lars Ingebrigtsen <[email-masked]> writes:

> "Drew Adams" <[email-masked]> writes:
>
>> Eval this: (dired '("TTTT" "111.el" "b*.el")), assuming there is a file
>> 111.el and some file matching b*.el (but no file with name "b*.el",
>> i.e. with a literal `*' in the name).
>>
>> You get this error: (wrong-type-argument stringp nil)
>
> Can you post the backtrace?
>
> [...]
>
>> This gets eval'd (where the ^@ is really a control char):
>>
>> (ls-lisp-insert-directory nil (97 108) nil "\\`b[^^@]*\\.el\\'" nil)
>>
>> That happens because of this call:
>>
>> (insert-directory "b*.el" "-al" nil nil)
>>
>> which calls (string-match "[[?*]" "b*.el") returning 1 (non-nil).
>>
>> (file-exists-p "b*.el") then returns nil,
>> and (wildcard-to-regexp "b*.el") returns the regexp shown above.
>
> I tried reproducing with
>
> (ls-lisp-insert-directory nil '(97 108) nil (wildcard-to-regexp "b*.el") nil)
>
> but that fails with a different error since FILE can't be nil.

More information was requested, but none was given within 28 weeks, so
I'm closing this bug.  If this is still an issue, please reply to this
email (use "Reply to all" in your email client) and we can reopen the
bug report.

Best regards,
Stefan Kangas

Subject: 24.0.50; Dired error (wrong-type-arg stringp nil) with cons arg with wildcard in name
From: "Drew Adams" <[email-masked]>
To: <[email-masked]>
Date: Sun, 12 Sep 2010 15:08:23 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

emacs -Q
 
Eval this: (dired '("TTTT" "111.el" "b*.el")), assuming there is a file
111.el and some file matching b*.el (but no file with name "b*.el",
i.e. with a literal `*' in the name).
 
You get this error: (wrong-type-argument stringp nil)
 
The problem is in `ls-lisp-insert-directory':
 
(defun ls-lisp-insert-directory
  (file switches time-index wildcard-regexp full-directory-p)
  "..."
  (if (or wildcard-regexp full-directory-p)
      (let* ((dir (file-name-as-directory file))
        ...))))
 
This gets eval'd (where the ^@ is really a control char):
 
(ls-lisp-insert-directory nil (97 108) nil "\\`b[^^@]*\\.el\\'" nil)
 
That happens because of this call:
 
(insert-directory "b*.el" "-al" nil nil)
 
which calls (string-match "[[?*]" "b*.el") returning 1 (non-nil).
 
(file-exists-p "b*.el") then returns nil,
and (wildcard-to-regexp "b*.el") returns the regexp shown above.
 
A proper message should be shown (but no error raised) saying, as for
any non-existent file, "b*.el: doesn't exist or is inaccessible".
 
And processing should then continue, displaying Dired with all of the
existing files that correspond to the names in the cons arg (e.g. 111.el
in this case).

In GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600)
 of 2010-09-06 on 3249CTO
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (4.4) --no-opt --cflags
-Ic:/imagesupport/include'