summaryrefslogtreecommitdiff
path: root/lisp/ses.el
diff options
context:
space:
mode:
authorJuanma Barranquero <lekktu@gmail.com>2007-10-30 00:21:42 +0000
committerJuanma Barranquero <lekktu@gmail.com>2007-10-30 00:21:42 +0000
commit7981ad6baaa4653414ad2ef41e35ded2dadfaed8 (patch)
tree31605b962388c329714bb51d870618a807027c81 /lisp/ses.el
parent352ddc78d31acd77c962d3776889c73981b01dcf (diff)
downloademacs-7981ad6baaa4653414ad2ef41e35ded2dadfaed8.tar.gz
(ses-unload-function): New function.
Diffstat (limited to 'lisp/ses.el')
-rw-r--r--lisp/ses.el15
1 files changed, 14 insertions, 1 deletions
diff --git a/lisp/ses.el b/lisp/ses.el
index 3f904fde0d2..2b6b452500e 100644
--- a/lisp/ses.el
+++ b/lisp/ses.el
@@ -2908,7 +2908,7 @@ TEST is evaluated."
;;----------------------------------------------------------------------------
;;These functions use the variables 'row' and 'col' that are
-;;dynamically bound by ses-print-cell. We define these varables at
+;;dynamically bound by ses-print-cell. We define these variables at
;;compile-time to make the compiler happy.
(eval-when-compile
(dolist (x '(row col))
@@ -2967,6 +2967,19 @@ current column and continues until the next nonblank column."
(dolist (x (cons 'ses-unsafe ses-standard-printer-functions))
(put x 'side-effect-free t))
+(defun ses-unload-function ()
+ "Unload the Simple Emacs Spreadsheet."
+ (dolist (fun '(copy-region-as-kill yank))
+ (ad-remove-advice fun 'around (intern (concat "ses-" (symbol-name fun))))
+ (ad-update fun))
+ (save-current-buffer
+ (dolist (buf (buffer-list))
+ (set-buffer buf)
+ (when (eq major-mode 'ses-mode)
+ (funcall (or default-major-mode 'fundamental-mode)))))
+ ;; continue standard unloading
+ nil)
+
(provide 'ses)
;; arch-tag: 88c1ccf0-4293-4824-8c5d-0757b52217f3