[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 11c41774302: Add option to keep some columns in dired-hide-detail
From: |
Eli Zaretskii |
Subject: |
master 11c41774302: Add option to keep some columns in dired-hide-details-mode |
Date: |
Thu, 2 Mar 2023 07:03:02 -0500 (EST) |
branch: master
commit 11c4177430230ef41cb700c48afecf475cf39893
Author: Augusto Stoffel <arstoffel@gmail.com>
Commit: Eli Zaretskii <eliz@gnu.org>
Add option to keep some columns in dired-hide-details-mode
* lisp/dired.el (dired-hide-details-preserved-columns): New user
option.
(dired-insert-set-properties): Use it. (Bug#61785)
---
lisp/dired.el | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/lisp/dired.el b/lisp/dired.el
index 55a5bbd9800..8e3244356fe 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -490,6 +490,11 @@ to nil: a pipe using `zcat' or `gunzip -c' will be used."
(string :tag "Switches"))
:version "29.1")
+(defcustom dired-hide-details-preserved-columns nil
+ "List of columns which are not hidden in `dired-hide-details-mode'."
+ :type '(repeat integer)
+ :version "30.1")
+
;;; Internal variables
@@ -1880,8 +1885,15 @@ other marked file as well. Otherwise, unmark all files."
(put-text-property (line-beginning-position)
(1+ (line-end-position))
'invisible 'dired-hide-details-information))
- (put-text-property (+ (line-beginning-position) 1) (1- (point))
- 'invisible 'dired-hide-details-detail)
+ (save-excursion
+ (let ((end (1- (point)))
+ (opoint (goto-char (1+ (pos-bol))))
+ (i 0))
+ (put-text-property opoint end 'invisible
'dired-hide-details-detail)
+ (while (re-search-forward "[^ ]+" end t)
+ (when (member (cl-incf i) dired-hide-details-preserved-columns)
+ (put-text-property opoint (point) 'invisible nil))
+ (setq opoint (point)))))
(when (and dired-mouse-drag-files (fboundp 'x-begin-drag))
(put-text-property (point)
(save-excursion
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 11c41774302: Add option to keep some columns in dired-hide-details-mode,
Eli Zaretskii <=