emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/calc/calc-store.el


From: Jay Belanger
Subject: [Emacs-diffs] Changes to emacs/lisp/calc/calc-store.el
Date: Fri, 26 Nov 2004 17:56:31 -0500

Index: emacs/lisp/calc/calc-store.el
diff -c emacs/lisp/calc/calc-store.el:1.6 emacs/lisp/calc/calc-store.el:1.7
*** emacs/lisp/calc/calc-store.el:1.6   Mon Sep  1 15:45:18 2003
--- emacs/lisp/calc/calc-store.el       Fri Nov 26 22:35:35 2004
***************
*** 3,10 ****
  ;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc.
  
  ;; Author: David Gillespie <address@hidden>
! ;; Maintainers: D. Goel <address@hidden>
! ;;              Colin Walters <address@hidden>
  
  ;; This file is part of GNU Emacs.
  
--- 3,9 ----
  ;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc.
  
  ;; Author: David Gillespie <address@hidden>
! ;; Maintainer: Jay Belanger <address@hidden>
  
  ;; This file is part of GNU Emacs.
  
***************
*** 44,49 ****
--- 43,50 ----
      (calc-store-into var)))
  
  (defvar calc-given-value-flag nil)
+ (defvar calc-given-value)
+ 
  (defun calc-store-into (&optional var)
    (interactive)
    (calc-wrapper
***************
*** 155,160 ****
--- 156,179 ----
                             tag (and (not val) 1))
           (message "Stored to variable \"%s\"" (calc-var-name var)))))))
  
+ (defvar calc-var-name-map nil "Keymap for reading Calc variable names.")
+ (if calc-var-name-map
+     ()
+   (setq calc-var-name-map (copy-keymap minibuffer-local-completion-map))
+   (define-key calc-var-name-map " " 'self-insert-command)
+   (mapcar (function
+          (lambda (x)
+            (define-key calc-var-name-map (char-to-string x)
+              'calcVar-digit)))
+         "0123456789")
+   (mapcar (function
+          (lambda (x)
+            (define-key calc-var-name-map (char-to-string x)
+              'calcVar-oper)))
+         "+-*/^|"))
+ 
+ (defvar calc-store-opers)
+ 
  (defun calc-read-var-name (prompt &optional calc-store-opers)
    (setq calc-given-value nil
        calc-aborted-prefix nil)
***************
*** 178,199 ****
                 svar))
           (intern var)))))
  
- (defvar calc-var-name-map nil "Keymap for reading Calc variable names.")
- (if calc-var-name-map
-     ()
-   (setq calc-var-name-map (copy-keymap minibuffer-local-completion-map))
-   (define-key calc-var-name-map " " 'self-insert-command)
-   (mapcar (function
-          (lambda (x)
-            (define-key calc-var-name-map (char-to-string x)
-              'calcVar-digit)))
-         "0123456789")
-   (mapcar (function
-          (lambda (x)
-            (define-key calc-var-name-map (char-to-string x)
-              'calcVar-oper)))
-         "+-*/^|"))
- 
  (defun calcVar-digit ()
    (interactive)
    (if (calc-minibuffer-contains "var-\\'")
--- 197,202 ----
***************
*** 530,540 ****
                                     var-PlotData5 var-PlotData6
                                     var-DUMMY))
  
  (defun calc-permanent-variable (&optional var)
    (interactive)
    (calc-wrapper
     (or var (setq var (calc-read-var-name "Save variable (default=all): ")))
!    (let (pos)
       (and var (or (and (boundp var) (symbol-value var))
                  (error "No such variable")))
       (set-buffer (find-file-noselect (substitute-in-file-name
--- 533,548 ----
                                     var-PlotData5 var-PlotData6
                                     var-DUMMY))
  
+ ;; The variable calc-pv-pos is local to calc-permanent-variable, but
+ ;; used by calc-insert-permanent-variable, which is called by
+ ;; calc-permanent-variable.
+ (defvar calc-pv-pos)
+ 
  (defun calc-permanent-variable (&optional var)
    (interactive)
    (calc-wrapper
     (or var (setq var (calc-read-var-name "Save variable (default=all): ")))
!    (let (calc-pv-pos)
       (and var (or (and (boundp var) (symbol-value var))
                  (error "No such variable")))
       (set-buffer (find-file-noselect (substitute-in-file-name
***************
*** 556,571 ****
    (goto-char (point-min))
    (if (search-forward (concat "(setq " (symbol-name var) " '") nil t)
        (progn
!       (setq pos (point-marker))
        (forward-line -1)
        (if (looking-at ";;; Variable .* stored by Calc on ")
            (progn
              (delete-region (match-end 0) (progn (end-of-line) (point)))
              (insert (current-time-string))))
!       (goto-char (- pos 8 (length (symbol-name var))))
        (forward-sexp 1)
        (backward-char 1)
!       (delete-region pos (point)))
      (goto-char (point-max))
      (insert "\n;;; Variable \""
            (symbol-name var)
--- 564,579 ----
    (goto-char (point-min))
    (if (search-forward (concat "(setq " (symbol-name var) " '") nil t)
        (progn
!       (setq calc-pv-pos (point-marker))
        (forward-line -1)
        (if (looking-at ";;; Variable .* stored by Calc on ")
            (progn
              (delete-region (match-end 0) (progn (end-of-line) (point)))
              (insert (current-time-string))))
!       (goto-char (- calc-pv-pos 8 (length (symbol-name var))))
        (forward-sexp 1)
        (backward-char 1)
!       (delete-region calc-pv-pos (point)))
      (goto-char (point-max))
      (insert "\n;;; Variable \""
            (symbol-name var)




reply via email to

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