+2014-11-14 Ivan Andrus <darthandrus@gmail.com>
+
+ * 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 <fgallina@gnu.org>
* progmodes/python.el (python-shell-virtualenv-root): Rename from
(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)
(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))))
(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))
(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)