now that we have dired-up-directory, use it in dired-jump too
authorop <op@openbsd.org>
Tue, 4 Jun 2024 06:51:15 +0000 (06:51 +0000)
committerop <op@openbsd.org>
Tue, 4 Jun 2024 06:51:15 +0000 (06:51 +0000)
it's handy to be able to do C-x C-j (dired-jump) repeatedly to
navigate upwards starting from a buffer, and follows GNU Emacs
behaviour too.

usr.bin/mg/dired.c

index 128ed0a..4129343 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: dired.c,v 1.103 2024/06/04 06:48:34 op Exp $  */
+/*     $OpenBSD: dired.c,v 1.104 2024/06/04 06:51:15 op Exp $  */
 
 /* This file is in the public domain. */
 
@@ -1125,7 +1125,7 @@ dired_jump(int f, int n)
        for (i = 0; i <= curbp->b_nmodes; i++) {
                modename = curbp->b_modes[i]->p_name;
                if (strncmp(modename, "dired", 5) == 0)
-                       return (dobeep_msg("In dired mode already"));
+                       return (d_updirectory(f, n));
        }
 
        if (getbufcwd(dname, sizeof(dname)) != TRUE)