Subject: Re: bug#39145: 28.0.50; dired: Show broken/circular links in different font

From: Tino Calancha <[email-masked]>
Date: Mon, 24 Aug 2020 19:52:50 +0200

Juri Linkov <[email-masked]> writes:

>> @@ -538,6 +549,18 @@ dired-font-lock-keywords
>>     (list dired-re-dir
>>  	 '(".+" (dired-move-to-filename) nil (0 dired-directory-face)))
>>     ;;
>> +   ;; Broken Symbolic link.
>> +   (list dired-re-sym
>> +         (list (lambda (end)
>> +                 (let* ((file (dired-file-name-at-point))
>> +                        (truename (ignore-errors (file-truename file))))
>> +                   ;; either links to unexistent files or circular links
>> +                   (and (not (and truename (file-exists-p truename)))
>> +	                (search-forward-regexp ".+-> ?.+" end t))))
>> +               '(dired-move-to-filename)
>
> Does this mean file-exists-p will be called on every file in the directory?
No it doesn't.
It will called only on symbolic links w/ a truename in such a dir.