# HG changeset patch # User Juanma Barranquero # Date 1193703702 0 # Node ID 7ddb2a8509d70beafea5b2e20e3c29b10df9645a # Parent 60995c957b44012f03dbaeec2a8949f7ee822360 (ses-unload-function): New function. diff -r 60995c957b44 -r 7ddb2a8509d7 lisp/ses.el --- a/lisp/ses.el Tue Oct 30 00:20:44 2007 +0000 +++ b/lisp/ses.el Tue Oct 30 00:21:42 2007 +0000 @@ -2908,7 +2908,7 @@ ;;---------------------------------------------------------------------------- ;;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 @@ (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