bug-gnu-emacs
[Top][All Lists]
Advanced

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

emacs-21 and calc-2.02f minibuffer patch


From: pace
Subject: emacs-21 and calc-2.02f minibuffer patch
Date: Thu, 8 Nov 2001 16:59:25 -0500

Here are some patches that will get calc-2.02f to work with emacs-21.
calc has problems due to the fact that minibuffers now include the
prompt.  I doubt I've solved the problem in the best way, but at least
now it basically works for me, and the same .elc files work with both
emacs 20 and 21.

Pace Willisson
pace@alum.mit.edu

diff -r -c calc-2.02f/Makefile elisp/calc-2.02f/Makefile
*** calc-2.02f/Makefile Sun Dec 15 23:50:45 1996
--- elisp/calc-2.02f/Makefile   Thu Nov  8 15:54:26 2001
***************
*** 41,47 ****
  
  # Other macros.
  EFLAGS   = -batch
! MAINT  = -l calc-maint.elc
  
  # Control whether intermediate files are kept.
  PURGE  = -rm -f
--- 41,47 ----
  
  # Other macros.
  EFLAGS   = -batch
! MAINT  = -l calc-maint.el
  
  # Control whether intermediate files are kept.
  PURGE  = -rm -f
***************
*** 153,163 ****
        $(EMACS) $(EFLAGS) $(MAINT) calc.texinfo -f calc-inline-summary
  
  
! # All this because "-l calc-maint" doesn't work.
! maint: calc-maint.elc
! calc-maint.elc: calc-maint.el
!       cp calc-maint.el calc-maint.elc
! 
  
  # Create an Emacs TAGS file
  tags: TAGS
--- 153,159 ----
        $(EMACS) $(EFLAGS) $(MAINT) calc.texinfo -f calc-inline-summary
  
  
! maint:
  
  # Create an Emacs TAGS file
  tags: TAGS
Only in elisp/calc-2.02f: Makefile.orig
Only in elisp/calc-2.02f: Makefile~
diff -r -c calc-2.02f/calc-aent.el elisp/calc-2.02f/calc-aent.el
*** calc-2.02f/calc-aent.el     Sun Dec 15 23:50:36 1996
--- elisp/calc-2.02f/calc-aent.el       Thu Nov  8 16:41:30 2001
***************
*** 385,391 ****
          (calc-minibuffer-contains
           "\\`\\([^\"]*\"[^\"]*\"\\)*[^\"]*\"[^\"]*\\'"))
        (insert "`")
!     (setq alg-exp (buffer-string))
      (and (> (length alg-exp) 0) (setq calc-previous-alg-entry alg-exp))
      (exit-minibuffer))
  )
--- 385,391 ----
          (calc-minibuffer-contains
           "\\`\\([^\"]*\"[^\"]*\"\\)*[^\"]*\"[^\"]*\\'"))
        (insert "`")
!     (setq alg-exp (minibuffer-contents))
      (and (> (length alg-exp) 0) (setq calc-previous-alg-entry alg-exp))
      (exit-minibuffer))
  )
***************
*** 393,399 ****
  
  (defun calcAlg-enter ()
    (interactive)
!   (let* ((str (buffer-string))
         (exp (and (> (length str) 0)
                   (save-excursion
                     (set-buffer calc-buffer)
--- 393,399 ----
  
  (defun calcAlg-enter ()
    (interactive)
!   (let* ((str (minibuffer-contents))
         (exp (and (> (length str) 0)
                   (save-excursion
                     (set-buffer calc-buffer)
***************
*** 455,468 ****
    (interactive)
    (if (calc-minibuffer-contains ".*[@oh] *[^'m ]+[^'m]*\\'")
        (calcDigit-key)
!     (setq calc-digit-value (buffer-string))
      (exit-minibuffer))
  )
  
  (defun calcDigit-edit ()
    (interactive)
    (calc-unread-command)
!   (setq calc-digit-value (buffer-string))
    (exit-minibuffer)
  )
  
--- 455,468 ----
    (interactive)
    (if (calc-minibuffer-contains ".*[@oh] *[^'m ]+[^'m]*\\'")
        (calcDigit-key)
!     (setq calc-digit-value (minibuffer-contents))
      (exit-minibuffer))
  )
  
  (defun calcDigit-edit ()
    (interactive)
    (calc-unread-command)
!   (setq calc-digit-value (minibuffer-contents))
    (exit-minibuffer)
  )
  
diff -r -c calc-2.02f/calc.el elisp/calc-2.02f/calc.el
*** calc-2.02f/calc.el  Sun Dec 15 23:50:47 1996
--- elisp/calc-2.02f/calc.el    Thu Nov  8 16:42:48 2001
***************
*** 1,3 ****
--- 1,6 ----
+ (if (not (fboundp 'minibuffer-contents))
+     (defun minibuffer-contents () (buffer-string)))
+ 
  ;; Calculator for GNU Emacs, part I
  ;; Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
  ;; Written by Dave Gillespie, daveg@synaptics.com.
***************
*** 1300,1305 ****
--- 1303,1309 ----
         (calc-start-time (and calc-timing (not calc-start-time)
                               (calc-extensions)
                               (current-time-string)))
+        (minibuffer-prompt-properties '(read-only t point-entered 
minibuffer-avoid-prompt))
         (gc-cons-threshold (max gc-cons-threshold
                                 (if calc-timing 2000000 100000))))
      (setq calc-aborted-prefix "")
***************
*** 2051,2057 ****
    ;; 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)))
      (setq calc-digit-value (save-excursion
                             (set-buffer calc-buffer)
                             (math-read-number str))))
--- 2055,2061 ----
    ;; Exercise for the reader:  Figure out why this is a good precaution!
    (or (boundp 'calc-buffer)
        (use-local-map minibuffer-local-map))
!   (let ((str (minibuffer-contents)))
      (setq calc-digit-value (save-excursion
                             (set-buffer calc-buffer)
                             (math-read-number str))))



reply via email to

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