From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Jack Coughlin Newsgroups: gmane.emacs.bugs Subject: bug#36720: [PATCH] [Calc] Fix saving user-defined compositions Date: Thu, 18 Jul 2019 08:32:48 -0700 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="24973"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: mu4e 1.2.0; emacs 26.2 To: 36720@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 18 18:08:09 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ho8wy-0006O3-06 for geb-bug-gnu-emacs@m.gmane.org; Thu, 18 Jul 2019 18:08:08 +0200 Original-Received: from localhost ([::1]:39664 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1ho8ww-000248-VS for geb-bug-gnu-emacs@m.gmane.org; Thu, 18 Jul 2019 12:08:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60145) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1ho8wu-000240-8o for bug-gnu-emacs@gnu.org; Thu, 18 Jul 2019 12:08:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ho8wt-0001Ez-5h for bug-gnu-emacs@gnu.org; Thu, 18 Jul 2019 12:08:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45744) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ho8ws-0001Eo-RB for bug-gnu-emacs@gnu.org; Thu, 18 Jul 2019 12:08:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ho8ws-000711-Ju for bug-gnu-emacs@gnu.org; Thu, 18 Jul 2019 12:08:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jack Coughlin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 18 Jul 2019 16:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 36720 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.156346605826911 (code B ref -1); Thu, 18 Jul 2019 16:08:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 18 Jul 2019 16:07:38 +0000 Original-Received: from localhost ([127.0.0.1]:54564 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ho8wT-0006zy-Ju for submit@debbugs.gnu.org; Thu, 18 Jul 2019 12:07:38 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:55725) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ho8P5-00061z-Rc for submit@debbugs.gnu.org; Thu, 18 Jul 2019 11:33:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49407) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1ho8P4-0006rU-Ns for bug-gnu-emacs@gnu.org; Thu, 18 Jul 2019 11:33:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ho8P3-0007mE-Os for bug-gnu-emacs@gnu.org; Thu, 18 Jul 2019 11:33:06 -0400 Original-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 ) id 1ho8P3-0007lT-AY for bug-gnu-emacs@gnu.org; Thu, 18 Jul 2019 11:33:05 -0400 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.west.internal (Postfix) with ESMTP id DCDD73F9 for ; Thu, 18 Jul 2019 11:33:03 -0400 (EDT) Original-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: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrieehgdelvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepfgfhvffufffkgggtsehmtderredtre dtnecuhfhrohhmpeflrggtkhcuvehouhhghhhlihhnuceojhgrtghksehjrggtkhgtrdhm vgeqnecukfhppeduleelrddukeekrdduleegrdefleenucfrrghrrghmpehmrghilhhfrh homhepjhgrtghksehjrggtkhgtrdhmvgenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Original-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 ; Thu, 18 Jul 2019 11:33:02 -0400 (EDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Mailman-Approved-At: Thu, 18 Jul 2019 12:07:36 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:163317 Archived-At: --=-=-= 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 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) --=-=-=--