From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tu Do Newsgroups: gmane.emacs.bugs Subject: bug#17218: 24.3; Dired does not insert subdirs when used with switch "--group-directories-first" Date: Mon, 7 Apr 2014 21:12:59 +0700 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b873c0cf95a8904f67476b7 X-Trace: ger.gmane.org 1396885763 28034 80.91.229.3 (7 Apr 2014 15:49:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 7 Apr 2014 15:49:23 +0000 (UTC) To: 17218@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Apr 07 17:49:17 2014 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 1WXBnP-0000hm-DT for geb-bug-gnu-emacs@m.gmane.org; Mon, 07 Apr 2014 17:49:15 +0200 Original-Received: from localhost ([::1]:35368 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXBnP-0002uj-49 for geb-bug-gnu-emacs@m.gmane.org; Mon, 07 Apr 2014 11:49:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58386) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXBnH-0002sr-Uw for bug-gnu-emacs@gnu.org; Mon, 07 Apr 2014 11:49:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WXBnE-00089W-OO for bug-gnu-emacs@gnu.org; Mon, 07 Apr 2014 11:49:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:38573) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXBnE-00089Q-Ks for bug-gnu-emacs@gnu.org; Mon, 07 Apr 2014 11:49:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WXBnE-0004sP-66 for bug-gnu-emacs@gnu.org; Mon, 07 Apr 2014 11:49:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tu Do Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 07 Apr 2014 15:49:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 17218 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.139688571118692 (code B ref -1); Mon, 07 Apr 2014 15:49:03 +0000 Original-Received: (at submit) by debbugs.gnu.org; 7 Apr 2014 15:48:31 +0000 Original-Received: from localhost ([127.0.0.1]:39754 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WXBmg-0004rP-HF for submit@debbugs.gnu.org; Mon, 07 Apr 2014 11:48:31 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:32875) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WXAIO-0002Gp-4P for submit@debbugs.gnu.org; Mon, 07 Apr 2014 10:13:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WXAIM-0007Pf-28 for submit@debbugs.gnu.org; Mon, 07 Apr 2014 10:13:07 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:52495) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXAIL-0007Pb-Uw for submit@debbugs.gnu.org; Mon, 07 Apr 2014 10:13:05 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34587) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXAIJ-0002sx-O2 for bug-gnu-emacs@gnu.org; Mon, 07 Apr 2014 10:13:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WXAII-0007Ot-0h for bug-gnu-emacs@gnu.org; Mon, 07 Apr 2014 10:13:03 -0400 Original-Received: from mail-la0-x232.google.com ([2a00:1450:4010:c03::232]:50056) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXAIH-0007Og-JF for bug-gnu-emacs@gnu.org; Mon, 07 Apr 2014 10:13:01 -0400 Original-Received: by mail-la0-f50.google.com with SMTP id pv20so4735719lab.23 for ; Mon, 07 Apr 2014 07:12:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=dOmJQRuFo9HeOp2kQM10aZvlWNBdifnlPpnN+qbSNvo=; b=I79823+qUfgYvJcYqm9Rvze1qWzj+mi/m7eB4Hh9UasOfBWwf2XYdQo7RLc5WyU4te gCGu16DDuXJjbrPr5i4U6o1BMKcEYVPkeQc0+oHRdT4xJDMglGvgCkjPNm0nTEafgpVv d0aKxNwbu/evjCkfSuitDwhaLZm+RWiieqhnWHseAX3xxwb54toJWIhW5+kqEFeduV+b it6tZz9LAK7mTBVyhNlY/658ab7MhTyyxIfHwnzxZ3TMSRyGlGiaHhxOlK8FrPpMPGM+ I4wAkadTZ+ITcKtFZ2mGpUfrKuA7v/qhqg+HGkCTZlnR0OheUG5hRo3SpxALIg1x8FVs mkGQ== X-Received: by 10.112.119.208 with SMTP id kw16mr20361860lbb.19.1396879979528; Mon, 07 Apr 2014 07:12:59 -0700 (PDT) Original-Received: by 10.112.219.193 with HTTP; Mon, 7 Apr 2014 07:12:59 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Mailman-Approved-At: Mon, 07 Apr 2014 11:48:28 -0400 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:87852 Archived-At: --047d7b873c0cf95a8904f67476b7 Content-Type: text/plain; charset=ISO-8859-1 If I remove the switch "--group-directories-first", then Bookmark Jump works as expected. However, as long as the switch is put in, sub-directories won't be inserted again. I found out the problem in the function "dired-insert-old-subdirs" at line 1367 in dired.el. In this function, it has an or: (defun dired-insert-old-subdirs (old-subdir-alist) "Try to insert all subdirs that were displayed before. Do so according to the former subdir alist OLD-SUBDIR-ALIST." (or (string-match "R" dired-actual-switches) (let (elt dir) (while old-subdir-alist (setq elt (car old-subdir-alist) old-subdir-alist (cdr old-subdir-alist) dir (car elt)) (condition-case () (progn (dired-uncache dir) (dired-insert-subdir dir)) (error nil)))))) The functional call to string-match: (string-match "R" dired-actual-switches) is the root cause. If dired-actual-switches is "-lha", then string-match returns nil, and the code for inserting subdirs is going to be executed. However, with dired-actual-switches is "--group-directories-first -lha", then string-match returns 3, making the or call returns true immediately and subdirs are never inserted. "ls -R" recursively list directories. But matching it this way is incorrect, since we have listing switches that contain character "R" in it (i.e. --group-directories-first). Hope that help. Regards, Tu. In GNU Emacs 24.3.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.6.4) of 2014-04-01 on oldfriend Windowing system distributor `The X.Org Foundation', version 11.0.11303000 System Description: Ubuntu 13.04 Configured using: `configure '--with-x-toolkit=gtk'' Important settings: value of $LC_MONETARY: en_US.UTF-8 value of $LC_NUMERIC: en_US.UTF-8 value of $LC_TIME: en_US.UTF-8 value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Bookmark Menu Minor modes in effect: tooltip-mode: t mouse-wheel-mode: t tool-bar-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 buffer-read-only: t line-number-mode: t transient-mark-mode: t Recent input: C-v M-v M-v C-x k e C-c C-c C-x o C-n C-n C-n C-p k x C-x 1 C-x C-g C-h v d i r e d - l i s C-s c u s C-g C-x o C-s c u s C-f C-n C-n C-n C-n C-n C-n C-n C-n C-e SPC - - g r o u p - d i r e c t o r i e s - f i r s t C-n C-a C-f C-f C-f C-f 0 q q C-x o C-x d . e m . d C-n C-n C-p i k C-n C-n C-n C-v M-v C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n M-v M-v M-v M-v C-v C-v C-v C-v 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-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-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-p C-p C-n C-n C-n C-n C-n C-n C-n C-x 1 C-x r l C-x b C-x r m C-x C-g C-x b C-v C-v C-x k C-v C-v C-v M-v M-v M-v C-x k M-x e m a b u r b u g r e e m a M-x M-x r e p o t r e Recent messages: Resetting customization items...done Creating customization setup...done Mark set Killed 0 lines. scroll-up-command: End of buffer [2 times] scroll-down-command: Beginning of buffer [2 times] Making completion list... [3 times] completing-read-default: Command attempted to use minibuffer while in minibuffer Quit Making completion list... Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils cus-edit cus-start cus-load wid-edit misearch multi-isearch bookmark pp dired-aux help-mode easymenu help-fns dired time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) --047d7b873c0cf95a8904f67476b7 Content-Type: text/html; charset=ISO-8859-1
If I remove the switch "--group-directories-first", then Bookmark Jump
works as expected. However, as long as the switch is put in,
sub-directories won't be inserted again.

I found out the problem in the function "dired-insert-old-subdirs" at line 1367 in dired.el. In this function, it has an or:

(defun dired-insert-old-subdirs (old-subdir-alist)
"Try to insert all subdirs that were displayed before.
Do so according to the former subdir alist OLD-SUBDIR-ALIST."
(or (string-match "R" dired-actual-switches)
(let (elt dir)
(while old-subdir-alist
(setq elt (car old-subdir-alist)
old-subdir-alist (cdr old-subdir-alist)
dir (car elt))
(condition-case ()
(progn
(dired-uncache dir)
(dired-insert-subdir dir))
(error nil))))))


The functional call to string-match:

(string-match "R" dired-actual-switches)

is the root cause. If dired-actual-switches is "-lha", then string-match returns nil, and the code for inserting subdirs is going to be executed. However, with dired-actual-switches is "--group-directories-first -lha", then string-match returns 3, making the or call returns true immediately and subdirs are never inserted.

"ls -R" recursively list directories. But matching it this way is
incorrect, since we have listing switches that contain character "R" in
it (i.e. --group-directories-first).

Hope that help.

Regards,

Tu.


In GNU Emacs 24.3.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.6.4)
of 2014-04-01 on oldfriend
Windowing system distributor `The X.Org Foundation', version 11.0.11303000
System Description: Ubuntu 13.04

Configured using:
`configure '--with-x-toolkit=gtk''

Important settings:
value of $LC_MONETARY: en_US.UTF-8
value of $LC_NUMERIC: en_US.UTF-8
value of $LC_TIME: en_US.UTF-8
value of $LANG: en_US.UTF-8
value of $XMODIFIERS: @im=ibus
locale-coding-system: utf-8-unix
default enable-multibyte-characters: t

Major mode: Bookmark Menu

Minor modes in effect:
tooltip-mode: t
mouse-wheel-mode: t
tool-bar-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
buffer-read-only: t
line-number-mode: t
transient-mark-mode: t

Recent input:
C-v M-v M-v C-x k <return> e C-c C-c C-x o C-n C-n
C-n C-p k x C-x 1 C-x C-g C-h v d i r e d - l i s <tab>
<return> C-s c u s C-g C-x o C-s c u s C-f <return>
C-n C-n C-n C-n C-n C-n C-n C-n C-e SPC - - g r o u
p - d i r e c t o r i e s - f i r s t C-n C-a C-f C-f
C-f C-f <return> 0 q q C-x o C-x d . e m <tab> . d
<tab> <return> C-n C-n C-p i k C-n C-n C-n C-v M-v
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n M-v
M-v M-v M-v C-v C-v C-v C-v 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-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-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-p C-p C-n C-n
C-n C-n C-n C-n C-n C-x 1 C-x r l C-x b <return> C-x
r m <return> C-x C-g C-x b <return> <return> C-v C-v
C-x k <return> <return> C-v C-v C-v M-v M-v M-v C-x
k <return> M-x e m <tab> a <tab> b u <tab> <backspace>
<backspace> r <tab> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> b u
g <tab> <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> <backspace>
r e <tab> <tab> <backspace> <backspace> e m a <tab>
<tab> <tab> <backspace> <backspace> <backspace> <backspace>
<backspace> M-x M-x r e p o <tab> t <tab> <backspace>
r <tab> e <backspace> <return>

Recent messages:
Resetting customization items...done
Creating customization setup...done
Mark set
Killed 0 lines.
scroll-up-command: End of buffer [2 times]
scroll-down-command: Beginning of buffer [2 times]
Making completion list... [3 times]
completing-read-default: Command attempted to use minibuffer while in minibuffer
Quit
Making completion list...

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils cus-edit cus-start cus-load wid-edit misearch
multi-isearch bookmark pp dired-aux help-mode easymenu help-fns dired
time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd
tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment
lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer loaddefs button faces cus-face macroexp files text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty emacs)

--047d7b873c0cf95a8904f67476b7--