/[emacs]/emacs/lisp/calc/calc-prog.el
ViewVC logotype

Diff of /emacs/lisp/calc/calc-prog.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by eliz, Tue Nov 6 18:59:06 2001 UTC revision 1.2 by eliz, Tue Nov 13 07:30:04 2001 UTC
# Line 1  Line 1 
1  ;; Calculator for GNU Emacs, part II [calc-prog.el]  ;; Calculator for GNU Emacs, part II [calc-prog.el]
2  ;; Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation, Inc.  ;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc.
3  ;; Written by Dave Gillespie, daveg@synaptics.com.  ;; Written by Dave Gillespie, daveg@synaptics.com.
4    
5  ;; This file is part of GNU Emacs.  ;; This file is part of GNU Emacs.
# Line 666  Line 666 
666                      (symbolp (cdr def))                      (symbolp (cdr def))
667                      (eq major-mode 'calc-mode))                      (eq major-mode 'calc-mode))
668                 (progn                 (progn
669                   (if (and (< (window-width) (screen-width))                   (if (and (< (window-width) (frame-width))
670                            calc-display-trail)                            calc-display-trail)
671                       (let ((win (get-buffer-window (calc-trail-buffer))))                       (let ((win (get-buffer-window (calc-trail-buffer))))
672                         (if win                         (if win
# Line 722  Line 722 
722                        (if (>= (prog2 (forward-char -1)                        (if (>= (prog2 (forward-char -1)
723                                       (current-column)                                       (current-column)
724                                       (forward-char 1))                                       (forward-char 1))
725                                (screen-width))                                (frame-width))
726                            (fill-region top (point))))                            (fill-region top (point))))
727                    (insert "Press C-q to quote control characters like RET"                    (insert "Press C-q to quote control characters like RET"
728                            " and TAB.\n"                            " and TAB.\n"
# Line 743  Line 743 
743                        (calc-edit-mode (list 'calc-finish-formula-edit                        (calc-edit-mode (list 'calc-finish-formula-edit
744                                              (list 'quote func)))                                              (list 'quote func)))
745                        (insert (math-showing-full-precision                        (insert (math-showing-full-precision
746                                 (math-format-nice-expr defn (screen-width)))                                 (math-format-nice-expr defn (frame-width)))
747                                "\n"))                                "\n"))
748                       (calc-show-edit-buffer))                       (calc-show-edit-buffer))
749                   (error "That command's definition cannot be edited"))))))                   (error "That command's definition cannot be edited"))))))
# Line 1241  Line 1241 
1241           (open last-command-char)           (open last-command-char)
1242           (counter initial)           (counter initial)
1243           ch)           ch)
1244      (or executing-macro      (or executing-kbd-macro
1245          (message "Reading loop body..."))          (message "Reading loop body..."))
1246      (while (>= count 0)      (while (>= count 0)
1247        (setq ch (read-char))        (setq ch (read-char))
# Line 1265  Line 1265 
1265          (setq body (concat body (char-to-string ch)))))          (setq body (concat body (char-to-string ch)))))
1266      (if (/= ch (cdr (assq open '( (?\< . ?\>) (?\( . ?\)) (?\{ . ?\}) ))))      (if (/= ch (cdr (assq open '( (?\< . ?\>) (?\( . ?\)) (?\{ . ?\}) ))))
1267          (error "Mismatched Z%c and Z%c in keyboard macro" open ch))          (error "Mismatched Z%c and Z%c in keyboard macro" open ch))
1268      (or executing-macro      (or executing-kbd-macro
1269          (message "Looping..."))          (message "Looping..."))
1270      (setq body (concat (substring body 0 -2) "Z]"))      (setq body (concat (substring body 0 -2) "Z]"))
1271      (and (not executing-macro)      (and (not executing-kbd-macro)
1272           (= rpt-count 1000000)           (= rpt-count 1000000)
1273           (null parts)           (null parts)
1274           (null counter)           (null counter)
# Line 1300  Line 1300 
1300                       (calc-pop-stack 1)                       (calc-pop-stack 1)
1301                       (setq counter (calcFunc-add counter step)))                       (setq counter (calcFunc-add counter step)))
1302                   (setq rpt-count (1- rpt-count))))))))                   (setq rpt-count (1- rpt-count))))))))
1303      (or executing-macro      (or executing-kbd-macro
1304          (message "Looping...done")))          (message "Looping...done")))
1305  )  )
1306    
# Line 1358  Line 1358 
1358            (count 0)            (count 0)
1359            (body "")            (body "")
1360            ch)            ch)
1361       (if (or executing-macro defining-kbd-macro)       (if (or executing-kbd-macro defining-kbd-macro)
1362           (progn           (progn
1363             (if defining-kbd-macro             (if defining-kbd-macro
1364                 (message "Reading body..."))                 (message "Reading body..."))
# Line 1400  Line 1400 
1400  (defun calc-kbd-report (msg)  (defun calc-kbd-report (msg)
1401    (interactive "sMessage: ")    (interactive "sMessage: ")
1402    (calc-wrapper    (calc-wrapper
1403     (let ((executing-macro nil)     (let ((executing-kbd-macro nil)
1404           (defining-kbd-macro nil))           (defining-kbd-macro nil))
1405       (math-working msg (calc-top-n 1))))       (math-working msg (calc-top-n 1))))
1406  )  )
# Line 1408  Line 1408 
1408  (defun calc-kbd-query (msg)  (defun calc-kbd-query (msg)
1409    (interactive "sPrompt: ")    (interactive "sPrompt: ")
1410    (calc-wrapper    (calc-wrapper
1411     (let ((executing-macro nil)     (let ((executing-kbd-macro nil)
1412           (defining-kbd-macro nil))           (defining-kbd-macro nil))
1413       (calc-alg-entry nil (and (not (equal msg "")) msg))))       (calc-alg-entry nil (and (not (equal msg "")) msg))))
1414  )  )

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26