From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#41250: 28.0.50; Dired displays unconditionally ls-switches on modeline Date: Fri, 02 Oct 2020 09:54:17 +0300 Organization: LINKOV.NET Message-ID: <87lfgpm82u.fsf@mail.linkov.net> References: <87v9ky9p6o.fsf@mail.linkov.net> <654acc31-015d-4552-bd9b-3b8c69661fcd@default> <0957af50-7f85-455a-9d2c-e96451727872@default> <6073a2d5-4024-465d-8293-88ad7f6127ed@default> <87mu172qxb.fsf@gnus.org> <87sgazi550.fsf@mail.linkov.net> <87tuvfxdsf.fsf@gnus.org> <875z7vdol3.fsf@mail.linkov.net> <87pn63xcgp.fsf@gnus.org> <874knd7mow.fsf@mail.linkov.net> <877ds91zvy.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14351"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: 41250@debbugs.gnu.org, Arthur Miller To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 02 09:00:32 2020 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 1kOF3Q-0003bK-7Q for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 02 Oct 2020 09:00:32 +0200 Original-Received: from localhost ([::1]:36880 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kOF3P-00049T-99 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 02 Oct 2020 03:00:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49856) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kOF2x-00048T-Qi for bug-gnu-emacs@gnu.org; Fri, 02 Oct 2020 03:00:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55898) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kOF2w-0007xN-FA for bug-gnu-emacs@gnu.org; Fri, 02 Oct 2020 03:00:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kOF2w-0007mn-Bp for bug-gnu-emacs@gnu.org; Fri, 02 Oct 2020 03:00:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 02 Oct 2020 07:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41250 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed Original-Received: via spool by 41250-submit@debbugs.gnu.org id=B41250.160162199629880 (code B ref 41250); Fri, 02 Oct 2020 07:00:02 +0000 Original-Received: (at 41250) by debbugs.gnu.org; 2 Oct 2020 06:59:56 +0000 Original-Received: from localhost ([127.0.0.1]:39208 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kOF2p-0007ls-Mu for submit@debbugs.gnu.org; Fri, 02 Oct 2020 02:59:55 -0400 Original-Received: from relay4-d.mail.gandi.net ([217.70.183.196]:57189) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kOF2n-0007lY-UZ for 41250@debbugs.gnu.org; Fri, 02 Oct 2020 02:59:54 -0400 X-Originating-IP: 91.129.108.13 Original-Received: from mail.gandi.net (m91-129-108-13.cust.tele2.ee [91.129.108.13]) (Authenticated sender: juri@linkov.net) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 67C37E0009; Fri, 2 Oct 2020 06:59:45 +0000 (UTC) In-Reply-To: <877ds91zvy.fsf@gnus.org> (Lars Ingebrigtsen's message of "Thu, 01 Oct 2020 21:59:13 +0200") 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" Xref: news.gmane.io gmane.emacs.bugs:189626 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit > The variable doesn't work as is (because of the problem of mixed > frames), and `auto-detect' doesn't have much meaning, which is why this > should never have been a variable in the first place. > > Instead of trying to fix that mess, I thought it would be easier to > introduce a new function that does the right thing automatically, and > without a gazillion optional parameters, and then make the old function > obsolete. I have no opinion about a new function. Like everyone else, I'm using truncate-string-to-width, and happy with it, except of one complaint: on every use I need to wrap it with such code: (let ((ellipsis (cond (truncate-string-ellipsis) ((char-displayable-p ?…) "…") ("...")))) (truncate-string-to-width string max nil nil ellipsis)) Preferably, this should be fixed with this patch: --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=truncate-string-ellipsis.patch Content-Transfer-Encoding: 8bit diff --git a/lisp/international/mule-util.el b/lisp/international/mule-util.el index 660ac58e02..a2bd5802cc 100644 --- a/lisp/international/mule-util.el +++ b/lisp/international/mule-util.el @@ -44,10 +44,16 @@ store-substring (setq i (1+ i))))) string) -(defvar truncate-string-ellipsis "..." ;"…" +(defvar truncate-string-ellipsis nil "String to use to indicate truncation. Serves as default value of ELLIPSIS argument to `truncate-string-to-width'.") +(defun truncate-string-ellipsis () + (cond + (truncate-string-ellipsis) + ((char-displayable-p ?…) "…") + ("..."))) + ;;;###autoload (defun truncate-string-to-width (str end-column &optional start-column padding ellipsis @@ -81,7 +87,7 @@ truncate-string-to-width (or start-column (setq start-column 0)) (when (and ellipsis (not (stringp ellipsis))) - (setq ellipsis truncate-string-ellipsis)) + (setq ellipsis (truncate-string-ellipsis))) (let ((str-len (length str)) (str-width (string-width str)) (ellipsis-width (if ellipsis (string-width ellipsis) 0)) --=-=-=--