home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / languages / elisp / functions / dired-updir < prev    next >
Encoding:
Internet Message Format  |  1990-03-21  |  2.5 KB

  1. From: rodney@sun.ipl.rpi.edu (Rodney Peck II)
  2. Newsgroups: comp.emacs,gnu.emacs
  3. Subject: dired patch for up directory on '<' key
  4. Message-ID: <RODNEY.89Aug26161524@sun.ipl.rpi.edu>
  5. Date: 26 Aug 89 20:15:24 GMT
  6. Organization: Rensselaer Polytechnic Institute Image Processing Lab, Troy NY
  7. Lines: 72
  8.  
  9.  
  10. Ok, here's yet another of my semi useful patches to emacs.  I used to
  11. use a TI Explorer lisp machine alot.  I got used to Zmac's dired mode
  12. which is really similar to gnuemacs's, but flashier in spots.  Anyway,
  13. one of the things that I missed was the ability to go up a dir on a
  14. keystroke.  (Unless I'm wrong, you have to go use f or v on the line
  15. with the .. in it now)
  16.  
  17. So, this patch to dired.el will add the '<' key to go up a dir.  It's
  18. really simple.
  19.  
  20. This patch should not affect anyone who doesn't use the < key in dired
  21. so it's safe to apply to the system dired.el file (if you can write to
  22. it).
  23.  
  24. Maybe this patch will be added to future versions of emacs.  It's
  25. really trivial.
  26.  
  27. -- patch follows....
  28. -- ~/updir.patch ----- BEGINS ------
  29. *** dired.el    Thu Jul 20 09:18:06 1989
  30. --- dired.el    Sat Aug 26 16:01:31 1989
  31. ***************
  32. *** 22,27 ****
  33. --- 22,29 ----
  34.   ;; file named COPYING.  Among other things, the copyright notice
  35.   ;; and this notice must be preserved on all copies.
  36.   
  37. + ;; rodney@ipl.rpi.edu Sat Aug 26 3:49pm
  38. + ;; added the "<" command to dired to go to the previous directory a la zmacs.
  39.   
  40.   ;In loaddefs.el
  41.   ;(defvar dired-listing-switches "-al"
  42. ***************
  43. *** 138,146 ****
  44.     (define-key dired-mode-map "B" 'dired-byte-recompile)
  45.     (define-key dired-mode-map "M" 'dired-chmod)
  46.     (define-key dired-mode-map "G" 'dired-chgrp)
  47. !   (define-key dired-mode-map "O" 'dired-chown))
  48.   
  49.   ;; Dired mode is suitable only for specially formatted data.
  50.   (put 'dired-mode 'mode-class 'special)
  51.   
  52. --- 140,148 ----
  53.     (define-key dired-mode-map "B" 'dired-byte-recompile)
  54.     (define-key dired-mode-map "M" 'dired-chmod)
  55.     (define-key dired-mode-map "G" 'dired-chgrp)
  56. !   (define-key dired-mode-map "O" 'dired-chown)
  57. !   (define-key dired-mode-map "<" 'dired-up-directory))
  58.   
  59.   ;; Dired mode is suitable only for specially formatted data.
  60.   (put 'dired-mode 'mode-class 'special)
  61.   
  62. ***************
  63. *** 248,253 ****
  64. --- 250,260 ----
  65.     (interactive "p")
  66.     (previous-line arg)
  67.     (dired-move-to-filename))
  68. + (defun dired-up-directory ()
  69. +   "Find the file .. from wherever we are now."
  70. +   (interactive)
  71. +   (find-file ".."))
  72.   
  73.   (defun dired-find-file ()
  74.     "In dired, visit the file or directory named on this line."
  75.  
  76. -- ~/updir.patch ----- ENDS --------
  77. --
  78. Rodney
  79.