aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes
diff options
context:
space:
mode:
authorIvan Andrus2014-11-01 12:33:02 -0600
committerIvan Andrus2014-11-14 13:54:10 -0700
commitf20a19df87444d1977f63dd5b3fc42f4f2d50aa2 (patch)
tree602dc3e4e4dd1f6a3da21352c3b133d83c074791 /lisp/progmodes
parenta6a43d654a5f2a139c69f75f6d46383bf58b3a77 (diff)
downloademacs-f20a19df87444d1977f63dd5b3fc42f4f2d50aa2.tar.gz
emacs-f20a19df87444d1977f63dd5b3fc42f4f2d50aa2.zip
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'.
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/python.el8
1 files changed, 4 insertions, 4 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 122f4ec9460..2fcbe6430f2 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."
2224 (when (and python-shell--font-lock-buffer 2224 (when (and python-shell--font-lock-buffer
2225 (buffer-live-p python-shell--font-lock-buffer)) 2225 (buffer-live-p python-shell--font-lock-buffer))
2226 (kill-buffer python-shell--font-lock-buffer) 2226 (kill-buffer python-shell--font-lock-buffer)
2227 (when (eq major-mode 'inferior-python-mode) 2227 (when (derived-mode-p 'inferior-python-mode)
2228 (setq python-shell--font-lock-buffer nil))))) 2228 (setq python-shell--font-lock-buffer nil)))))
2229 2229
2230(defmacro python-shell-font-lock-with-font-lock-buffer (&rest body) 2230(defmacro python-shell-font-lock-with-font-lock-buffer (&rest body)
@@ -2241,7 +2241,7 @@ also `with-current-buffer'."
2241 (set-buffer python-shell--font-lock-buffer) 2241 (set-buffer python-shell--font-lock-buffer)
2242 (set (make-local-variable 'delay-mode-hooks) t) 2242 (set (make-local-variable 'delay-mode-hooks) t)
2243 (let ((python-indent-guess-indent-offset nil)) 2243 (let ((python-indent-guess-indent-offset nil))
2244 (when (not (eq major-mode 'python-mode)) 2244 (when (not (derived-mode-p 'python-mode))
2245 (python-mode)) 2245 (python-mode))
2246 ,@body)))) 2246 ,@body))))
2247 2247
@@ -2504,7 +2504,7 @@ startup."
2504(defun python-shell-get-buffer () 2504(defun python-shell-get-buffer ()
2505 "Return inferior Python buffer for current buffer. 2505 "Return inferior Python buffer for current buffer.
2506If current buffer is in `inferior-python-mode', return it." 2506If current buffer is in `inferior-python-mode', return it."
2507 (if (eq major-mode 'inferior-python-mode) 2507 (if (derived-mode-p 'inferior-python-mode)
2508 (current-buffer) 2508 (current-buffer)
2509 (let* ((dedicated-proc-name (python-shell-get-process-name t)) 2509 (let* ((dedicated-proc-name (python-shell-get-process-name t))
2510 (dedicated-proc-buffer-name (format "*%s*" dedicated-proc-name)) 2510 (dedicated-proc-buffer-name (format "*%s*" dedicated-proc-name))
@@ -3481,7 +3481,7 @@ The skeleton will be bound to python-skeleton-NAME."
3481(defun python-ffap-module-path (module) 3481(defun python-ffap-module-path (module)
3482 "Function for `ffap-alist' to return path for MODULE." 3482 "Function for `ffap-alist' to return path for MODULE."
3483 (let ((process (or 3483 (let ((process (or
3484 (and (eq major-mode 'inferior-python-mode) 3484 (and (derived-mode-p 'inferior-python-mode)
3485 (get-buffer-process (current-buffer))) 3485 (get-buffer-process (current-buffer)))
3486 (python-shell-get-process)))) 3486 (python-shell-get-process))))
3487 (if (not process) 3487 (if (not process)