unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#7027: 24.0.50; Dired error (wrong-type-arg stringp nil) with cons arg with wildcard in name
@ 2010-09-12 22:08 Drew Adams
  2019-10-01 19:59 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Drew Adams @ 2010-09-12 22:08 UTC (permalink / raw)
  To: 7027

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'
 






^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#7027: 24.0.50; Dired error (wrong-type-arg stringp nil) with cons arg with wildcard in name
  2010-09-12 22:08 bug#7027: 24.0.50; Dired error (wrong-type-arg stringp nil) with cons arg with wildcard in name Drew Adams
@ 2019-10-01 19:59 ` Lars Ingebrigtsen
  2020-04-17 10:22   ` Stefan Kangas
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Ingebrigtsen @ 2019-10-01 19:59 UTC (permalink / raw)
  To: Drew Adams; +Cc: 7027

"Drew Adams" <drew.adams@oracle.com> 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.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#7027: 24.0.50; Dired error (wrong-type-arg stringp nil) with cons arg with wildcard in name
  2019-10-01 19:59 ` Lars Ingebrigtsen
@ 2020-04-17 10:22   ` Stefan Kangas
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Kangas @ 2020-04-17 10:22 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 7027-done

Lars Ingebrigtsen <larsi@gnus.org> writes:

> "Drew Adams" <drew.adams@oracle.com> 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





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-04-17 10:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-12 22:08 bug#7027: 24.0.50; Dired error (wrong-type-arg stringp nil) with cons arg with wildcard in name Drew Adams
2019-10-01 19:59 ` Lars Ingebrigtsen
2020-04-17 10:22   ` Stefan Kangas

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).