all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jack Coughlin <jack@jackc.me>
To: 36720@debbugs.gnu.org
Subject: bug#36720: [PATCH] [Calc] Fix saving user-defined compositions
Date: Thu, 18 Jul 2019 08:32:48 -0700	[thread overview]
Message-ID: <m2r26nwe73.fsf@jackc.me> (raw)

[-- Attachment #1: Type: text/plain, Size: 555 bytes --]

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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-patch, Size: 1049 bytes --]

From c65e573fbdff716b91d3a93cb4b79a8ee506adc1 Mon Sep 17 00:00:00 2001
From: Jack Coughlin <jack@jackc.me>
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)


             reply	other threads:[~2019-07-18 15:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-18 15:32 Jack Coughlin [this message]
2019-09-13  1:50 ` bug#36720: [PATCH] [Calc] Fix saving user-defined compositions Noam Postavsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2r26nwe73.fsf@jackc.me \
    --to=jack@jackc.me \
    --cc=36720@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.