From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#67161: 30.0.50; [PATCH] Add option `dired-filename-display-length' Date: Sat, 18 Nov 2023 12:55:16 +0200 Message-ID: <83jzqfmiuj.fsf@gnu.org> References: <8334x8tqi9.fsf@gnu.org> <83a5rfrych.fsf@gnu.org> <83sf55q4nc.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4251"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 67161@debbugs.gnu.org, stefankangas@gmail.com, monnier@iro.umontreal.ca To: Liu Hui Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 18 11:56:12 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r4Izk-0000ub-A2 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 18 Nov 2023 11:56:12 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r4Izb-0005D5-IA; Sat, 18 Nov 2023 05:56:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r4IzZ-0005CN-4C for bug-gnu-emacs@gnu.org; Sat, 18 Nov 2023 05:56:01 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r4IzY-0007tV-Rx for bug-gnu-emacs@gnu.org; Sat, 18 Nov 2023 05:56:00 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r4IzZ-0001XZ-Jc for bug-gnu-emacs@gnu.org; Sat, 18 Nov 2023 05:56:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 Nov 2023 10:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67161 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 67161-submit@debbugs.gnu.org id=B67161.17003049405894 (code B ref 67161); Sat, 18 Nov 2023 10:56:01 +0000 Original-Received: (at 67161) by debbugs.gnu.org; 18 Nov 2023 10:55:40 +0000 Original-Received: from localhost ([127.0.0.1]:47894 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r4IzD-0001Wz-Gh for submit@debbugs.gnu.org; Sat, 18 Nov 2023 05:55:39 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35850) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r4IzA-0001Wl-Vu for 67161@debbugs.gnu.org; Sat, 18 Nov 2023 05:55:38 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r4Iz4-0006xE-NW; Sat, 18 Nov 2023 05:55:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=oeSynKYhNk7xU410eMzbGymUujxpd5fi7pB2E2v/ti0=; b=EMTG3xAX2fX0 W4KD+EEdahMJiZjC/J0jiCkjsZYGgEl2BgIo3ZP3KvZGZJ7xW01BJ6wdhYNB+63em3SQ1hmyMU0CI HdHNwuOnDYeH2QDyAkUi6dNbxMgu/YpKGsTIU3w0Yt1iUrUtARj8FaesNCOwXs+z/ksJUpFqcHZ1S lfwH3XDnWA4o9qJQXHwXxM9PE5+M2w82KJGHHOgYUJl4138qSkypu3O/+mmnPflrdUJr3nxTueEFY ds4N+qpcn55mr6A/OUKRqA8LU9ULL200jNGlpvtWa29SsHxYjfQoY/yrCCYfc5tKZq5qUDJqEOAc2 I2b3W3+k/Oi7J/+puKqH9A==; In-Reply-To: (message from Liu Hui on Sat, 18 Nov 2023 17:23:26 +0800) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:274552 Archived-At: > From: Liu Hui > Date: Sat, 18 Nov 2023 17:23:26 +0800 > Cc: stefankangas@gmail.com, monnier@iro.umontreal.ca, 67161@debbugs.gnu.org > > > > +(defun dired--get-filename-display-length () > > > + "Return maximum display length of filename." > > > > This doc string is inaccurate. The function actually returns the > > number of columns available for displaying the file names in a Dired > > buffer, and it should be called with point at the first character of > > the file name. > > Why is it inaccurate? When `dired-filename-display-length' is window, > the function does return the number of columns available, and it is > used as the maximum display length. Moreover, it could be an integer, > which also means the maximum display length. 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. > 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? > --- 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.