GNU bug report logs - #43028
28.0.50; Add dired commands to navigate symbolic links

Previous Next

Package: emacs;

Reported by: Tino Calancha <tino.calancha <at> gmail.com>

Date: Mon, 24 Aug 2020 19:13:01 UTC

Severity: normal

Tags: patch, wontfix

Found in version 28.0.50

Done: Tino Calancha <tino.calancha <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 43028 in the body.
You can then email your comments to 43028 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to uyennhi.qm <at> gmail.com, jidanni <at> jidanni.org, bug-gnu-emacs <at> gnu.org:
bug#43028; Package emacs. (Mon, 24 Aug 2020 19:13:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tino Calancha <tino.calancha <at> gmail.com>:
New bug report received and forwarded. Copy sent to uyennhi.qm <at> gmail.com, jidanni <at> jidanni.org, bug-gnu-emacs <at> gnu.org. (Mon, 24 Aug 2020 19:13:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tino Calancha <tino.calancha <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; Add dired commands to navigate symbolic links
Date: Mon, 24 Aug 2020 21:12:25 +0200
X-Debbugs-Cc: uyennhi.qm <at> gmail.com, jidanni <at> jidanni.org,
drew.adams <at> oracle.com, michael_heerdegen <at> web.de, larsi <at> gnus.org
Severity: wishlist

How do you feel about adding these new navigators and bind them to
'{' '}' ?


--8<-----------------------------cut here---------------start------------->8---
commit 98e474b5b3be644d6cdff8aaf3b2d917ca4cea56
Author: Tino Calancha <ccalancha <at> suse.com>
Date:   Mon Aug 24 20:56:27 2020 +0200

    New dired commands to navigate symbolic links
    
    Like dired-prev-dirline and dired-next-dirline
    but for symbolic links.
    
    * lisp/dired.el (dired-prev-symlinkline, dired-next-symlinkline):
    New commands.
    (dired-mode-map): Bind them to '{' and '}'.  Add menu entries for them.
    
    * doc/emacs/dired.texi (Dired Navigation): Document them.
    
    * etc/NEWS (Changes in Specialized Modes and Packages in Emacs 28.1):
    Announce them.

diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi
index 19aaca962d..92c1214cb4 100644
--- a/doc/emacs/dired.texi
+++ b/doc/emacs/dired.texi
@@ -177,6 +177,16 @@ Dired Navigation
 minibuffer, and moves point to the line in the Dired buffer describing
 that file.
 
+@findex dired-prev-symlinkline
+@kindex @{ @r{(Dired)}
+  @kbd{@{} (@code{dired-prev-symlinkline}) jumps to the previous
+  symbolic link in the Dired buffer.
+
+@findex dired-next-symlinkline
+@kindex @} @r{(Dired)}
+  @kbd{@}} (@code{dired-next-symlinkline}) jumps to the next
+  symbolic link in the Dired buffer.
+
 @cindex searching Dired buffers
 @findex dired-isearch-filenames
 @vindex dired-isearch-filenames
diff --git a/etc/NEWS b/etc/NEWS
index a65852fcd0..5785cdc1e5 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -235,6 +235,10 @@ time zones will use a form like "+0100" instead of "CET".
 
 ** Dired
 
++++
+*** New commands 'dired-prev-symlinkline', 'dired-next-symlinkline' to visit
+symbolic links in the current dired buffer, bound respectively to '{' '}'.
+
 +++
 *** New user option 'dired-maybe-use-globstar'.
 If set, enables globstar (recursive globbing) in shells that support
diff --git a/lisp/dired.el b/lisp/dired.el
index 94d3befda8..273e787af0 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -1898,6 +1898,8 @@ dired-mode-map
     ;; moving
     (define-key map "<" 'dired-prev-dirline)
     (define-key map ">" 'dired-next-dirline)
+    (define-key map "}" 'dired-next-symlinkline)
+    (define-key map "{" 'dired-prev-symlinkline)
     (define-key map "^" 'dired-up-directory)
     (define-key map " " 'dired-next-line)
     (define-key map [?\S-\ ] 'dired-previous-line)
@@ -2039,6 +2041,12 @@ dired-mode-map
     (define-key map [menu-bar immediate find-file]
       '(menu-item "Find This File" dired-find-file
 		  :help "Edit file at cursor"))
+    (define-key map [menu-bar immediate prev-symlink]
+      '(menu-item "Prev Symlink" dired-prev-symlinkline
+		  :help "Move to next symbolic link line"))
+    (define-key map [menu-bar immediate next-symlink]
+      '(menu-item "Next Symlink" dired-next-symlinkline
+		  :help "Move to previous symbolic link line"))
     (define-key map [menu-bar immediate create-directory]
       '(menu-item "Create Directory..." dired-create-directory
 		  :help "Create a directory"))
@@ -2431,6 +2439,23 @@ dired-prev-dirline
   (interactive "p")
   (dired-next-dirline (- arg)))
 
+(defun dired-next-symlinkline (arg &optional opoint)
+  "Goto ARGth next symbolic link file line."
+  (interactive "p")
+  (or opoint (setq opoint (point)))
+  (if (if (> arg 0)
+	  (re-search-forward dired-re-sym nil t arg)
+	(beginning-of-line)
+	(re-search-backward dired-re-sym nil t (- arg)))
+      (dired-move-to-filename)		; user may type `i' or `f'
+    (goto-char opoint)
+    (error "No more symlinks")))
+
+(defun dired-prev-symlinkline (arg)
+  "Goto ARGth previous symbolic link file line."
+  (interactive "p")
+  (dired-next-symlinkline (- arg)))
+
 (defun dired-up-directory (&optional other-window)
   "Run Dired on parent directory of current directory.
 Find the parent directory either in this buffer or another buffer.

--8<-----------------------------cut here---------------end--------------->8---

In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw scroll bars)
 of 2020-08-19 built on localhost.example.com
Repository revision: 88795c52ff13203dda5940ed5defc26ce2c20e5e
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12008000
System Description: openSUSE Tumbleweed




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43028; Package emacs. (Mon, 24 Aug 2020 22:39:02 GMT) Full text and rfc822 format available.

Message #8 received at 43028 <at> debbugs.gnu.org (full text, mbox):

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: Tino Calancha <tino.calancha <at> gmail.com>
Cc: 43028 <at> debbugs.gnu.org, uyennhi.qm <at> gmail.com
Subject: Re: bug#43028: 28.0.50; Add dired commands to navigate symbolic links
Date: Tue, 25 Aug 2020 06:36:19 +0800
>>>>> "TC" == Tino Calancha <tino.calancha <at> gmail.com> writes:

TC> How do you feel about adding these new navigators and bind them to
TC> '{' '}' ?

Keen I guess.




Added tag(s) patch. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 25 Aug 2020 08:28:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43028; Package emacs. (Tue, 25 Aug 2020 08:30:01 GMT) Full text and rfc822 format available.

Message #13 received at 43028 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Tino Calancha <tino.calancha <at> gmail.com>
Cc: 43028 <at> debbugs.gnu.org, uyennhi.qm <at> gmail.com, jidanni <at> jidanni.org
Subject: Re: bug#43028: 28.0.50; Add dired commands to navigate symbolic links
Date: Tue, 25 Aug 2020 10:29:14 +0200
Tino Calancha <tino.calancha <at> gmail.com> writes:

> How do you feel about adding these new navigators and bind them to
> '{' '}' ?

[...]

> +*** New commands 'dired-prev-symlinkline', 'dired-next-symlinkline' to visit
> +symbolic links in the current dired buffer, bound respectively to '{' '}'.

Hm...  I can't say that I can remember ever wanting to visit symlinks in
a dired buffer in particular.  What's the use case?

And I think that if I wanted to, I probably wouldn't remember these
keystrokes -- I'd just isearch for -> instead.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43028; Package emacs. (Tue, 25 Aug 2020 15:45:01 GMT) Full text and rfc822 format available.

Message #16 received at 43028 <at> debbugs.gnu.org (full text, mbox):

From: Tino Calancha <tino.calancha <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 43028 <at> debbugs.gnu.org, jidanni <at> jidanni.org, uyennhi.qm <at> gmail.com,
 Tino Calancha <tino.calancha <at> gmail.com>
Subject: Re: bug#43028: 28.0.50; Add dired commands to navigate symbolic links
Date: Tue, 25 Aug 2020 17:44:46 +0200 (CEST)

On Tue, 25 Aug 2020, Lars Ingebrigtsen wrote:

> Hm...  I can't say that I can remember ever wanting to visit symlinks in
> a dired buffer in particular.  What's the use case?
Of course, it is of interest if you work a lot with symbolic links: to 
move promptly to them with short typing.
I do use them often, that's why I feel good with this.

Of course, if it is not see as something useful it's OK to 
discard this idea (that's why I wanted to ask first) :-)

> And I think that if I wanted to, I probably wouldn't remember these
> keystrokes -- I'd just isearch for -> instead.
I added the menu entry under 'Immediate' for discoverability.

For american keyboards is almost same exercise push < or > than { or }
Also, the curly braces suggested me some directionability in their shape 
that we haven't exploit yet.
I have noticed dired+ is not using this key either.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43028; Package emacs. (Tue, 25 Aug 2020 19:56:01 GMT) Full text and rfc822 format available.

Message #19 received at 43028 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Tino Calancha <tino.calancha <at> gmail.com>
Cc: 43028 <at> debbugs.gnu.org, uyennhi.qm <at> gmail.com, jidanni <at> jidanni.org
Subject: Re: bug#43028: 28.0.50; Add dired commands to navigate symbolic links
Date: Tue, 25 Aug 2020 21:55:21 +0200
Tino Calancha <tino.calancha <at> gmail.com> writes:

> For american keyboards is almost same exercise push < or > than { or }
> Also, the curly braces suggested me some directionability in their
> shape that we haven't exploit yet.

Yeah, they're not much used.  tabulated-list-mode uses them to
widen/narrow columns, for instance, and...   that's all the special-mode
usage of those keys I can remember.  :-)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43028; Package emacs. (Tue, 25 Aug 2020 20:18:02 GMT) Full text and rfc822 format available.

Message #22 received at 43028 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>, Tino Calancha <tino.calancha <at> gmail.com>
Cc: 43028 <at> debbugs.gnu.org, uyennhi.qm <at> gmail.com, jidanni <at> jidanni.org
Subject: RE: bug#43028: 28.0.50; Add dired commands to navigate symbolic links
Date: Tue, 25 Aug 2020 13:17:46 -0700 (PDT)
> Yeah, they're not much used.  tabulated-list-mode uses them to
> widen/narrow columns, for instance, and...   that's all the special-mode
> usage of those keys I can remember.  :-)

Dired uses `M-{' and `M-}' to move among marked files.

Personally, I'd say leave navigation-to-symlinks commands
unbound to keys.  If such navigation becomes popular,
users will bind the commands to keys, and if users ask
for Emacs to bind them by default we can then ask which
keys to use, etc.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43028; Package emacs. (Thu, 27 Aug 2020 08:16:02 GMT) Full text and rfc822 format available.

Message #25 received at 43028 <at> debbugs.gnu.org (full text, mbox):

From: Tino Calancha <tino.calancha <at> gmail.com>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 43028 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>,
 uyennhi.qm <at> gmail.com, jidanni <at> jidanni.org
Subject: Re: bug#43028: 28.0.50; Add dired commands to navigate symbolic links
Date: Thu, 27 Aug 2020 10:14:46 +0200
Drew Adams <drew.adams <at> oracle.com> writes:

> Dired uses `M-{' and `M-}' to move among marked files.
>
> Personally, I'd say leave navigation-to-symlinks commands
> unbound to keys.  If such navigation becomes popular,
> users will bind the commands to keys, and if users ask
> for Emacs to bind them by default we can then ask which
> keys to use, etc.
I agree.
Thanks all.  I am closing this issue as it turned out to be
too specific for my use cases.




Added tag(s) wontfix. Request was from Tino Calancha <tino.calancha <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 27 Aug 2020 08:16:02 GMT) Full text and rfc822 format available.

Reply sent to Tino Calancha <tino.calancha <at> gmail.com>:
You have taken responsibility. (Thu, 27 Aug 2020 08:19:01 GMT) Full text and rfc822 format available.

Notification sent to Tino Calancha <tino.calancha <at> gmail.com>:
bug acknowledged by developer. (Thu, 27 Aug 2020 08:19:02 GMT) Full text and rfc822 format available.

Message #32 received at 43028-done <at> debbugs.gnu.org (full text, mbox):

From: Tino Calancha <tino.calancha <at> gmail.com>
To: 43028-done <at> debbugs.gnu.org
Subject: Re: bug#43028: 28.0.50; Add dired commands to navigate symbolic links
Date: Thu, 27 Aug 2020 10:17:52 +0200
It is not clear that the proposed key bindings are useful
for a broader audience.  Closing the issue as wontfix.






bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 24 Sep 2020 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 213 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.