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#52183: 29.0.50; Empty space in the mode line if server-mode is active Date: Sat, 04 Dec 2021 13:59:56 +0200 Message-ID: <83tufo60n7.fsf@gnu.org> References: <87tufvkl5f.fsf@mssdvd.com> <83y25067bw.fsf@gnu.org> <87ee6s1yny.fsf@mssdvd.com> <83wnkk64tz.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27331"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 52183@debbugs.gnu.org, dm@mssdvd.com To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 04 13:01:32 2021 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 1mtTjQ-0006yl-Dv for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 04 Dec 2021 13:01:32 +0100 Original-Received: from localhost ([::1]:56550 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mtTjO-0003Sa-O0 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 04 Dec 2021 07:01:30 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:37224) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtTiv-0003Q5-W4 for bug-gnu-emacs@gnu.org; Sat, 04 Dec 2021 07:01:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41484) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtTiv-0001wi-P5 for bug-gnu-emacs@gnu.org; Sat, 04 Dec 2021 07:01:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mtTiv-0001dm-Nn for bug-gnu-emacs@gnu.org; Sat, 04 Dec 2021 07:01: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, 04 Dec 2021 12:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52183 X-GNU-PR-Package: emacs Original-Received: via spool by 52183-submit@debbugs.gnu.org id=B52183.16386192196246 (code B ref 52183); Sat, 04 Dec 2021 12:01:01 +0000 Original-Received: (at 52183) by debbugs.gnu.org; 4 Dec 2021 12:00:19 +0000 Original-Received: from localhost ([127.0.0.1]:53030 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtTiF-0001cf-H5 for submit@debbugs.gnu.org; Sat, 04 Dec 2021 07:00:19 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:36286) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtTiC-0001cN-MV for 52183@debbugs.gnu.org; Sat, 04 Dec 2021 07:00:17 -0500 Original-Received: from [2001:470:142:3::e] (port=32944 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtTi6-0001l4-Vt; Sat, 04 Dec 2021 07:00:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=W0M6vQdTTm8Xmgoqccg2UTnJeb6Q8R6B9/WMt/m5aJs=; b=iCpuViRsSBRd3sTXirjx oKillWj4kjm18NcVRTRBtSn6ze+YDlZfV9abDTnPDMKZfBRxysH/iK0BQdgKDnjdQCohIDtgHYpYE fwgDu+p+imo/Qyjwh1avxslagTHeJ0QEQxXLyenXObmjwVn/eMLIIAfFxXNQE/AKtPgKdF2EyfrGN g6wQIYAfNJ9Dg1P5PTJ56nFZdweISMpQ27tJc3tbLzHM7Aj3DPByw2inSasNtcXeQkUfrgSWQnTYF Q3g5tcZIS1aVfGHiYnjn8eEGcCPVonUMTJIlWZsrDA0qsyAjAJJWW7taxdygI7LaGKG0J0tc55FkV h0uIStTtFDOqGA==; Original-Received: from [87.69.77.57] (port=3253 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtTi0-0001mK-Rz; Sat, 04 Dec 2021 07:00:11 -0500 In-Reply-To: <83wnkk64tz.fsf@gnu.org> (message from Eli Zaretskii on Sat, 04 Dec 2021 12:29:28 +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:221463 Archived-At: > Date: Sat, 04 Dec 2021 12:29:28 +0200 > From: Eli Zaretskii > Cc: 52183@debbugs.gnu.org > > > From: Davide Masserut > > Cc: 52183@debbugs.gnu.org > > Date: Sat, 04 Dec 2021 10:56:17 +0100 > > > > Eli Zaretskii writes: > > > > > Do you still see this on the current master? I seem to be unable to > > > reproduce this today. > > > > I'm still seeing it on "3e7aff5fcdd3fa6e30497323c914f6c79c951ed6". > > Ignore me: I wasn't testing this properly. I think I understand the root cause of this. bindings.el produce this part of mode line as follows: (list :propertize (list "" 'mode-line-mule-info 'mode-line-client 'mode-line-modified 'mode-line-remote) 'display '(min-width (5.0))) This presumes that the values of the mode-line-* variables mentioned there will be concatenated, then the display property with the min-width spec added to the result of the concatenation, and then the result will be displayed. But that's not how the mode-line display works. The "concatenation", as mentioned in the ELisp manual: ‘(STRING REST...)’ ‘(LIST REST...)’ A list whose first element is a string or list means to process all the elements recursively and concatenate the results. is not a real concatenation that produces a Lisp string, it is a "effective concatenation" that happens on display, because the elements of the list are displayed one after the other. Any string in the list gets the properties specified in :propertize applied to it _before_ displaying it, but text properties on C strings are ignored when they are displayed, and so have no effect. Now the way min-width is implemented, if we display a series of C strings, then display a Lisp string, the min-width will have effect before the Lisp string is displayed. Which is what happens here: the "@" indicator is computed in bindings.el as a Lisp string. Without the "@" part, the " " string that follows the above group of indicators plays the role of that Lisp string, so the min-width thing _seems_ to work as intended when all the 4 parts above are either C strings or empty strings. Bottom line: I think to make this work as intended, bindings.el should be modified to produce a Lisp string from all those 4 elements, by concatenating them, and then the min-width display spec should be put on the result of the concatenation.