[Top][All Lists]

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

[debbugs-tracker] bug#18854: closed (25.0.50; Inferior Python mode shoul

From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#18854: closed (25.0.50; Inferior Python mode should use derived-mode-p [with patch])
Date: Sat, 15 Nov 2014 19:06:02 +0000

Your message dated Sat, 15 Nov 2014 16:05:47 -0300
with message-id <address@hidden>
and subject line 
has caused the debbugs.gnu.org bug report #18854,
regarding 25.0.50; Inferior Python mode should use derived-mode-p [with patch]
to be marked as done.

(If you believe you have received this mail in error, please contact

18854: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18854
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 25.0.50; Inferior Python mode should use derived-mode-p [with patch] Date: Mon, 27 Oct 2014 16:02:15 +0000 User-agent: Microsoft-MacOutlook/
I maintain sage-mode which is implemented as a derived mode of
python-mode.  Likewise with inferior-sage-mode and inferior-python-mode.
There are some places in python-mode where major-mode is checked with
eq.  This causes some weird breakage when using sage-mode, particularly
it causes inferior-sage-mode to hang in some situations [1].  I could
probably work around it on the sage-mode side, but I think it makes
sense to use derived-mode-p instead, so I'm including this patch


diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index b230992..06f1ffe 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -2221,7 +2221,7 @@ Signals an error if no shell buffer is available for current buffer."
     (when (and python-shell--font-lock-buffer
                (buffer-live-p python-shell--font-lock-buffer))
       (kill-buffer python-shell--font-lock-buffer)
-      (when (eq major-mode 'inferior-python-mode)
+      (when (derived-mode-p 'inferior-python-mode)
         (setq python-shell--font-lock-buffer nil)))))
(defmacro python-shell-font-lock-with-font-lock-buffer (&rest body)
@@ -2238,7 +2238,7 @@ also `with-current-buffer'."
        (set-buffer python-shell--font-lock-buffer)
        (set (make-local-variable 'delay-mode-hooks) t)
        (let ((python-indent-guess-indent-offset nil))
-         (when (not (eq major-mode 'python-mode))
+         (when (not (derived-mode-p 'python-mode))
@@ -2501,7 +2501,7 @@ startup."
(defun python-shell-get-buffer ()
   "Return inferior Python buffer for current buffer.
If current buffer is in `inferior-python-mode', return it."
-  (if (eq major-mode 'inferior-python-mode)
+  (if (derived-mode-p 'inferior-python-mode)
     (let* ((dedicated-proc-name (python-shell-get-process-name t))
            (dedicated-proc-buffer-name (format "*%s*" dedicated-proc-name))
@@ -3482,7 +3482,7 @@ The skeleton will be bound to python-skeleton-NAME."
(defun python-ffap-module-path (module)
   "Function for `ffap-alist' to return path for MODULE."
   (let ((process (or
-                  (and (eq major-mode 'inferior-python-mode)
+                  (and (derived-mode-p 'inferior-python-mode)
                        (get-buffer-process (current-buffer)))
     (if (not process)

--- End Message ---
--- Begin Message --- Subject: Date: Sat, 15 Nov 2014 16:05:47 -0300 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
Closing just for cleanup.  I see this merged on master at f20a19d.

--- End Message ---

reply via email to

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