From 660e76905df7b5d32ae1add3efa1901f209803b3 Mon Sep 17 00:00:00 2001 From: rearman Date: Mon, 8 Jan 2024 11:33:04 -0500 Subject: [PATCH] Add macro for calc --- calc.el | 9 +++++++++ init.org | 2 ++ 2 files changed, 11 insertions(+) create mode 100644 calc.el diff --git a/calc.el b/calc.el new file mode 100644 index 0000000..9266ac4 --- /dev/null +++ b/calc.el @@ -0,0 +1,9 @@ +;;; Definition stored by Calc on Mon Jan 8 11:30:38 2024 +(put 'calc-define 'calc-User-scale-analog '(progn + (defun calc-User-scale-analog (arg) (interactive "P") + (calc-execute-kbd-macro ["s s e m i n - M-' 3 s s p m i + n - / s r e m i n s r p m i n + / -" nil] arg "zs")) + (put 'calc-User-scale-analog 'calc-user-defn 't) + (define-key calc-mode-map "zs" 'calc-User-scale-analog) +)) diff --git a/init.org b/init.org index 2966277..392ceb1 100644 --- a/init.org +++ b/init.org @@ -1077,6 +1077,8 @@ Define square, cube, and inv for brevity of common usages. *** Unit Conversions The rest of the world decided to self-castrate because some French guys told them things Definitely Made More Sense if everything was divisible by 10. I'm convinced the average Frenchman simply couldn't grasp fractions, and that's why he came up with this crap. What's 1/3 of a meter? What's 1/3 of a yard? And 1/3 of a foot? How likely are you to need to divide a measurement by 3 when you're building something? Maybe the [[https://dozenal.org/][Dozenal]] people were right all along. Anyway, I'm now forced to convert into proper units daily because of this grave error. + + #+BEGIN_SRC emacs-lisp (defun mm->in (mm) "Convert milimeters to inches." -- 2.39.5