]> 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 5e5ae8166dbe882f812112a84baa58d7ca219f2a..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 "\C-y" 'calc-yank)
-  (define-key calc-mode-map [mouse-2] 'calc-yank)
+  (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)
   (define-key calc-mode-map "vx" 'calc-index)
   (define-key calc-mode-map "vA" 'calc-apply)
   (define-key calc-mode-map "vC" 'calc-cross)
+  (define-key calc-mode-map "vK" 'calc-kron)
   (define-key calc-mode-map "vD" 'calc-mdet)
   (define-key calc-mode-map "vE" 'calc-set-enumerate)
   (define-key calc-mode-map "vF" 'calc-set-floor)
@@ -940,7 +940,7 @@ math-units-in-expr-p)
 
  ("calc-vec" calcFunc-append calcFunc-appendrev
 calcFunc-arrange calcFunc-cnorm calcFunc-cons calcFunc-cross
-calcFunc-ctrn calcFunc-cvec calcFunc-diag calcFunc-find
+calcFunc-kron calcFunc-ctrn calcFunc-cvec calcFunc-diag calcFunc-find
 calcFunc-getdiag calcFunc-grade calcFunc-head calcFunc-histogram
 calcFunc-idn calcFunc-index calcFunc-mcol calcFunc-mdims
 calcFunc-mrcol calcFunc-mrow calcFunc-mrrow calcFunc-pack
@@ -959,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)
 
 ))
@@ -1145,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
@@ -1163,7 +1165,7 @@ calc-remove-units calc-simplify-units calc-undefine-unit
 calc-view-units-table)
 
  ("calc-vec" calc-arrange-vector calc-build-vector calc-cnorm
-calc-conj-transpose calc-cons calc-cross calc-diag
+calc-conj-transpose calc-cons calc-cross calc-kron calc-diag
 calc-display-strings calc-expand-vector calc-grade calc-head
 calc-histogram calc-ident calc-index calc-mask-vector calc-mcol
 calc-mrow calc-pack calc-pack-bits calc-remove-duplicates
@@ -1444,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)
@@ -1650,10 +1652,15 @@ calc-kill calc-kill-region calc-yank))))
    (calc-handle-whys)))
 
 
+(defvar calc-extended-command-history nil
+  "The history list for calc-execute-extended-command.")
+
 (defun calc-execute-extended-command (n)
   (interactive "P")
   (let* ((prompt (concat (calc-num-prefix-name n) "M-x "))
-        (cmd (intern (completing-read prompt obarray 'commandp t "calc-"))))
+        (cmd (intern 
+               (completing-read prompt obarray 'commandp t "calc-" 
+                                'calc-extended-command-history))))
     (setq prefix-arg n)
     (command-execute cmd)))
 
@@ -3437,5 +3444,5 @@ A key may contain additional specs for Inverse, Hyperbolic, and Inv+Hyp.")
 
 (provide 'calc-ext)
 
-;;; arch-tag: 1814ba7f-a390-49dc-9e25-a5adc205e97e
+;; arch-tag: 1814ba7f-a390-49dc-9e25-a5adc205e97e
 ;;; calc-ext.el ends here