1 |
;; Calculator for GNU Emacs, part II [calc-sel.el] |
;;; calc-sel.el --- data selection functions for Calc |
2 |
|
|
3 |
;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. |
;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. |
4 |
;; Written by Dave Gillespie, daveg@synaptics.com. |
|
5 |
|
;; Author: David Gillespie <daveg@synaptics.com> |
6 |
|
;; Maintainer: Colin Walters <walters@debian.org> |
7 |
|
|
8 |
;; This file is part of GNU Emacs. |
;; This file is part of GNU Emacs. |
9 |
|
|
22 |
;; file named COPYING. Among other things, the copyright notice |
;; file named COPYING. Among other things, the copyright notice |
23 |
;; and this notice must be preserved on all copies. |
;; and this notice must be preserved on all copies. |
24 |
|
|
25 |
|
;;; Commentary: |
26 |
|
|
27 |
|
;;; Code: |
28 |
|
|
29 |
;; This file is autoloaded from calc-ext.el. |
;; This file is autoloaded from calc-ext.el. |
30 |
(require 'calc-ext) |
(require 'calc-ext) |
36 |
|
|
37 |
;;; Selection commands. |
;;; Selection commands. |
38 |
|
|
39 |
|
(defvar calc-keep-selection t) |
40 |
|
|
41 |
(defun calc-select-here (num &optional once keep) |
(defun calc-select-here (num &optional once keep) |
42 |
(interactive "P") |
(interactive "P") |
43 |
(calc-wrapper |
(calc-wrapper |
356 |
"Selection treats a+b+c as a sum of three terms" |
"Selection treats a+b+c as a sum of three terms" |
357 |
"Selection treats a+b+c as (a+b)+c")))) |
"Selection treats a+b+c as (a+b)+c")))) |
358 |
|
|
359 |
|
(defvar calc-selection-cache-entry nil) |
360 |
(defun calc-prepare-selection (&optional num) |
(defun calc-prepare-selection (&optional num) |
361 |
(or num (setq num (calc-locate-cursor-element (point)))) |
(or num (setq num (calc-locate-cursor-element (point)))) |
362 |
(setq calc-selection-true-num num |
(setq calc-selection-true-num num |
379 |
(length calc-left-label) |
(length calc-left-label) |
380 |
(if calc-line-numbering 4 0)))))) |
(if calc-line-numbering 4 0)))))) |
381 |
(calc-preserve-point)) |
(calc-preserve-point)) |
|
(setq calc-selection-cache-entry nil) |
|
382 |
|
|
383 |
;;; The following ensures that no two subformulas will be "eq" to each other! |
;;; The following ensures that no two subformulas will be "eq" to each other! |
384 |
(defun calc-encase-atoms (x) |
(defun calc-encase-atoms (x) |
515 |
(t (calc-sel-error)))) |
(t (calc-sel-error)))) |
516 |
(calc-pop-stack n m t) |
(calc-pop-stack n m t) |
517 |
(calc-push-list vals m))) |
(calc-push-list vals m))) |
|
(setq calc-keep-selection t) |
|
518 |
|
|
519 |
(defun calc-delete-selection (n) |
(defun calc-delete-selection (n) |
520 |
(let ((entry (calc-top n 'entry))) |
(let ((entry (calc-top n 'entry))) |