From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jonas Bernoulli Newsgroups: gmane.emacs.bugs Subject: bug#42397: [PATCH 04/14] * lisp/epa.el (epa--derived-mode-p): Remove unnecessary alias. Date: Thu, 16 Jul 2020 16:54:46 +0200 Message-ID: <20200716145456.17531-4-jonas@bernoul.li> References: <20200716145456.17531-1-jonas@bernoul.li> <20200716145456.17531-2-jonas@bernoul.li> <20200716145456.17531-3-jonas@bernoul.li> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39384"; mail-complaints-to="usenet@ciao.gmane.io" Cc: jonas@bernoul.li To: 42397@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 16 16:57:43 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jw5KQ-000A7y-Fr for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 16 Jul 2020 16:57:42 +0200 Original-Received: from localhost ([::1]:45770 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jw5KP-00076N-Cs for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 16 Jul 2020 10:57:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51994) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jw5Iq-0006ET-5G for bug-gnu-emacs@gnu.org; Thu, 16 Jul 2020 10:56:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44165) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jw5Ip-0002Qm-RH for bug-gnu-emacs@gnu.org; Thu, 16 Jul 2020 10:56:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jw5Ip-0007eW-R1 for bug-gnu-emacs@gnu.org; Thu, 16 Jul 2020 10:56:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jonas Bernoulli Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 16 Jul 2020 14:56:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42397 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 42397-submit@debbugs.gnu.org id=B42397.159491131529216 (code B ref 42397); Thu, 16 Jul 2020 14:56:03 +0000 Original-Received: (at 42397) by debbugs.gnu.org; 16 Jul 2020 14:55:15 +0000 Original-Received: from localhost ([127.0.0.1]:55681 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jw5I3-0007bA-1p for submit@debbugs.gnu.org; Thu, 16 Jul 2020 10:55:15 -0400 Original-Received: from mail.hostpark.net ([212.243.197.30]:59940) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jw5I1-0007b0-Rw for 42397@debbugs.gnu.org; Thu, 16 Jul 2020 10:55:14 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.hostpark.net (Postfix) with ESMTP id 2CA20160BA; Thu, 16 Jul 2020 16:55:13 +0200 (CEST) X-Virus-Scanned: by Hostpark/NetZone Mailprotection at hostpark.net Original-Received: from mail.hostpark.net ([127.0.0.1]) by localhost (mail1.hostpark.net [127.0.0.1]) (amavisd-new, port 10124) with ESMTP id NhuJVlSjoanA; Thu, 16 Jul 2020 16:55:13 +0200 (CEST) Original-Received: from customer (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.hostpark.net (Postfix) with ESMTPSA id F00E4160AE; Thu, 16 Jul 2020 16:55:12 +0200 (CEST) X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200716145456.17531-3-jonas@bernoul.li> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:183057 Archived-At: `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