GNU bug report logs - #41268
[PATCH 6/9] Drop unnecessary backward compatibility aliases

Previous Next

Package: emacs;

Reported by: Jonas Bernoulli <jonas <at> bernoul.li>

Date: Thu, 14 May 2020 19:14:02 UTC

Severity: normal

Tags: patch

Merged with 41269, 41270, 41271, 41272, 41273, 41274, 41275, 41276, 41277

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Jonas Bernoulli <jonas <at> bernoul.li>
To: 41268 <at> debbugs.gnu.org
Subject: bug#41268: [PATCH 6/9] Drop unnecessary backward compatibility aliases
Date: Thu, 14 May 2020 21:13:22 +0200
* 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.

encode-coding-string and decode-coding-string existed every since
4ed4686978bd18292e2bb7b87a7b0e0407ecb3b1 added them in 1997.
---
 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 ede7177054..3e23c09a51 100644
--- a/lisp/epa-file.el
+++ b/lisp/epa-file.el
@@ -56,16 +56,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))
@@ -243,11 +233,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)))
@@ -273,7 +259,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)))
@@ -287,8 +273,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





This bug report was last modified 4 years and 290 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.