From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#2034: [PATCH] 27.0.50; Support mode line constructs for `mode-name' in c-mode Date: Mon, 02 Jul 2018 18:29:26 +0300 Message-ID: <83sh51k65l.fsf@gnu.org> References: <87skn8xhia.fsf@transitory.lefae.org> <47fd3239-fe83-0f2f-b903-e18713cc60f6@orcon.net.nz> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1530545963 14620 195.159.176.226 (2 Jul 2018 15:39:23 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 2 Jul 2018 15:39:23 +0000 (UTC) Cc: 2034@debbugs.gnu.org To: Phil Sainty Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 02 17:39:18 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fa0v8-0003go-8J for geb-bug-gnu-emacs@m.gmane.org; Mon, 02 Jul 2018 17:39:18 +0200 Original-Received: from localhost ([::1]:33668 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fa0xF-0003g6-G9 for geb-bug-gnu-emacs@m.gmane.org; Mon, 02 Jul 2018 11:41:29 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54573) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fa0mE-0002lo-Ez for bug-gnu-emacs@gnu.org; Mon, 02 Jul 2018 11:30:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fa0mA-0008Qj-Hh for bug-gnu-emacs@gnu.org; Mon, 02 Jul 2018 11:30:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35845) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fa0mA-0008Qf-EB for bug-gnu-emacs@gnu.org; Mon, 02 Jul 2018 11:30:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fa0mA-0006Pr-6k for bug-gnu-emacs@gnu.org; Mon, 02 Jul 2018 11:30:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Jul 2018 15:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 2034 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug wontfix Original-Received: via spool by 2034-submit@debbugs.gnu.org id=B2034.153054539124619 (code B ref 2034); Mon, 02 Jul 2018 15:30:02 +0000 Original-Received: (at 2034) by debbugs.gnu.org; 2 Jul 2018 15:29:51 +0000 Original-Received: from localhost ([127.0.0.1]:43742 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fa0lz-0006P1-2G for submit@debbugs.gnu.org; Mon, 02 Jul 2018 11:29:51 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:35245) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fa0lx-0006On-DA for 2034@debbugs.gnu.org; Mon, 02 Jul 2018 11:29:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fa0lo-0008GQ-8O for 2034@debbugs.gnu.org; Mon, 02 Jul 2018 11:29:44 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59705) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fa0lo-0008GC-57; Mon, 02 Jul 2018 11:29:40 -0400 Original-Received: from [176.228.60.248] (port=1612 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fa0ln-0005jy-2t; Mon, 02 Jul 2018 11:29:39 -0400 In-reply-to: <47fd3239-fe83-0f2f-b903-e18713cc60f6@orcon.net.nz> (message from Phil Sainty on Tue, 3 Jul 2018 00:40:49 +1200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:148100 Archived-At: > From: Phil Sainty > Date: Tue, 3 Jul 2018 00:40:49 +1200 > > `c-update-modeline' in cc-cmds.el has a long-standing bug (and FIXME > comment) whereby a `mode-name' which is not a string will trigger > errors, on account of the function using string manipulations to add > the minor mode flags to the original `mode-name'. > > This is what bug #2034 was originally about. i.e.: > > > c-update-modeline: Wrong type argument: stringp, > > (sgml-xml-mode "XML" "SGML") > > This new patch instead uses mode-line constructs to concatenate the > flags, thus eliminating the string manipulation code and this bug. I've just skimmed the patch, so apologies in advance if what I'm saying makes no sense. That said, did you try to compare the old and the new code when the flag strings have text properties, like faces or colors? The mode-line formatting code is tricky when text properties are involved. > +(defcustom c-modeline-display-flags t > + "If non-nil, `mode-name' includes indicators for certain minor modes. > + > +These flags are set by `c-update-modeline'. > + > +See Info node `(ccmode) Minor Modes'." > + :type 'boolean > + :group 'c) Please always provide a :version tag for new/modified defcustoms. Finally, I think this needs a NEWS entry, if not a suitable change to the manual. Thanks.