[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Conf] dired and diredx




Just in case there are some who might be interested, below is a
snippet from my .emacs setup which configures dired and diredx. I use
diredx for its very handy ability to omit certain files from the dired
listing. Files which are omitted can easily be shown using \M-o which
toggles between omitted and un-omitted mode. 

The last part of the file causes dired to sort listings with
directories first. 

I've only run this under emacs 21 and still consider myself an elisp
novice, so if you see any bugs, bad coding practice or whatever,
please let me know.

Tim


;; From .emacs 11th Jan 2003. tcross@rapttech.com.au
;; Load diredx
(add-hook 'dired-load-hook
	  (lambda ()
	    (setq dired-x-hands-off-my-keys nil)
	    (load "dired-x")
	    (setq dired-guess-shell-gnutar "tar")
	    ))

;; Omit uninteresting files from dired listing. Can show with \M-o
(add-hook 'dired-mode-hook
	  (lambda ()
	    (setq dired-omit-files-p t)
	    (setq dired-omit-files "^#\\|^\\.$\\|~$\\|^\\..+$")
	    ))

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

-----------------------------------------------------------------------------
To unsubscribe from the emacspeak list or change your address on the
emacspeak list send mail to "emacspeak-request@cs.vassar.edu" with a
subject of "unsubscribe" or "help"


Emacspeak Files | Subscribe | Unsubscribe | Search