1 |
;; Calculator for GNU Emacs, maintenance routines |
;;; calc-maint.el --- maintenance routines for Calc |
2 |
|
|
3 |
;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. |
;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. |
4 |
;; Written by Dave Gillespie, daveg@synaptics.com. |
|
5 |
|
;; Author: David Gillespie <daveg@synaptics.com> |
6 |
|
;; Maintainer: Colin Walters <walters@debian.org> |
7 |
|
|
8 |
;; This file is part of GNU Emacs. |
;; This file is part of GNU Emacs. |
9 |
|
|
22 |
;; file named COPYING. Among other things, the copyright notice |
;; file named COPYING. Among other things, the copyright notice |
23 |
;; and this notice must be preserved on all copies. |
;; and this notice must be preserved on all copies. |
24 |
|
|
25 |
|
;;; Commentary: |
26 |
|
|
27 |
|
;;; Code: |
28 |
|
|
29 |
(defun calc-compile () |
(defun calc-compile () |
30 |
"Compile all parts of Calc. |
"Compile all parts of Calc. |
62 |
;; Make sure we're in the right directory. |
;; Make sure we're in the right directory. |
63 |
(find-file "calc.el") |
(find-file "calc.el") |
64 |
(if (= (buffer-size) 0) |
(if (= (buffer-size) 0) |
65 |
(error "This command must be used in the Calc source directory.")) |
(error "This command must be used in the Calc source directory")) |
66 |
|
|
67 |
;; Make sure current directory is in load-path. |
;; Make sure current directory is in load-path. |
68 |
(setq load-path (cons default-directory load-path)) |
(setq load-path (cons default-directory load-path)) |
86 |
(setq changed-units t)) |
(setq changed-units t)) |
87 |
(or message-bug (message "")) |
(or message-bug (message "")) |
88 |
(byte-compile-file (car files))) |
(byte-compile-file (car files))) |
89 |
(message "File %s is up to date." (car files))) |
(message "File %s is up to date" (car files))) |
90 |
(if (string-match "calc\\(-ext\\)?.el" (car files)) |
(if (string-match "calc\\(-ext\\)?.el" (car files)) |
91 |
(load (concat (car files) "c") nil t t)) |
(load (concat (car files) "c") nil t t)) |
92 |
(setq files (cdr files)))) |
(setq files (cdr files)))) |
136 |
(sort rules 'string<)) |
(sort rules 'string<)) |
137 |
(save-buffer)))) |
(save-buffer)))) |
138 |
(error (message "Unable to pre-build tables %s" err)))) |
(error (message "Unable to pre-build tables %s" err)))) |
139 |
(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\""))) |
140 |
|
|
141 |
(defun calc-compile-message (fmt &rest args) |
(defun calc-compile-message (fmt &rest args) |
142 |
(cond ((and (= (length args) 2) |
(cond ((and (= (length args) 2) |
162 |
(= (length args) 1) |
(= (length args) 1) |
163 |
(stringp (car args)) |
(stringp (car args)) |
164 |
(string-match ".elc?\\'" (car args))) |
(string-match ".elc?\\'" (car args))) |
165 |
(or (string-match "Saving file %s..." fmt) |
(unless (string-match "Saving file %s..." fmt) |
166 |
(funcall old-message fmt (file-name-nondirectory (car args))))) |
(funcall old-message fmt (file-name-nondirectory (car args))))) |
167 |
((string-match "\\(Preparing\\|Building\\).*\\.\\.\\.$" fmt) |
((string-match "\\(Preparing\\|Building\\).*\\.\\.\\.$" fmt) |
168 |
(send-string-to-terminal (apply 'format fmt args))) |
(send-string-to-terminal (apply 'format fmt args))) |
169 |
((string-match "\\(Preparing\\|Building\\).*\\.\\.\\. *done$" fmt) |
((string-match "\\(Preparing\\|Building\\).*\\.\\.\\. *done$" fmt) |
207 |
(or (let ((case-fold-search t)) |
(or (let ((case-fold-search t)) |
208 |
(string-match "calc\\.texinfo" (buffer-name))) |
(string-match "calc\\.texinfo" (buffer-name))) |
209 |
force |
force |
210 |
(error "This command should be used in the calc.texinfo buffer.")) |
(error "This command should be used in the calc.texinfo buffer")) |
211 |
(let ((srcbuf (current-buffer)) |
(let ((srcbuf (current-buffer)) |
212 |
tutpos refpos endpos (maxpos (point-max))) |
tutpos refpos endpos (maxpos (point-max))) |
213 |
(goto-char 1) |
(goto-char 1) |
282 |
(or (let ((case-fold-search t)) |
(or (let ((case-fold-search t)) |
283 |
(string-match "calc\\.texinfo" (buffer-name))) |
(string-match "calc\\.texinfo" (buffer-name))) |
284 |
force |
force |
285 |
(error "This command should be used in the calc.texinfo buffer.")) |
(error "This command should be used in the calc.texinfo buffer")) |
286 |
(let ((srcbuf (current-buffer)) |
(let ((srcbuf (current-buffer)) |
287 |
begpos sumpos endpos midpos) |
begpos sumpos endpos midpos) |
288 |
(goto-char 1) |
(goto-char 1) |
406 |
(not (file-exists-p |
(not (file-exists-p |
407 |
(setq name (expand-file-name "default.el" (car p)))))) |
(setq name (expand-file-name "default.el" (car p)))))) |
408 |
(setq p (cdr p))) |
(setq p (cdr p))) |
409 |
(or p (error "Unable to find \"default\" file. Create one and try again.")) |
(unless p |
410 |
|
(error "Unable to find \"default\" file. Create one and try again")) |
411 |
(find-file name) |
(find-file name) |
412 |
(if buffer-read-only (error "No write permission for \"%s\"" buffer-file-name)) |
(if buffer-read-only (error "No write permission for \"%s\"" buffer-file-name)) |
413 |
(goto-char (point-max)) |
(goto-char (point-max)) |