From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: c-update-modeline format for c-block-comment-flag Date: Fri, 13 Oct 2017 15:36:23 +0000 Message-ID: <20171013153623.GB3881@ACM> References: <20171013144554.GA3881@ACM> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1507909159 25945 195.159.176.226 (13 Oct 2017 15:39:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 13 Oct 2017 15:39:19 +0000 (UTC) User-Agent: Mutt/1.7.2 (2016-11-26) Cc: emacs-devel@gnu.org To: Andy Moreton Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 13 17:39:13 2017 Return-path: Envelope-to: ged-emacs-devel@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 1e3239-0004OP-S8 for ged-emacs-devel@m.gmane.org; Fri, 13 Oct 2017 17:38:59 +0200 Original-Received: from localhost ([::1]:50759 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e323D-0007Lh-Hh for ged-emacs-devel@m.gmane.org; Fri, 13 Oct 2017 11:39:03 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57964) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3236-0007LR-C4 for emacs-devel@gnu.org; Fri, 13 Oct 2017 11:38:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3233-0008GE-7v for emacs-devel@gnu.org; Fri, 13 Oct 2017 11:38:56 -0400 Original-Received: from ocolin.muc.de ([193.149.48.4]:15290 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1e3232-0008FK-Ro for emacs-devel@gnu.org; Fri, 13 Oct 2017 11:38:53 -0400 Original-Received: (qmail 20694 invoked by uid 3782); 13 Oct 2017 15:38:48 -0000 Original-Received: from acm.muc.de (p548C7335.dip0.t-ipconnect.de [84.140.115.53]) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 13 Oct 2017 17:38:47 +0200 Original-Received: (qmail 5593 invoked by uid 1000); 13 Oct 2017 15:36:23 -0000 Content-Disposition: inline In-Reply-To: X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 193.149.48.4 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:219458 Archived-At: Hello again, Andy. On Fri, Oct 13, 2017 at 16:20:48 +0100, Andy Moreton wrote: > On Fri 13 Oct 2017, Alan Mackenzie wrote: > > Hello, Andy. > > On Fri, Oct 13, 2017 at 11:24:03 +0100, Andy Moreton wrote: > >> Hi, > >> The handling of c-block-comment-flag in c-update-modeline is > >> unfortunate: > >> (defun c-update-modeline () > >> (let ((fmt (format "/%s%s%s%s%s" > >> (if c-block-comment-flag "*" "/") > >> (if c-electric-flag "l" "") > >> (if (and c-electric-flag c-auto-newline) > >> "a" "") > >> (if c-hungry-delete-key "h" "") > >> (if (and > >> ;; (cc-)subword might not be loaded. > >> (boundp 'c-subword-mode) > >> (symbol-value 'c-subword-mode)) > >> ;; FIXME: subword-mode already comes with its > >> ;; own lighter! > >> "w" > >> ""))) > >> This fixed "/" in the modeline string forces this submode lighter to be > >> always present, ..... > > How? What mechanism do you mean? > The lighter for c-mode changed from "C" to "C//" or "C/*". > The lighter for c++-mode changed from "C++" to "C++//" or "C++/*". The lighter for these modes has "always" included a "/" followed by status letters, where "always" means for at least 15 years. The "*" or second "/" is a recent innovation to indicate the current default form of comments. > Both of these changes do not allow me to omit the lighter, or to change > it to something else without replacing the implementation of > c-update-modeline. The form of this section of the mode line matches the regexp "/[/*]l?a?h?w?". Perhaps one of these packages could be enhanced to handle regexps, if they can't already do so. > >> .... and prevents the diminish or delight packages from being able to > >> remove or replace this lighter. > > I'm not familiar with either of these packages. How does the fixed "/" > > prevent these packages from working? > I've not found a way to get them to work with varying strings. How about enhancing one of them to do so? > >> Can this be fixed for emacs-26 ? > > What do you mean by "fixed", here? What do you want to do with this > > portion of the mode line, exactly? > Allow the "//" or "/*" to be omitted entirely, or replaced with a > different string as the lighter for those sub-modes. With the first of my questions, I was really asking you how you want CC Mode to be fixed. I think I now understand that you want to replace the string. > AndyM -- Alan Mackenzie (Nuremberg, Germany).