-;; Calculator for GNU Emacs, part II [calc-sel-2.el]
-;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc.
-;; Written by Dave Gillespie, daveg@synaptics.com.
+;;; calcsel2.el --- selection functions for Calc
+
+;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2002, 2003, 2004,
+;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+;; Author: David Gillespie <daveg@synaptics.com>
+;; 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.
+;; 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.
-;; 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.
+;; 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:
+;;; Code:
;; This file is autoloaded from calc-ext.el.
-(require 'calc-ext)
+(require 'calc-ext)
(require 'calc-macs)
-(defun calc-Need-calc-sel-2 () nil)
+;; The variable calc-keep-selection is declared and set in calc-sel.el.
+(defvar calc-keep-selection)
+;; The variable calc-sel-reselect is local to the methods below,
+;; but is used by some functions in calc-sel.el which are called
+;; by the functions below.
(defun calc-commute-left (arg)
(interactive "p")
(calc-wrapper
(calc-preserve-point)
(let ((num (max 1 (calc-locate-cursor-element (point))))
- (reselect calc-keep-selection))
+ (calc-sel-reselect calc-keep-selection))
(if (= arg 0) (setq arg nil))
(while (or (null arg) (>= (setq arg (1- arg)) 0))
(let* ((entry (calc-top num 'entry))
(if (null new)
(if arg
(error "Term is already leftmost")
- (or reselect
+ (or calc-sel-reselect
(calc-pop-push-list 1 (list expr) num '(nil)))
(setq arg 0))
(calc-pop-push-record-list
1 "left"
(list (calc-replace-sub-formula expr parent new))
num
- (list (and (or (not (eq arg 0)) reselect)
+ (list (and (or (not (eq arg 0)) calc-sel-reselect)
sel))))))))))
(defun calc-commute-right (arg)
(calc-wrapper
(calc-preserve-point)
(let ((num (max 1 (calc-locate-cursor-element (point))))
- (reselect calc-keep-selection))
+ (calc-sel-reselect calc-keep-selection))
(if (= arg 0) (setq arg nil))
(while (or (null arg) (>= (setq arg (1- arg)) 0))
(let* ((entry (calc-top num 'entry))
(if (null new)
(if arg
(error "Term is already rightmost")
- (or reselect
+ (or calc-sel-reselect
(calc-pop-push-list 1 (list expr) num '(nil)))
(setq arg 0))
(calc-pop-push-record-list
1 "rght"
(list (calc-replace-sub-formula expr parent new))
num
- (list (and (or (not (eq arg 0)) reselect)
+ (list (and (or (not (eq arg 0)) calc-sel-reselect)
sel))))))))))
(defun calc-build-assoc-term (op lhs rhs)
(calc-wrapper
(calc-preserve-point)
(let* ((num (max 1 (calc-locate-cursor-element (point))))
- (reselect calc-keep-selection)
+ (calc-sel-reselect calc-keep-selection)
(entry (calc-top num 'entry))
(expr (car entry))
(sel (or (calc-auto-selection entry) expr)))
(list (calc-replace-sub-formula
expr sel (nth 1 sel)))
num
- (list (and reselect (nth 1 sel)))))))
+ (list (and calc-sel-reselect (nth 1 sel)))))))
(defun calc-sel-isolate ()
(interactive)
(calc-slow-wrapper
(calc-preserve-point)
(let* ((num (max 1 (calc-locate-cursor-element (point))))
- (reselect calc-keep-selection)
+ (calc-sel-reselect calc-keep-selection)
(entry (calc-top num 'entry))
(expr (car entry))
(sel (or (calc-auto-selection entry) (error "No selection")))
(list (calc-replace-sub-formula
expr eqn soln))
num
- (list (and reselect sel)))
+ (list (and calc-sel-reselect sel)))
(calc-handle-whys))))
(defun calc-sel-commute (many)
(interactive "P")
(calc-rewrite-selection "InvertRules" many "jinv"))
+(provide 'calcsel2)
+
+;; arch-tag: 7c5b8d65-b8f0-45d9-820d-9930f8ee114b
;;; calcsel2.el ends here