]> code.delx.au - gnu-emacs/blobdiff - lisp/calc/calc-misc.el
(math-format-stack-value): Revert a broken
[gnu-emacs] / lisp / calc / calc-misc.el
index d1cecd2c703ebdaac3caf721203097b8e616fb3c..78dd86306210a297b02d55302cf98c71435f5158 100644 (file)
@@ -1,6 +1,9 @@
-;; Calculator for GNU Emacs, part I [calc-misc.el]
+;;; calc-misc.el --- miscellaenous functions for Calc
+
 ;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc.
-;; Written by Dave Gillespie, daveg@synaptics.com.
+
+;; Author: David Gillespie <daveg@synaptics.com>
+;; Maintainer: Colin Walters <walters@debian.org>
 
 ;; This file is part of GNU Emacs.
 
@@ -19,7 +22,9 @@
 ;; file named COPYING.  Among other things, the copyright notice
 ;; and this notice must be preserved on all copies.
 
+;;; Commentary:
 
+;;; Code:
 
 ;; This file is autoloaded from calc.el.
 (require 'calc)
@@ -121,8 +126,8 @@ Calc user interface as before (either M-# C or M-# K; initially M-# C)."
            (calc-quit)
            (calc nil calc-full-mode nil))))
     (message (if calc-full-mode
-                "Now using full screen for Calc."
-              "Now using partial screen for Calc."))))
+                "Now using full screen for Calc"
+              "Now using partial screen for Calc"))))
 
 (defun calc-other-window ()
   "Invoke the Calculator in another window."
@@ -148,95 +153,11 @@ Calc user interface as before (either M-# C or M-# K; initially M-# C)."
   (pop-to-buffer (current-buffer))
   (calc-mode))
 
-
-;;; Make an attempt to preserve the window configuration, while deleting
-;;; windows on "bufs".  Emacs 19's delete-window function will probably
-;;; make this kludgery unnecessary, but Emacs 18's tendency to grow all
-;;; windows on the screen to take up the slack from the deleted windows
-;;; can be annoying when Calc was called during another multi-window
-;;; application, such as GNUS.
-
-(defun calc-delete-windows-keep (&rest bufs)
-  (if (one-window-p)
-      (mapcar 'delete-windows-on bufs)
-    (let* ((w (car calc-was-split))
-          (e (window-edges w))
-          (wins nil)
-          w2 e2)
-      (while (progn
-              (setq w2 (previous-window w)
-                    e2 (window-edges w2))
-              (and (= (car e2) (car e))
-                   (= (nth 2 e2) (nth 2 e))
-                   (< (nth 1 e2) (nth 1 e))))
-       (setq w w2 e e2))
-      (setq w2 w e2 e)
-      (while (progn
-              (setq wins (cons (list w (nth 1 e) (window-buffer w)
-                                     (window-point w) (window-start w))
-                               wins)
-                    w (next-window w)
-                    e (window-edges w))
-              (and (not (eq w w2))
-                   (= (car e2) (car e))
-                   (= (nth 2 e2) (nth 2 e)))))
-      (setq wins (nreverse wins))
-      (mapcar 'delete-windows-on bufs)
-      (or (one-window-p)
-         (let ((w wins)
-               (main nil)
-               (mainpos 0)
-               (sel (if (window-point (nth 2 calc-was-split))
-                        (nth 2 calc-was-split)
-                      (selected-window))))
-           (while w
-             (if (window-point (car (car w)))
-                 (if main
-                     (delete-window (car (car w)))
-                   (setq main (car (car w))
-                         mainpos (nth 1 (car w))
-                         wins (cdr wins)))
-               (setq wins (delq (car w) wins)))
-             (setq w (cdr w)))
-           (while wins
-             (setq w (split-window main
-                                   (if (eq main (car calc-was-split))
-                                       (nth 1 calc-was-split)
-                                     (- (nth 1 (car wins)) mainpos))))
-             (set-window-buffer w (nth 2 (car wins)))
-             (set-window-point w (nth 3 (car wins)))
-             (set-window-start w (nth 4 (car wins)))
-             (if (eq sel (car (car wins)))
-                 (select-window w))
-             (setq main w
-                   mainpos (nth 1 (car wins))
-                   wins (cdr wins)))
-           (if (window-point sel)
-               (select-window sel)))))))
-
-
 (defun calc-info ()
   "Run the Emacs Info system on the Calculator documentation."
   (interactive)
-  (require 'info)
   (select-window (get-largest-window))
-  (or (file-name-absolute-p calc-info-filename)
-       (let ((p load-path)
-            name)
-        (if (boundp 'Info-directory)
-            (setq p (cons Info-directory p)))
-        (while (and p (not (file-exists-p
-                            (setq name (expand-file-name calc-info-filename
-                                                         (car p))))))
-          (setq p (cdr p)))
-        (if p (setq calc-info-filename name))))
-  (condition-case err
-      (info)
-    (error nil))
-  (or (and (boundp 'Info-current-file)
-          (stringp Info-current-file)
-          (string-match "calc" Info-current-file))
-      (Info-find-node calc-info-filename "Top")))
+  (info "Calc"))
 
 (defun calc-tutorial ()
   "Run the Emacs Info system on the Calculator Tutorial."
@@ -630,8 +551,8 @@ loaded and the keystroke automatically re-typed."
            ((equal a '(var inf var-inf)) t))
     (> a 0)))
 
-(defalias math-fixnump 'integerp)
-(defalias math-fixnatnump 'natnump)
+(defalias 'math-fixnump 'integerp)
+(defalias 'math-fixnatnump 'natnump)
 
 
 ;;; True if A is an even integer.  [P R R] [Public]
@@ -678,7 +599,7 @@ loaded and the keystroke automatically re-typed."
         (math-scale-int (nth 1 a) (nth 2 a)))
        (t (calc-extensions)
           (math-trunc-fancy a))))
-(defalias calcFunc-trunc 'math-trunc)
+(defalias 'calcFunc-trunc 'math-trunc)
 
 ;;; Coerce A to be an integer (by truncation toward minus infinity).  [I N]
 (defun math-floor (a &optional prec)    ;  [Public]
@@ -693,7 +614,7 @@ loaded and the keystroke automatically re-typed."
           (math-trunc a)))
        (t (calc-extensions)
           (math-floor-fancy a))))
-(defalias calcFunc-floor 'math-floor)
+(defalias 'calcFunc-floor 'math-floor)
 
 
 (defun math-imod (a b)   ; [I I I] [Public]
@@ -809,19 +730,19 @@ loaded and the keystroke automatically re-typed."
       nil)))
 
 
-
-
-
 ;;; Bug reporting
 
-(defun report-calc-bug (topic)
+(defun report-calc-bug ()
   "Report a bug in Calc, the GNU Emacs calculator.
 Prompts for bug subject.  Leaves you in a mail buffer."
-  (interactive "sBug Subject: ")
-  (mail nil calc-bug-address topic)
-  (goto-char (point-max))
-  (insert "\nIn Calc " calc-version ", Emacs " (emacs-version) "\n\n")
-  (message (substitute-command-keys "Type \\[mail-send] to send bug report.")))
-(defalias calc-report-bug 'report-calc-bug)
+  (interactive)
+  (let ((reporter-prompt-for-summary-p t))
+    (reporter-submit-bug-report calc-bug-address "Calc" '(calc-version)
+                               nil nil
+                               "Please describe exactly what actions triggered the bug and the
+precise symptoms of the bug.  If possible, include a backtrace by
+doing 'M-x toggle-debug-on-error', then reproducing the bug.
+" )))
+(defalias 'calc-report-bug 'report-calc-bug)
 
 ;;; calc-misc.el ends here