]> git.earman.xyz Git - emacsinit.git/commitdiff
Add macro for calc
authorrearman <rearman@r717.net>
Mon, 8 Jan 2024 16:33:04 +0000 (11:33 -0500)
committerrearman <rearman@r717.net>
Mon, 8 Jan 2024 16:33:04 +0000 (11:33 -0500)
calc.el [new file with mode: 0644]
init.org

diff --git a/calc.el b/calc.el
new file mode 100644 (file)
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 <return> - M-' 3 <tab> s s p m i
+  n <return> - <tab> / <return> s r e m i n <return> s r p m i n
+  <return> <escape> <tab> / -" nil] arg "zs"))
+ (put 'calc-User-scale-analog 'calc-user-defn 't)
+ (define-key calc-mode-map "zs" 'calc-User-scale-analog)
+))
index 29662775ddb47571d586c2271568e4ac64ac6f65..392ceb1f350535234b4f75026f984772abe6c223 100644 (file)
--- 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."