From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#20776: 25.0.50; [PATCH] ls-lisp fix for wrong-type-arg error Date: Tue, 9 Jun 2015 08:05:24 -0700 (PDT) Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="__143386232488385542abhmp0016.oracle.com" X-Trace: ger.gmane.org 1433862392 9412 80.91.229.3 (9 Jun 2015 15:06:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 9 Jun 2015 15:06:32 +0000 (UTC) To: 20776@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jun 09 17:06:19 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Z2L6V-0001PD-KK for geb-bug-gnu-emacs@m.gmane.org; Tue, 09 Jun 2015 17:06:15 +0200 Original-Received: from localhost ([::1]:35586 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2L6U-0002Gs-Tw for geb-bug-gnu-emacs@m.gmane.org; Tue, 09 Jun 2015 11:06:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49938) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2L6M-0002DT-7V for bug-gnu-emacs@gnu.org; Tue, 09 Jun 2015 11:06:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z2L6I-0003Sl-Qb for bug-gnu-emacs@gnu.org; Tue, 09 Jun 2015 11:06:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36378) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2L6I-0003Sc-Lp for bug-gnu-emacs@gnu.org; Tue, 09 Jun 2015 11:06:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Z2L6I-0006wM-8h for bug-gnu-emacs@gnu.org; Tue, 09 Jun 2015 11:06:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 Jun 2015 15:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 20776 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.143386234926658 (code B ref -1); Tue, 09 Jun 2015 15:06:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 9 Jun 2015 15:05:49 +0000 Original-Received: from localhost ([127.0.0.1]:46353 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z2L64-0006vt-I4 for submit@debbugs.gnu.org; Tue, 09 Jun 2015 11:05:49 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36309) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z2L61-0006vd-GY for submit@debbugs.gnu.org; Tue, 09 Jun 2015 11:05:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z2L5q-0003Ct-Mv for submit@debbugs.gnu.org; Tue, 09 Jun 2015 11:05:40 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:42275) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2L5q-0003Cp-Kk for submit@debbugs.gnu.org; Tue, 09 Jun 2015 11:05:34 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49754) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2L5p-00023c-NV for bug-gnu-emacs@gnu.org; Tue, 09 Jun 2015 11:05:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z2L5j-00031R-9Z for bug-gnu-emacs@gnu.org; Tue, 09 Jun 2015 11:05:33 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:35648) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2L5j-00030R-4D for bug-gnu-emacs@gnu.org; Tue, 09 Jun 2015 11:05:27 -0400 Original-Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t59F5PGh007089 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 9 Jun 2015 15:05:26 GMT Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id t59F5P0E012030 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Tue, 9 Jun 2015 15:05:25 GMT Original-Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id t59F5Pap006644 for ; Tue, 9 Jun 2015 15:05:25 GMT X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6691.5000 (x86)] X-Source-IP: userv0021.oracle.com [156.151.31.71] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:103767 Archived-At: --__143386232488385542abhmp0016.oracle.com Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable 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=3D "[^~]\\'" 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@gnu.org-20141020195941-icp42t8ttcnud09g Windowing system distributor `Microsoft Corp.', version 6.1.7601 Configured using: `configure --enable-checking=3Dyes,glyphs CPPFLAGS=3D-DGLYPH_DEBUG=3D1' --__143386232488385542abhmp0016.oracle.com Content-Type: application/octet-stream; name="ls-lisp-2015-06-09.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="ls-lisp-2015-06-09.patch" ZGlmZiAtdSBscy1saXNwLmVsIGxzLWxpc3AtcGF0Y2hlZC0yMDE1LTA2LTA5LmVsCi0tLSBscy1s aXNwLmVsCTIwMTUtMDYtMDkgMDc6NDE6MzUuNjAzNTg5MzAwIC0wNzAwCisrKyBscy1saXNwLXBh dGNoZWQtMjAxNS0wNi0wOS5lbAkyMDE1LTA2LTA5IDA3OjQ4OjIyLjMwNjMzMzUwMCAtMDcwMApA QCAtMzQ4LDcgKzM0OCw5IEBACiBmaWxlLWF0dHJpYnV0ZXMgYWNjb3JkaW5nIHRvIFNXSVRDSEVT LiAgV0lMRENBUkQtUkVHRVhQIGlzIG5pbCBvciBhbiAqRW1hY3MKIHJlZ2V4cCouICBGVUxMLURJ UkVDVE9SWS1QIG1lYW5zIGZpbGUgaXMgYSBkaXJlY3RvcnkgYW5kIFNXSVRDSEVTIGRvZXMKIG5v dCBjb250YWluIGBkJywgc28gdGhhdCBhIGZ1bGwgbGlzdGluZyBpcyBleHBlY3RlZC4iCi0gIChp ZiAob3Igd2lsZGNhcmQtcmVnZXhwIGZ1bGwtZGlyZWN0b3J5LXApCisgIChpZiAob3IgKGFuZCB3 aWxkY2FyZC1yZWdleHAKKyAgICAgICAgICAgICAgIChub3QgKHN0cmluZz0gIltefl1cXCciIHdp bGRjYXJkLXJlZ2V4cCkpKSA7IFN3aXRjaCAtQiBwc2V1ZG8td2lsZGNhcmQgcmVnZXhwCisgICAg ICAgICAgZnVsbC1kaXJlY3RvcnktcCkKICAgICAgIChsZXQqICgoZGlyIChmaWxlLW5hbWUtYXMt ZGlyZWN0b3J5IGZpbGUpKQogCSAgICAgKGRlZmF1bHQtZGlyZWN0b3J5IGRpcikJOyBzbyB0aGF0 IGZpbGUtYXR0cmlidXRlcyB3b3JrcwogCSAgICAgKGZpbGUtYWxpc3QK --__143386232488385542abhmp0016.oracle.com--