From: Eli Zaretskii <eliz@gnu.org>
To: Nicolas Graves <ngraves@ngraves.fr>
Cc: emacs-devel@gnu.org
Subject: Re: [PATCH] Add custom variable auth-source-pass-file-extension.
Date: Sat, 11 Mar 2023 11:20:42 +0200 [thread overview]
Message-ID: <83zg8jwsnp.fsf@gnu.org> (raw)
In-Reply-To: <20230309163018.20565-1-ngraves@ngraves.fr> (emacs-devel@gnu.org)
> Cc: ngraves@ngraves.fr
> Date: Thu, 9 Mar 2023 17:30:18 +0100
> From: Nicolas Graves via "Emacs development discussions." <emacs-devel@gnu.org>
>
> ---
> lisp/auth-source-pass.el | 15 +++++++++++----
> 1 file changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/lisp/auth-source-pass.el b/lisp/auth-source-pass.el
> index dbcc9d05753..5e232b44438 100644
> --- a/lisp/auth-source-pass.el
> +++ b/lisp/auth-source-pass.el
> @@ -69,6 +69,11 @@ Unix password store'."
> :type 'boolean
> :version "29.1")
>
> +(defcustom auth-source-pass-file-extension "gpg"
> + "File extension to expect for auth-source-pass."
> + :type 'string
> + :version "30.1")
> +
> (cl-defun auth-source-pass-search (&rest spec
> &key backend type host user port
> require max
> @@ -195,9 +200,10 @@ See `auth-source-pass-get'."
> (defun auth-source-pass--read-entry (entry)
> "Return a string with the file content of ENTRY."
> (with-temp-buffer
> - (insert-file-contents (expand-file-name
> - (format "%s.gpg" entry)
> - auth-source-pass-filename))
> + (insert-file-contents
> + (expand-file-name
> + (format (concat "%s." auth-source-pass-file-extension) entry)
> + auth-source-pass-filename))
> (buffer-substring-no-properties (point-min) (point-max))))
>
> (defun auth-source-pass-parse-entry (entry)
> @@ -238,7 +244,8 @@ CONTENTS is the contents of a password-store formatted file."
> (let ((store-dir (expand-file-name auth-source-pass-filename)))
> (mapcar
> (lambda (file) (file-name-sans-extension (file-relative-name file store-dir)))
> - (directory-files-recursively store-dir "\\.gpg\\'"))))
> + (directory-files-recursively
> + store-dir (concat "\\." auth-source-pass-file-extension "\\'")))))
>
> (defun auth-source-pass--find-match (hosts user port)
> "Return password-store entry data matching HOSTS, USER and PORT.
> --
> 2.39.2
Thanks, but could you please state the motivation and rationale for
this change?
prev parent reply other threads:[~2023-03-11 9:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-09 16:30 [PATCH] Add custom variable auth-source-pass-file-extension Nicolas Graves via Emacs development discussions.
2023-03-11 9:20 ` Eli Zaretskii [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83zg8jwsnp.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=ngraves@ngraves.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.