GNU bug report logs - #36720
[PATCH] [Calc] Fix saving user-defined compositions

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: Jack Coughlin <jack@HIDDEN>; Keywords: patch; merged with #36719; dated Thu, 18 Jul 2019 16:08:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Forcibly Merged 36719 36720. Request was from Glenn Morris <rgm@HIDDEN> to control <at> Full text available.

Message received at submit <at>

Received: (at submit) by; 18 Jul 2019 16:07:38 +0000
From debbugs-submit-bounces <at> Thu Jul 18 12:07:38 2019
Received: from localhost ([]:54564
	by with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at>>)
	id 1ho8wT-0006zy-Ju
	for submit <at>; Thu, 18 Jul 2019 12:07:38 -0400
Received: from ([]:55725)
 by with esmtp (Exim 4.84_2)
 (envelope-from <jack@HIDDEN>) id 1ho8P5-00061z-Rc
 for submit <at>; Thu, 18 Jul 2019 11:33:08 -0400
Received: from ([2001:470:142:3::10]:49407)
 by with esmtp (Exim 4.86_2)
 (envelope-from <jack@HIDDEN>) id 1ho8P4-0006rU-Ns
 for bug-gnu-emacs@HIDDEN; Thu, 18 Jul 2019 11:33:07 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on
X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_LOW,
 URIBL_BLOCKED autolearn=disabled version=3.3.2
Received: from Debian-exim by with spam-scanned (Exim 4.71)
 (envelope-from <jack@HIDDEN>) id 1ho8P3-0007mE-Os
 for bug-gnu-emacs@HIDDEN; Thu, 18 Jul 2019 11:33:06 -0400
Received: from ([]:35643)
 by with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <jack@HIDDEN>) id 1ho8P3-0007lT-AY
 for bug-gnu-emacs@HIDDEN; Thu, 18 Jul 2019 11:33:05 -0400
Received: from compute3.internal (compute3.nyi.internal [])
 by mailnew.west.internal (Postfix) with ESMTP id DCDD73F9
 for <bug-gnu-emacs@HIDDEN>; Thu, 18 Jul 2019 11:33:03 -0400 (EDT)
Received: from mailfrontend1 ([])
 by compute3.internal (MEProxy); Thu, 18 Jul 2019 11:33:03 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; h=from
 :to:subject:date:message-id:mime-version:content-type; s=fm1;
 bh=xy9ISsuJjaOY+bnZ7srrEwIFl3ypGAgmEw4b0Knj+tY=; b=F+Pep4x8lKPT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=; h=content-type:date:from:message-id
 :x-me-sender:x-sasl-enc; s=fm3; bh=xy9ISsuJjaOY+bnZ7srrEwIFl3ypG
 AgmEw4b0Knj+tY=; b=Q0e2xUUJbwpIniuYRZgE9nhSdMg7b5ulm24cjby83SSQj
X-ME-Sender: <xms:LpEwXWLiiODFG-8c1AYW5b8V-Kfx-vA9vkHB4dmqOUG3is_GCbtJaQ>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrieehgdelvdcutefuodetggdotefrodftvf
X-ME-Proxy: <xmx:L5EwXbABK-3pdnsRHHmHPhLWx6sDs9JdPyMG1Z58AtllDjcYMY48Tw>
Received: from Jacks-MacBook-Pro.local (
 by (Postfix) with ESMTPA id 393C480068
 for <bug-gnu-emacs@HIDDEN>; Thu, 18 Jul 2019 11:33:02 -0400 (EDT)
User-agent: mu4e 1.2.0; emacs 26.2
From: Jack Coughlin <jack@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: [PATCH] [Calc] Fix saving user-defined compositions
Date: Thu, 18 Jul 2019 08:32:48 -0700
Message-ID: <m2r26nwe73.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-detected-operating-system: by GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -1.6 (-)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Thu, 18 Jul 2019 12:07:36 -0400
X-BeenThere: debbugs-submit <at>
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <>
List-Unsubscribe: <>, 
 <mailto:debbugs-submit-request <at>>
List-Archive: <>
List-Post: <mailto:debbugs-submit <at>>
List-Help: <mailto:debbugs-submit-request <at>>
List-Subscribe: <>, 
 <mailto:debbugs-submit-request <at>>
Errors-To: debbugs-submit-bounces <at>
Sender: "Debbugs-submit" <debbugs-submit-bounces <at>>
X-Spam-Score: -2.6 (--)

Content-Type: text/plain

When saving a user-defined formula by specifying its ~z-~ key, or the
~M-x~ command name, its compositions are not saved correctly. The
attached patch fixes this behavior.

--- notes on the code change ---

~func~ is the calcFunc- symbol representing the formula.
~cmd~ is either the calc- symbol representing the command, or, if we
are saving just the formula, the calcFunc- symbol.

We always want to associate the composition forms to the calcFunc-
version. Observe for example that two lines below, this is the symbol
that we pull them from to save.

Content-Type: text/x-patch
Content-Disposition: attachment;
Content-Description: patch

From c65e573fbdff716b91d3a93cb4b79a8ee506adc1 Mon Sep 17 00:00:00 2001
From: Jack Coughlin <jack@HIDDEN>
Date: Thu, 18 Jul 2019 08:16:50 -0700
Subject: [PATCH] Fix bug when saving user-defined commands with compositions

This fixes a bug where saving user-defined formulas with compositions
would fail to save the compositions when the user specified their
formula by its command name or key.
 lisp/calc/calc-prog.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/calc/calc-prog.el b/lisp/calc/calc-prog.el
index ba8efd43b8..01b39478c9 100644
--- a/lisp/calc/calc-prog.el
+++ b/lisp/calc/calc-prog.el
@@ -1097,7 +1097,7 @@ Redefine the corresponding command."
        (or func (setq func (and cmd (symbolp cmd) (fboundp cmd) cmd)))
        (if (get func 'math-compose-forms)
 	   (let ((pt (point)))
-	     (insert "(put '" (symbol-name cmd)
+	     (insert "(put '" (symbol-name func)
 		     " 'math-compose-forms '"
 		     (prin1-to-string (get func 'math-compose-forms))
2.14.3 (Apple Git-98)


Acknowledgement sent to Jack Coughlin <jack@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#36720; 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: Thu, 18 Jul 2019 16:30:03 UTC

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