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

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

Re: Function to find symlink target


From: Michael Heerdegen
Subject: Re: Function to find symlink target
Date: Tue, 24 May 2022 03:09:46 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Emanuel Berg <incal@dataswamp.org> writes:

> (defun dired-find-link-target (link)
>   (let*((target (file-truename link))
>         (name   (file-name-nondirectory target)) )
>     (find-file (file-name-directory target))
>     (goto-char (point-min))
>     (cl-loop
>      while (re-search-forward name (point-max) t)
>      do (when (get-text-property (point) 'dired-filename)
>           (cl-return) ))
>     (goto-char (match-beginning 0)) ))

Not wrong - but reinventing wheels: see `dired-jump' and
`dired-goto-file'.

Michael.




reply via email to

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