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

To reply to this bug, email your comments to 72272 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#72272; Package emacs. (Wed, 24 Jul 2024 11:19:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alvaro Ramirez <alvaro <at> xenodium.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 24 Jul 2024 11:19:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Alvaro Ramirez <alvaro <at> xenodium.com>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] dired-hide-details-mode hides directory's absolute path
Date: Wed, 24 Jul 2024 12:17:58 +0100
[Message part 1 (text/plain, inline)]
Tags: patch

Hi folks,

Sending an initial patch. Happy to iterate on it, add tests, 
etc. if we
reckon the feature is worth pursuing.

Set `dired-hide-details-hide-absolute-location` to non-nil and 
toggle
`dired-hide-details-mode` to hide the current directory's absolute 
path.

This is my first submission, might need some process guidance.

Alvaro

In GNU Emacs 31.0.50 (build 1, aarch64-apple-darwin23.5.0, NS
appkit-2487.60 Version 14.5 (Build 23F79)) of 2024-07-23 built on 
jiko
Windowing system distributor 'Apple', version 10.3.2487
System Description:  macOS 14.5

Configured using:
'configure --with-ns
--prefix=/Users/alvaro/stuff/active/code/third_party/emacs/nextstep/Emacs.app/Contents/MacOS
--enable-locallisppath=/Users/alvaro/stuff/active/code/third_party/emacs/nextstep/Emacs.app/Contents/MacOS'

[0001-dired-hide-details.patch (text/patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72272; Package emacs. (Sun, 04 Aug 2024 08:07:02 GMT) Full text and rfc822 format available.

Message #8 received at 72272 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alvaro Ramirez <alvaro <at> xenodium.com>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>,
 Andrea Corallo <acorallo <at> gnu.org>
Cc: 72272 <at> debbugs.gnu.org
Subject: Re: bug#72272: [PATCH] dired-hide-details-mode hides directory's
 absolute path
Date: Sun, 04 Aug 2024 11:06:09 +0300
> From: Alvaro Ramirez <alvaro <at> xenodium.com>
> Date: Wed, 24 Jul 2024 12:17:58 +0100
> 
> Hi folks,
> 
> Sending an initial patch. Happy to iterate on it, add tests, 
> etc. if we
> reckon the feature is worth pursuing.
> 
> Set `dired-hide-details-hide-absolute-location` to non-nil and 
> toggle
> `dired-hide-details-mode` to hide the current directory's absolute 
> path.
> 
> This is my first submission, might need some process guidance.

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.

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

Same here.

> +            (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.

Also, this change needs a NEWS entry.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72272; Package emacs. (Mon, 05 Aug 2024 09:49:02 GMT) Full text and rfc822 format available.

Message #11 received at 72272 <at> debbugs.gnu.org (full text, mbox):

From: Andrea Corallo <acorallo <at> gnu.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Alvaro Ramirez <alvaro <at> xenodium.com>, 72272 <at> debbugs.gnu.org,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#72272: [PATCH] dired-hide-details-mode hides directory's
 absolute path
Date: Mon, 05 Aug 2024 05:45:29 -0400
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Alvaro Ramirez <alvaro <at> xenodium.com>
>> Date: Wed, 24 Jul 2024 12:17:58 +0100
>> 
>> Hi folks,
>> 
>> Sending an initial patch. Happy to iterate on it, add tests, 
>> etc. if we
>> reckon the feature is worth pursuing.
>> 
>> Set `dired-hide-details-hide-absolute-location` to non-nil and 
>> toggle
>> `dired-hide-details-mode` to hide the current directory's absolute 
>> path.
>> 
>> This is my first submission, might need some process guidance.
>
> 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.
>
>> +(defcustom dired-hide-details-hide-absolute-location t
>> +  "Non-nil means `dired-hide-details-mode' hides current location's absolute path."
>
> Same here.
>
>> +            (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.
>
> Also, this change needs a NEWS entry.

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?

Thanks

  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72272; Package emacs. (Mon, 05 Aug 2024 14:35:02 GMT) Full text and rfc822 format available.

Message #14 received at 72272 <at> debbugs.gnu.org (full text, mbox):

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: Re: 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)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72272; Package emacs. (Sat, 17 Aug 2024 08:55:01 GMT) Full text and rfc822 format available.

Message #17 received at 72272 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alvaro Ramirez <alvaro <at> xenodium.com>
Cc: 72272 <at> debbugs.gnu.org, acorallo <at> gnu.org
Subject: Re: bug#72272: [PATCH] dired-hide-details-mode hides directory's
 absolute path
Date: Sat, 17 Aug 2024 11:53:36 +0300
> From: Alvaro Ramirez <alvaro <at> xenodium.com>
> Cc: eliz <at> gnu.org, 72272 <at> debbugs.gnu.org
> Date: Mon, 05 Aug 2024 15:34:17 +0100
> 
> 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.

Thanks, this LGTM.  However, AFAIU your copyright-assignment paperwork
is not yet completed, so we should wait for that, and then we can
install.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72272; Package emacs. (Sat, 17 Aug 2024 09:29:01 GMT) Full text and rfc822 format available.

Message #20 received at 72272 <at> debbugs.gnu.org (full text, mbox):

From: Alvaro Ramirez <alvaro <at> xenodium.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 72272 <at> debbugs.gnu.org, copyright-clerk <at> fsf.org, acorallo <at> gnu.org
Subject: Re: bug#72272: [PATCH] dired-hide-details-mode hides directory's
 absolute path
Date: Sat, 17 Aug 2024 10:27:08 +0100
> On 17 Aug 2024, at 09:53, Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
> 
>> 
>> From: Alvaro Ramirez <alvaro <at> xenodium.com>
>> Cc: eliz <at> gnu.org, 72272 <at> debbugs.gnu.org
>> Date: Mon, 05 Aug 2024 15:34:17 +0100
>> 
>> 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.
> 
> Thanks, this LGTM.

Thanks Eli!

>  However, AFAIU your copyright-assignment paperwork
> is not yet completed, so we should wait for that, and then we can
> install.

+copyright-clerk <at> fsf.org

Sounds good. It’s submitted. Waiting for response. 



This bug report was last modified 33 days ago.

Previous Next


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