GNU bug report logs -
#67161
30.0.50; [PATCH] Add option `dired-filename-display-length'
Previous Next
Reported by: Liu Hui <liuhui1610 <at> gmail.com>
Date: Tue, 14 Nov 2023 09:55:02 UTC
Severity: normal
Tags: patch
Found in version 30.0.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #41 received at 67161 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> 于2023年11月18日周六 18:55写道:
> If there are two different modes of using this function, the doc
> string could describe them both. Currently, it only describes the use
> case where dired-filename-display-length is an integer, in which case
> it is a simple accessor. The other use case is more subtle, and the
> doc string is completely silent about that, in particular it doesn't
> mention that point should be at the first character of the file name
> in that case.
Thanks for the explanation. I have updated the doc string as suggested.
> > BTW, I just find isearch doesn't handle hidden filenames based on
> > 'invisible' text property, which needs to be fixed. So maybe an
> > overlay-based approach is better? though I don't know if there is any
> > possible problem with using overlays for this feature. WDYT?
>
> Doesn't "M-x i" during isearch handle this?
No. I want to search text in hidden part rather than only in the
visible part, which is necessary for users to find relevant files even
if they are partly hidden.
Here is an example illustrating the problem:
1. emacs -Q
2. type M-: (insert "visible " (propertize "hidden" 'invisible t))
3. C-s hidden
isearch fails to match the invisible text by default, unless
search-invisible is changed to t. However, the default value of
search-invisible is open and it cannot be changed to t during isearch
by M-s i.
Therefore, I would like to change
(put-text-property ell-beg (point) 'invisible 'dired-filename-hide)
to
(let ((ov (make-overlay ell-beg (point))))
(overlay-put ov 'invisible 'dired-filename-hide)
(overlay-put ov 'isearch-open-invisible t)
(overlay-put ov 'evaporate t))
in the attached patch, then text in hidden part can be matched
regardless of search-invisible being open or t. It also has a bonus
that hidden text can be revealed during isearch.
> > --- a/lisp/wdired.el
> > +++ b/lisp/wdired.el
> > @@ -261,6 +261,9 @@ wdired-change-to-wdired-mode
> > (add-function :override (local 'revert-buffer-function) #'wdired-revert)
> > (set-buffer-modified-p nil)
> > (setq buffer-undo-list nil)
> > + ;; remove filename invisibility spec to ensure filenames are visible
> > + ;; for editing
>
> Comments should be complete sentences: begin with a capital letter and
> end with a period. Also, please mention here the new defcustom you
> add to Dired, so that the comment could better explain itself.
>
> Thanks.
Fixed.
[0001-Add-option-dired-filename-display-length.patch (text/x-patch, attachment)]
This bug report was last modified 1 year and 234 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.