GNU bug report logs - #22828
25.1.50; Mark symlinks whose target matches regexp

Previous Next

Package: emacs;

Reported by: Tino Calancha <f92capac <at> gmail.com>

Date: Sat, 27 Feb 2016 14:25:01 UTC

Severity: wishlist

Tags: patch, wontfix

Found in version 25.1.50

Done: Glenn Morris <rgm <at> gnu.org>

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 22828 in the body.
You can then email your comments to 22828 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 bug-gnu-emacs <at> gnu.org:
bug#22828; Package emacs. (Sat, 27 Feb 2016 14:25:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tino Calancha <f92capac <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 27 Feb 2016 14:25:01 GMT) Full text and rfc822 format available.

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

From: Tino Calancha <f92capac <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.1.50; Mark symlinks whose target matches regexp
Date: Sat, 27 Feb 2016 23:27:28 +0900 (JST)
[Message part 1 (text/plain, inline)]
dired-mark-files-regexp checks the NAME of a symbolic link.
Its useful to introduce one function which look for a match
in the TARGET of the symbolic links.
Such function could be bound to '%@'.

In GNU Emacs 25.1.50.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.29)
Repository revision: 25c5651951ef39f650927652dac8b4bbfccb60fa
[dired_mark-symlink-target.patch (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22828; Package emacs. (Sun, 28 Feb 2016 05:38:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Tino Calancha <f92capac <at> gmail.com>
Cc: 22828 <at> debbugs.gnu.org
Subject: Re: bug#22828: 25.1.50; Mark symlinks whose target matches regexp
Date: Sun, 28 Feb 2016 16:06:34 +1030
Tino Calancha <f92capac <at> gmail.com> writes:

> dired-mark-files-regexp checks the NAME of a symbolic link.
> Its useful to introduce one function which look for a match
> in the TARGET of the symbolic links.
> Such function could be bound to '%@'.

I'm not sure whether that's generally useful enough to include in
dired...  I can't say that I remember ever wanting something like that.


[...]

> +    (dired-mark-if
> +     (and (looking-at-p dired-re-sym)
> +		  (not (looking-at-p dired-re-dot))
> +		  (not (eolp))			; empty line
> +		  
> +		  (let* ((eol (line-end-position))
> +				 (fn (save-excursion
> +					   (search-forward " -> " eol t)
> +					   (buffer-substring-no-properties (point) eol))))
> +			(and fn (string-match-p regexp fn))))
> +			"matching symbolic link")))

And this implementation also seems quite fragile.  Will symlinks always
be presented as " -> "?  And can " -> " be a valid part of a file name.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22828; Package emacs. (Sun, 28 Feb 2016 06:46:02 GMT) Full text and rfc822 format available.

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

From: Tino Calancha <f92capac <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Tino Calancha <f92capac <at> gmail.com>, 22828 <at> debbugs.gnu.org
Subject: Re: bug#22828: 25.1.50; Mark symlinks whose target matches regexp
Date: Sun, 28 Feb 2016 15:48:19 +0900 (JST)
> I'm not sure whether that's generally useful enough to include in
> dired...  I can't say that I remember ever wanting something like that.
Sometimes the meaninful part of the symbolic link is in the target.
Let's say you have a lot of files (thousands of them), in different 
locations and you create links to them:
t1
t2
...
ti
...
to all those files under the same directory for whatever 
processing/editing that you have in mind.
In such case, the only mark which has sense to pick up some
particular files with a regexp is something like the proposed
command in this thread.

> And this implementation also seems quite fragile.  Will symlinks always
> be presented as " -> "?  And can " -> " be a valid part of a file name.
Good point. I agree with this.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22828; Package emacs. (Sun, 28 Feb 2016 09:56:01 GMT) Full text and rfc822 format available.

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

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Tino Calancha <f92capac <at> gmail.com>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 22828 <at> debbugs.gnu.org
Subject: Re: bug#22828: 25.1.50; Mark symlinks whose target matches regexp
Date: Sun, 28 Feb 2016 10:55:55 +0100
Tino Calancha <f92capac <at> gmail.com> writes:

>> And this implementation also seems quite fragile.  Will symlinks always
>> be presented as " -> "?  And can " -> " be a valid part of a file name.
> Good point. I agree with this.

Use dired-move-to-end-of-filename to find the proper place.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22828; Package emacs. (Sun, 28 Feb 2016 10:36:02 GMT) Full text and rfc822 format available.

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

From: Tino Calancha <f92capac <at> gmail.com>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: Tino Calancha <f92capac <at> gmail.com>, Lars Ingebrigtsen <larsi <at> gnus.org>,
 22828 <at> debbugs.gnu.org
Subject: Re: bug#22828: 25.1.50; Mark symlinks whose target matches regexp
Date: Sun, 28 Feb 2016 19:38:19 +0900 (JST)
[Message part 1 (text/plain, inline)]

> Use dired-move-to-end-of-filename to find the proper place.
I see, this way we forget about the '@ -> ' or ' -> ' 
(or any other?).

Do you think is ok that fn contains such ' -> ' thing?
I would prefer if fn doesn't contain that.
So, the question is:
do we have a portable way to get the target of one link?
We may introduce something like:
dired-symlink-target (if doesn't exist)
[dired_mark-symlink-target_2.patch (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22828; Package emacs. (Mon, 29 Feb 2016 02:19:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Tino Calancha <f92capac <at> gmail.com>
Cc: Andreas Schwab <schwab <at> linux-m68k.org>, 22828 <at> debbugs.gnu.org
Subject: Re: bug#22828: 25.1.50; Mark symlinks whose target matches regexp
Date: Mon, 29 Feb 2016 13:18:18 +1100
Tino Calancha <f92capac <at> gmail.com> writes:

>> Use dired-move-to-end-of-filename to find the proper place.
> I see, this way we forget about the '@ -> ' or ' -> ' (or any other?).
>
> Do you think is ok that fn contains such ' -> ' thing?
> I would prefer if fn doesn't contain that.
> So, the question is:
> do we have a portable way to get the target of one link?
> We may introduce something like:
> dired-symlink-target (if doesn't exist)

I thin kyou should just call `(dired-get-filename nil t)' on each line
to get the file names, and then call `file-truename' to get the name of
the target.  Inspecting the text in the buffer with regexps is bound to
be fragile.

But I'm still not sure this is a function that would be generally
useful.  :-)

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22828; Package emacs. (Tue, 01 Mar 2016 11:10:02 GMT) Full text and rfc822 format available.

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

From: "Constantino Calancha" <f92capac <at> gmail.com>
To: "22828 <at> debbugs.gnu.org" <22828 <at> debbugs.gnu.org>
Subject: Re: bug#22828: 25.1.50; Mark symlinks whose target matches regexp
Date: Tue, 01 Mar 2016 20:12:40 +0900
> I thin kyou should just call `(dired-get-filename nil t)' on each line
> to get the file names, and then call `file-truename' to get the name of
> the target.
Very good. I wasn't aware about this function.

> But I'm still not sure this is a function that would be generally
> useful.  :-)
In that case let's forget about it and let's close this thread. No problem.




Added tag(s) wontfix. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 07 Jun 2016 19:19:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 22828 <at> debbugs.gnu.org and Tino Calancha <f92capac <at> gmail.com> Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 07 Jun 2016 19:19:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 06 Jul 2016 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 42 days ago.

Previous Next


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