bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#22828: 25.1.50; Mark symlinks whose target matches regexp


From: Lars Ingebrigtsen
Subject: bug#22828: 25.1.50; Mark symlinks whose target matches regexp
Date: Sun, 28 Feb 2016 16:06:34 +1030
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Tino Calancha <f92capac@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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]