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

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

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


From: Tino Calancha
Subject: bug#39145: 28.0.50; dired: Show broken/circular links in different font
Date: Tue, 25 Aug 2020 18:34:08 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Tino Calancha <tino.calancha@gmail.com> writes:

> Today I have updated the patch to match what bash does
> now I only use dired-broken-symlink at 'foo' and 'bar' keeping '->' with
> dired-symlink.
>
> commit d250625b8f79a3b9273de6640f4840b5c8e54fe8
> Author: Tino Calancha <ccalancha@suse.com>
> Date:   Mon Aug 24 19:44:29 2020 +0200
>
>     dired: Show broken/circular links w/ different face
>     
>     * lisp/dired.el (dired-broken-symlink): New face.
>     (dired-font-lock-keywords) Use the new face for broken/circular links.
>     
>     * etc/NEWS (Changes in Specialized Modes and Packages in Emacs 28.1):
>     Announce this change.
>     
>     * test/lisp/dired-tests.el (dired-test-dired-broken-symlink-face):
>     Add a test.

Would be more emacsy to add an user option to enable/disable the feature?
Something like:

(defcustom dired-alert-on-broken-links t
  "If non-nil, display broken and circular links with `dired-broken-symlink'."
  :type 'boolean
  :group 'dired
  :version "28.1")

There is still something else that worries me.

If I have a broken link, and I create the missing target with
`dired-create-directory' or `dired-create-empty-file', then
I need to manually call `revert-buffer' to get the link face updated.

Same if teh target do exist and I decide to delete it with
`dired-do-delete'.
Note, this is not the case if you modify the target with wdired, because
wdired revert the buffer after applying the changes. 

A solution would be to call `dired-revert' at functions like
`dired-internal-do-deletions', `dired-create-empty-file' or
`dired-create-directory'.
That call could be optional in case we add a user option to control this 
feature.





reply via email to

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