[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: dired listg & dired-sort-menu.el
From: |
Drew Adams |
Subject: |
RE: dired listg & dired-sort-menu.el |
Date: |
Fri, 21 Jun 2013 14:08:56 -0700 (PDT) |
> What I'm really after is a way to have 2 things extra going on in the
> regular dired buffer.
> 1) hide dot files
> 2) sort directories first.
>
> The menu on your pages on the wiki
> http://www.emacswiki.org/emacs/DrewsEmacsDiredSortMenu
> show a menu with an item
> "Dirs first (W)"
> so that is what got me looking at that program.
That menu item is from dired-sort-menu+.el, which is an add-on to
dired-sort-menu.el. Both files are available on Emacs Wiki:
http://www.emacswiki.org/emacs-en/download/dired-sort-menu.el
http://www.emacswiki.org/emacs-en/download/dired-sort-menu%2b.el
> I had already googled up code to hide dot files
Yes, Dired Omit is good for that. But `dired-omit-mode' is the supported name
now, instead of `dired-omit-files-p'. It is probably better to use this to
turn it on, instead of just setting the mode variable:
(dired-omit-mode 1)
You can also toggle omit mode interactively, using `M-o'.
> and a setq to list dirs first
You don't need that if you use dired-sort-menu[+].el.
> but with them both in ~/.emacs the hiding dot files part gets canceled
> out...
It shouldn't.
> so I was thinking maybe getting your program in there might
> solve that.
>
> Getting back to subject. I've posted three images, now that I broke
> out of the idiocy veil.
> 1) menu produced by S-Mouse-2
> 2) Menu produced by Menu / Immediate / Sort by
> 3) Menu posted on webpages.
>
> You'll see that even though the first two pop up with a little
> different look, they seem to contain the same items.
>
> Whereas, the menu from your wikipages (The bottom image), have two
> different items.... `Ignore Case' and `Dirs First'
See above - you need (require 'dired-sort-menu+)
> www.jtan.com/~reader/vu1/disp.cgi
> (Should produce 3 stacked images in the order shown above)
>
> But to repeat my reason for query... In my default dired view I want
> to have dot files hidden and Dirs sorted first... but be able to
> toggle dot files.
Should just work. You toggle omit mode with `M-o'.
> Hide dot files
> (require 'dired-x)
> (setq-default dired-omit-files-p t)
> (setq dired-omit-files (concat dired-omit-files "\\|^\\..+$"))
OK.
> Sort directories first
> (setq dired-listing-switches "-lXGh --group-directories-first")
Not needed, but might also work (depending on your platform etc.), as an
alternative to Dired Sort Menu. (FWIW, it doesn't work for me, on Windows with
Cygwin.)