GNU bug report logs - #72272
[PATCH] dired-hide-details-mode hides directory's absolute path

Previous Next

Package: emacs;

Reported by: Alvaro Ramirez <alvaro <at> xenodium.com>

Date: Wed, 24 Jul 2024 11:19:01 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Alvaro Ramirez <alvaro <at> xenodium.com>
To: Andrea Corallo <acorallo <at> gnu.org>
Cc: eliz <at> gnu.org, 72272 <at> debbugs.gnu.org
Subject: bug#72272: [PATCH] dired-hide-details-mode hides directory's absolute path
Date: Mon, 05 Aug 2024 15:34:17 +0100
[Message part 1 (text/plain, inline)]
+cc 72272 <at> debbugs.gnu.org

Thank you for the comments Andrea and Eli.

Andrea Corallo <acorallo <at> gnu.org> writes:

> Eli Zaretskii <eliz <at> gnu.org> writes:
>
>>
>> Thanks.
>>
>> Stefan and Andrea, any comments?
>>
>> I have a few minor ones:
>>
>>> From: xenodium <me+gh <at> xenodium.com>
>>> Date: Tue, 23 Jul 2024 21:55:37 +0100
>>> Subject: [PATCH] Hides current location's path via
>>> dired-hide-details-mode
>>                                             ^^^^
>> Please don't use "path" for anything except PATH-style
>> directory
>> lists.  The GNU Coding Standards frown on such usage.
>>

Ah got it. TIL the naming convention used for functions like of 
file-name-as-directory.

>>> +(defcustom dired-hide-details-hide-absolute-location t
>>> +  "Non-nil means `dired-hide-details-mode' hides current
>>> location's absolute path."
>>
>> Same here.

Done

>>
>>> +            (if-let ((dir-base (file-name-nondirectory
>>> new-dir-name))
>>> +                     (dir-path (file-name-directory
>>> new-dir-name))
>>> +                     (hide-dir-path (and
>>> dired-hide-details-hide-absolute-location
>>
>> And here.

Done

>>
>> Also, this change needs a NEWS entry.

Added

>
> No further comments other than:
>
>> @@ -3268,6 +3275,11 @@
>> dired-hide-details-update-invisibility-spec
>>  	       'add-to-invisibility-spec
>>  	     'remove-from-invisibility-spec)
>>  	   'dired-hide-details-information)
>> +  (funcall (if (and dired-hide-details-mode
>> +		    dired-hide-details-hide-absolute-location)
>> +	       'add-to-invisibility-spec
>> +	     'remove-from-invisibility-spec)
>> +	   'dired-hide-details-absolute-location)
>
> don't we favor #' in place of ' when quoting functions?

Added

I also modified the patch a little to cater for 
`dired-maybe-insert-subdir` (see 
https://lists.gnu.org/archive/html/emacs-devel/2024-08/msg00033.html) 
and to include a couple of tests.

May be worth noting, the following dired.el comment seemed
outdated 
https://github.com/emacs-mirror/emacs/blob/c7d9cd722e5a7042a52c92f8497f903bfe9870b8/lisp/dired.el#L1805

;; Note that dired-build-subdir-alist will replace the name
;; by its expansion, so it does not matter whether what we insert
;; here is fully expanded, but it should be absolute.

The mentioned replacement doesn't take place when using 
`dired-maybe-insert-subdir`, so I tweaked the comment. Setting 
invisible property is now needed in two places (to handle current 
location and now subdirs).

Please take a look at the latest patch. Happy to go with a 
different direction if preferred.

[0001-Hides-directory-absolute-location-via-dired-hide-det.patch (text/x-patch, attachment)]

This bug report was last modified 215 days ago.

Previous Next


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