aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonas Bernoulli2020-02-18 16:58:31 +0100
committerJonas Bernoulli2020-07-15 18:06:04 +0200
commite78c15acf679259caea6566446f61966cea032aa (patch)
tree4abf58f1a466d3876e7bf65f9657266fec56d71f
parent0e2af5cc3726d6e661f0f396a843185326ed5e7d (diff)
downloademacs-e78c15acf679259caea6566446f61966cea032aa.tar.gz
emacs-e78c15acf679259caea6566446f61966cea032aa.zip
Drop unnecessary backward compatibility aliases
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.
-rw-r--r--lisp/epa-file.el22
1 files changed, 4 insertions, 18 deletions
diff --git a/lisp/epa-file.el b/lisp/epa-file.el
index 22c3dc1146b..14a169b13fb 100644
--- a/lisp/epa-file.el
+++ b/lisp/epa-file.el
@@ -51,16 +51,6 @@ encryption is used."
51 51
52(defvar epa-file-passphrase-alist nil) 52(defvar epa-file-passphrase-alist nil)
53 53
54(eval-and-compile
55 (if (fboundp 'encode-coding-string)
56 (defalias 'epa-file--encode-coding-string 'encode-coding-string)
57 (defalias 'epa-file--encode-coding-string 'identity)))
58
59(eval-and-compile
60 (if (fboundp 'decode-coding-string)
61 (defalias 'epa-file--decode-coding-string 'decode-coding-string)
62 (defalias 'epa-file--decode-coding-string 'identity)))
63
64(defun epa-file-passphrase-callback-function (context key-id file) 54(defun epa-file-passphrase-callback-function (context key-id file)
65 (if (and epa-file-cache-passphrase-for-symmetric-encryption 55 (if (and epa-file-cache-passphrase-for-symmetric-encryption
66 (eq key-id 'SYM)) 56 (eq key-id 'SYM))
@@ -236,11 +226,7 @@ encryption is used."
236 (setq file (expand-file-name file)) 226 (setq file (expand-file-name file))
237 (let* ((coding-system (or coding-system-for-write 227 (let* ((coding-system (or coding-system-for-write
238 (if (fboundp 'select-safe-coding-system) 228 (if (fboundp 'select-safe-coding-system)
239 ;; This is needed since Emacs 22 has 229 (let ((buffer-file-name file))
240 ;; no-conversion setting for *.gpg in
241 ;; `auto-coding-alist'.
242 (let ((buffer-file-name
243 (file-name-sans-extension file)))
244 (select-safe-coding-system 230 (select-safe-coding-system
245 (point-min) (point-max))) 231 (point-min) (point-max)))
246 buffer-file-coding-system))) 232 buffer-file-coding-system)))
@@ -266,7 +252,7 @@ encryption is used."
266 (epg-encrypt-string 252 (epg-encrypt-string
267 context 253 context
268 (if (stringp start) 254 (if (stringp start)
269 (epa-file--encode-coding-string start coding-system) 255 (encode-coding-string start coding-system)
270 (unless start 256 (unless start
271 (setq start (point-min) 257 (setq start (point-min)
272 end (point-max))) 258 end (point-max)))
@@ -280,8 +266,8 @@ encryption is used."
280 ;; decrypted contents. 266 ;; decrypted contents.
281 (format-encode-buffer (with-current-buffer buffer 267 (format-encode-buffer (with-current-buffer buffer
282 buffer-file-format)) 268 buffer-file-format))
283 (epa-file--encode-coding-string (buffer-string) 269 (encode-coding-string (buffer-string)
284 coding-system))) 270 coding-system)))
285 (if (or (eq epa-file-select-keys t) 271 (if (or (eq epa-file-select-keys t)
286 (and (null epa-file-select-keys) 272 (and (null epa-file-select-keys)
287 (not (local-variable-p 'epa-file-encrypt-to 273 (not (local-variable-p 'epa-file-encrypt-to