From tromey@redhat.com Tue Aug 18 09:24:47 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 18 Aug 2009 16:24:47 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.1 required=4.0 tests=AWL,FOURLA autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7IGOXLm026880 for ; Tue, 18 Aug 2009 09:24:35 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MdRU7-0005cp-PT for bug-gnu-emacs@gnu.org; Tue, 18 Aug 2009 12:24:31 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MdRU1-0005Zz-FP for bug-gnu-emacs@gnu.org; Tue, 18 Aug 2009 12:24:30 -0400 Received: from [199.232.76.173] (port=34007 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MdRU0-0005Zs-TX for bug-gnu-emacs@gnu.org; Tue, 18 Aug 2009 12:24:25 -0400 Received: from mx2.redhat.com ([66.187.237.31]:46595) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MdRTz-00063G-Se for bug-gnu-emacs@gnu.org; Tue, 18 Aug 2009 12:24:24 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n7IGO5mj030639 for ; Tue, 18 Aug 2009 12:24:05 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n7IGO3D1027551; Tue, 18 Aug 2009 12:24:04 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n7IGO2Wk011679; Tue, 18 Aug 2009 12:24:03 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 5C0EA3782CC; Tue, 18 Aug 2009 10:24:02 -0600 (MDT) From: Tom Tromey To: bug-gnu-emacs@gnu.org Subject: 23.1; special fontification for "//" in cc-mode Reply-To: Tom Tromey X-Attribution: Tom Date: Tue, 18 Aug 2009 10:24:02 -0600 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Please write in English if possible, because the Emacs maintainers usually do not have translators to read other languages for them. Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list, and to the gnu.emacs.bug news group. Please describe exactly what actions triggered the bug and the precise symptoms of the bug: This is a feature request for cc-mode. I work on a number of projects that use C89, not C99. In these projects, it is invalid to use "//"-style comment. It would be nice if cc-mode would optionally flag such comments in a special face, so that I can immediately see when I've written a comment incorrectly. If Emacs crashed, and you have the Emacs process in the gdb debugger, please include the output from the following gdb commands: `bt full' and `xbacktrace'. If you would like to further debug the crash, please read the file /usr/share/emacs/23.1/etc/DEBUG for instructions. In GNU Emacs 23.1.1 (i386-redhat-linux-gnu, GTK+ Version 2.16.5) of 2009-08-03 on x86-5.fedora.phx.redhat.com Windowing system distributor `The X.Org Foundation', version 11.0.10601901 configured using `configure '--build=i386-redhat-linux-gnu' '--host=i386-redhat-linux-gnu' '--target=i586-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--with-dbus' '--with-gif' '--with-jpeg' '--with-png' '--with-rsvg' '--with-tiff' '--with-xft' '--with-xpm' '--with-x-toolkit=gtk' 'build_alias=i386-redhat-linux-gnu' 'host_alias=i386-redhat-linux-gnu' 'target_alias=i586-redhat-linux-gnu' 'CFLAGS=-DMAIL_USE_LOCKF -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i586 -mtune=generic -fasynchronous-unwind-tables'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_US.UTF-8 value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default-enable-multibyte-characters: t Major mode: Fundamental Minor modes in effect: erc-list-mode: t erc-menu-mode: t erc-autojoin-mode: t erc-ring-mode: t erc-pcomplete-mode: t erc-track-mode: t erc-track-minor-mode: t erc-match-mode: t erc-button-mode: t erc-fill-mode: t erc-stamp-mode: t erc-netsplit-mode: t erc-spelling-mode: t erc-truncate-mode: t diff-auto-refine-mode: t shell-dirtrack-mode: t highlight-changes-visible-mode: t erc-status-mode: t erc-services-mode: t erc-networks-mode: t erc-irccontrols-mode: t erc-noncommands-mode: t erc-move-to-prompt-mode: t erc-readonly-mode: t tooltip-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t global-auto-composition-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: e a t u r e s , SPC b u t SPC i t SPC d i d SPC b r e a k SPC w 3 m - e l SPC f o r SPC m e SPC : ( n o SPC m o r e SPC h t m l SPC m a i l SPC f o r SPC a SPC w h i l e m a y b e SPC t h a t SPC i s SPC a SPC p l u s SPC M-v M-> C-z o C-x b P C-x k C-x b L C-v C-v M-v M-v M-v C-z o C-h i d m c c SPC m C-v C-l m o d l C-v C-s c o m m e n t C-a m C-v C-s C-s C-v M-> C-s C-s C-s C-s C-s C-s C-s C-a C-v M-> C-s C-s C-s C-s C-a n n n n C-s C-s C-a SPC n u n n p 1 u SPC SPC SPC SPC SPC SPC p SPC n SPC n n u n SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC n SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC n SPC SPC SPC SPC SPC SPC n n n n n n C-s / / C-a C-v n C-s C-s C-a n n t C-s / / C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-a q C-z o M-x r e p r o t - e C-u C-b C-b C-f C-t C-e m Recent messages: call-interactively: End of buffer Mark set Mark saved where search started Mark set Mark saved where search started Info-extract-pointer: Node has no Next [2 times] Searching subfile ccmode-2... uncompressing ccmode-2.gz...done uncompressing ccmode-1.gz...done Mark saved where search started Tom From rgm@gnu.org Thu Aug 20 18:09:19 2009 Received: (at control) by emacsbugs.donarmstrong.com; 21 Aug 2009 01:09:19 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-4.9 required=4.0 tests=AWL,ONEWORD,X_DEBBUGS_NO_ACK autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7L19H7w000999 for ; Thu, 20 Aug 2009 18:09:19 -0700 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1MeId3-0004Zc-5w; Thu, 20 Aug 2009 21:09:17 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19085.62397.105518.639079@fencepost.gnu.org> Date: Thu, 20 Aug 2009 21:09:17 -0400 From: Glenn Morris To: control Subject: control X-Debbugs-No-Ack: yes merge 4185 4202 merge 4186 4201 severity 4192 wishlist reassign 4192 emacs,cc-mode reassign 4143 emacs,ns reassign 4146 emacs,cc-mode severity 4164 minor reassign 4180 emacs,ns reassign 4187 emacs,cc-mode forcemerge 2868 4194 From acm@muc.de Fri Aug 21 14:30:37 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 21 Aug 2009 21:30:37 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-4.4 required=4.0 tests=AWL,FVGT_m_MULTI_ODD, HAS_BUG_NUMBER autolearn=unavailable version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7LLUZAA029989 for ; Fri, 21 Aug 2009 14:30:36 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mebgx-0001HC-8k for bug-gnu-emacs@gnu.org; Fri, 21 Aug 2009 17:30:35 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mebgr-0001Gw-9v for bug-gnu-emacs@gnu.org; Fri, 21 Aug 2009 17:30:33 -0400 Received: from [199.232.76.173] (port=39962 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mebgr-0001Gt-55 for bug-gnu-emacs@gnu.org; Fri, 21 Aug 2009 17:30:29 -0400 Received: from colin.muc.de ([193.149.48.1]:3398 helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Mebgq-0004do-HO for bug-gnu-emacs@gnu.org; Fri, 21 Aug 2009 17:30:28 -0400 Received: (qmail 15515 invoked by uid 3782); 21 Aug 2009 21:30:25 -0000 Received: from acm.muc.de (pD9E51B5C.dip.t-dialin.net [217.229.27.92]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Fri, 21 Aug 2009 23:30:23 +0200 Received: (qmail 13921 invoked by uid 1000); 21 Aug 2009 21:33:23 -0000 Date: Fri, 21 Aug 2009 21:33:23 +0000 To: Tom Tromey , 4192@debbugs.gnu.org Cc: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Subject: Re: bug#4192: 23.1; special fontification for "//" in cc-mode Message-ID: <20090821213323.GC1897@muc.de> Reply-To: bug-cc-mode@gnu.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.6-4.9 Hi, Tom! On Tue, Aug 18, 2009 at 10:24:02AM -0600, Tom Tromey wrote: > This is a feature request for cc-mode. > I work on a number of projects that use C89, not C99. In these > projects, it is invalid to use "//"-style comment. It would be nice if > cc-mode would optionally flag such comments in a special face, so that > I can immediately see when I've written a comment incorrectly. I'm not sure this is important enough to warrant a fully implemented/documented/QA'd feature, but then again, I'm not sure it's not. Here's a quick hack called c-disable-line-comments.el. Load it into your Emacs before CC Mode (in particular, before desktop gets loaded). Toggling c-disable-line-comments doesn't work smoothly with the font locking, but I'm assuming here you'll not really be wanting to toggle this. Criticism is, of course, welcome. I've set the followup to bug-cc-mode@gnu.org. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; c-disable-line-comments.el. ;; ;; A function which disables line comments in C mode and fontifies the ;; delimiter "//" with font-lock-warning-face. ;; ;; It should be loaded before CC Mode. It will only work in GNU Emacs, and ;; has only been "properly" tested in Emacs 23.1. ;; ;; Written 2009-08-21 by Alan Mackenzie at the request of Tom Tromey. ;; ;; This file isn't part of Emacs. It's licence is GPL version 2, or (at your ;; option) any later version. The copyright has been assigned to the FSF. (defun c-warning-face-on-// () (font-lock-add-keywords 'c-mode '(("//" . font-lock-warning-face)))) (add-hook 'c-initialization-hook 'c-warning-face-on-//) (defvar c-disable-line-comments t "Is t when line comments in C Mode are disabled, nil otherwise. Note that this variable is NOT buffer local.") (defun c-disable-line-comments (arg) "Toggle the disablement of line comments in every C Mode buffer. With a non-nil argument \(which must be numeric), disable comments when it's positive, reenable them when negative. \(Incidentally, the delimiter \"//\" gets fontified with font-lock-warning-face when \"//\" is disabled, but this defun doesn't do this." (interactive "P") (setq c-disable-line-comments (cond ((null arg) (not c-disable-line-comments)) ((> (prefix-numeric-value arg) 0) t) (t nil))) (if c-disable-line-comments (progn (modify-syntax-entry ?/ ". 14" c-mode-syntax-table) (modify-syntax-entry ?\n " " c-mode-syntax-table) (modify-syntax-entry ?\r " " c-mode-syntax-table)) (modify-syntax-entry ?/ ". 124b" c-mode-syntax-table) (modify-syntax-entry ?\n "> b" c-mode-syntax-table) (modify-syntax-entry ?\r "> b" c-mode-syntax-table))) (c-disable-line-comments 1) ;; End of c-disable-line-comments.el ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > Tom -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 26 20:52:15 2010 Received: (at control) by debbugs.gnu.org; 27 Jan 2010 01:52:16 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NZx4p-0001L8-3A for submit@debbugs.gnu.org; Tue, 26 Jan 2010 20:52:15 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NZx4n-0001Kz-Cy for control@debbugs.gnu.org; Tue, 26 Jan 2010 20:52:13 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1NZx4j-0008Do-Q1; Tue, 26 Jan 2010 20:52:09 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19295.40009.742711.907136@fencepost.gnu.org> Date: Tue, 26 Jan 2010 20:52:09 -0500 From: Glenn Morris To: control Subject: control X-Attribution: GM X-Mailer: VM (www.wonderworks.com/vm), GNU Emacs (www.gnu.org/software/emacs) X-Hue: black X-Ran: .,Id9;5qiQf&2n,<1Q)pSe~'s"9B`l,&Ounxr+7\iedM93C_oK>"#$=D?*3Jqnu(&EvTR4 X-Debbugs-No-Ack: yes X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.0 (-----) tags 4053 moreinfo reassign 4066 emacs,org-mode reassign 4068 emacs,org-mode severity 4068 minor unarchive 4087 reassign 4087 notemacs tags 4094 moreinfo merge 4094 4096 merge 1611 3978 4108 unarchive 4097 unarchive 4130 merge 4097 4130 tags 4140 moreinfo close 4146 reassign 4151 emacs,ns tags 4192 patch From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 28 22:36:47 2016 Received: (at 4192) by debbugs.gnu.org; 29 Feb 2016 03:36:47 +0000 Received: from localhost ([127.0.0.1]:51203 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aaEdb-0002uP-2X for submit@debbugs.gnu.org; Sun, 28 Feb 2016 22:36:47 -0500 Received: from hermes.netfonds.no ([80.91.224.195]:36308) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aaEdZ-0002uH-V6 for 4192@debbugs.gnu.org; Sun, 28 Feb 2016 22:36:46 -0500 Received: from cpe-60-225-211-161.nsw.bigpond.net.au ([60.225.211.161] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aaEdB-0000f2-RG; Mon, 29 Feb 2016 04:36:22 +0100 From: Lars Ingebrigtsen To: Alan Mackenzie Subject: Re: bug#4192: 23.1; special fontification for "//" in cc-mode References: <20090821213323.GC1897@muc.de> Date: Mon, 29 Feb 2016 14:36:15 +1100 In-Reply-To: <20090821213323.GC1897@muc.de> (Alan Mackenzie's message of "Fri, 21 Aug 2009 21:33:23 +0000") Message-ID: <87k2lo193k.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-MailScanner-ID: 1aaEdB-0000f2-RG X-Netfonds-MailScanner: Found to be clean X-Netfonds-MailScanner-From: larsi@gnus.org MailScanner-NULL-Check: 1457321782.75069@uor87vvbJ3dEZ/m68tt4tg X-Spam-Status: No X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 4192 Cc: Tom Tromey , bug-cc-mode@gnu.org, 4192@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Alan Mackenzie writes: >> This is a feature request for cc-mode. > >> I work on a number of projects that use C89, not C99. In these >> projects, it is invalid to use "//"-style comment. It would be nice if >> cc-mode would optionally flag such comments in a special face, so that >> I can immediately see when I've written a comment incorrectly. > > I'm not sure this is important enough to warrant a fully > implemented/documented/QA'd feature, but then again, I'm not sure it's > not. > > Here's a quick hack called c-disable-line-comments.el. Load it into your > Emacs before CC Mode (in particular, before desktop gets loaded). > > Toggling c-disable-line-comments doesn't work smoothly with the font > locking, but I'm assuming here you'll not really be wanting to toggle > this. I think this sounds useful. For instance, in the Emacs source code, // is also frowned upon, so having those be marked by CC mode would be handy. This doesn't seem to have made its way into the code base, I think. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 01 12:08:55 2019 Received: (at 4192) by debbugs.gnu.org; 1 Nov 2019 16:08:55 +0000 Received: from localhost ([127.0.0.1]:56884 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iQZTr-0000uF-4Z for submit@debbugs.gnu.org; Fri, 01 Nov 2019 12:08:55 -0400 Received: from quimby.gnus.org ([80.91.231.51]:38484) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iQZTp-0000u5-Cy for 4192@debbugs.gnu.org; Fri, 01 Nov 2019 12:08:54 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iQZTk-0007eB-Fa; Fri, 01 Nov 2019 17:08:52 +0100 From: Lars Ingebrigtsen To: Alan Mackenzie Subject: Re: bug#4192: 23.1; special fontification for "//" in cc-mode References: <20090821213323.GC1897@muc.de> <87k2lo193k.fsf@gnus.org> Date: Fri, 01 Nov 2019 17:08:48 +0100 In-Reply-To: <87k2lo193k.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 29 Feb 2016 14:36:15 +1100") Message-ID: <87wocjzii7.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Lars Ingebrigtsen writes: > Alan Mackenzie writes: > >>> This is a feature request for cc-mode. >> >>> I work on a number of projects that use C89, not C99. In these >>> projects, it is invalid to use "//"-style c [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 4192 Cc: Tom Tromey , bug-cc-mode@gnu.org, 4192@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Lars Ingebrigtsen writes: > Alan Mackenzie writes: > >>> This is a feature request for cc-mode. >> >>> I work on a number of projects that use C89, not C99. In these >>> projects, it is invalid to use "//"-style comment. It would be nice if >>> cc-mode would optionally flag such comments in a special face, so that >>> I can immediately see when I've written a comment incorrectly. >> >> I'm not sure this is important enough to warrant a fully >> implemented/documented/QA'd feature, but then again, I'm not sure it's >> not. >> >> Here's a quick hack called c-disable-line-comments.el. Load it into your >> Emacs before CC Mode (in particular, before desktop gets loaded). >> >> Toggling c-disable-line-comments doesn't work smoothly with the font >> locking, but I'm assuming here you'll not really be wanting to toggle >> this. > > I think this sounds useful. For instance, in the Emacs source code, // > is also frowned upon, so having those be marked by CC mode would be > handy. This doesn't seem to have made its way into the code base, I > think. Alan, have you thought any further about this? It does seem like a nice feature. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 02 12:35:26 2019 Received: (at 4192) by debbugs.gnu.org; 2 Nov 2019 16:35:26 +0000 Received: from localhost ([127.0.0.1]:32984 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iQwN1-0006ds-LK for submit@debbugs.gnu.org; Sat, 02 Nov 2019 12:35:26 -0400 Received: from colin.muc.de ([193.149.48.1]:18011 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1iQwMu-0006da-NF for 4192@debbugs.gnu.org; Sat, 02 Nov 2019 12:35:22 -0400 Received: (qmail 44441 invoked by uid 3782); 2 Nov 2019 16:35:14 -0000 Received: from acm.muc.de (p2E5D5AEB.dip0.t-ipconnect.de [46.93.90.235]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 02 Nov 2019 17:35:13 +0100 Received: (qmail 9931 invoked by uid 1000); 2 Nov 2019 16:35:13 -0000 Date: Sat, 2 Nov 2019 16:35:13 +0000 To: Lars Ingebrigtsen Subject: Re: bug#4192: 23.1; special fontification for "//" in cc-mode Message-ID: <20191102163513.GC6710@ACM> References: <20090821213323.GC1897@muc.de> <87k2lo193k.fsf@gnus.org> <87wocjzii7.fsf@gnus.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87wocjzii7.fsf@gnus.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 4192 Cc: Tom Tromey , bug-cc-mode@gnu.org, 4192@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Lars. On Fri, Nov 01, 2019 at 17:08:48 +0100, Lars Ingebrigtsen wrote: > Lars Ingebrigtsen writes: > > Alan Mackenzie writes: > >>> This is a feature request for cc-mode. > >>> I work on a number of projects that use C89, not C99. In these > >>> projects, it is invalid to use "//"-style comment. It would be > >>> nice if cc-mode would optionally flag such comments in a special > >>> face, so that I can immediately see when I've written a comment > >>> incorrectly. > >> I'm not sure this is important enough to warrant a fully > >> implemented/documented/QA'd feature, but then again, I'm not sure > >> it's not. > >> Here's a quick hack called c-disable-line-comments.el. Load it into > >> your Emacs before CC Mode (in particular, before desktop gets > >> loaded). > >> Toggling c-disable-line-comments doesn't work smoothly with the font > >> locking, but I'm assuming here you'll not really be wanting to > >> toggle this. > > I think this sounds useful. For instance, in the Emacs source code, > > // is also frowned upon, so having those be marked by CC mode would > > be handy. This doesn't seem to have made its way into the code base, > > I think. > Alan, have you thought any further about this? It does seem like a > nice feature. I'm still not sure either way whether or not this is a feature worth implementing. It may be nice, but it will add bulk to CC Mode and Emacs. But, given that there are people (yourself and Tom Tromey, the OP) who think it worthwhile, I'm willing to implement it. It will not be that difficult, except for deciding what to call the new configuration variable(s). ;-) A couple of hours, perhaps. So, yes, sometime in the very near future, I will implement this. > -- > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 03 10:55:51 2019 Received: (at 4192) by debbugs.gnu.org; 3 Nov 2019 15:55:51 +0000 Received: from localhost ([127.0.0.1]:34868 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iRIEI-0006p6-Ov for submit@debbugs.gnu.org; Sun, 03 Nov 2019 10:55:51 -0500 Received: from quimby.gnus.org ([80.91.231.51]:45034) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iRIEF-0006ou-U7 for 4192@debbugs.gnu.org; Sun, 03 Nov 2019 10:55:48 -0500 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iRIEB-00077g-8S; Sun, 03 Nov 2019 16:55:45 +0100 From: Lars Ingebrigtsen To: Alan Mackenzie Subject: Re: bug#4192: 23.1; special fontification for "//" in cc-mode References: <20090821213323.GC1897@muc.de> <87k2lo193k.fsf@gnus.org> <87wocjzii7.fsf@gnus.org> <20191102163513.GC6710@ACM> Date: Sun, 03 Nov 2019 16:55:42 +0100 In-Reply-To: <20191102163513.GC6710@ACM> (Alan Mackenzie's message of "Sat, 2 Nov 2019 16:35:13 +0000") Message-ID: <875zk1ar9d.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Alan Mackenzie writes: > So, yes, sometime in the very near future, I will implement this. Great! Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 4192 Cc: Tom Tromey , bug-cc-mode@gnu.org, 4192@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Alan Mackenzie writes: > So, yes, sometime in the very near future, I will implement this. Great! -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 03 12:46:29 2019 Received: (at 4192) by debbugs.gnu.org; 3 Nov 2019 17:46:29 +0000 Received: from localhost ([127.0.0.1]:35062 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iRJxM-0005Zu-NZ for submit@debbugs.gnu.org; Sun, 03 Nov 2019 12:46:29 -0500 Received: from colin.muc.de ([193.149.48.1]:56649 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1iRJxH-0005Zj-PZ for 4192@debbugs.gnu.org; Sun, 03 Nov 2019 12:46:27 -0500 Received: (qmail 90103 invoked by uid 3782); 3 Nov 2019 17:46:22 -0000 Received: from acm.muc.de (p2E5D5ADE.dip0.t-ipconnect.de [46.93.90.222]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 03 Nov 2019 18:46:18 +0100 Received: (qmail 11657 invoked by uid 1000); 3 Nov 2019 17:46:18 -0000 Date: Sun, 3 Nov 2019 17:46:18 +0000 To: Lars Ingebrigtsen Subject: Re: bug#4192: 23.1; special fontification for "//" in cc-mode Message-ID: <20191103174618.GA11619@ACM> References: <20090821213323.GC1897@muc.de> <87k2lo193k.fsf@gnus.org> <87wocjzii7.fsf@gnus.org> <20191102163513.GC6710@ACM> <875zk1ar9d.fsf@gnus.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <875zk1ar9d.fsf@gnus.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 4192 Cc: bug-cc-mode@gnu.org, Tom Tromey , 4192@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Lars. On Sun, Nov 03, 2019 at 16:55:42 +0100, Lars Ingebrigtsen wrote: > Alan Mackenzie writes: > > So, yes, sometime in the very near future, I will implement this. > Great! Would you (and anybody else) please review the following patch. Short instructions on how to enable the feature are in the NEWS alteration; longer ones are in the cc-mode.texi bit: diff --git a/doc/misc/cc-mode.texi b/doc/misc/cc-mode.texi index 217261090b..5ee5540284 100644 --- a/doc/misc/cc-mode.texi +++ b/doc/misc/cc-mode.texi @@ -1149,7 +1149,9 @@ Minor Modes @table @asis @item comment style This specifies whether comment commands (such as @kbd{M-;}) insert -block comments or line comments. +block comments or line comments.@footnote{You can emphasize +non-default style comments in your code by giving their delimiters +@code{font-lock-warning-face}. @xref{Wrong Comment Style}.} @item electric mode When this is enabled, certain visible characters cause reformatting as they are typed. This is normally helpful, but can be a nuisance when @@ -1866,6 +1868,7 @@ Font Locking * Font Locking Preliminaries:: * Faces:: * Doc Comments:: +* Wrong Comment Style:: * Misc Font Locking:: * AWK Mode Font Locking:: @end menu @@ -2069,7 +2072,7 @@ Faces @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -@node Doc Comments, Misc Font Locking, Faces, Font Locking +@node Doc Comments, Wrong Comment Style, Faces, Font Locking @comment node-name, next, previous, up @section Documentation Comments @cindex documentation comments @@ -2149,7 +2152,29 @@ Doc Comments contributing it: send a note to @email{bug-cc-mode@@gnu.org}. @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -@node Misc Font Locking, AWK Mode Font Locking, Doc Comments, Font Locking +@node Wrong Comment Style, Misc Font Locking, Doc Comments, Font Locking +@comment node-name, next, previous, up +@section Marking ''Wrong'' style comments +@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +Most languages supported by @ccmode{} have two styles of comments, +namely block comments and line comments. Your project may have such a +strong preference for one of them, that you wish ''wrong'' style +comments to be clearly marked. + +You can get @ccmode{} to do this by setting the default comment style, +if necessary, (@pxref{Minor Modes}) and setting the customizable +option @code{c-mark-wrong-style-of-comment} to non-@code{nil}. + +@defvar c-mark-wrong-style-of-comment +@vindex mark-wrong-style-of-comment (c-) +When this customizable option is non-@code{nil}, comment delimiters +which aren't of the default style will be fontified with +@code{font-lock-warning-face}. +@end defvar + +@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +@node Misc Font Locking, AWK Mode Font Locking, Wrong Comment Style, Font Locking @comment node-name, next, previous, up @section Miscellaneous Font Locking @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! diff --git a/etc/NEWS b/etc/NEWS index 033cb48978..56faf13281 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2215,6 +2215,14 @@ file-local variable, you may need to update the value. *** Declare 'define-overload' and 'define-child-mode' as obsolete *** Rename several internal functions to use a ''mode-local-' prefix +** CC Mode + ++++ +*** You can now flag the "wrong style" of comments with +font-lock-warning-face. To do this, use c-toggle-comment-style, if +needed, to set the desired default comment style (block or line); then +set the option c-mark-wrong-style-of-comment to non-nil. + * New Modes and Packages in Emacs 27.1 diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el index c27b70603e..0daea8c84c 100644 --- a/lisp/progmodes/cc-fonts.el +++ b/lisp/progmodes/cc-fonts.el @@ -95,6 +95,7 @@ ;; during compilation. (cc-bytecomp-defvar c-preprocessor-face-name) (cc-bytecomp-defvar c-reference-face-name) +(cc-bytecomp-defvar c-block-comment-flag) (cc-bytecomp-defun c-fontify-recorded-types-and-refs) (cc-bytecomp-defun c-font-lock-declarators) (cc-bytecomp-defun c-font-lock-objc-method) @@ -532,7 +533,12 @@ c-fontify-recorded-types-and-refs (sws-depth (c-lang-const c-syntactic-ws-depth)) (nsws-depth (c-lang-const c-nonempty-syntactic-ws-depth))) - `(;; The stuff after #error and #warning is a message, so + `(;; Fontify "invalid" comment delimiters + ,@(when (and (c-lang-const c-block-comment-starter) + (c-lang-const c-line-comment-starter)) + `(c-maybe-font-lock-wrong-style-comments)) + + ;; The stuff after #error and #warning is a message, so ;; fontify it as a string. ,@(when (c-lang-const c-cpp-message-directives) (let* ((re (c-make-keywords-re 'appendable ; nil @@ -715,6 +721,59 @@ c-font-lock-invalid-single-quotes (parse-partial-sexp end limit nil nil state 'syntax-table))) nil) +(defun c-maybe-font-lock-wrong-style-comments (limit) + ;; This function will be called from font-lock-for a region bounded by POINT + ;; and LIMIT, as though it were to identify a keyword for + ;; font-lock-keyword-face. It always returns NIL to inhibit this and + ;; prevent a repeat invocation. See elisp/lispref page "Search-based + ;; Fontification". + ;; + ;; This function fontifies "invalid" comment delimiters with + ;; `font-lock-warning-face'. A delimiter is "invalid" when + ;; `c-mark-wrong-style-of-comment' is non-nil, and the delimiter style is + ;; not the default specified by `c-block-comment-flag'. + (when c-mark-wrong-style-of-comment + (let* ((lit (c-semi-pp-to-literal (point))) + (s (car lit)) ; parse-partial-sexp state. + ) + ;; First, deal with and move out of any literal we start in. + (cond + ((null (cadr lit))) ; Not in a literal + ((eq (cadr lit) 'string) + (setq s (parse-partial-sexp (point) limit nil nil s 'syntax-table))) + ((and (not c-block-comment-flag) ; In an "invalid" block comment + (eq (cadr lit) 'c)) + (setq s (parse-partial-sexp (point) limit nil nil s 'syntax-table)) + ;; Font lock the block comment ender with warning face. + (when (not (nth 4 s)) + (c-put-font-lock-face (- (point) (length c-block-comment-ender)) + (point) font-lock-warning-face))) + (t ; In a line comment, or a "valid" block comment + (setq s (parse-partial-sexp (point) limit nil nil s 'syntax-table)))) + + (while (< (point) limit) + (setq s (parse-partial-sexp (point) limit nil nil s 'syntax-table)) + (cond + ((or (nth 3 s) ; In a string + (and (nth 4 s) ; In a comment + (eq (nth 7 s) ; Comment style + (if c-block-comment-flag + nil ; Block comment + 1)))) ; Line comment + ;; Move over a "valid" literal. + (setq s (parse-partial-sexp (point) limit nil nil s 'syntax-table))) + ((nth 4 s) ; In an invalid comment + ;; Fontify the invalid comment opener. + (c-put-font-lock-face (nth 8 s) (point) font-lock-warning-face) + ;; Move to end of comment or LIMIT. + (setq s (parse-partial-sexp (point) limit nil nil s 'syntax-table)) + ;; Fontify an invalid block comment ender, if that's what we have. + (when (and (not c-block-comment-flag) + (not (nth 4 s))) ; We're outside the comment + (c-put-font-lock-face (- (point) (length c-block-comment-ender)) + (point) font-lock-warning-face))))))) + nil) + (c-lang-defconst c-basic-matchers-before "Font lock matchers for basic keywords, labels, references and various other easily recognizable things that should be fontified before generic diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el index 60ad42f24f..273174e041 100644 --- a/lisp/progmodes/cc-vars.el +++ b/lisp/progmodes/cc-vars.el @@ -1751,6 +1751,14 @@ c-make-macro-with-semi-re c-macro-names-with-semicolon: %s" c-macro-names-with-semicolon)))))) +(defcustom c-mark-wrong-style-of-comment nil + "Fontify \"invalid\" comment delims with `font-lock-warning-face' if non-nil. +\"Invalid\" means a line comment when the default comment style (set by +`c-toggle-comment-style') is block, or a block comment otherwise." + :type 'boolean + :group 'c + :version 27.1) + (defvar c-file-style nil "Variable interface for setting style via File Local Variables. In a file's Local Variable section, you can set this variable to a > -- > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 03 12:59:27 2019 Received: (at 4192) by debbugs.gnu.org; 3 Nov 2019 17:59:27 +0000 Received: from localhost ([127.0.0.1]:35071 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iRK9v-0005uf-8O for submit@debbugs.gnu.org; Sun, 03 Nov 2019 12:59:27 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54618) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iRK9s-0005uL-5j for 4192@debbugs.gnu.org; Sun, 03 Nov 2019 12:59:25 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:44207) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iRK9m-0003Oe-FJ; Sun, 03 Nov 2019 12:59:18 -0500 Received: from [176.228.60.248] (port=4937 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iRK9l-00059G-O8; Sun, 03 Nov 2019 12:59:18 -0500 Date: Sun, 03 Nov 2019 19:59:24 +0200 Message-Id: <83bltsj0xv.fsf@gnu.org> From: Eli Zaretskii To: Alan Mackenzie In-reply-to: <20191103174618.GA11619@ACM> (message from Alan Mackenzie on Sun, 3 Nov 2019 17:46:18 +0000) Subject: Re: bug#4192: 23.1; special fontification for "//" in cc-mode References: <20090821213323.GC1897@muc.de> <87k2lo193k.fsf@gnus.org> <87wocjzii7.fsf@gnus.org> <20191102163513.GC6710@ACM> <875zk1ar9d.fsf@gnus.org> <20191103174618.GA11619@ACM> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 4192 Cc: larsi@gnus.org, tom@tromey.com, 4192@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sun, 3 Nov 2019 17:46:18 +0000 > From: Alan Mackenzie > Cc: tom@tromey.com, 4192@debbugs.gnu.org > > -block comments or line comments. > +block comments or line comments.@footnote{You can emphasize @footnote should begin before the period. > +@section Marking ''Wrong'' style comments Why are you quoting ''like this'' in Texinfo? > +*** You can now flag the "wrong style" of comments with > +font-lock-warning-face. To do this, use c-toggle-comment-style, if > +needed, to set the desired default comment style (block or line); then > +set the option c-mark-wrong-style-of-comment to non-nil. Please make the first line a complete sentence, so that Outline mode displays this sensibly. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 03 14:20:43 2019 Received: (at 4192) by debbugs.gnu.org; 3 Nov 2019 19:20:44 +0000 Received: from localhost ([127.0.0.1]:35108 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iRLQZ-00088C-I2 for submit@debbugs.gnu.org; Sun, 03 Nov 2019 14:20:43 -0500 Received: from colin.muc.de ([193.149.48.1]:59598 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1iRLQW-000883-Lm for 4192@debbugs.gnu.org; Sun, 03 Nov 2019 14:20:41 -0500 Received: (qmail 26720 invoked by uid 3782); 3 Nov 2019 19:20:39 -0000 Received: from acm.muc.de (p2E5D5ADE.dip0.t-ipconnect.de [46.93.90.222]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 03 Nov 2019 20:20:37 +0100 Received: (qmail 12161 invoked by uid 1000); 3 Nov 2019 19:20:37 -0000 Date: Sun, 3 Nov 2019 19:20:37 +0000 To: Eli Zaretskii Subject: Re: bug#4192: 23.1; special fontification for "//" in cc-mode Message-ID: <20191103192037.GB11619@ACM> References: <20090821213323.GC1897@muc.de> <87k2lo193k.fsf@gnus.org> <87wocjzii7.fsf@gnus.org> <20191102163513.GC6710@ACM> <875zk1ar9d.fsf@gnus.org> <20191103174618.GA11619@ACM> <83bltsj0xv.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83bltsj0xv.fsf@gnu.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 4192 Cc: larsi@gnus.org, tom@tromey.com, 4192@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Eli. Thanks for doing these routine checks. On Sun, Nov 03, 2019 at 19:59:24 +0200, Eli Zaretskii wrote: > > Date: Sun, 3 Nov 2019 17:46:18 +0000 > > From: Alan Mackenzie > > Cc: tom@tromey.com, 4192@debbugs.gnu.org > > -block comments or line comments. > > +block comments or line comments.@footnote{You can emphasize > @footnote should begin before the period. OK. > > +@section Marking ''Wrong'' style comments > Why are you quoting ''like this'' in Texinfo? I was under the mistaken impression this was correct. There are several such occurrences in cc-mode.texi. I will correct them. > > +*** You can now flag the "wrong style" of comments with > > +font-lock-warning-face. To do this, use c-toggle-comment-style, if > > +needed, to set the desired default comment style (block or line); then > > +set the option c-mark-wrong-style-of-comment to non-nil. > Please make the first line a complete sentence, so that Outline mode > displays this sensibly. OK. > Thanks. I'll fix all these things before committing the change. Thanks. -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 07 15:11:24 2019 Received: (at 4192) by debbugs.gnu.org; 7 Nov 2019 20:11:25 +0000 Received: from localhost ([127.0.0.1]:43948 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iSo7o-0007rJ-Lx for submit@debbugs.gnu.org; Thu, 07 Nov 2019 15:11:24 -0500 Received: from quimby.gnus.org ([80.91.231.51]:35384) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iSo7j-0007r7-Q0 for 4192@debbugs.gnu.org; Thu, 07 Nov 2019 15:11:22 -0500 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iSo7f-00052H-51; Thu, 07 Nov 2019 21:11:17 +0100 From: Lars Ingebrigtsen To: Alan Mackenzie Subject: Re: bug#4192: 23.1; special fontification for "//" in cc-mode References: <20090821213323.GC1897@muc.de> <87k2lo193k.fsf@gnus.org> <87wocjzii7.fsf@gnus.org> <20191102163513.GC6710@ACM> <875zk1ar9d.fsf@gnus.org> <20191103174618.GA11619@ACM> Date: Thu, 07 Nov 2019 21:11:14 +0100 In-Reply-To: <20191103174618.GA11619@ACM> (Alan Mackenzie's message of "Sun, 3 Nov 2019 17:46:18 +0000") Message-ID: <871ruj8n19.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Alan Mackenzie writes: > Would you (and anybody else) please review the following patch. Short > instructions on how to enable the feature are in the NEWS alteration; > longer ones are in the cc-mode.texi bit: Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 4192 Cc: tom@tromey.com, 4192@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Alan Mackenzie writes: > Would you (and anybody else) please review the following patch. Short > instructions on how to enable the feature are in the NEWS alteration; > longer ones are in the cc-mode.texi bit: Looks nice. The only confusing thing is that the `C-c C-k' doesn't immediately flush the fontifying, so there's no feedback until you start typing. It'd be nice if `C-c C-k' immediately fontified the "wrong" comment style. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 09 07:20:17 2019 Received: (at 4192-done) by debbugs.gnu.org; 9 Nov 2019 12:20:17 +0000 Received: from localhost ([127.0.0.1]:48342 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iTPiz-0003MZ-6z for submit@debbugs.gnu.org; Sat, 09 Nov 2019 07:20:17 -0500 Received: from colin.muc.de ([193.149.48.1]:11281 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1iTPix-0003ML-C6 for 4192-done@debbugs.gnu.org; Sat, 09 Nov 2019 07:20:15 -0500 Received: (qmail 72649 invoked by uid 3782); 9 Nov 2019 12:20:13 -0000 Received: from acm.muc.de (p2E5D5246.dip0.t-ipconnect.de [46.93.82.70]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 09 Nov 2019 13:20:11 +0100 Received: (qmail 6271 invoked by uid 1000); 9 Nov 2019 12:20:11 -0000 Date: Sat, 9 Nov 2019 12:20:11 +0000 To: Lars Ingebrigtsen Subject: Re: bug#4192: 23.1; special fontification for "//" in cc-mode Message-ID: <20191109122011.GA5546@ACM> References: <20090821213323.GC1897@muc.de> <87k2lo193k.fsf@gnus.org> <87wocjzii7.fsf@gnus.org> <20191102163513.GC6710@ACM> <875zk1ar9d.fsf@gnus.org> <20191103174618.GA11619@ACM> <871ruj8n19.fsf@gnus.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <871ruj8n19.fsf@gnus.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 4192-done Cc: 4192-done@debbugs.gnu.org, tom@tromey.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Lars. On Thu, Nov 07, 2019 at 21:11:14 +0100, Lars Ingebrigtsen wrote: > Alan Mackenzie writes: > > Would you (and anybody else) please review the following patch. Short > > instructions on how to enable the feature are in the NEWS alteration; > > longer ones are in the cc-mode.texi bit: > Looks nice. Thanks for the review. > The only confusing thing is that the `C-c C-k' doesn't immediately > flush the fontifying, so there's no feedback until you start typing. > It'd be nice if `C-c C-k' immediately fontified the "wrong" comment > style. Yes. You're right. I've amended the code so that this toggling of the fontification of the "wrong" comments is now done instantly. I've committed the change (including the amendments to the NEWS and cc-mode.texi hunks requested by Eli), and I'm closing the bug with this post. > -- > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no -- Alan Mackenzie (Nuremberg, Germany). From unknown Wed Jun 18 00:17:56 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 07 Dec 2019 12:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator