Mercurial > emacs
view lisp/calc/calc-macs.el @ 105842:83dde921cc1b
* emacs-lisp/autoload.el (generated-autoload-feature): Remove.
(autoload-rubric): Don't use any more.
* cedet/semantic/fw.el (semantic/loaddefs):
* cedet/srecode.el (srecode/loaddefs):
* cedet/ede.el (ede/loaddefs): Load rather than require.
* lisp/cedet/ede/cpp-root.el:
* lisp/cedet/ede/emacs.el:
* lisp/cedet/ede/files.el:
* lisp/cedet/ede/linux.el:
* lisp/cedet/ede/locate.el:
* lisp/cedet/ede/make.el:
* lisp/cedet/ede/shell.el:
* lisp/cedet/ede/speedbar.el:
* lisp/cedet/ede/system.el:
* lisp/cedet/ede/util.el:
* lisp/cedet/semantic/analyze.el:
* lisp/cedet/semantic/bovine.el:
* lisp/cedet/semantic/complete.el:
* lisp/cedet/semantic/ctxt.el:
* lisp/cedet/semantic/db-file.el:
* lisp/cedet/semantic/db-find.el:
* lisp/cedet/semantic/db-global.el:
* lisp/cedet/semantic/db-mode.el:
* lisp/cedet/semantic/db-typecache.el:
* lisp/cedet/semantic/db.el:
* lisp/cedet/semantic/debug.el:
* lisp/cedet/semantic/dep.el:
* lisp/cedet/semantic/doc.el:
* lisp/cedet/semantic/edit.el:
* lisp/cedet/semantic/find.el:
* lisp/cedet/semantic/format.el:
* lisp/cedet/semantic/html.el:
* lisp/cedet/semantic/ia-sb.el:
* lisp/cedet/semantic/ia.el:
* lisp/cedet/semantic/idle.el:
* lisp/cedet/semantic/lex-spp.el:
* lisp/cedet/semantic/lex.el:
* lisp/cedet/semantic/mru-bookmark.el:
* lisp/cedet/semantic/scope.el:
* lisp/cedet/semantic/senator.el:
* lisp/cedet/semantic/sort.el:
* lisp/cedet/semantic/symref.el:
* lisp/cedet/semantic/tag-file.el:
* lisp/cedet/semantic/tag-ls.el:
* lisp/cedet/semantic/tag-write.el:
* lisp/cedet/semantic/tag.el:
* lisp/cedet/semantic/util-modes.el:
* lisp/cedet/semantic/analyze/complete.el:
* lisp/cedet/semantic/analyze/refs.el:
* lisp/cedet/semantic/bovine/c.el:
* lisp/cedet/semantic/bovine/gcc.el:
* lisp/cedet/semantic/bovine/make.el:
* lisp/cedet/semantic/bovine/scm.el:
* lisp/cedet/semantic/decorate/include.el:
* lisp/cedet/semantic/decorate/mode.el:
* lisp/cedet/semantic/symref/cscope.el:
* lisp/cedet/semantic/symref/global.el:
* lisp/cedet/semantic/symref/grep.el:
* lisp/cedet/semantic/symref/idutils.el:
* lisp/cedet/semantic/symref/list.el:
* lisp/cedet/semantic/wisent/java-tags.el:
* lisp/cedet/semantic/wisent/javascript.el:
* lisp/cedet/srecode/compile.el:
* lisp/cedet/srecode/cpp.el:
* lisp/cedet/srecode/document.el:
* lisp/cedet/srecode/el.el:
* lisp/cedet/srecode/expandproto.el:
* lisp/cedet/srecode/getset.el:
* lisp/cedet/srecode/insert.el:
* lisp/cedet/srecode/java.el:
* lisp/cedet/srecode/map.el:
* lisp/cedet/srecode/mode.el:
* lisp/cedet/srecode/template.el:
* lisp/cedet/srecode/texi.el: Remove the file-local setting of
generated-autoload-feature.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Tue, 03 Nov 2009 21:45:31 +0000 |
parents | a9dc0e7c3f2b |
children | 1d1d5d9bd884 |
line wrap: on
line source
;;; calc-macs.el --- important macros for Calc ;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2002, 2003, 2004, ;; 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. ;; Author: David Gillespie <daveg@synaptics.com> ;; Maintainer: Jay Belanger <jay.p.belanger@gmail.com> ;; This file is part of GNU Emacs. ;; GNU Emacs is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. ;;; Commentary: ;;; Code: ;; Declare functions which are defined elsewhere. (declare-function math-zerop "calc-misc" (a)) (declare-function math-negp "calc-misc" (a)) (declare-function math-looks-negp "calc-misc" (a)) (declare-function math-posp "calc-misc" (a)) (declare-function math-compare "calc-ext" (a b)) (declare-function math-bignum "calc" (a)) (declare-function math-compare-bignum "calc-ext" (a b)) (defmacro calc-wrapper (&rest body) `(calc-do (function (lambda () ,@body)))) (defmacro calc-slow-wrapper (&rest body) `(calc-do (function (lambda () ,@body)) (point))) (defmacro math-showing-full-precision (form) `(let ((calc-float-format calc-full-float-format)) ,form)) (defmacro math-with-extra-prec (delta &rest body) `(math-normalize (let ((calc-internal-prec (+ calc-internal-prec ,delta))) ,@body))) (defmacro math-working (msg arg) ; [Public] `(if (eq calc-display-working-message 'lots) (math-do-working ,msg ,arg))) (defmacro calc-with-default-simplification (&rest body) `(let ((calc-simplify-mode (and (not (memq calc-simplify-mode '(none num))) calc-simplify-mode))) ,@body)) (defmacro calc-with-trail-buffer (&rest body) `(let ((save-buf (current-buffer)) (calc-command-flags nil)) (with-current-buffer (calc-trail-display t) (progn (goto-char calc-trail-pointer) ,@body)))) ;;; Faster in-line version zerop, normalized values only. (defsubst Math-zerop (a) ; [P N] (if (consp a) (and (not (memq (car a) '(bigpos bigneg))) (if (eq (car a) 'float) (eq (nth 1 a) 0) (math-zerop a))) (eq a 0))) (defsubst Math-integer-negp (a) (if (consp a) (eq (car a) 'bigneg) (< a 0))) (defsubst Math-integer-posp (a) (if (consp a) (eq (car a) 'bigpos) (> a 0))) (defsubst Math-negp (a) (if (consp a) (or (eq (car a) 'bigneg) (and (not (eq (car a) 'bigpos)) (if (memq (car a) '(frac float)) (Math-integer-negp (nth 1 a)) (math-negp a)))) (< a 0))) (defsubst Math-looks-negp (a) ; [P x] [Public] (or (Math-negp a) (and (consp a) (or (eq (car a) 'neg) (and (memq (car a) '(* /)) (or (math-looks-negp (nth 1 a)) (math-looks-negp (nth 2 a)))))))) (defsubst Math-posp (a) (if (consp a) (or (eq (car a) 'bigpos) (and (not (eq (car a) 'bigneg)) (if (memq (car a) '(frac float)) (Math-integer-posp (nth 1 a)) (math-posp a)))) (> a 0))) (defsubst Math-integerp (a) (or (not (consp a)) (memq (car a) '(bigpos bigneg)))) (defsubst Math-natnump (a) (if (consp a) (eq (car a) 'bigpos) (>= a 0))) (defsubst Math-ratp (a) (or (not (consp a)) (memq (car a) '(bigpos bigneg frac)))) (defsubst Math-realp (a) (or (not (consp a)) (memq (car a) '(bigpos bigneg frac float)))) (defsubst Math-anglep (a) (or (not (consp a)) (memq (car a) '(bigpos bigneg frac float hms)))) (defsubst Math-numberp (a) (or (not (consp a)) (memq (car a) '(bigpos bigneg frac float cplx polar)))) (defsubst Math-scalarp (a) (or (not (consp a)) (memq (car a) '(bigpos bigneg frac float cplx polar hms)))) (defsubst Math-vectorp (a) (and (consp a) (eq (car a) 'vec))) (defsubst Math-messy-integerp (a) (and (consp a) (eq (car a) 'float) (>= (nth 2 a) 0))) (defsubst Math-objectp (a) ; [Public] (or (not (consp a)) (memq (car a) '(bigpos bigneg frac float cplx polar hms date sdev intv mod)))) (defsubst Math-objvecp (a) ; [Public] (or (not (consp a)) (memq (car a) '(bigpos bigneg frac float cplx polar hms date sdev intv mod vec)))) ;;; Compute the negative of A. [O O; o o] [Public] (defsubst Math-integer-neg (a) (if (consp a) (if (eq (car a) 'bigpos) (cons 'bigneg (cdr a)) (cons 'bigpos (cdr a))) (- a))) (defsubst Math-equal (a b) (= (math-compare a b) 0)) (defsubst Math-lessp (a b) (= (math-compare a b) -1)) (defsubst Math-primp (a) (or (not (consp a)) (memq (car a) '(bigpos bigneg frac float cplx polar hms date mod var)))) (defsubst Math-num-integerp (a) (or (not (consp a)) (memq (car a) '(bigpos bigneg)) (and (eq (car a) 'float) (>= (nth 2 a) 0)))) (defsubst Math-bignum-test (a) ; [B N; B s; b b] (if (consp a) a (math-bignum a))) (defsubst Math-equal-int (a b) (or (eq a b) (and (consp a) (eq (car a) 'float) (eq (nth 1 a) b) (= (nth 2 a) 0)))) (defsubst Math-natnum-lessp (a b) (if (consp a) (and (consp b) (= (math-compare-bignum (cdr a) (cdr b)) -1)) (or (consp b) (< a b)))) (provide 'calc-macs) ;; arch-tag: 08ba8ec2-fcff-4b80-a079-ec661bdb057e ;;; calc-macs.el ends here