diff options
| author | Juanma Barranquero | 2011-06-05 02:32:23 +0200 |
|---|---|---|
| committer | Juanma Barranquero | 2011-06-05 02:32:23 +0200 |
| commit | 499719b7762b7dea99f0306b9d907ba50432215e (patch) | |
| tree | 70196b4c268be0ed13fb3ecb41471aa654829e68 /lisp/progmodes/python.el | |
| parent | b1adde906f7265d93b392a7ed2da37df39c65ae1 (diff) | |
| download | emacs-499719b7762b7dea99f0306b9d907ba50432215e.tar.gz emacs-499719b7762b7dea99f0306b9d907ba50432215e.zip | |
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.
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 86f82432578..f2dbdb5a013 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -1914,6 +1914,7 @@ instance. Assumes an inferior Python is running." | |||
| 1914 | 1914 | ||
| 1915 | (declare-function info-lookup-maybe-add-help "info-look" (&rest arg)) | 1915 | (declare-function info-lookup-maybe-add-help "info-look" (&rest arg)) |
| 1916 | 1916 | ||
| 1917 | ;;;###autoload | ||
| 1917 | (defun python-after-info-look () | 1918 | (defun python-after-info-look () |
| 1918 | "Set up info-look for Python. | 1919 | "Set up info-look for Python. |
| 1919 | Used with `eval-after-load'." | 1920 | Used with `eval-after-load'." |
| @@ -2895,6 +2896,32 @@ filter." | |||
| 2895 | (defun python-sentinel (proc msg) | 2896 | (defun python-sentinel (proc msg) |
| 2896 | (setq overlay-arrow-position nil)) | 2897 | (setq overlay-arrow-position nil)) |
| 2897 | 2898 | ||
| 2899 | (defun python-unload-function () | ||
| 2900 | "Unload the Python library." | ||
| 2901 | (let* ((default-mode (default-value 'major-mode)) | ||
| 2902 | (inferior-mode (or (get 'inferior-python-mode 'derived-mode-parent) | ||
| 2903 | default-mode))) | ||
| 2904 | (dolist (buffer (buffer-list)) | ||
| 2905 | (set-buffer buffer) | ||
| 2906 | (cond ((memq major-mode '(python-mode jython-mode)) | ||
| 2907 | (funcall default-mode)) | ||
| 2908 | ((eq major-mode 'inferior-python-mode) | ||
| 2909 | (remove-hook 'comint-preoutput-filter-functions | ||
| 2910 | 'python-preoutput-filter t) | ||
| 2911 | (remove-hook 'comint-output-filter-functions | ||
| 2912 | 'python-comint-output-filter-function t) | ||
| 2913 | (let ((proc (get-buffer-process (current-buffer)))) | ||
| 2914 | (if (not proc) | ||
| 2915 | (funcall default-mode) | ||
| 2916 | (set-process-sentinel proc nil) | ||
| 2917 | (funcall inferior-mode))))))) | ||
| 2918 | (setq minor-mode-alist (assq-delete-all 'python-pdbtrack-is-tracking-p | ||
| 2919 | minor-mode-alist)) | ||
| 2920 | (dolist (error '("^No symbol" "^Can't shift all lines enough")) | ||
| 2921 | (setq debug-ignored-errors (delete error debug-ignored-errors))) | ||
| 2922 | ;; continue standard unloading | ||
| 2923 | nil) | ||
| 2924 | |||
| 2898 | (provide 'python) | 2925 | (provide 'python) |
| 2899 | (provide 'python-21) | 2926 | (provide 'python-21) |
| 2900 | 2927 | ||