]> code.delx.au - gnu-emacs/blobdiff - lisp/calc/calc-ext.el
* view.el (view-recenter): Allow recenter to compute window height
[gnu-emacs] / lisp / calc / calc-ext.el
index bab24effe7f94111d4e91c59f882624b88e129cf..d97cd7971ea650c0ac67daf44a134dc07fcc1dff 100644 (file)
@@ -1,17 +1,17 @@
 ;;; calc-ext.el --- various extension functions for Calc
 
 ;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;;   2005, 2006, 2007, 2008, 2009 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
+;; 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.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -19,9 +19,7 @@
 ;; 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.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
   (define-key calc-mode-map "\M-k" 'calc-copy-as-kill)
   (define-key calc-mode-map "\C-w" 'calc-kill-region)
   (define-key calc-mode-map "\M-w" 'calc-copy-region-as-kill)
+  (define-key calc-mode-map "\M-\C-w" 'kill-ring-save)
   (define-key calc-mode-map "\C-_" 'calc-undo)
   (define-key calc-mode-map "\C-xu" 'calc-undo)
   (define-key calc-mode-map "\M-\C-m" 'calc-last-args)
   (define-key calc-mode-map "mX" 'calc-load-everything)
 
   (define-key calc-mode-map "r" nil)
+  (define-key calc-mode-map "ri" 'calc-insert-register)
+  (define-key calc-mode-map "rs" 'calc-copy-to-register)
   (define-key calc-mode-map "r?" 'calc-r-prefix-help)
 
   (define-key calc-mode-map "s" nil)
@@ -958,6 +959,8 @@ math-read-brackets math-reduce-cols math-reduce-vec math-transpose)
 
  ("calc-yank" calc-alg-edit calc-clean-newlines
 calc-do-grab-rectangle calc-do-grab-region calc-finish-stack-edit
+calc-copy-to-register calc-insert-register 
+calc-append-to-register calc-prepend-to-register
 calc-force-refresh calc-locate-cursor-element calc-show-edit-buffer)
 
 ))
@@ -1144,7 +1147,7 @@ calc-store-times calc-subscript calc-unstore)
 
  ("calc-stuff" calc-clean calc-clean-num calc-flush-caches
 calc-less-recursion-depth calc-more-recursion-depth calc-num-prefix
-calc-version calc-why)
+calc-why)
 
  ("calc-trail" calc-trail-backward calc-trail-first calc-trail-forward
 calc-trail-in calc-trail-isearch-backward calc-trail-isearch-forward
@@ -1443,26 +1446,26 @@ calc-kill calc-kill-region calc-yank))))
         (if (boundp 'overriding-terminal-local-map)
             (setq overriding-terminal-local-map calc-fancy-prefix-map)
           (let ((event (calc-read-key t)))
-            (if (eq (setq last-command-char (car event)) ?\C-u)
+            (if (eq (setq last-command-event (car event)) ?\C-u)
                 (universal-argument)
-              (if (or (not (integerp last-command-char))
-                      (and (>= last-command-char 0) (< last-command-char ? )
-                           (not (memq last-command-char '(?\e)))))
+              (if (or (not (integerp last-command-event))
+                      (and (>= last-command-event 0) (< last-command-event ? )
+                           (not (memq last-command-event '(?\e)))))
                   (calc-wrapper))  ; clear flags if not a Calc command.
                (setq last-command-event (cdr event))
-              (if (or (not (integerp last-command-char))
-                      (eq last-command-char ?-))
+              (if (or (not (integerp last-command-event))
+                      (eq last-command-event ?-))
                   (calc-unread-command)
                 (digit-argument n))))))))
 
 (defun calc-fancy-prefix-other-key (arg)
   (interactive "P")
   (if (and
-       (not (eq last-command-char 'tab))
-       (not (eq last-command-char 'M-tab))
-       (or (not (integerp last-command-char))
-           (and (>= last-command-char 0) (< last-command-char ? )
-                (not (eq last-command-char meta-prefix-char)))))
+       (not (eq last-command-event 'tab))
+       (not (eq last-command-event 'M-tab))
+       (or (not (integerp last-command-event))
+           (and (>= last-command-event 0) (< last-command-event ? )
+                (not (eq last-command-event meta-prefix-char)))))
      (calc-wrapper))  ; clear flags if not a Calc command.
   (setq prefix-arg arg)
   (calc-unread-command)