1 |
;; Calculator for GNU Emacs, part II [calc-sel-2.el] |
;; Calculator for GNU Emacs, part II [calc-sel-2.el] |
2 |
;; Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation, Inc. |
;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. |
3 |
;; Written by Dave Gillespie, daveg@synaptics.com. |
;; Written by Dave Gillespie, daveg@synaptics.com. |
4 |
|
|
5 |
;; This file is part of GNU Emacs. |
;; This file is part of GNU Emacs. |
109 |
(list (calc-replace-sub-formula expr parent new)) |
(list (calc-replace-sub-formula expr parent new)) |
110 |
num |
num |
111 |
(list (and (or (not (eq arg 0)) reselect) |
(list (and (or (not (eq arg 0)) reselect) |
112 |
sel))))))))) |
sel)))))))))) |
|
) |
|
113 |
|
|
114 |
(defun calc-commute-right (arg) |
(defun calc-commute-right (arg) |
115 |
(interactive "p") |
(interactive "p") |
192 |
(list (calc-replace-sub-formula expr parent new)) |
(list (calc-replace-sub-formula expr parent new)) |
193 |
num |
num |
194 |
(list (and (or (not (eq arg 0)) reselect) |
(list (and (or (not (eq arg 0)) reselect) |
195 |
sel))))))))) |
sel)))))))))) |
|
) |
|
196 |
|
|
197 |
(defun calc-build-assoc-term (op lhs rhs) |
(defun calc-build-assoc-term (op lhs rhs) |
198 |
(cond ((and (eq op '+) (or (math-looks-negp rhs) |
(cond ((and (eq op '+) (or (math-looks-negp rhs) |
213 |
(or (math-equal-int (nth 1 rhs) 1) |
(or (math-equal-int (nth 1 rhs) 1) |
214 |
(equal (nth 1 rhs) '(cplx 1 0))))) |
(equal (nth 1 rhs) '(cplx 1 0))))) |
215 |
(list '/ lhs (nth 2 rhs))) |
(list '/ lhs (nth 2 rhs))) |
216 |
(t (list op lhs rhs))) |
(t (list op lhs rhs)))) |
|
) |
|
217 |
|
|
218 |
(defun calc-sel-unpack () |
(defun calc-sel-unpack () |
219 |
(interactive) |
(interactive) |
231 |
(list (calc-replace-sub-formula |
(list (calc-replace-sub-formula |
232 |
expr sel (nth 1 sel))) |
expr sel (nth 1 sel))) |
233 |
num |
num |
234 |
(list (and reselect (nth 1 sel)))))) |
(list (and reselect (nth 1 sel))))))) |
|
) |
|
235 |
|
|
236 |
(defun calc-sel-isolate () |
(defun calc-sel-isolate () |
237 |
(interactive) |
(interactive) |
262 |
expr eqn soln)) |
expr eqn soln)) |
263 |
num |
num |
264 |
(list (and reselect sel))) |
(list (and reselect sel))) |
265 |
(calc-handle-whys))) |
(calc-handle-whys)))) |
|
) |
|
266 |
|
|
267 |
(defun calc-sel-commute (many) |
(defun calc-sel-commute (many) |
268 |
(interactive "P") |
(interactive "P") |
269 |
(let ((calc-assoc-selections nil)) |
(let ((calc-assoc-selections nil)) |
270 |
(calc-rewrite-selection "CommuteRules" many "cmut")) |
(calc-rewrite-selection "CommuteRules" many "cmut")) |
271 |
(calc-set-mode-line) |
(calc-set-mode-line)) |
|
) |
|
272 |
|
|
273 |
(defun calc-sel-jump-equals (many) |
(defun calc-sel-jump-equals (many) |
274 |
(interactive "P") |
(interactive "P") |
275 |
(calc-rewrite-selection "JumpRules" many "jump") |
(calc-rewrite-selection "JumpRules" many "jump")) |
|
) |
|
276 |
|
|
277 |
(defun calc-sel-distribute (many) |
(defun calc-sel-distribute (many) |
278 |
(interactive "P") |
(interactive "P") |
279 |
(calc-rewrite-selection "DistribRules" many "dist") |
(calc-rewrite-selection "DistribRules" many "dist")) |
|
) |
|
280 |
|
|
281 |
(defun calc-sel-merge (many) |
(defun calc-sel-merge (many) |
282 |
(interactive "P") |
(interactive "P") |
283 |
(calc-rewrite-selection "MergeRules" many "merg") |
(calc-rewrite-selection "MergeRules" many "merg")) |
|
) |
|
284 |
|
|
285 |
(defun calc-sel-negate (many) |
(defun calc-sel-negate (many) |
286 |
(interactive "P") |
(interactive "P") |
287 |
(calc-rewrite-selection "NegateRules" many "jneg") |
(calc-rewrite-selection "NegateRules" many "jneg")) |
|
) |
|
288 |
|
|
289 |
(defun calc-sel-invert (many) |
(defun calc-sel-invert (many) |
290 |
(interactive "P") |
(interactive "P") |
291 |
(calc-rewrite-selection "InvertRules" many "jinv") |
(calc-rewrite-selection "InvertRules" many "jinv")) |
|
) |
|
292 |
|
|
293 |
|
;;; calcsel2.el ends here |