* bug#36720: [PATCH] [Calc] Fix saving user-defined compositions
@ 2019-07-18 15:32 Jack Coughlin
2019-09-13 1:50 ` Noam Postavsky
0 siblings, 1 reply; 2+ messages in thread
From: Jack Coughlin @ 2019-07-18 15:32 UTC (permalink / raw)
To: 36720
[-- 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)
^ permalink raw reply related [flat|nested] 2+ messages in thread
* bug#36720: [PATCH] [Calc] Fix saving user-defined compositions
2019-07-18 15:32 bug#36720: [PATCH] [Calc] Fix saving user-defined compositions Jack Coughlin
@ 2019-09-13 1:50 ` Noam Postavsky
0 siblings, 0 replies; 2+ messages in thread
From: Noam Postavsky @ 2019-09-13 1:50 UTC (permalink / raw)
To: Jack Coughlin; +Cc: 36720
tags 36720 fixed
close 36720 27.1
quit
Jack Coughlin <jack@jackc.me> writes:
> 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.
Thanks, pushed to master.
a4c471c984 2019-09-12T20:25:30-04:00 "Fix saving user-defined calc commands with compositions (Bug#36720)"
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=a4c471c98474a249948793aad386e4efc64a1c96
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-09-13 1:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-18 15:32 bug#36720: [PATCH] [Calc] Fix saving user-defined compositions Jack Coughlin
2019-09-13 1:50 ` Noam Postavsky
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).