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.
diff --git a/src/edwin/dired.scm b/src/edwin/dired.scm index 55f9c1a..29eb8e2 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 of the current directory." + () + (lambda () + (find-file + (merge-pathnames + (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