From 2a4e9478cb03874c060bda2cb2d23f9c15d02685 Mon Sep 17 00:00:00 2001 From: Peter Bray <308463+illumino@users.noreply.github.com> Date: Sat, 27 Nov 2021 19:25:58 +1100 Subject: [PATCH 1/2] Use (setq-local var value) to support older Emacs (such as 26.1 on CentOS 8.5) Emacs 27.1 permits (setq-local [VARIABLE VALUE]...), earlier Emacs do not. --- ansible-vault.el | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/ansible-vault.el b/ansible-vault.el index 425f946..84261c3 100644 --- a/ansible-vault.el +++ b/ansible-vault.el @@ -150,11 +150,10 @@ save hooks to treat ansible-vault file as encrypted on disk.") (cipher-algorithm (caddr header-tokens)) (vault-id (cadddr header-tokens))) (when (string= "$ANSIBLE_VAULT" format-id) - (setq-local - ansible-vault--header-format-id format-id - ansible-vault--header-version version - ansuble-vault--header-cipher-algorithm cipher-algorithm - ansible-vault--header-vault-id vault-id))))) + (setq-local ansible-vault--header-format-id format-id) + (setq-local ansible-vault--header-version version) + (setq-local ansuble-vault--header-cipher-algorithm cipher-algorithm) + (setq-local ansible-vault--header-vault-id vault-id))))) ;;;###autoload (defun ansible-vault--is-encrypted-vault-file () @@ -273,9 +272,8 @@ PASSWORD-FILE path to the stored secret for provided VAULT-ID." (call-interactively 'ansible-vault--request-password)))) (car (push (cons vault-id password-file) ansible-vault-vault-id-alist))))) (password-file (or password-file (cdr vault-id-pair)))) - (setq-local - ansible-vault--vault-id vault-id - ansible-vault--password-file password-file) + (setq-local ansible-vault--vault-id vault-id) + (setq-local ansible-vault--password-file password-file) vault-id-pair)) (defun ansible-vault--flush-password-file () @@ -333,9 +331,8 @@ its password file." (ansible-config-path (ansible-vault--process-config-files))) (cond (vault-id-pair - (setq-local - ansible-vault--vault-id (car vault-id-pair) - ansible-vault--password-file (cdr vault-id-pair))) + (setq-local ansible-vault--vault-id (car vault-id-pair)) + (setq-local ansible-vault--password-file (cdr vault-id-pair))) (ansible-vault--header-vault-id (ansible-vault--request-vault-id ansible-vault--header-vault-id)) (t (let* ((password-file From 7b3c30814e88b829319e24dd850eac2835777a33 Mon Sep 17 00:00:00 2001 From: Peter Bray <308463+illumino@users.noreply.github.com> Date: Sat, 27 Nov 2021 19:27:33 +1100 Subject: [PATCH 2/2] Fix a typo spotted during last commit - ansuble -> ansible --- ansible-vault.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible-vault.el b/ansible-vault.el index 84261c3..251e753 100644 --- a/ansible-vault.el +++ b/ansible-vault.el @@ -111,7 +111,7 @@ generation.") (defvar ansible-vault--header-version '() "Buffer local variable for `ansible-vault-mode'.") -(defvar ansuble-vault--header-cipher-algorithm '() +(defvar ansible-vault--header-cipher-algorithm '() "Buffer local variable for `ansible-vault-mode'.") (defvar ansible-vault--header-vault-id '() @@ -152,7 +152,7 @@ save hooks to treat ansible-vault file as encrypted on disk.") (when (string= "$ANSIBLE_VAULT" format-id) (setq-local ansible-vault--header-format-id format-id) (setq-local ansible-vault--header-version version) - (setq-local ansuble-vault--header-cipher-algorithm cipher-algorithm) + (setq-local ansible-vault--header-cipher-algorithm cipher-algorithm) (setq-local ansible-vault--header-vault-id vault-id))))) ;;;###autoload @@ -525,7 +525,7 @@ Ensures deletion of ansible-vault generated password files." "Unset all buffer local variables." (dolist (var '(ansible-vault--header-format-id ansible-vault--header-version - ansuble-vault--header-cipher-algorithm + ansible-vault--header-cipher-algorithm ansible-vault--header-vault-id ansible-vault--point ansible-vault--password-file