emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs build failure


From: Colin Walters
Subject: Re: Emacs build failure
Date: Sat, 10 Nov 2001 18:08:43 -0500
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.1.50 (powerpc-debian-linux-gnu)

address@hidden (Kai Großjohann) writes:

> The following change (diff below signature) allows me to build Emacs
> with "make bootstrap", and it builds calc, too.
>
> Colin, what do you think?  Would this be a first step?

I think these changes are good.  Here is a version of the patch from
etc/PROBLEMS, slightly cleaned up, plus Kai's patch.  There is still
some problems with loading some extensions, which I will hopefully be
able to fix shortly.  But basic input and operations work.

Lots more to do...

Index: calc-aent.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/calc/calc-aent.el,v
retrieving revision 1.1
diff -u -r1.1 calc-aent.el
--- calc-aent.el        2001/11/06 18:59:06     1.1
+++ calc-aent.el        2001/11/10 23:03:39
@@ -25,6 +25,7 @@
 (require 'calc)
 
 (require 'calc-macs)
+(eval-when-compile '(require calc-macs))
 
 (defun calc-Need-calc-aent () nil)
 
@@ -85,11 +86,11 @@
                                    (format ", \"%c\"" (car alg-exp))
                                  "")
                                ")")))
-         (if (and (< (length buf) (screen-width)) (= (length entry) 1)
+         (if (and (< (length buf) (frame-width)) (= (length entry) 1)
                   calc-extensions-loaded)
              (let ((long (concat (math-format-value (car entry) 1000)
                                  " =>  " buf)))
-               (if (<= (length long) (- (screen-width) 8))
+               (if (<= (length long) (- (frame-width) 8))
                    (setq buf long))))
          (calc-handle-whys)
          (message "Result: %s" buf)))
@@ -385,7 +386,7 @@
          (calc-minibuffer-contains
           "\\`\\([^\"]*\"[^\"]*\"\\)*[^\"]*\"[^\"]*\\'"))
       (insert "`")
-    (setq alg-exp (buffer-string))
+    (setq alg-exp (minibuffer-contents))
     (and (> (length alg-exp) 0) (setq calc-previous-alg-entry alg-exp))
     (exit-minibuffer))
 )
@@ -393,14 +394,14 @@
 
 (defun calcAlg-enter ()
   (interactive)
-  (let* ((str (buffer-string))
+  (let* ((str (minibuffer-contents))
         (exp (and (> (length str) 0)
                   (save-excursion
                     (set-buffer calc-buffer)
                     (math-read-exprs str)))))
     (if (eq (car-safe exp) 'error)
        (progn
-         (goto-char (point-min))
+         (goto-char (minibuffer-prompt-end))
          (forward-char (nth 1 exp))
          (beep)
          (calc-temp-minibuffer-message
@@ -455,14 +456,14 @@
   (interactive)
   (if (calc-minibuffer-contains "address@hidden *[^'m ]+[^'m]*\\'")
       (calcDigit-key)
-    (setq calc-digit-value (buffer-string))
+    (setq calc-digit-value (minibuffer-contents))
     (exit-minibuffer))
 )
 
 (defun calcDigit-edit ()
   (interactive)
   (calc-unread-command)
-  (setq calc-digit-value (buffer-string))
+  (setq calc-digit-value (minibuffer-contents))
   (exit-minibuffer)
 )
Index: calc-ext.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/calc/calc-ext.el,v
retrieving revision 1.1
diff -u -r1.1 calc-ext.el
--- calc-ext.el 2001/11/06 18:59:06     1.1
+++ calc-ext.el 2001/11/10 23:06:14
@@ -22,6 +22,7 @@
 
 
 (provide 'calc-ext)
+(require 'calc)
 
 (setq calc-extensions-loaded t)
 
@@ -1354,6 +1355,25 @@
   (calc-fancy-prefix 'calc-inverse-flag "Inverse..." n)
 )
 
+(defconst calc-fancy-prefix-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map [t] 'calc-fancy-prefix-other-key)
+    (define-key map (vector meta-prefix-char t) 'calc-fancy-prefix-other-key)
+    (define-key map [switch-frame] nil)
+    (define-key map [?\C-u] 'universal-argument)
+    (define-key map [?0] 'digit-argument)
+    (define-key map [?1] 'digit-argument)
+    (define-key map [?2] 'digit-argument)
+    (define-key map [?3] 'digit-argument)
+    (define-key map [?4] 'digit-argument)
+    (define-key map [?5] 'digit-argument)
+    (define-key map [?6] 'digit-argument)
+    (define-key map [?7] 'digit-argument)
+    (define-key map [?8] 'digit-argument)
+    (define-key map [?9] 'digit-argument)
+    map)
+  "Keymap used while processing calc-fancy-prefix.")
+
 (defun calc-fancy-prefix (flag msg n)
   (let (prefix)
     (calc-wrapper
@@ -1363,23 +1383,32 @@
           prefix-arg n)
      (message (if prefix msg "")))
     (and prefix
-         nil   ; Excise broken code we can live without.  -- daveg 12/12/96
         (not calc-is-keypad-press)
-        (let ((event (calc-read-key t)))
-          (if (eq (setq last-command-char (car event)) ?\C-u)
-              (universal-argument)
-            (if (or (not (integerp last-command-char))
-                    (and (>= last-command-char 0) (< last-command-char ? )
-                         (not (memq last-command-char '(?\e)))))
-                (calc-wrapper))  ; clear flags if not a Calc command.
-            (if calc-emacs-type-19
-                (setq last-command-event (cdr event)))
-            (if (or (not (integerp last-command-char))
-                    (eq last-command-char ?-))
-                (calc-unread-command)
-              (digit-argument n))))))
-)
+        (if (boundp 'overriding-terminal-local-map)
+            (setq overriding-terminal-local-map calc-fancy-prefix-map)
+          (let ((event (calc-read-key t)))
+            (if (eq (setq last-command-char (car event)) ?\C-u)
+                (universal-argument)
+              (if (or (not (integerp last-command-char))
+                      (and (>= last-command-char 0) (< last-command-char ? )
+                           (not (memq last-command-char '(?\e)))))
+                  (calc-wrapper))  ; clear flags if not a Calc command.
+              (if calc-emacs-type-19
+                  (setq last-command-event (cdr event)))
+              (if (or (not (integerp last-command-char))
+                      (eq last-command-char ?-))
+                  (calc-unread-command)
+                (digit-argument n))))))))
 (setq calc-is-keypad-press nil)
+
+(defun calc-fancy-prefix-other-key (arg)
+  (interactive "P")
+  (if (or (not (integerp last-command-char))
+         (and (>= last-command-char 0) (< last-command-char ? )
+              (not (eq last-command-char meta-prefix-char))))
+     (calc-wrapper))  ; clear flags if not a Calc command.
+  (calc-unread-command)
+  (setq overriding-terminal-local-map nil))
 
 (defun calc-invert-func ()
   (save-excursion
Index: calc-macs.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/calc/calc-macs.el,v
retrieving revision 1.1
diff -u -r1.1 calc-macs.el
--- calc-macs.el        2001/11/06 18:59:06     1.1
+++ calc-macs.el        2001/11/10 23:06:29
@@ -26,10 +26,9 @@
 
 
 (defmacro calc-record-compilation-date-macro ()
-  (` (setq calc-installed-date (, (concat (current-time-string)
-                                         " by "
-                                         (user-full-name)))))
-)
+  `(setq calc-installed-date ,(concat (current-time-string)
+                                     " by "
+                                     (user-full-name))))
 
 
 (defmacro calc-wrapper (&rest body)
Index: calc.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/calc/calc.el,v
retrieving revision 1.1
diff -u -r1.1 calc.el
--- calc.el     2001/11/06 18:59:06     1.1
+++ calc.el     2001/11/10 23:06:42
@@ -67,11 +67,10 @@
 
 
 (provide 'calc)
+(require 'calc-macs)
 
-
 (defun calc-record-compilation-date ()
-  (calc-record-compilation-date-macro)
-)
+  (calc-record-compilation-date-macro))
 (calc-record-compilation-date)
 
 
@@ -2046,16 +2045,19 @@
             (calc-dots))))))
 )
 
+(defsubst calc-minibuffer-size ()
+  (- (point-max) (minibuffer-prompt-end)))
+
 (defun calcDigit-nondigit ()
   (interactive)
   ;; Exercise for the reader:  Figure out why this is a good precaution!
   (or (boundp 'calc-buffer)
       (use-local-map minibuffer-local-map))
-  (let ((str (buffer-string)))
+  (let ((str (minibuffer-contents)))
     (setq calc-digit-value (save-excursion
                             (set-buffer calc-buffer)
                             (math-read-number str))))
-  (if (and (null calc-digit-value) (> (buffer-size) 0))
+  (if (and (null calc-digit-value) (> (calc-minibuffer-size) 0))
       (progn
        (beep)
        (calc-temp-minibuffer-message " [Bad format]"))
@@ -2071,7 +2073,7 @@
 
 (defun calc-minibuffer-contains (rex)
   (save-excursion
-    (goto-char (point-min))
+    (goto-char (minibuffer-prompt-end))
     (looking-at rex))
 )
 
@@ -2158,10 +2160,8 @@
                                          (upcase last-command-char))))
                                (and dig
                                     (< dig radix)))))))
-             (save-excursion
-               (goto-char (point-min))
-               (looking-at
-                "[-+]?\\(.*\\+/- *\\|.*mod *\\)?\\(address@hidden 
*\\)?\\([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]?\\'")))
+             (calc-minibuffer-contains
+              "[-+]?\\(.*\\+/- *\\|.*mod *\\)?\\(address@hidden 
*\\)?\\([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]?\\'"))
          (if (and (memq last-command-char '(?@ ?o ?h ?\' ?m))
                   (string-match " " calc-hms-format))
              (insert " "))
@@ -2190,7 +2190,7 @@
        ((eq last-command 'calcDigit-start)
         (erase-buffer))
        (t (backward-delete-char 1)))
-  (if (= (buffer-size) 0)
+  (if (= (calc-minibuffer-size) 0)
       (progn
        (setq last-command-char 13)
        (calcDigit-nondigit)))
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]