Date: Fri, 24 Apr 2015 17:13:54 +0000
   From: Taylor R Campbell <campb...@mumble.net>

      Date: Thu, 23 Apr 2015 22:36:32 -0400
      From: Rich Loveland <r...@rmloveland.com>

      In the attached patch, I've implemented the DIRED-UP-DIRECTORY command
      for Edwin, and bound it to #\^ as found in that other Emacs.

      Please let me know if there's a better way of specifying "the next
      directory up" than just merging the current directory with "..".  I
      read through the manual section on pathnames and the runtime pathname
      code but I might have missed it.

   Probably something like:

   (merge-pathnames (make-pathname #f #f '(RELATIVE UP) #f #f #f)
                    (directory-pathname (dired-current-pathname)))

OK.  New patch is attached using your code above.  Tested it on Linux,
OS X, and Windows; works as expected.
diff --git a/src/edwin/dired.scm b/src/edwin/dired.scm
index 55f9c1a..cb9e87a 100644
--- a/src/edwin/dired.scm
+++ b/src/edwin/dired.scm
@@ -90,6 +90,7 @@ Space and Rubout can be used to move down and up by lines.
 (define-key 'dired #\e 'dired-find-file)
 (define-key 'dired #\f 'dired-find-file)
 (define-key 'dired #\return 'dired-find-file)
+(define-key 'dired #\^ 'dired-up-directory)
 (define-key 'dired #\g 'dired-revert)
 (define-key 'dired #\h 'describe-mode)
 (define-key 'dired #\m 'dired-mark)
@@ -285,6 +286,14 @@ Type `h' after entering dired for more info."
   (lambda ()
     (find-file-other-window (dired-current-pathname))))
 
+(define-command dired-up-directory
+  "Browse the parent directory of the current directory."
+  ()
+  (lambda ()
+    (find-file
+     (merge-pathnames (make-pathname #f #f '(RELATIVE UP) #f #f #f)
+                      (directory-pathname (dired-current-pathname))))))
+
 (define-command dired-revert
   "Read the current buffer."
   ()
_______________________________________________
MIT-Scheme-devel mailing list
MIT-Scheme-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/mit-scheme-devel

Reply via email to