[comp.emacs] dired patch for up directory on '<' key

rodney@sun.ipl.rpi.edu (Rodney Peck II) (08/27/89)

Ok, here's yet another of my semi useful patches to emacs.  I used to
use a TI Explorer lisp machine alot.  I got used to Zmac's dired mode
which is really similar to gnuemacs's, but flashier in spots.  Anyway,
one of the things that I missed was the ability to go up a dir on a
keystroke.  (Unless I'm wrong, you have to go use f or v on the line
with the .. in it now)

So, this patch to dired.el will add the '<' key to go up a dir.  It's
really simple.

This patch should not affect anyone who doesn't use the < key in dired
so it's safe to apply to the system dired.el file (if you can write to
it).

Maybe this patch will be added to future versions of emacs.  It's
really trivial.

-- patch follows....
-- ~/updir.patch ----- BEGINS ------
*** dired.el	Thu Jul 20 09:18:06 1989
--- dired.el	Sat Aug 26 16:01:31 1989
***************
*** 22,27 ****
--- 22,29 ----
  ;; file named COPYING.  Among other things, the copyright notice
  ;; and this notice must be preserved on all copies.
  
+ ;; rodney@ipl.rpi.edu Sat Aug 26 3:49pm
+ ;; added the "<" command to dired to go to the previous directory a la zmacs.
  
  ;In loaddefs.el
  ;(defvar dired-listing-switches "-al"
***************
*** 138,146 ****
    (define-key dired-mode-map "B" 'dired-byte-recompile)
    (define-key dired-mode-map "M" 'dired-chmod)
    (define-key dired-mode-map "G" 'dired-chgrp)
!   (define-key dired-mode-map "O" 'dired-chown))
  
- 
  ;; Dired mode is suitable only for specially formatted data.
  (put 'dired-mode 'mode-class 'special)
  
--- 140,148 ----
    (define-key dired-mode-map "B" 'dired-byte-recompile)
    (define-key dired-mode-map "M" 'dired-chmod)
    (define-key dired-mode-map "G" 'dired-chgrp)
!   (define-key dired-mode-map "O" 'dired-chown)
!   (define-key dired-mode-map "<" 'dired-up-directory))
  
  ;; Dired mode is suitable only for specially formatted data.
  (put 'dired-mode 'mode-class 'special)
  
***************
*** 248,253 ****
--- 250,260 ----
    (interactive "p")
    (previous-line arg)
    (dired-move-to-filename))
+ 
+ (defun dired-up-directory ()
+   "Find the file .. from wherever we are now."
+   (interactive)
+   (find-file ".."))
  
  (defun dired-find-file ()
    "In dired, visit the file or directory named on this line."

-- ~/updir.patch ----- ENDS --------
--
Rodney