emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] [emacs] 01/01: Use derived-mode-p in python.el instead of


From: Ivan Andrus
Subject: [Emacs-diffs] [emacs] 01/01: Use derived-mode-p in python.el instead of equality test on major-mode
Date: Fri, 14 Nov 2014 20:57:29 +0000

gvol pushed a commit to branch master
in repository emacs.

commit f20a19df87444d1977f63dd5b3fc42f4f2d50aa2
Author: Ivan Andrus <address@hidden>
Date:   Sat Nov 1 12:33:02 2014 -0600

    Use derived-mode-p in python.el instead of equality test on major-mode
    
    * progmodes/python.el (python-shell-font-lock-kill-buffer):
    (python-shell-font-lock-with-font-lock-buffer)
    (python-shell-get-buffer, python-ffap-module-path): Use
    `derived-mode-p' instead of equality test on `major-mode'.
---
 lisp/ChangeLog           |    7 +++++++
 lisp/progmodes/python.el |    8 ++++----
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c3b879a..e2e5352 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
+2014-11-14  Ivan Andrus  <address@hidden>
+
+       * progmodes/python.el (python-shell-font-lock-kill-buffer):
+       (python-shell-font-lock-with-font-lock-buffer)
+       (python-shell-get-buffer, python-ffap-module-path): Use
+       `derived-mode-p' instead of equality test on `major-mode'.
+
 2014-11-14  Fabián Ezequiel Gallina  <address@hidden>
 
        * progmodes/python.el (python-shell-virtualenv-root): Rename from
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 122f4ec..2fcbe64 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -2224,7 +2224,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)
@@ -2241,7 +2241,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))
            (python-mode))
          ,@body))))
 
@@ -2504,7 +2504,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)
       (current-buffer)
     (let* ((dedicated-proc-name (python-shell-get-process-name t))
            (dedicated-proc-buffer-name (format "*%s*" dedicated-proc-name))
@@ -3481,7 +3481,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)))
                   (python-shell-get-process))))
     (if (not process)



reply via email to

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