;;; calc-embed.el --- embed Calc in a buffer
;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007 Free Software Foundation, Inc.
+;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
;; Author: David Gillespie <daveg@synaptics.com>
-;; Maintainer: Jay Belanger <belanger@truman.edu>
+;; Maintainer: Jay Belanger <jay.p.belanger@gmail.com>
;; This file is part of GNU Emacs.
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY. No author or distributor
-;; accepts responsibility to anyone for the consequences of using it
-;; or for whether it serves any particular purpose or works at all,
-;; unless he says so in writing. Refer to the GNU Emacs General Public
-;; License for full details.
-
-;; Everyone is granted permission to copy, modify and redistribute
-;; GNU Emacs, but only under the conditions described in the
-;; GNU Emacs General Public License. A copy of this license is
-;; supposed to have been given to you along with GNU Emacs so you
-;; can know your rights and responsibilities. It should be in a
-;; file named COPYING. Among other things, the copyright notice
-;; and this notice must be preserved on all copies.
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
;;; Commentary:
))
-;;; Format of calc-embedded-info vector:
-;;; 0 Editing buffer.
-;;; 1 Calculator buffer.
-;;; 2 Top of current formula (marker).
-;;; 3 Bottom of current formula (marker).
-;;; 4 Top of current formula's delimiters (marker).
-;;; 5 Bottom of current formula's delimiters (marker).
-;;; 6 String representation of current formula.
-;;; 7 Non-nil if formula is embedded within a single line.
-;;; 8 Internal representation of current formula.
-;;; 9 Variable assigned by this formula, or nil.
-;;; 10 List of variables upon which this formula depends.
-;;; 11 Evaluated value of the formula, or nil.
-;;; 12 Mode settings for current formula.
-;;; 13 Local mode settings for current formula.
-;;; 14 Permanent mode settings for current formula.
-;;; 15 Global mode settings for editing buffer.
-
-
-;;; calc-embedded-active is an a-list keyed on buffers; each cdr is a
-;;; sorted list of calc-embedded-infos in that buffer. We do this
-;;; rather than using buffer-local variables because the latter are
-;;; thrown away when a buffer changes major modes.
+;; Format of calc-embedded-info vector:
+;; 0 Editing buffer.
+;; 1 Calculator buffer.
+;; 2 Top of current formula (marker).
+;; 3 Bottom of current formula (marker).
+;; 4 Top of current formula's delimiters (marker).
+;; 5 Bottom of current formula's delimiters (marker).
+;; 6 String representation of current formula.
+;; 7 Non-nil if formula is embedded within a single line.
+;; 8 Internal representation of current formula.
+;; 9 Variable assigned by this formula, or nil.
+;; 10 List of variables upon which this formula depends.
+;; 11 Evaluated value of the formula, or nil.
+;; 12 Mode settings for current formula.
+;; 13 Local mode settings for current formula.
+;; 14 Permanent mode settings for current formula.
+;; 15 Global mode settings for editing buffer.
+
+
+;; calc-embedded-active is an a-list keyed on buffers; each cdr is a
+;; sorted list of calc-embedded-infos in that buffer. We do this
+;; rather than using buffer-local variables because the latter are
+;; thrown away when a buffer changes major modes.
(defvar calc-embedded-original-modes nil
"The mode settings for Calc buffer when put in embedded mode.")
(set-buffer-modified-p (buffer-modified-p))
(calc-embedded-restore-original-modes)
(or calc-embedded-quiet
- (message "Back to %s mode" mode-name))))
+ (message "Back to %s mode" (format-mode-line mode-name)))))
(t
(if (buffer-name (aref calc-embedded-info 0))
(let ((val (save-excursion
(set-buffer (aref info 1))
(let ((calc-language nil)
- (math-expr-opers math-standard-opers))
+ (math-expr-opers (math-standard-ops)))
(math-read-expr str)))))
(if (eq (car-safe val) 'error)
(progn
(aset info 8 val)
(calc-embedded-update info 14 t t))))
+;;;###autoload
(defun calc-do-embedded-activate (calc-embed-arg cbuf)
(calc-plain-buffer-only)
(if calc-embed-arg
(provide 'calc-embed)
-;;; arch-tag: 1b8f311e-fba1-40d3-b8c3-1d6f68fd26fc
+;; Local variables:
+;; generated-autoload-file: "calc-loaddefs.el"
+;; End:
+
+;; arch-tag: 1b8f311e-fba1-40d3-b8c3-1d6f68fd26fc
;;; calc-embed.el ends here