comparison lisp/calc/calc-undo.el @ 88155:d7ddb3e565de

sync with trunk
author Henrik Enberg <henrik.enberg@telia.com>
date Mon, 16 Jan 2006 00:03:54 +0000
parents 0d8b17d428b5
children
comparison
equal deleted inserted replaced
88154:8ce476d3ba36 88155:d7ddb3e565de
1 ;;; calc-undo.el --- undo functions for Calc 1 ;;; calc-undo.el --- undo functions for Calc
2 2
3 ;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. 3 ;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2002, 2003, 2004,
4 ;; 2005 Free Software Foundation, Inc.
4 5
5 ;; Author: David Gillespie <daveg@synaptics.com> 6 ;; Author: David Gillespie <daveg@synaptics.com>
6 ;; Maintainers: D. Goel <deego@gnufans.org> 7 ;; Maintainer: Jay Belanger <belanger@truman.edu>
7 ;; Colin Walters <walters@debian.org>
8 8
9 ;; This file is part of GNU Emacs. 9 ;; This file is part of GNU Emacs.
10 10
11 ;; GNU Emacs is distributed in the hope that it will be useful, 11 ;; GNU Emacs is distributed in the hope that it will be useful,
12 ;; but WITHOUT ANY WARRANTY. No author or distributor 12 ;; but WITHOUT ANY WARRANTY. No author or distributor
26 ;;; Commentary: 26 ;;; Commentary:
27 27
28 ;;; Code: 28 ;;; Code:
29 29
30 ;; This file is autoloaded from calc-ext.el. 30 ;; This file is autoloaded from calc-ext.el.
31
31 (require 'calc-ext) 32 (require 'calc-ext)
32
33 (require 'calc-macs) 33 (require 'calc-macs)
34
35 (defun calc-Need-calc-undo () nil)
36
37 34
38 ;;; Undo. 35 ;;; Undo.
39 36
40 (defun calc-undo (n) 37 (defun calc-undo (n)
41 (interactive "p") 38 (interactive "p")
79 (set (nth 1 action) (nth 2 action))) 76 (set (nth 1 action) (nth 2 action)))
80 ((eq (car action) 'store) 77 ((eq (car action) 'store)
81 (let ((v (intern (nth 1 action)))) 78 (let ((v (intern (nth 1 action))))
82 (calc-record-undo (list 'store (nth 1 action) 79 (calc-record-undo (list 'store (nth 1 action)
83 (and (boundp v) (symbol-value v)))) 80 (and (boundp v) (symbol-value v))))
84 (if (y-or-n-p (format "Un-store variable %s? " (nth 1 action))) 81 (if (y-or-n-p (format "Un-store variable %s? "
82 (calc-var-name (nth 1 action))))
85 (progn 83 (progn
86 (if (nth 2 action) 84 (if (nth 2 action)
87 (set v (nth 2 action)) 85 (set v (nth 2 action))
88 (makunbound v)) 86 (makunbound v))
89 (calc-refresh-evaltos v))))) 87 (calc-refresh-evaltos v)))))
148 (defun calc-undo-does-pushes (list) 146 (defun calc-undo-does-pushes (list)
149 (and list 147 (and list
150 (or (eq (car (car list)) 'pop) 148 (or (eq (car (car list)) 'pop)
151 (calc-undo-does-pushes (cdr list))))) 149 (calc-undo-does-pushes (cdr list)))))
152 150
151 (provide 'calc-undo)
152
153 ;;; arch-tag: eeb485d2-fb3d-454a-9d79-450af1f50d6c
153 ;;; calc-undo.el ends here 154 ;;; calc-undo.el ends here