all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Thamer Mahmoud <thamer.mahmoud@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Sort directories then files in Dired.
Date: Sun, 05 Sep 2010 23:02:12 +0300	[thread overview]
Message-ID: <87bp8chscb.fsf@zemblan.newkuwait.org> (raw)
In-Reply-To: i60ojt$j0a$1@dough.gmane.org

Oleksandr Gavenko <gavenkoa@gmail.com> writes:

> ls have option --group-directories-first. But then I set
> 'dired-listing-switches' to '-al --group-directories-first'
> output seems damaged:
>
>   e:/home/devel/autorpg:
>   total used in directory 1 available 13039040
>       281474976729852  0drwxrwxrwx  1 sasha Отсутствует 0 2007-09-05  ..
>      1407374883569819  0drwxrwxrwx  1 sasha Отсутствует 0 2009-08-24  .
>      1125899906859437  0drwxrwxrwx  1 sasha Отсутствует 0 2009-08-24  .hg
>      2533274790412740  1-rw-rw-rw-  1 sasha Отсутствует 209 2009-08-24
> README
>       562949953438149  0drwxrwxrwx  1 sasha Отсутствует 0 2009-08-24
> very-dumb-game

I don't use --group-directories-first, sorry. Perhaps you should
consider reporting this as a bug.

As an alternative, I use the following code in ~/.emacs which
essentially does the same thing:

(defun mydired-sort ()
  "Sort dired listings with directories first."
  (save-excursion
    (let (buffer-read-only)
      (forward-line 2) ;; beyond dir. header 
      (sort-regexp-fields t "^.*$" "[ ]*." (point) (point-max)))
    (set-buffer-modified-p nil)))

(defadvice dired-readin
  (after dired-after-updating-hook first () activate)
  "Sort dired listings with directories first before adding marks."
  (mydired-sort))

For more sorting options, see:
http://www.emacswiki.org/emacs/DiredSortDirectoriesFirst
http://www.emacswiki.org/emacs/DiredSortMenu

--
Thamer




  reply	other threads:[~2010-09-05 20:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-05 18:47 Sort directories then files in Dired Oleksandr Gavenko
2010-09-05 20:02 ` Thamer Mahmoud [this message]
2010-09-05 21:16   ` Drew Adams
2010-09-17 13:25     ` Oleksandr Gavenko
     [not found] <mailman.3.1283713178.26984.help-gnu-emacs@gnu.org>
2010-09-05 22:10 ` Tim X

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bp8chscb.fsf@zemblan.newkuwait.org \
    --to=thamer.mahmoud@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.