From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sean McAfee Newsgroups: gmane.emacs.bugs Subject: bug#13575: 24.1; dired-mark-sexp misparses directory contents Date: Sun, 27 Jan 2013 18:49:55 -0800 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f46d04428f8a09dd4104d4505587 X-Trace: ger.gmane.org 1359361071 24462 80.91.229.3 (28 Jan 2013 08:17:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 28 Jan 2013 08:17:51 +0000 (UTC) To: 13575@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jan 28 09:18:10 2013 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 1Tzjur-0001DR-44 for geb-bug-gnu-emacs@m.gmane.org; Mon, 28 Jan 2013 09:18:09 +0100 Original-Received: from localhost ([::1]:60164 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TzjuZ-0001wx-BE for geb-bug-gnu-emacs@m.gmane.org; Mon, 28 Jan 2013 03:17:51 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:35111) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TzjuU-0001w3-1H for bug-gnu-emacs@gnu.org; Mon, 28 Jan 2013 03:17:49 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TzjuM-000818-7e for bug-gnu-emacs@gnu.org; Mon, 28 Jan 2013 03:17:45 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:46513) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TzjuM-000814-4F for bug-gnu-emacs@gnu.org; Mon, 28 Jan 2013 03:17:38 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Tzjuj-0007Pj-O5 for bug-gnu-emacs@gnu.org; Mon, 28 Jan 2013 03:18:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Sean McAfee Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 28 Jan 2013 08:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 13575 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.135936104328444 (code B ref -1); Mon, 28 Jan 2013 08:18:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 28 Jan 2013 08:17:23 +0000 Original-Received: from localhost ([127.0.0.1]:51977 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tzju4-0007Og-2c for submit@debbugs.gnu.org; Mon, 28 Jan 2013 03:17:21 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:55502) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tzeny-0008H2-4y for submit@debbugs.gnu.org; Sun, 27 Jan 2013 21:50:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TzenR-0002rs-EV for submit@debbugs.gnu.org; Sun, 27 Jan 2013 21:50:17 -0500 Original-Received: from lists.gnu.org ([208.118.235.17]:43864) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TzenR-0002ro-Az for submit@debbugs.gnu.org; Sun, 27 Jan 2013 21:50:09 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:38618) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TzenN-0005YU-0L for bug-gnu-emacs@gnu.org; Sun, 27 Jan 2013 21:50:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TzenF-0002XQ-SU for bug-gnu-emacs@gnu.org; Sun, 27 Jan 2013 21:50:04 -0500 Original-Received: from mail-wg0-x22a.google.com ([2a00:1450:400c:c00::22a]:38565) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TzenF-0002Vt-GP for bug-gnu-emacs@gnu.org; Sun, 27 Jan 2013 21:49:57 -0500 Original-Received: by mail-wg0-f42.google.com with SMTP id 12so935564wgh.1 for ; Sun, 27 Jan 2013 18:49:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type; bh=aRtOmcYByhrMWvda3J2iVZAp9fydY0fKSyJ2cmUcSxM=; b=dMNZBE7jXzacEoXiYm8frUlsP0HloT5+UwW3Gaki4bFzAimjZHNoc/WbqWQ++WzFWI 2UBnf/AsObkoUlUCM3F2S16QwN5kme5bSmPoIQkAbp44wRSm0yg4rKqFAN5lhRUainNt swXk2eSRqXgBDY8qn31k+DTS66yO/472P9iv3DR3QhQZvrv8aHiJIBZMRiBcpC/NytAp tKH0G6yF+yv1+lowqxANj61tZZFho1bSGutKvZCeT1uQkL82+sqmoe7mwZqzJXTEpk9y F2ZBLfr6alXtAbH826kgH4hV2Hyqep/Swto52wdamSCOIPxYjaN0ZxMXVQ2VOv5CscvD vidg== X-Received: by 10.180.33.202 with SMTP id t10mr7254829wii.3.1359341396024; Sun, 27 Jan 2013 18:49:56 -0800 (PST) Original-Received: by 10.216.188.78 with HTTP; Sun, 27 Jan 2013 18:49:55 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Mailman-Approved-At: Mon, 28 Jan 2013 03:17:19 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.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:70397 Archived-At: --f46d04428f8a09dd4104d4505587 Content-Type: text/plain; charset=ISO-8859-1 This bug report will be sent to the Bug-GNU-Emacs mailing list and the GNU bug tracker at debbugs.gnu.org. Please check that the From: line contains a valid email address. After a delay of up to one day, you should receive an acknowledgement at that address. Please write in English if possible, as the Emacs maintainers usually do not have translators for other languages. Please describe exactly what actions triggered the bug, and the precise symptoms of the bug. If you can, give a recipe starting from `emacs -Q': I recently wanted to mark all zero-size files in a dired buffer. I found that dired-mark-sexp seemed to be just what I needed, but when I invoked it with the expression (= size 0), I found that it marked every file, even those of nonzero size. Here's a test directory I set up: /home/mcafee/test: total used in directory 28 available 102379756 drwxrwxr-x 2 mcafee mcafee 4096 Jan 27 18:31 . drwxr-xr-x 44 mcafee mcafee 12288 Jan 27 18:31 .. -rw-rw-r-- 1 mcafee mcafee 8 Jan 27 18:31 bar -rw-rw-r-- 1 mcafee mcafee 12 Jan 27 18:31 baz -rw-rw-r-- 1 mcafee mcafee 4 Jan 27 18:31 foo In this directory, I ran dired-mark-sexp with the following expression, intended to exercise all of the available symbols: (progn (message "name=%s;inode=%s;s=%s;mode=%s;nlink=%s;uid=%s;gid=%s;size=%s;time=%s;sym=%s" name inodes mode nlink uid gid size time sym) nil) Here are the messages that were produced: name=.;inode=0;s=0;mode=drwxrwxr-x;nlink=2;uid=mcafee;gid=2;size=0;time= mcafee 4096 Jan 27 18:31;sym= name=..;inode=0;s=0;mode=drwxr-xr-x;nlink=44;uid=mcafee;gid=44;size=0;time= mcafee 12288 Jan 27 18:31;sym= name=bar;inode=0;s=0;mode=-rw-rw-r--;nlink=1;uid=mcafee;gid=1;size=0;time= mcafee 8 Jan 27 18:31;sym= name=baz;inode=0;s=0;mode=-rw-rw-r--;nlink=1;uid=mcafee;gid=1;size=0;time= mcafee 12 Jan 27 18:31;sym= name=foo;inode=0;s=0;mode=-rw-rw-r--;nlink=1;uid=mcafee;gid=1;size=0;time= mcafee 4 Jan 27 18:31;sym= Clearly, the "time" variable includes more of the directory listing than it should, and "size" is incorrectly set to zero for all files, as I originally noticed. If Emacs crashed, and you have the Emacs process in the gdb debugger, please include the output from the following gdb commands: `bt full' and `xbacktrace'. For information about debugging Emacs, please read the file /usr/share/emacs/24.1/etc/DEBUG. In GNU Emacs 24.1.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.12) of 2012-09-22 on batsu, modified by Debian Windowing system distributor `The X.Org Foundation', version 11.0.11300000 Configured using: `configure '--build' 'x86_64-linux-gnu' '--build' 'x86_64-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.1/site-lisp:/usr/share/emacs/site-lisp' '--with-crt-dir=/usr/lib/x86_64-linux-gnu' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall -O2' 'CPPFLAGS=-D_FORTIFY_SOURCE=2'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_US.UTF-8 value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Dired by name Minor modes in effect: gnus-dired-mode: t recentf-mode: t shell-dirtrack-mode: t minibuffer-depth-indicate-mode: t ido-everywhere: t global-undo-tree-mode: t diff-auto-refine-mode: t desktop-save-mode: t tooltip-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: y SPC = SPC . 2 5 SPC = SPC * S-SPC 3 0 SPC = SPC C-u M-: ( * S-SPC 2 . 2 5 SPC 3 0 ) C-p C-p C-n C-n C-p RET C-/ M-x t w i t i ESC ESC ESC ESC ESC ESC ESC ESC ESC ESC ESC ESC ESC ESC ESC ESC C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-a C-n C-f C-f C-f C-f v i C-v C-x k C-a M-< C-p C-n q C-n C-n M-x g n u s q M-B C-x d ~ / C-j + t e s t a M-! t p e c h o SPC f o o SPC > S-SPC f o o ; SPC e h o SPC b c h o SPC b a r SPC b a r SPC > S-SPC b a r ; SPC e c h o SPC b a z SPC b a z SPC b a z SPC > S-SPC b a z g C-p C-n M-: C-g M-( ( p r o g n SPC ( m e s s a g e S-SPC C-g M-( M-p M-p M-n C-e C-x b m e s s M-x r e [ p r = e p o r t e m - e m b u C-g C-x b k M-( C-h C-g C-h k C-g C-g M-( C-g C-h k M-( C-x 1 M-x M-p d i C-g C-g C-h k M-( C-g C-x 1 M-x M-p Recent messages: name=foo;inode=0;s=0;mode=-rw-rw-r--;nlink=1;uid=mcafee;gid=1;size=0;time= mcafee 4 Jan 27 18:31;sym= 0 '(progn (message name=%s;inode=%s;s=%s;mode=%s;nlink=%s;uid=%s;gid=%s;size=%s;time=%s;sym=%s name inode s mode nlink uid gid size time sym) nil) files marked. Quit Killed 0 lines. Quit Type C-x 1 to delete the help window. Quit [2 times] Quit [2 times] Type C-x 1 to delete the help window, C-M-v to scroll help. Quit Load-path shadows: --f46d04428f8a09dd4104d4505587 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable This bug report will be sent to the Bug-GNU-Emacs mailing list
and the G= NU bug tracker at debb= ugs.gnu.org.=A0 Please check that
the From: line contains a valid em= ail address.=A0 After a delay of up
to one day, you should receive an acknowledgement at that address.

P= lease write in English if possible, as the Emacs maintainers
usually do = not have translators for other languages.

Please describe exactly wh= at actions triggered the bug, and
the precise symptoms of the bug.=A0 If you can, give a recipe
starting f= rom `emacs -Q':

I recently wanted to mark all zero-size files in= a dired buffer.=A0 I
found that dired-mark-sexp seemed to be just what = I needed, but when I
invoked it with the expression (=3D size 0), I found that it marked everyfile, even those of nonzero size.

Here's a test directory I se= t up:

=A0 /home/mcafee/test:
=A0 total used in directory 28 avail= able 102379756
=A0 drwxrwxr-x=A0 2 mcafee mcafee=A0 4096 Jan 27 18:31 .
=A0 drwxr-xr-x 44 mcafee mcafee 12288 Jan 27 18:31 ..
=A0 -rw-rw-r--=A0 = 1 mcafee mcafee=A0=A0=A0=A0 8 Jan 27 18:31 bar
=A0 -rw-rw-r--=A0 1 mcafe= e mcafee=A0=A0=A0 12 Jan 27 18:31 baz
=A0 -rw-rw-r--=A0 1 mcafee mcafee= =A0=A0=A0=A0 4 Jan 27 18:31 foo

In this directory, I ran dired-mark-sexp with the following expression,=
intended to exercise all of the available symbols:

(progn (messa= ge "name=3D%s;inode=3D%s;s=3D%s;mode=3D%s;nlink=3D%s;uid=3D%s;gid=3D%s= ;size=3D%s;time=3D%s;sym=3D%s" name inodes mode nlink uid gid size tim= e sym) nil)

Here are the messages that were produced:
name=3D.;inode=3D0;s=3D0;m= ode=3Ddrwxrwxr-x;nlink=3D2;uid=3Dmcafee;gid=3D2;size=3D0;time=3D mcafee=A0 = 4096 Jan 27 18:31;sym=3D
name=3D..;inode=3D0;s=3D0;mode=3Ddrwxr-xr-x;nli= nk=3D44;uid=3Dmcafee;gid=3D44;size=3D0;time=3D mcafee 12288 Jan 27 18:31;sy= m=3D
name=3Dbar;inode=3D0;s=3D0;mode=3D-rw-rw-r--;nlink=3D1;uid=3Dmcafee;gid=3D1= ;size=3D0;time=3D mcafee=A0=A0=A0=A0 8 Jan 27 18:31;sym=3D
name=3Dbaz;in= ode=3D0;s=3D0;mode=3D-rw-rw-r--;nlink=3D1;uid=3Dmcafee;gid=3D1;size=3D0;tim= e=3D mcafee=A0=A0=A0 12 Jan 27 18:31;sym=3D
name=3Dfoo;inode=3D0;s=3D0;m= ode=3D-rw-rw-r--;nlink=3D1;uid=3Dmcafee;gid=3D1;size=3D0;time=3D mcafee=A0= =A0=A0=A0 4 Jan 27 18:31;sym=3D

Clearly, the "time" variable includes more of the directory l= isting than
it should, and "size" is incorrectly set to zero f= or all files, as I
originally noticed.

If Emacs crashed, and you = have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
=A0=A0=A0 `bt= full' and `xbacktrace'.
For information about debugging Emacs, = please read the file
/usr/share/emacs/24.1/etc/DEBUG.


In GNU = Emacs 24.1.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.12)
=A0of 2012-09-22 on batsu, modified by Debian
Windowing system distribut= or `The X.Org Foundation', version 11.0.11300000
Configured using:=A0`configure '--build' 'x86_64-linux-gnu' '--build&#= 39; 'x86_64-linux-gnu'
=A0'--prefix=3D/usr' '--sharedstatedir=3D/var/lib' '--l= ibexecdir=3D/usr/lib'
=A0'--localstatedir=3D/var/lib' '-= -infodir=3D/usr/share/info'
=A0'--mandir=3D/usr/share/man' &= #39;--with-pop=3Dyes'
=A0'--enable-locallisppath=3D/etc/emacs24:/etc/emacs:/usr/local/share/e= macs/24.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.1/= site-lisp:/usr/share/emacs/site-lisp'
=A0'--with-crt-dir=3D/usr/= lib/x86_64-linux-gnu' '--with-x=3Dyes'
=A0'--with-x-toolkit=3Dgtk' '--with-toolkit-scroll-bars'=A0'build_alias=3Dx86_64-linux-gnu' 'CFLAGS=3D-g -O2 -fstack-p= rotector
=A0--param=3Dssp-buffer-size=3D4 -Wformat -Werror=3Dformat-secu= rity -Wall -O2'
=A0'CPPFLAGS=3D-D_FORTIFY_SOURCE=3D2''

Important setting= s:
=A0 value of $LC_ALL: nil
=A0 value of $LC_COLLATE: nil
=A0 val= ue of $LC_CTYPE: nil
=A0 value of $LC_MESSAGES: nil
=A0 value of $LC_= MONETARY: nil
=A0 value of $LC_NUMERIC: nil
=A0 value of $LC_TIME: nil
=A0 value of= $LANG: en_US.UTF-8
=A0 value of $XMODIFIERS: nil
=A0 locale-coding-s= ystem: utf-8-unix
=A0 default enable-multibyte-characters: t

Majo= r mode: Dired by name

Minor modes in effect:
=A0 gnus-dired-mode: t
=A0 recentf-mode: t=
=A0 shell-dirtrack-mode: t
=A0 minibuffer-depth-indicate-mode: t
= =A0 ido-everywhere: t
=A0 global-undo-tree-mode: t
=A0 diff-auto-refi= ne-mode: t
=A0 desktop-save-mode: t
=A0 tooltip-mode: t
=A0 mouse-wheel-mode: t<= br>=A0 menu-bar-mode: t
=A0 file-name-shadow-mode: t
=A0 global-font-= lock-mode: t
=A0 font-lock-mode: t
=A0 blink-cursor-mode: t
=A0 au= to-composition-mode: t
=A0 auto-encryption-mode: t
=A0 auto-compression-mode: t
=A0 line-num= ber-mode: t
=A0 transient-mark-mode: t

Recent input:
y SPC =3D= SPC . 2 5 SPC =3D SPC <backspace> <backspace>
* S-SPC 3 0 = SPC =3D SPC C-u M-: ( * S-SPC 2 <backspace>
. 2 5 SPC 3 0 ) <S-return> <return> C-p C-p C-n C-n
C-p RET= C-/ M-x t w i t <return> i ESC ESC ESC ESC
ESC ESC ESC ESC ESC E= SC ESC ESC ESC ESC ESC ESC C-p
C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p = C-p C-p C-p
C-p C-p C-p C-p C-a C-n C-f C-f C-f C-f <return> v
i C-v C-x k &l= t;return> C-a M-< <return> C-p <return>
C-n q C-n C-n= M-x g n u s <return> <return> q M-B C-x
d ~ / C-j <S-ba= ckspace> + t e s t <return> a M-! t
p <backspace> <backspace> e c h o SPC f o o SPC > S-SPC
= f o o ; SPC e h o SPC b <backspace> <backspace> <backspace&g= t;
<backspace> c h o SPC b a r SPC b a r SPC > S-SPC b
a r ; SPC e c h o SPC b a z SPC b a z SPC b a z SPC
> S-SPC b a z &l= t;return> g C-p C-n M-: C-g M-( ( p r
o g n SPC ( m e s s a g e S-SP= C C-g M-( M-p M-p M-n
C-e <return> C-x b m e s s <return> M= -x r e [ p r =3D
e <backspace> <backspace> <backspace> <backspace> &= lt;backspace>
p o r t e m <tab> <backspace> <backspac= e> - e m <tab>
b u <tab> <return> C-g C-x b <re= turn> k M-( C-h C-g
C-h k C-g C-g M-( C-g C-h k M-( C-x 1 M-x M-p <return>
d i C-g C-= g C-h k M-( C-g C-x 1 M-x M-p <return>

Recent messages:
nam= e=3Dfoo;inode=3D0;s=3D0;mode=3D-rw-rw-r--;nlink=3D1;uid=3Dmcafee;gid=3D1;si= ze=3D0;time=3D mcafee=A0=A0=A0=A0 4 Jan 27 18:31;sym=3D
0 '(progn (message name=3D%s;inode=3D%s;s=3D%s;mode=3D%s;nlink=3D%s;uid= =3D%s;gid=3D%s;size=3D%s;time=3D%s;sym=3D%s name inode s mode nlink uid gid= size time sym) nil) files marked.
Quit
Killed 0 lines.
Quit
Ty= pe C-x 1 to delete the help window.
Quit [2 times]

Quit [2 times]
Type C-x 1 to delete the help windo= w, C-M-v to scroll help.
Quit

Load-path shadows:
--f46d04428f8a09dd4104d4505587--