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> debbugs.gnu.org. Full text available.

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


Received: (at submit) by debbugs.gnu.org; 18 Jul 2019 16:07:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jul 18 12:07:38 2019
Received: from localhost ([127.0.0.1]:54564 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ho8wT-0006zy-Ju
	for submit <at> debbugs.gnu.org; Thu, 18 Jul 2019 12:07:38 -0400
Received: from lists.gnu.org ([209.51.188.17]:55725)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jack@HIDDEN>) id 1ho8P5-00061z-Rc
 for submit <at> debbugs.gnu.org; Thu, 18 Jul 2019 11:33:08 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:49407)
 by lists.gnu.org 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 eggs.gnu.org
X-Spam-Level: 
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 eggs.gnu.org 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 wnew2-smtp.messagingengine.com ([64.147.123.27]:35643)
 by eggs.gnu.org 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 [10.202.2.43])
 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 ([10.202.2.162])
 by compute3.internal (MEProxy); Thu, 18 Jul 2019 11:33:03 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jackc.me; h=from
 :to:subject:date:message-id:mime-version:content-type; s=fm1;
 bh=xy9ISsuJjaOY+bnZ7srrEwIFl3ypGAgmEw4b0Knj+tY=; b=F+Pep4x8lKPT
 nr8Nhuwy383zMbTxtBhiNfUo6xDNvmMsEYMrxEgRxJb035gE5XOakpIRv7ZJgiT8
 9KLveAKzIbcQZu+9ZRhXHX2WPiobqG0M/Gb+sEj6JGw0EcX53iWOOSshadoqNZZg
 aWI3b8RVC6LwPbn0s/sQVXfaF2h5Vb2dfXK1azNXLAM7aYYNUt5pEdKyMKTebmaB
 YiLFhS5h07h2aDau+y17N7lYMngM1knylf7DhZaf9P99d8ulEsIrZqyaBGJgmSts
 fhaDr4Yn/epP9dfHU8Bc4EJPrkMXyljvuv/Q1zh59pJpIL842+OsMuWVbyGdtyaL
 zR+Rtw1m/Q==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=content-type:date:from:message-id
 :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender
 :x-me-sender:x-sasl-enc; s=fm3; bh=xy9ISsuJjaOY+bnZ7srrEwIFl3ypG
 AgmEw4b0Knj+tY=; b=Q0e2xUUJbwpIniuYRZgE9nhSdMg7b5ulm24cjby83SSQj
 FbUrccGVzqo4PrOiFnoi5noyf2TSIEVQKamnzBGzBWrrIJcEqIDdpwSf4grkqzAn
 3akSqdslW0/kP4fYT+xx0w6pKeqPOkfGnQeAxHf14LqbcvynJ2/mGn9CGwJpAGks
 7tQ0c8SXt8sk3RloMZiix5JbhjJBuLUVDnyra7Fn+A1pJJrN5RPTWMEofbCDRjX3
 AZNozPTC0dLl+pOpNPzJigyn4suxPYMEJiIcOsh3Pzu9fFjLD+ibJG/hdUrGSCzc
 A5tzvVRUQsuXIHdpsy8gcAXpWcsif4dNvMTphM7Tg==
X-ME-Sender: <xms:LpEwXWLiiODFG-8c1AYW5b8V-Kfx-vA9vkHB4dmqOUG3is_GCbtJaQ>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrieehgdelvdcutefuodetggdotefrodftvf
 curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
 uegrihhlohhuthemuceftddtnecunecujfgurhepfgfhvffufffkgggtsehmtderredtre
 dtnecuhfhrohhmpeflrggtkhcuvehouhhghhhlihhnuceojhgrtghksehjrggtkhgtrdhm
 vgeqnecukfhppeduleelrddukeekrdduleegrdefleenucfrrghrrghmpehmrghilhhfrh
 homhepjhgrtghksehjrggtkhgtrdhmvgenucevlhhushhtvghrufhiiigvpedt
X-ME-Proxy: <xmx:L5EwXbABK-3pdnsRHHmHPhLWx6sDs9JdPyMG1Z58AtllDjcYMY48Tw>
 <xmx:L5EwXVcBfXLozSMtM4ENZ7w6rA0p9XQlc8jwpalO_f1K-FYSqEdolA>
 <xmx:L5EwXfq61PvL4qbwfpR-tHmNpckA7SKAcpNYOlQYBRCX4Sh1yr6KCQ>
 <xmx:L5EwXSgPwK6ItzRsXPSnvQJs80FXT6nKHLKxJKRPdDghFx6XZ0FX94iIuIKQ_NfB>
Received: from Jacks-MacBook-Pro.local (199-188-194-39.public.monkeybrains.net
 [199.188.194.39])
 by mail.messagingengine.com (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 eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 64.147.123.27
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> 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 (--)

--=-=-=
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;
 filename=0001-Fix-bug-when-saving-user-defined-commands-with-compo.patch
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))
 		     ")\n")
-- 
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.