GNU bug report logs - #45560
27.1; add-change-log-entry erroneously removes "const" from function name

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Tom Tromey <tom@HIDDEN>; Keywords: patch; dated Wed, 30 Dec 2020 23:13:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Added tag(s) patch. Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 45560 <at> debbugs.gnu.org:


Received: (at 45560) by debbugs.gnu.org; 2 Jan 2021 05:42:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 02 00:42:20 2021
Received: from localhost ([127.0.0.1]:38882 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kvZgC-0000bI-9I
	for submit <at> debbugs.gnu.org; Sat, 02 Jan 2021 00:42:20 -0500
Received: from quimby.gnus.org ([95.216.78.240]:35642)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1kvZgA-0000b4-Qx
 for 45560 <at> debbugs.gnu.org; Sat, 02 Jan 2021 00:42:19 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=R/3k8Wt4SpXX7x5034kS9FBt/0CSOjcQHqLL92fuaiU=; b=i8ERXXl95LSFBXSU1UPePeobO1
 Rr9ox2EHrAzdYzgG46nfq16l9/rmFdo3/oQ3rVs8rZ3lz/jG8LUy9iltSirllMSQshiXti2PWsqVX
 tU/U5Yiwml377YYye15m1GtPjp+hbv8ZPHXgyu4846fPVAPoss2vaPYyNFe9b0OQGkFI=;
Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1kvZg1-0006eL-9P; Sat, 02 Jan 2021 06:42:11 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
Subject: Re: bug#45560: 27.1; add-change-log-entry erroneously removes
 "const" from function name
References: <87im8ievo2.fsf@HIDDEN> <87ft3mmuim.fsf@HIDDEN>
 <X+9LyWW/jJwHnkgV@ACM>
X-Now-Playing: Simple Minds's _Sparkle In The Rain_: "White Hot Day"
Date: Sat, 02 Jan 2021 06:42:07 +0100
In-Reply-To: <X+9LyWW/jJwHnkgV@ACM> (Alan Mackenzie's message of "Fri, 1 Jan
 2021 16:20:25 +0000")
Message-ID: <87h7nzao9c.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.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 <acm@HIDDEN> writes: > Please try the
 following
 patch out, which shouldn't be at all > controversial, and let me know whether
 it fixes everything. Thanks! Yup; your patch fixes the test case here, too.
 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: 45560
Cc: Tom Tromey <tom@HIDDEN>, 45560 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Alan Mackenzie <acm@HIDDEN> writes:

> Please try the following patch out, which shouldn't be at all
> controversial, and let me know whether it fixes everything.  Thanks!

Yup; your patch fixes the test case here, too.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#45560; Package emacs. Full text available.

Message received at 45560 <at> debbugs.gnu.org:


Received: (at 45560) by debbugs.gnu.org; 1 Jan 2021 16:20:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 01 11:20:36 2021
Received: from localhost ([127.0.0.1]:34594 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kvNAJ-0006fH-Jg
	for submit <at> debbugs.gnu.org; Fri, 01 Jan 2021 11:20:36 -0500
Received: from colin.muc.de ([193.149.48.1]:56558 helo=mail.muc.de)
 by debbugs.gnu.org with smtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1kvNAH-0006f0-18
 for 45560 <at> debbugs.gnu.org; Fri, 01 Jan 2021 11:20:34 -0500
Received: (qmail 41631 invoked by uid 3782); 1 Jan 2021 16:20:26 -0000
Received: from acm.muc.de (p4fe15b14.dip0.t-ipconnect.de [79.225.91.20]) by
 colin.muc.de (tmda-ofmipd) with ESMTP;
 Fri, 01 Jan 2021 17:20:25 +0100
Received: (qmail 8265 invoked by uid 1000); 1 Jan 2021 16:20:25 -0000
Date: Fri, 1 Jan 2021 16:20:25 +0000
To: Lars Ingebrigtsen <larsi@HIDDEN>, Tom Tromey <tom@HIDDEN>
Subject: Re: bug#45560: 27.1; add-change-log-entry erroneously removes
 "const" from function name
Message-ID: <X+9LyWW/jJwHnkgV@ACM>
References: <87im8ievo2.fsf@HIDDEN>
 <87ft3mmuim.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <87ft3mmuim.fsf@HIDDEN>
X-Delivery-Agent: TMDA/1.1.12 (Macallan)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 45560
Cc: acm@HIDDEN, 45560 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hello, Lars and Tom

On Thu, Dec 31, 2020 at 06:09:21 +0100, Lars Ingebrigtsen wrote:
> Tom Tromey <tom@HIDDEN> writes:

> > Put this into a .c file:
> >
> > void
> > const_ref ()
> > {
> > }
> >
> > Now, put point inside the braces and M-x add-change-log-entry.
> >
> > For me the resulting ChangeLog looks like:
> >
> > 2020-12-30  Tom Tromey  <tom@HIDDEN>
> >
> > 	* q.c (_ref): 

> Debugging this, it looks like this is down to

> (c-defun-name-1)

> returning "_ref" if called in the const_ref function, so I've added Alan
> to the CCs. 

Yes, there was a regular expression recognising "const" where it
shouldn't have.  It was a regexp with many discordant, conflicting
requirements, so I had to "split it in two" to get it working properly.

Please try the following patch out, which shouldn't be at all
controversial, and let me know whether it fixes everything.  Thanks!



diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 7444f0f805..60e85fc085 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -9021,14 +9021,15 @@ c-forward-declarator
 		    (c-forward-noise-clause))
 		   ((and (looking-at c-type-decl-prefix-key)
 			 (if (and (c-major-mode-is 'c++-mode)
-				  (match-beginning 3))
+				  (match-beginning 4)) ; Was 3 - 2021-01-01
 			     ;; If the third submatch matches in C++ then
 			     ;; we're looking at an identifier that's a
 			     ;; prefix only if it specifies a member pointer.
 			     (progn
 			       (setq id-start (point))
 			       (c-forward-name)
-			       (if (looking-at "\\(::\\)")
+			       (if (save-match-data
+				     (looking-at "\\(::\\)"))
 				   ;; We only check for a trailing "::" and
 				   ;; let the "*" that should follow be
 				   ;; matched in the next round.
@@ -9038,13 +9039,15 @@ c-forward-declarator
 				 (setq got-identifier t)
 				 nil))
 			   t))
-		    (if (looking-at c-type-decl-operator-prefix-key)
+		    (if (save-match-data
+			  (looking-at c-type-decl-operator-prefix-key))
 			(setq decorated t))
 		    (if (eq (char-after) ?\()
 			(progn
 			  (setq paren-depth (1+ paren-depth))
 			  (forward-char))
-		      (goto-char (match-end 1)))
+		      (goto-char (or (match-end 1)
+				     (match-end 2))))
 		    (c-forward-syntactic-ws)
 		    t)))
 
@@ -9721,14 +9724,15 @@ c-forward-decl-or-cast-1
 	      (setq after-paren-pos (point))))
 	(while (and (looking-at c-type-decl-prefix-key)
 		    (if (and (c-major-mode-is 'c++-mode)
-			     (match-beginning 3))
+			     (match-beginning 4))
 			;; If the third submatch matches in C++ then
 			;; we're looking at an identifier that's a
 			;; prefix only if it specifies a member pointer.
 			(when (progn (setq pos (point))
 				     (setq got-identifier (c-forward-name)))
 			  (setq name-start pos)
-			  (if (looking-at "\\(::\\)")
+			  (if (save-match-data
+				(looking-at "\\(::\\)"))
 			      ;; We only check for a trailing "::" and
 			      ;; let the "*" that should follow be
 			      ;; matched in the next round.
@@ -9749,7 +9753,8 @@ c-forward-decl-or-cast-1
 	    (when (save-match-data
 		    (looking-at c-type-decl-operator-prefix-key))
 	      (setq got-function-name-prefix t))
-	    (goto-char (match-end 1)))
+	    (goto-char (or (match-end 1)
+			   (match-end 2))))
 	  (c-forward-syntactic-ws)))
 
       (setq got-parens (> paren-depth 0))
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el
index c3cd81e1e8..9577f55e87 100644
--- a/lisp/progmodes/cc-langs.el
+++ b/lisp/progmodes/cc-langs.el
@@ -3433,41 +3433,47 @@ c-populate-syntax-table
   t (c-make-bare-char-alt (c-lang-const c-block-prefix-disallowed-chars) t))
 (c-lang-defvar c-block-prefix-charset (c-lang-const c-block-prefix-charset))
 
-(c-lang-defconst c-type-decl-prefix-key
-  "Regexp matching any declarator operator that might precede the
-identifier in a declaration, e.g. the \"*\" in \"char *argv\".  This
-regexp should match \"(\" if parentheses are valid in declarators.
-The end of the first submatch is taken as the end of the operator.
-Identifier syntax is in effect when this is matched (see
-`c-identifier-syntax-table')."
+(c-lang-defconst c-type-decl-prefix-keywords-key
+  ;; Regexp matching any keyword operator that might precede the identifier in
+  ;; a declaration, e.g. "const" or nil.  It doesn't test there is no "_"
+  ;; following the keyword.
   t (if (or (c-lang-const c-type-modifier-kwds) (c-lang-const c-modifier-kwds))
-        (concat
+	(concat
 	 (regexp-opt (c--delete-duplicates
 		      (append (c-lang-const c-type-modifier-kwds)
 			      (c-lang-const c-modifier-kwds))
 		      :test 'string-equal)
 		     t)
-	 "\\>")
-      ;; Default to a regexp that never matches.
-      regexp-unmatchable)
+	 "\\>")))
+
+(c-lang-defconst c-type-decl-prefix-key
+  "Regexp matching any declarator operator that might precede the
+identifier in a declaration, e.g. the \"*\" in \"char *argv\".  This
+regexp should match \"(\" if parentheses are valid in declarators.
+The operator found is either the first submatch (if it is not a
+keyword) or the second submatch (if it is)."
+  t (if (c-lang-const c-type-decl-prefix-keywords-key)
+	(concat "\\(\\`a\\`\\)\\|"	; 1 - will never match.
+		(c-lang-const c-type-decl-prefix-keywords-key) ; 2
+		"\\([^_]\\|$\\)")			       ; 3
+      regexp-unmatchable) ;; Default to a regexp that never matches.
   ;; Check that there's no "=" afterwards to avoid matching tokens
   ;; like "*=".
-  (c objc) (concat "\\("
+  (c objc) (concat "\\("		; 1
 		   "[*(]"
-		   "\\|"
-		   (c-lang-const c-type-decl-prefix-key)
-		   "\\)"
-		   "\\([^=]\\|$\\)")
-  c++  (concat "\\("
+		   "\\)\\|"
+		   (c-lang-const c-type-decl-prefix-keywords-key) ; 2
+		   "\\([^=_]\\|$\\)")	; 3
+  c++  (concat "\\("			; 1
 	       "&&"
 	       "\\|"
 	       "\\.\\.\\."
 	       "\\|"
 	       "[*(&~]"
+	       "\\)\\|\\("				      ; 2
+	       (c-lang-const c-type-decl-prefix-keywords-key) ; 3
 	       "\\|"
-	       (c-lang-const c-type-decl-prefix-key)
-	       "\\|"
-	       (concat "\\("   ; 3
+	       (concat "\\("   ; 4
 		       ;; If this matches there's special treatment in
 		       ;; `c-font-lock-declarators' and
 		       ;; `c-font-lock-declarations' that check for a
@@ -3475,8 +3481,9 @@ c-populate-syntax-table
 		       (c-lang-const c-identifier-start)
 		       "\\)")
 	       "\\)"
-	       "\\([^=]\\|$\\)")
+	       "\\([^=_]\\|$\\)")	; 5
   pike "\\(\\*\\)\\([^=]\\|$\\)")
+
 (c-lang-defvar c-type-decl-prefix-key (c-lang-const c-type-decl-prefix-key)
   'dont-doc)
 


> -- 
> (domestic pets only, the antidote for overdose, milk.)
>    bloggy blog: http://lars.ingebrigtsen.no

-- 
Alan Mackenzie (Nuremberg, Germany).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#45560; Package emacs. Full text available.

Message received at 45560 <at> debbugs.gnu.org:


Received: (at 45560) by debbugs.gnu.org; 31 Dec 2020 05:09:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 31 00:09:35 2020
Received: from localhost ([127.0.0.1]:51683 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kuqDP-00068m-0N
	for submit <at> debbugs.gnu.org; Thu, 31 Dec 2020 00:09:35 -0500
Received: from quimby.gnus.org ([95.216.78.240]:44592)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1kuqDM-00068X-UJ
 for 45560 <at> debbugs.gnu.org; Thu, 31 Dec 2020 00:09:33 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=JYhsNwnNMgfVIMxzm4xx1SvcUTr5x2LE89eM2pODaIM=; b=M8MotuD51otRXAPyDSD1ORSm+P
 g07QrCgSyUyElUZgUH2Ty+OughqAXdZ9ilggsN+yzNGAEKGvIRYGOgSGTx2Hkks4p4WtCyTUt2OeR
 Op9RwDTXxDvQXT28aCv5vupFqEfXca0bt9+Aifi6IQiHlyrJWZYOdO5R3hkuwzAbA+5M=;
Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1kuqDC-0002af-N3; Thu, 31 Dec 2020 06:09:26 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Tom Tromey <tom@HIDDEN>
Subject: Re: bug#45560: 27.1; add-change-log-entry erroneously removes
 "const" from function name
References: <87im8ievo2.fsf@HIDDEN>
X-Now-Playing: Hermine's _The World On My Plates_: "I Won't Make It Without
 You"
Date: Thu, 31 Dec 2020 06:09:21 +0100
In-Reply-To: <87im8ievo2.fsf@HIDDEN> (Tom Tromey's message of "Wed, 30 Dec
 2020 16:11:41 -0700")
Message-ID: <87ft3mmuim.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.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: Tom Tromey <tom@HIDDEN> writes: > Put this into a .c
 file:
 > > void > const_ref () > { > } > > Now, put point inside the braces and
 M-x add-change-log-entry. > > For me the resulting ChangeLog looks like: >
 > 2020-12-30 Tom Tromey < [...] 
 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: 45560
Cc: Alan Mackenzie <acm@HIDDEN>, 45560 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Tom Tromey <tom@HIDDEN> writes:

> Put this into a .c file:
>
> void
> const_ref ()
> {
> }
>
> Now, put point inside the braces and M-x add-change-log-entry.
>
> For me the resulting ChangeLog looks like:
>
> 2020-12-30  Tom Tromey  <tom@HIDDEN>
>
> 	* q.c (_ref): 

Debugging this, it looks like this is down to

(c-defun-name-1)

returning "_ref" if called in the const_ref function, so I've added Alan
to the CCs. 

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#45560; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 30 Dec 2020 23:12:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Dec 30 18:12:26 2020
Received: from localhost ([127.0.0.1]:51466 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kukdl-0001so-R5
	for submit <at> debbugs.gnu.org; Wed, 30 Dec 2020 18:12:26 -0500
Received: from lists.gnu.org ([209.51.188.17]:57550)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <tom@HIDDEN>) id 1kukdk-0001sh-2d
 for submit <at> debbugs.gnu.org; Wed, 30 Dec 2020 18:12:24 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:33482)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <tom@HIDDEN>) id 1kukdj-0002vI-TU
 for bug-gnu-emacs@HIDDEN; Wed, 30 Dec 2020 18:12:23 -0500
Received: from gateway34.websitewelcome.com ([192.185.148.204]:35312)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <tom@HIDDEN>) id 1kukdg-0003i3-N4
 for bug-gnu-emacs@HIDDEN; Wed, 30 Dec 2020 18:12:22 -0500
Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8])
 by gateway34.websitewelcome.com (Postfix) with ESMTP id 374E110F2F0
 for <bug-gnu-emacs@HIDDEN>; Wed, 30 Dec 2020 17:11:43 -0600 (CST)
Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP
 id ukd5kU3NOiQiZukd5kBjDM; Wed, 30 Dec 2020 17:11:43 -0600
X-Authority-Reason: nr=8
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; 
 s=default;
 h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:
 Date:Subject:To:From:Sender:Reply-To:Cc:Content-ID:Content-Description:
 Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:
 In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
 List-Post:List-Owner:List-Archive;
 bh=nJftIUA97Ar9jJpjtmtIEEEaiPIgsukwymqFTF2evhU=; b=PFq28JdgJtvvs+6q9VgtYX7bfP
 gguCtJQ+mbxwu99fUqlxG5bIw24lHA8mnYUqryrwqIxaO6j5fAod0k1pDaR6+wgwiuaI4mfD86pyX
 8+AsJ7UVySqcKndHHOEhAbaxv;
Received: from 97-122-81-39.hlrn.qwest.net ([97.122.81.39]:55948
 helo=localhost.localdomain)
 by box5379.bluehost.com with esmtpsa (TLS1.2) tls
 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93)
 (envelope-from <tom@HIDDEN>)
 id 1kukd4-004NuI-T0; Wed, 30 Dec 2020 16:11:43 -0700
From: Tom Tromey <tom@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 27.1; add-change-log-entry erroneously removes "const" from
 function name
X-Attribution: Tom
Date: Wed, 30 Dec 2020 16:11:41 -0700
Message-ID: <87im8ievo2.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-AntiAbuse: This header was added to track abuse,
 please include it with any abuse report
X-AntiAbuse: Primary Hostname - box5379.bluehost.com
X-AntiAbuse: Original Domain - gnu.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - tromey.com
X-BWhitelist: no
X-Source-IP: 97.122.81.39
X-Source-L: No
X-Exim-ID: 1kukd4-004NuI-T0
X-Source: 
X-Source-Args: 
X-Source-Dir: 
X-Source-Sender: 97-122-81-39.hlrn.qwest.net (localhost.localdomain)
 [97.122.81.39]:55948
X-Source-Auth: tom+tromey.com
X-Email-Count: 1
X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20=
X-Local-Domain: yes
Received-SPF: permerror client-ip=192.185.148.204; envelope-from=tom@HIDDEN;
 helo=gateway34.websitewelcome.com
X-Spam_score_int: -10
X-Spam_score: -1.1
X-Spam_bar: -
X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001,
 RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001,
 SPF_NEUTRAL=0.779 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.6 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.6 (--)


Put this into a .c file:

void
const_ref ()
{
}


Now, put point inside the braces and M-x add-change-log-entry.

For me the resulting ChangeLog looks like:

2020-12-30  Tom Tromey  <tom@HIDDEN>

	* q.c (_ref):=20

Note that the "const" was removed.
However, it should not be removed here, as it is part of the function's
name.



In GNU Emacs 27.1 (build 1, x86_64-redhat-linux-gnu, GTK+ Version 3.24.21, =
cairo version 1.16.0)
 of 2020-08-20 built on buildvm-x86-24.iad2.fedoraproject.org
Windowing system distributor 'Fedora Project', version 11.0.12010000
System Description: Fedora 32 (Workstation Edition)

Recent messages:
Saving file /tmp/q.c...
Wrote /tmp/q.c
Quit
C-c a runs the command tromey-add-change-log-entry
Undo [3 times]
Redo [2 times]
C-x C-g is undefined
Quit
Scanning for dabbrevs...done
user-error: No dynamic expansion for =E2=80=98add-changelo=E2=80=99 found

Configured using:
 'configure --build=3Dx86_64-redhat-linux-gnu
 --host=3Dx86_64-redhat-linux-gnu --program-prefix=3D
 --disable-dependency-tracking --prefix=3D/usr --exec-prefix=3D/usr
 --bindir=3D/usr/bin --sbindir=3D/usr/sbin --sysconfdir=3D/etc
 --datadir=3D/usr/share --includedir=3D/usr/include --libdir=3D/usr/lib64
 --libexecdir=3D/usr/libexec --localstatedir=3D/var
 --sharedstatedir=3D/var/lib --mandir=3D/usr/share/man
 --infodir=3D/usr/share/info --with-dbus --with-gif --with-jpeg --with-png
 --with-rsvg --with-tiff --with-xft --with-xpm --with-x-toolkit=3Dgtk3
 --with-gpm=3Dno --with-xwidgets --with-modules --with-harfbuzz
 --with-cairo --with-json build_alias=3Dx86_64-redhat-linux-gnu
 host_alias=3Dx86_64-redhat-linux-gnu 'CFLAGS=3D-DMAIL_USE_LOCKF -O2 -g
 -pipe -Wall -Werror=3Dformat-security -Wp,-D_FORTIFY_SOURCE=3D2
 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong
 -grecord-gcc-switches -specs=3D/usr/lib/rpm/redhat/redhat-hardened-cc1
 -specs=3D/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=3Dgeneric
 -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
 LDFLAGS=3D-Wl,-z,relro
 PKG_CONFIG_PATH=3D:/usr/lib64/pkgconfig:/usr/share/pkgconfig'

Configured features:
XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND DBUS GSETTINGS GLIB NOTIFY
INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF
ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS
LIBSYSTEMD JSON PDUMPER GMP

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=3Dibus
  locale-coding-system: utf-8-unix

Major mode: Change Log

Minor modes in effect:
  flyspell-mode: t
  shell-dirtrack-mode: t
  which-function-mode: t
  erc-services-mode: t
  erc-networks-mode: t
  savehist-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  auto-fill-function: do-auto-fill
  transient-mark-mode: t

Load-path shadows:
/home/tromey/.emacs.d/elpa/bubbles-0.5/bubbles hides /usr/share/emacs/27.1/=
lisp/play/bubbles

Features:
(shadow mail-hist emacsbug flow-fill tcl shr-color mm-archive sh-script
smie executable rect copyright dabbrev goto-addr ggtags hippie-exp etags
fileloop generator xref project bug-reference smerge-mode diff cc-mode
cc-fonts cc-guess cc-menus cc-cmds term/xterm xterm apropos mule-diag
descr-text sort smiley gnus-cite mail-extr gnus-bcklg gnus-async qp
gnus-ml disp-table gnus-topic nndraft nnmh nnfolder utf-7 gnutls
network-stream nsm gnus-agent gnus-srvr gnus-score score-mode nnvirtual
gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime dig nntp
gnus-cache gnus-sum url url-proxy url-privacy url-expand url-methods
url-history mailcap shr url-cookie url-domsuf url-util svg xml dom
gnus-group gnus-undo smtpmail sendmail gnus-start gnus-cloud nnimap
nnmail mail-source utf7 netrc nnoo gnus-spec gnus-int gnus-range message
rmc puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg
epg-config mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader gnus-win gnus nnheader gnus-util rmail
rmail-loaddefs rfc2047 rfc2045 ietf-drums text-property-search
mail-utils mm-util mail-prsvr two-column iso-transl help-fns radix-tree
log-view pcvs-util vc-mtn vc-hg cl-extra help-mode vc-git diff-mode
vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs misearch multi-isearch
add-log flyspell ispell diminish projectile ibuf-macs pcase edmacro
kmacro grep compile ibuf-ext ibuffer ibuffer-loaddefs dash appt
diary-lib diary-loaddefs cal-menu calendar cal-loaddefs tramp
tramp-loaddefs trampver tramp-integration files-x tramp-compat shell
pcomplete parse-time iso8601 time-date ls-lisp which-func imenu minimap
autorevert filenotify cus-start cus-load erc-track erc-match
erc-services erc-networks erc-hl-nicks easy-mmode color erc-button
erc-fill erc-stamp wid-edit erc-goodies erc erc-backend erc-compat
format-spec thingatpt pp erc-loaddefs warnings advice vc-dir ewoc vc
vc-dispatcher cc-styles cc-align cc-engine cc-vars cc-defs ange-ftp
comint ansi-color ring server savehist finder-inf gdb-shell-autoloads
lisppaste-autoloads pydoc-info-autoloads info-look info cl
weblogger-autoloads package easymenu browse-url url-handlers url-parse
auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache json subr-x map url-vars seq byte-opt gv bytecomp
byte-compile cconv cl-loaddefs cl-lib tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese composite charscript charprop case-table epa-hook
jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote threads dbusbind inotify dynamic-setting system-font-setting
font-render-setting xwidget-internal cairo move-toolbar gtk x-toolkit x
multi-tty make-network-process emacs)

Memory information:
((conses 16 1344143 98632)
 (symbols 48 71080 17)
 (strings 32 190276 19842)
 (string-bytes 1 6368664)
 (vectors 16 83075)
 (vector-slots 8 2440137 207780)
 (floats 8 448 669)
 (intervals 56 185659 164)
 (buffers 1000 464))




Acknowledgement sent to Tom Tromey <tom@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#45560; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 11 Jan 2021 16:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.