emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/ivy-hydra 387390b 312/395: Prefer derived-mode-p for ma


From: Basil L. Contovounesios
Subject: [elpa] externals/ivy-hydra 387390b 312/395: Prefer derived-mode-p for major-mode comparisons
Date: Thu, 25 Feb 2021 08:32:27 -0500 (EST)

branch: externals/ivy-hydra
commit 387390b1026b7087bbb4df2e6b778ebe5d9e1b8d
Author: Basil L. Contovounesios <contovob@tcd.ie>
Commit: Basil L. Contovounesios <contovob@tcd.ie>

    Prefer derived-mode-p for major-mode comparisons
    
    * ivy.el (ivy-completion-in-region): Use derived-mode-p.
---
 ivy.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ivy.el b/ivy.el
index de6faf0..de2c95a 100644
--- a/ivy.el
+++ b/ivy.el
@@ -2579,13 +2579,14 @@ See `completion-in-region' for further information."
                  (setq initial nil)
                  (setq predicate nil)
                  (setq collection comps))
-               (unless (memq major-mode '(lisp-interaction-mode 
emacs-lisp-mode))
+               (unless (derived-mode-p #'emacs-lisp-mode)
                  (setq collection comps)
                  (setq predicate nil))
                (ivy-read (format "(%s): " str) collection
                          :predicate predicate
                          :initial-input (concat
-                                         (and (memq major-mode 
'(lisp-interaction-mode emacs-lisp-mode)) "^")
+                                         (and (derived-mode-p 
#'emacs-lisp-mode)
+                                              "^")
                                          initial)
                          :action #'ivy-completion-in-region-action
                          :unwind (lambda ()



reply via email to

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