From: "Mathias Dahl" <mathias.dahl@gmail.com>
To: "Drew Adams" <drew.adams@oracle.com>
Cc: Luc Teirlinck <teirllm@dms.auburn.edu>, emacs-devel@gnu.org
Subject: Re: patch for buff-menu.el enhancements
Date: Tue, 10 Jul 2007 23:21:15 +0200 [thread overview]
Message-ID: <7dbe73ed0707101421l6ab22c71w3ae31f4ef6ca8d1b@mail.gmail.com> (raw)
In-Reply-To: <BNELLINCGFJLDJIKDGACAEGICAAA.drew.adams@oracle.com>
> For those who use Windows Explorer, you will recognize this
> click-column-header sorting; you probably use it many times a day. IMO, it
> is one of the most useful features of Windows Explorer. I think we should do
> the same thing for Dired.
Speaking of sorting in Dired, I really like this simple hack, which I
use many times per day:
;;; dired-sort-map.el --- in Dired: press s then s, x, t or n to sort
by Size, eXtension, Time or Name
;; Copyright (C) 2002 by Free Software Foundation, Inc.
;; Author: Patrick Anderson
;; Version: 1
;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;; This file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to
;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
;;; Commentary:
;;; inspired by Francis J. Wright's dired-sort-menu.el
;install:
;this file in your load path
;add
; (require 'dired-sort-map)
;to your .emacs file
(defvar dired-sort-map (make-sparse-keymap))
(add-hook 'dired-mode-hook '(lambda () (define-key dired-mode-map "s"
dired-sort-map)))
(add-hook 'dired-mode-hook '(lambda () (define-key dired-sort-map "s"
'(lambda () "sort by Size" (interactive) (dired-sort-other (concat
dired-listing-switches "S"))))))
(add-hook 'dired-mode-hook '(lambda () (define-key dired-sort-map "x"
'(lambda () "sort by eXtension" (interactive) (dired-sort-other
(concat dired-listing-switches "X"))))))
(add-hook 'dired-mode-hook '(lambda () (define-key dired-sort-map "t"
'(lambda () "sort by Time" (interactive) (dired-sort-other (concat
dired-listing-switches "t"))))))
(add-hook 'dired-mode-hook '(lambda () (define-key dired-sort-map "n"
'(lambda () "sort by Name" (interactive) (dired-sort-other (concat
dired-listing-switches ""))))))
(provide 'dired-sort-map)
;;; dired-sort-map.el ends here
/Mathias
next prev parent reply other threads:[~2007-07-10 21:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-09 23:52 patch for buff-menu.el enhancements Drew Adams
2007-07-10 16:02 ` Luc Teirlinck
2007-07-10 17:25 ` Drew Adams
2007-07-10 21:21 ` Mathias Dahl [this message]
2007-07-10 21:56 ` Drew Adams
2007-07-11 10:00 ` Mathias Dahl
2007-07-15 17:42 ` Drew Adams
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7dbe73ed0707101421l6ab22c71w3ae31f4ef6ca8d1b@mail.gmail.com \
--to=mathias.dahl@gmail.com \
--cc=drew.adams@oracle.com \
--cc=emacs-devel@gnu.org \
--cc=teirllm@dms.auburn.edu \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).