Subject: bug#42397: [PATCH 04/14] * lisp/epa.el (epa--derived-mode-p): Remove unnecessary alias.

From: Jonas Bernoulli <[email-masked]>
Date: Thu, 16 Jul 2020 16:54:46 +0200

`derived-mode-p' was added twenty years ago in
6ad501012b9a9ddc26dd8ce1cef8332ee16d87df and by
now we can just assume that it exists.
---
 lisp/epa.el | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/lisp/epa.el b/lisp/epa.el
index 3c7dd8309a..fc7ad5efab 100644
--- a/lisp/epa.el
+++ b/lisp/epa.el
@@ -1105,17 +1105,6 @@ epa-sign-region
 				 'start-open t
 				 'end-open t)))))
 
-(defalias 'epa--derived-mode-p
-  (if (fboundp 'derived-mode-p)
-      #'derived-mode-p
-    (lambda (&rest modes)
-      "Non-nil if the current major mode is derived from one of MODES.
-Uses the `derived-mode-parent' property of the symbol to trace backwards."
-      (let ((parent major-mode))
-        (while (and (not (memq parent modes))
-                    (setq parent (get parent 'derived-mode-parent))))
-        parent))))
-
 ;;;###autoload
 (defun epa-encrypt-region (start end recipients sign signers)
   "Encrypt the current region between START and END for RECIPIENTS.
@@ -1227,8 +1216,7 @@ epa-import-keys
     (if (epg-context-result-for context 'import)
 	(epa-display-info (epg-import-result-to-string
 			   (epg-context-result-for context 'import))))
-    ;; FIXME: Why not use the (otherwise unused) epa--derived-mode-p?
-    (if (eq major-mode 'epa-key-list-mode)
+    (if (derived-mode-p 'epa-key-list-mode)
 	(apply #'epa--list-keys epa-list-keys-arguments))))
 
 ;;;###autoload
-- 
2.26.0