emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/emacs-23 r100595: Fixes bug#8730, bug#8781.


From: Juanma Barranquero
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-23 r100595: Fixes bug#8730, bug#8781. Do not merge into trunk.
Date: Sun, 05 Jun 2011 02:32:23 +0200
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 100595
fixes bug(s): http://debbugs.gnu.org/8781 http://debbugs.gnu.org/8730
committer: Juanma Barranquero <address@hidden>
branch nick: emacs-23
timestamp: Sun 2011-06-05 02:32:23 +0200
message:
  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.
modified:
  lisp/ChangeLog
  lisp/progmodes/python.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-06-04 23:06:53 +0000
+++ b/lisp/ChangeLog    2011-06-05 00:32:23 +0000
@@ -1,3 +1,8 @@
+2011-06-05  Juanma Barranquero  <address@hidden>
+
+       * progmodes/python.el (python-after-info-look): Add autoload cookie.
+       (python-unload-function): New function. (Bug#8730, bug#8781)
+
 2011-06-04  Reuben Thomas <address@hidden>
 
        * progmodes/flymake.el (flymake-compilation-prevents-syntax-check):

=== modified file 'lisp/progmodes/python.el'
--- a/lisp/progmodes/python.el  2011-05-13 12:44:48 +0000
+++ b/lisp/progmodes/python.el  2011-06-05 00:32:23 +0000
@@ -1914,6 +1914,7 @@
 
 (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 @@
 (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)
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]