]> code.delx.au - gnu-emacs/blobdiff - lisp/calc/calc-maint.el
(math-format-stack-value): Revert a broken
[gnu-emacs] / lisp / calc / calc-maint.el
index a5d92c969bd8c1dbaaccfac3b19d67aeb580e3af..3b8882efebace64ef4fdff1ce81fafc3c4899d36 100644 (file)
@@ -1,6 +1,9 @@
-;; Calculator for GNU Emacs, maintenance routines
+;;; calc-maint.el --- maintenance routines 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,8 +22,9 @@
 ;; file named COPYING.  Among other things, the copyright notice
 ;; and this notice must be preserved on all copies.
 
+;;; Commentary:
 
-
+;;; Code:
 
 (defun calc-compile ()
   "Compile all parts of Calc.
@@ -58,7 +62,7 @@ Unix usage:
     ;; Make sure we're in the right directory.
     (find-file "calc.el")
     (if (= (buffer-size) 0)
-       (error "This command must be used in the Calc source directory."))
+       (error "This command must be used in the Calc source directory"))
 
     ;; Make sure current directory is in load-path.
     (setq load-path (cons default-directory load-path))
@@ -82,7 +86,7 @@ Unix usage:
                  (setq changed-units t))
              (or message-bug (message ""))
              (byte-compile-file (car files)))
-         (message "File %s is up to date." (car files)))
+         (message "File %s is up to date" (car files)))
        (if (string-match "calc\\(-ext\\)?.el" (car files))
            (load (concat (car files) "c") nil t t))
        (setq files (cdr files))))
@@ -132,7 +136,7 @@ Unix usage:
                            (sort rules 'string<))
                    (save-buffer))))
          (error (message "Unable to pre-build tables %s" err))))
-    (message "Done.  Don't forget to install with \"make public\" or \"make private\".")))
+    (message "Done.  Don't forget to install with \"make public\" or \"make private\"")))
 
 (defun calc-compile-message (fmt &rest args)
   (cond ((and (= (length args) 2)
@@ -158,8 +162,8 @@ Unix usage:
              (= (length args) 1)
              (stringp (car args))
              (string-match ".elc?\\'" (car args)))
-        (or (string-match "Saving file %s..." fmt)
-            (funcall old-message fmt (file-name-nondirectory (car args)))))
+        (unless (string-match "Saving file %s..." fmt)
+          (funcall old-message fmt (file-name-nondirectory (car args)))))
        ((string-match "\\(Preparing\\|Building\\).*\\.\\.\\.$" fmt)
         (send-string-to-terminal (apply 'format fmt args)))
        ((string-match "\\(Preparing\\|Building\\).*\\.\\.\\. *done$" fmt)
@@ -181,18 +185,14 @@ Unix usage:
   (message "Wrote %s" filename)
   nil)
 
-
-
 (defun calc-split-tutorial (&optional force)
   (interactive "P")
   (calc-split-manual force 1))
 
-
 (defun calc-split-reference (&optional force)
   (interactive "P")
   (calc-split-manual force 2))
 
-
 (defun calc-split-manual (&optional force part)
   "Split the Calc manual into separate Tutorial and Reference manuals.
 Use this if your TeX installation is too small-minded to handle
@@ -201,9 +201,9 @@ Usage:  C-x C-f calc.texinfo RET
         M-x calc-split-manual RET"
   (interactive "P")
   (or (let ((case-fold-search t))
-       (string-match "calc\\.texinfo" (buffer-name)))
+       (string-match "calc\\.texi" (buffer-name)))
       force
-      (error "This command should be used in the calc.texinfo buffer."))
+      (error "This command should be used in the calc.texi buffer"))
   (let ((srcbuf (current-buffer))
        tutpos refpos endpos (maxpos (point-max)))
     (goto-char 1)
@@ -278,7 +278,7 @@ Usage:  C-x C-f calc.texinfo RET
   (or (let ((case-fold-search t))
        (string-match "calc\\.texinfo" (buffer-name)))
       force
-      (error "This command should be used in the calc.texinfo buffer."))
+      (error "This command should be used in the calc.texinfo buffer"))
   (let ((srcbuf (current-buffer))
        begpos sumpos endpos midpos)
     (goto-char 1)
@@ -387,67 +387,4 @@ Usage:  C-x C-f calc.texinfo RET
     (save-buffer))
   (message "Wrote file calcsum.tex"))
 
-
-
-(defun calc-public-autoloads ()
-  "Modify the public \"default\" file to contain the necessary autoload and
-global-set-key commands for Calc."
-  (interactive)
-  (let ((home default-directory)
-       (p load-path)
-       instbuf name)
-    (while (and p
-               (not (file-exists-p
-                     (setq name (expand-file-name "default" (car p)))))
-               (not (file-exists-p
-                     (setq name (expand-file-name "default.el" (car p))))))
-      (setq p (cdr p)))
-    (or p (error "Unable to find \"default\" file.  Create one and try again."))
-    (find-file name)
-    (if buffer-read-only (error "No write permission for \"%s\"" buffer-file-name))
-    (goto-char (point-max))
-    (calc-add-autoloads home "calc-public-autoloads")))
-
-(defun calc-private-autoloads ()
-  "Modify the user's \".emacs\" file to contain the necessary autoload and
-global-set-key commands for Calc."
-  (interactive)
-  (let ((home default-directory))
-    (find-file "~/.emacs")
-    (goto-char (point-max))
-    (calc-add-autoloads home "calc-private-autoloads")))
-
-(defun calc-add-autoloads (home cmd)
-  (barf-if-buffer-read-only)
-  (let (top)
-    (if (and (re-search-backward ";;; Commands added by calc-.*-autoloads"
-                                nil t)
-            (setq top (point))
-            (search-forward ";;; End of Calc autoloads" nil t))
-       (progn
-         (forward-line 1)
-         (message "(Removing previous autoloads)")
-         (delete-region top (point)))
-      (insert "\n\n")
-      (backward-char 1)))
-  (insert ";;; Commands added by " cmd " on "
-         (current-time-string) ".
-\(autoload 'calc-dispatch         \"calc\" \"Calculator Options\" t)
-\(autoload 'full-calc             \"calc\" \"Full-screen Calculator\" t)
-\(autoload 'full-calc-keypad      \"calc\" \"Full-screen X Calculator\" t)
-\(autoload 'calc-eval             \"calc\" \"Use Calculator from Lisp\")
-\(autoload 'defmath               \"calc\" nil t t)
-\(autoload 'calc                          \"calc\" \"Calculator Mode\" t)
-\(autoload 'quick-calc            \"calc\" \"Quick Calculator\" t)
-\(autoload 'calc-keypad                   \"calc\" \"X windows Calculator\" t)
-\(autoload 'calc-embedded         \"calc\" \"Use Calc inside any buffer\" t)
-\(autoload 'calc-embedded-activate  \"calc\" \"Activate =>'s in buffer\" t)
-\(autoload 'calc-grab-region      \"calc\" \"Grab region of Calc data\" t)
-\(autoload 'calc-grab-rectangle           \"calc\" \"Grab rectangle of data\" t)
-\(setq load-path (nconc load-path (list \"" (directory-file-name home) "\")))
-\(global-set-key \"\\e#\" 'calc-dispatch)
-;;; End of Calc autoloads.\n")
-  (let ((trim-versions-without-asking t))
-    (save-buffer)))
-
 ;;; calc-maint.el ends here