Path: utzoo!utgpu!watmath!att!dptg!rutgers!apple!bbn!gateway!dsys.ncsl.nist.GOV!rbj From: rbj@dsys.ncsl.nist.GOV (Root Boy Jim) Newsgroups: comp.emacs Subject: dired sorting by date Message-ID: <8908301643.AA26372@dsys.ncsl.nist.gov> Date: 30 Aug 89 16:43:49 GMT Sender: news@bbn.COM Organization: National Institute of Standards and Technology formerly National Bureau of Standards Lines: 33 OOPS! Forgot that buffer was read only! A corrected version: Add the following to your .emacs to sort by both time and date: (setq dired-mode-hook 'dired-mode-hook) (defun dired-mode-hook () "Define dired extensions" (setq case-fold-search t) ; Why is this not done? (define-key dired-mode-map "t" 'dired-sort-by-time) (define-key dired-mode-map "s" 'dired-sort-by-size) (setq dired-mode-hook nil)) (defun dired-sort-by-time (arg) ; t "Reread directory and sort by time. Reverse sort with prefix." (interactive "P") (let ((dired-listing-switches (concat dired-listing-switches "t" (and arg "r")))) (revert-buffer))) (defun dired-sort-by-size (arg) ; s "Reread directory and sort by size. Reverse sort with prefix." (interactive "P") (revert-buffer) (let ((buffer-read-only nil)) ; I forgot this line (shell-command-on-region (point-min) (point-max) (concat "sort +3n" (and arg " -r")) t))) ? --Denys Root Boy Jim and the GNU Bohemians