Mercurial > emacs
view lisp/calc/calc-macs.el @ 82988:f82e3a6f5ccb
A few more bugfixes and new features.
(Sigh.) I obviously need to remember to separate individual changes
to multiple commits.
src/emacsclient.c: Improved error handling.
(decode_options): Changed frame option (again) from -f to -t.
(print_help_and_exit): Ditto.
(copy_from_to): Check EINTR after write, not EAGAIN. Removed SIGIO hack.
(pty_conversation): Handle errors transmitted through the socket.
Handle pty errors by not reading from it anymore.
(main): Restore correct errno after socket_status failed. Send -tty
on -t, not -pty.
lisp/server.el (server-process-filter): Watch -tty, not -pty.
Use make-frame-on-tty instead of make-terminal-frame.
Don't set newframe to t if make-frame-on-tty failed.
Don't delete frames here. Print correct message when there are no
files to edit, but a new frame was requested.
(server-sentinel): Delete the frame after the process.
(server-handle-delete-frame): New function for delete-frame-functions.
(server-start): Add server-handle-delete-frame to delete-frame-functions.
(server-buffer-done): Don't delete frames here.
src/alloc.c (mark_ttys): Add prototype.
(Fgarbage_collect): Call mark_ttys.
src/emacs.c: (shut_down_emacs): Don't flush stdout before
reset_sys_modes().
src/process.c (add_keyboard_wait_descriptor_called_flag): Removed.
(add_keyboard_wait_descriptor): Removed stdin hack.
src/sysdep.c: Unconditionally include sysselect.h.
(old_fcntl_flags): Changed to an array.
(init_sigio, reset_sigio): Use it.
(narrow_foreground_group, widen_foreground_group): Use setpgid, not
setpgrp.
(old_fcntl_owner): Changed to an array.
(init_sys_modes, reset_sys_modes): Use it. Fix fsync() and reset_sigio() calls.
src/term.c (Qframe_tty_name, Qframe_tty_type): New variables.
(syms_of_term): Initialize them.
(Fframe_tty_name, Fframe_tty_type): New functions.
(term_init): Call add_keyboard_wait_descriptor().
(Fdelete_tty): New function.
(delete_tty): Call delete_keyboard_wait_descriptor().
(get_current_tty): Removed.
(mark_ttys): New function.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-28
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Wed, 31 Dec 2003 05:09:29 +0000 |
parents | 695cf19ef79e |
children | d48ee50961f3 375f2633d815 |
line wrap: on
line source
;;; calc-macs.el --- important macros for Calc ;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. ;; Author: David Gillespie <daveg@synaptics.com> ;; Maintainers: D. Goel <deego@gnufans.org> ;; Colin Walters <walters@debian.org> ;; This file is part of GNU Emacs. ;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY. No author or distributor ;; accepts responsibility to anyone for the consequences of using it ;; or for whether it serves any particular purpose or works at all, ;; unless he says so in writing. Refer to the GNU Emacs General Public ;; License for full details. ;; Everyone is granted permission to copy, modify and redistribute ;; GNU Emacs, but only under the conditions described in the ;; GNU Emacs General Public License. A copy of this license is ;; supposed to have been given to you along with GNU Emacs so you ;; can know your rights and responsibilities. It should be in a ;; file named COPYING. Among other things, the copyright notice ;; and this notice must be preserved on all copies. ;;; Commentary: ;;; Code: (provide 'calc-macs) (defun calc-need-macros () nil) (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)))) ;;; arch-tag: 08ba8ec2-fcff-4b80-a079-ec661bdb057e ;;; calc-macs.el ends here