GNU bug report logs - #20776
25.0.50; [PATCH] ls-lisp fix for wrong-type-arg error

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Tue, 9 Jun 2015 15:06:02 UTC

Severity: normal

Tags: fixed, patch

Found in version 25.0.50

Fixed in version 25.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 20776 in the body.
You can then email your comments to 20776 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#20776; Package emacs. (Tue, 09 Jun 2015 15:06:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Drew Adams <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 09 Jun 2015 15:06:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.0.50; [PATCH] ls-lisp fix for wrong-type-arg error
Date: Tue, 9 Jun 2015 08:05:24 -0700 (PDT)
[Message part 1 (text/plain, inline)]
This bug was described as part of bug #20739, and the fix was mentioned
there.  A patch for the fix is attached.

The bug is that when `dired' is called with a cons DIRNAME argument and
with switch -B you get a wrong-type-argument error.  For example:

(dired-other-window '("foo" "toto.el" "foo.el") "-B")

The problem is at the beginning of `ls-lisp-insert-directory.  There we
see this code on the first line:

(if (or wildcard-regexp full-directory-p)

But that is incorrect, because when switch `B' is used the code does
this (ugly hack) in `ls-lisp--insert-directory':

(if (memq ?B switches) (setq wildcard-regexp "[^~]\\'"))

and this, similarly:

(setq wildcard-regexp  (if (memq ?B switches) "[^~]\\'")
      file             (file-relative-name orig-file))

IOW, we use a pseudo wildcard-regexp, "[^~]\\'", to handle the case of
backup files.

And that doesn't work with this call:
(directory-files-and-attributes
  dir nil wildcard-regexp t (if (memq ?n switches) 'integer 'string))

Debugger entered--Lisp error: (file-error "Opening directory"
 "No such file or directory" "d:/the/path/to/foo.el/foo.el/")
  directory-files-and-attributes("foo.el/" nil "[^~]\\'" t string)
  ls-lisp-insert-directory("foo.el" (66) nil "[^~]\\'" nil)
  ls-lisp--insert-directory(...

The attached patch changes the (if (or wildcard-regexp full-directory-p)
to this, which fixes the problem of raising an error:

 (if (or (and wildcard-regexp
              (not (string= "[^~]\\'" wildcard-regexp)))
         full-directory-p)

(Note that this does not fix bug #20739, which requires that when
DIRNAME is a cons the switches actually do what they are supposed to do.
This patch merely allows Dired to list the files normally without
raising an error, but ignoring the still unsupported -B switch.)


In GNU Emacs 25.0.50.1 (i686-pc-mingw32)
 of 2014-10-20 on LEG570
Bzr revision: 118168 rgm <at> gnu.org-20141020195941-icp42t8ttcnud09g
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --enable-checking=yes,glyphs CPPFLAGS=-DGLYPH_DEBUG=1'
[ls-lisp-2015-06-09.patch (application/octet-stream, attachment)]

Added tag(s) patch. Request was from Ivan Andrus <darthandrus <at> gmail.com> to control <at> debbugs.gnu.org. (Sat, 02 Jan 2016 02:04:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20776; Package emacs. (Tue, 23 Feb 2016 10:14:01 GMT) Full text and rfc822 format available.

Message #10 received at 20776 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 20776 <at> debbugs.gnu.org
Subject: Re: bug#20776: 25.0.50; [PATCH] ls-lisp fix for wrong-type-arg error
Date: Tue, 23 Feb 2016 21:13:05 +1100
Drew Adams <drew.adams <at> oracle.com> writes:

> This bug was described as part of bug #20739, and the fix was mentioned
> there.  A patch for the fix is attached.

Thanks; applied to emacs-25.

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




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 23 Feb 2016 10:15:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 25.1, send any further explanations to 20776 <at> debbugs.gnu.org and Drew Adams <drew.adams <at> oracle.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 23 Feb 2016 10:15:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 22 Mar 2016 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 96 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.