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#41276: [PATCH v2 5/8] Drop unnecessary backward compatibility aliases Date: Tue, 7 Jul 2020 17:47:36 +0200 Message-ID: <20200707154739.1829-6-jonas@bernoul.li> References: <20200707154739.1829-1-jonas@bernoul.li> <20200707154739.1829-2-jonas@bernoul.li> <20200707154739.1829-3-jonas@bernoul.li> <20200707154739.1829-4-jonas@bernoul.li> <20200707154739.1829-5-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="1609"; mail-complaints-to="usenet@ciao.gmane.io" To: 41276@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 07 17:50:47 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 1jsprr-0000Ih-3c for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 07 Jul 2020 17:50:47 +0200 Original-Received: from localhost ([::1]:37212 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jsprp-0000cK-Sw for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 07 Jul 2020 11:50:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53622) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jsppE-0006ky-66 for bug-gnu-emacs@gnu.org; Tue, 07 Jul 2020 11:48:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53245) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jsppD-0002lU-Sb for bug-gnu-emacs@gnu.org; Tue, 07 Jul 2020 11:48:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jsppD-0000ad-SC for bug-gnu-emacs@gnu.org; Tue, 07 Jul 2020 11:48: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: Tue, 07 Jul 2020 15:48:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41276 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 41276-submit@debbugs.gnu.org id=B41276.15941368712193 (code B ref 41276); Tue, 07 Jul 2020 15:48:03 +0000 Original-Received: (at 41276) by debbugs.gnu.org; 7 Jul 2020 15:47:51 +0000 Original-Received: from localhost ([127.0.0.1]:36547 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jspp1-0000ZD-Fx for submit@debbugs.gnu.org; Tue, 07 Jul 2020 11:47:51 -0400 Original-Received: from mail.hostpark.net ([212.243.197.30]:48002) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jspov-0000Xs-Sc for 41276@debbugs.gnu.org; Tue, 07 Jul 2020 11:47:46 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.hostpark.net (Postfix) with ESMTP id F24E216A2C for <41276@debbugs.gnu.org>; Tue, 7 Jul 2020 17:47:42 +0200 (CEST) X-Virus-Scanned: by Hostpark/NetZone Mailprotection at hostpark.net Original-Received: from mail.hostpark.net ([127.0.0.1]) by localhost (mail0.hostpark.net [127.0.0.1]) (amavisd-new, port 10124) with ESMTP id h6osD0Orw9ga for <41276@debbugs.gnu.org>; Tue, 7 Jul 2020 17:47:42 +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 BE85D16708 for <41276@debbugs.gnu.org>; Tue, 7 Jul 2020 17:47:42 +0200 (CEST) X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200707154739.1829-5-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:182801 Archived-At: We can assume that `encode-coding-string' and `decode-coding-string' are available; they were added in 1997. * lisp/epa-file.el (epa-file--encode-coding-string) (epa-file--decode-coding-string): Remove aliases for encode-coding-string and decode-coding-string. * lisp/epa-file.el (epa-file-write-region): Use encode-coding-string instead of removed epa-file--encode-coding-string. --- lisp/epa-file.el | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/lisp/epa-file.el b/lisp/epa-file.el index 22c3dc1146..14a169b13f 100644 --- a/lisp/epa-file.el +++ b/lisp/epa-file.el @@ -51,16 +51,6 @@ epa-file-select-keys (defvar epa-file-passphrase-alist nil) -(eval-and-compile - (if (fboundp 'encode-coding-string) - (defalias 'epa-file--encode-coding-string 'encode-coding-string) - (defalias 'epa-file--encode-coding-string 'identity))) - -(eval-and-compile - (if (fboundp 'decode-coding-string) - (defalias 'epa-file--decode-coding-string 'decode-coding-string) - (defalias 'epa-file--decode-coding-string 'identity))) - (defun epa-file-passphrase-callback-function (context key-id file) (if (and epa-file-cache-passphrase-for-symmetric-encryption (eq key-id 'SYM)) @@ -236,11 +226,7 @@ epa-file-write-region (setq file (expand-file-name file)) (let* ((coding-system (or coding-system-for-write (if (fboundp 'select-safe-coding-system) - ;; This is needed since Emacs 22 has - ;; no-conversion setting for *.gpg in - ;; `auto-coding-alist'. - (let ((buffer-file-name - (file-name-sans-extension file))) + (let ((buffer-file-name file)) (select-safe-coding-system (point-min) (point-max))) buffer-file-coding-system))) @@ -266,7 +252,7 @@ epa-file-write-region (epg-encrypt-string context (if (stringp start) - (epa-file--encode-coding-string start coding-system) + (encode-coding-string start coding-system) (unless start (setq start (point-min) end (point-max))) @@ -280,8 +266,8 @@ epa-file-write-region ;; decrypted contents. (format-encode-buffer (with-current-buffer buffer buffer-file-format)) - (epa-file--encode-coding-string (buffer-string) - coding-system))) + (encode-coding-string (buffer-string) + coding-system))) (if (or (eq epa-file-select-keys t) (and (null epa-file-select-keys) (not (local-variable-p 'epa-file-encrypt-to -- 2.26.0