Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!usc!apple!claris!sts!octopus!pyramid!prls!philabs!linus!gomez!gwr From: gwr@gomez.uucp (Gordon W. Ross) Newsgroups: comp.emacs Subject: Re: dired sorting by date Message-ID: <65587@linus.UUCP> Date: 25 Aug 89 18:54:08 GMT References: <44719@bbn.COM> <572C02cp4emH01@amdahl.uts.amdahl.com> Sender: news@linus.UUCP Reply-To: gwr@gomez.mitre.org (Gordon W. Ross) Distribution: usa Organization: The MITRE Corporation, Bedford, MA. Lines: 27 In article <572C02cp4emH01@amdahl.uts.amdahl.com> daveemme@amdahl.uts.amdahl.com (Dave Emme) writes: >In article <44719@bbn.COM> sboisen@bbn.com writes: [...] > >any suggestions for how to sort a dired buffer by _date_? [...] and each offer some simple ways to hack the elisp variable "dired-listing-switches" but I like mine better because it makes no permanent changes to that variable. (Small, too!) Here it is: ; Make the "t" key sort the current dired listing by date. ; It takes effect just this once, so "g" will be unchanged. (defun dired-sort-by-time () "Redisplays a dired listing sorted by time." (interactive) (let ((dired-listing-switches (concat dired-listing-switches "t"))) (revert-buffer t t))) (setq dired-mode-hook '(lambda() (define-key dired-mode-map "t" 'dired-sort-by-time) ; Add other dired-mode-map customizations here... )) Gordon W. Ross gwr@gomez.mitre.org (617) 271-3205 (daytime) The MITRE Corp. (M/S E025) Burlington Road, Bedford, MA 01730