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

Diff of /emacs/lisp/calc/calc.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, Sun Nov 11 10:28:55 2001 UTC
# Line 67  Line 67 
67    
68    
69  (provide 'calc)  (provide 'calc)
70    (require 'calc-macs)
71    
72  (defun calc-record-compilation-date ()  (defun calc-record-compilation-date ()
73    (calc-record-compilation-date-macro)    (calc-record-compilation-date-macro))
 )  
74  (calc-record-compilation-date)  (calc-record-compilation-date)
75    
76    
# Line 2046  If mouse is pressed in Calc window, push Line 2045  If mouse is pressed in Calc window, push
2045               (calc-dots))))))               (calc-dots))))))
2046  )  )
2047    
2048    (defsubst calc-minibuffer-size ()
2049      (- (point-max) (minibuffer-prompt-end)))
2050    
2051  (defun calcDigit-nondigit ()  (defun calcDigit-nondigit ()
2052    (interactive)    (interactive)
2053    ;; Exercise for the reader:  Figure out why this is a good precaution!    ;; Exercise for the reader:  Figure out why this is a good precaution!
2054    (or (boundp 'calc-buffer)    (or (boundp 'calc-buffer)
2055        (use-local-map minibuffer-local-map))        (use-local-map minibuffer-local-map))
2056    (let ((str (buffer-string)))    (let ((str (minibuffer-contents)))
2057      (setq calc-digit-value (save-excursion      (setq calc-digit-value (save-excursion
2058                               (set-buffer calc-buffer)                               (set-buffer calc-buffer)
2059                               (math-read-number str))))                               (math-read-number str))))
2060    (if (and (null calc-digit-value) (> (buffer-size) 0))    (if (and (null calc-digit-value) (> (calc-minibuffer-size) 0))
2061        (progn        (progn
2062          (beep)          (beep)
2063          (calc-temp-minibuffer-message " [Bad format]"))          (calc-temp-minibuffer-message " [Bad format]"))
# Line 2071  If mouse is pressed in Calc window, push Line 2073  If mouse is pressed in Calc window, push
2073    
2074  (defun calc-minibuffer-contains (rex)  (defun calc-minibuffer-contains (rex)
2075    (save-excursion    (save-excursion
2076      (goto-char (point-min))      (goto-char (minibuffer-prompt-end))
2077      (looking-at rex))      (looking-at rex))
2078  )  )
2079    
# Line 2158  If mouse is pressed in Calc window, push Line 2160  If mouse is pressed in Calc window, push
2160                                            (upcase last-command-char))))                                            (upcase last-command-char))))
2161                                  (and dig                                  (and dig
2162                                       (< dig radix)))))))                                       (< dig radix)))))))
2163                (save-excursion                (calc-minibuffer-contains
2164                  (goto-char (point-min))                 "[-+]?\\(.*\\+/- *\\|.*mod *\\)?\\([0-9]+\\.?0*[@oh] *\\)?\\([0-9]+\\.?0*['m] *\\)?[0-9]*\\(\\.?[0-9]*\\(e[-+]?[0-3]?[0-9]?[0-9]?[0-9]?[0-9]?[0-9]?[0-9]?\\)?\\|[0-9]:\\([0-9]+:\\)?[0-9]*\\)?[\"s]?\\'"))
                 (looking-at  
                  "[-+]?\\(.*\\+/- *\\|.*mod *\\)?\\([0-9]+\\.?0*[@oh] *\\)?\\([0-9]+\\.?0*['m] *\\)?[0-9]*\\(\\.?[0-9]*\\(e[-+]?[0-3]?[0-9]?[0-9]?[0-9]?[0-9]?[0-9]?[0-9]?\\)?\\|[0-9]:\\([0-9]+:\\)?[0-9]*\\)?[\"s]?\\'")))  
2165            (if (and (memq last-command-char '(?@ ?o ?h ?\' ?m))            (if (and (memq last-command-char '(?@ ?o ?h ?\' ?m))
2166                     (string-match " " calc-hms-format))                     (string-match " " calc-hms-format))
2167                (insert " "))                (insert " "))
# Line 2190  If mouse is pressed in Calc window, push Line 2190  If mouse is pressed in Calc window, push
2190          ((eq last-command 'calcDigit-start)          ((eq last-command 'calcDigit-start)
2191           (erase-buffer))           (erase-buffer))
2192          (t (backward-delete-char 1)))          (t (backward-delete-char 1)))
2193    (if (= (buffer-size) 0)    (if (= (calc-minibuffer-size) 0)
2194        (progn        (progn
2195          (setq last-command-char 13)          (setq last-command-char 13)
2196          (calcDigit-nondigit)))          (calcDigit-nondigit)))

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