Fixes bug#8730, bug#8781. Do not merge into trunk.

lisp/progmodes/python.el (python-after-info-look): Add autoload cookie.
(python-unload-function): New function.
This commit is contained in:
Juanma Barranquero 2011-06-05 02:32:23 +02:00
parent b1adde906f
commit 499719b776
2 changed files with 32 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2011-06-05 Juanma Barranquero <lekktu@gmail.com>
* progmodes/python.el (python-after-info-look): Add autoload cookie.
(python-unload-function): New function. (Bug#8730, bug#8781)
2011-06-04 Reuben Thomas <rrt@sc3d.org>
* progmodes/flymake.el (flymake-compilation-prevents-syntax-check):

View file

@ -1914,6 +1914,7 @@ instance. Assumes an inferior Python is running."
(declare-function info-lookup-maybe-add-help "info-look" (&rest arg))
;;;###autoload
(defun python-after-info-look ()
"Set up info-look for Python.
Used with `eval-after-load'."
@ -2895,6 +2896,32 @@ filter."
(defun python-sentinel (proc msg)
(setq overlay-arrow-position nil))
(defun python-unload-function ()
"Unload the Python library."
(let* ((default-mode (default-value 'major-mode))
(inferior-mode (or (get 'inferior-python-mode 'derived-mode-parent)
default-mode)))
(dolist (buffer (buffer-list))
(set-buffer buffer)
(cond ((memq major-mode '(python-mode jython-mode))
(funcall default-mode))
((eq major-mode 'inferior-python-mode)
(remove-hook 'comint-preoutput-filter-functions
'python-preoutput-filter t)
(remove-hook 'comint-output-filter-functions
'python-comint-output-filter-function t)
(let ((proc (get-buffer-process (current-buffer))))
(if (not proc)
(funcall default-mode)
(set-process-sentinel proc nil)
(funcall inferior-mode)))))))
(setq minor-mode-alist (assq-delete-all 'python-pdbtrack-is-tracking-p
minor-mode-alist))
(dolist (error '("^No symbol" "^Can't shift all lines enough"))
(setq debug-ignored-errors (delete error debug-ignored-errors)))
;; continue standard unloading
nil)
(provide 'python)
(provide 'python-21)