From 8caf99ad038e8b21c33f6eac14bb73f96c00541b Mon Sep 17 00:00:00 2001 From: TEC Date: Thu, 24 Dec 2020 03:16:05 +0800 Subject: [PATCH 2/2] authinfo-mode: add option to not hide any elements New custom variable `authinfo-hide-elements-p' when set to nil prevents calling `authinfo--hide-passwords' on activation of `authinfo-mode'. --- lisp/auth-source.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lisp/auth-source.el b/lisp/auth-source.el index 275a02c..ba7cfeb 100644 --- a/lisp/auth-source.el +++ b/lisp/auth-source.el @@ -2415,6 +2415,11 @@ MODE can be \"login\" or \"password\"." :type 'regexp :version "27.1") +(defcustom authinfo-hide-elements-p t + "Whether to use `authinfo-hidden' to hide elements in authinfo files." + :type 'boolean + :version "27.3") + ;;;###autoload (define-derived-mode authinfo-mode fundamental-mode "Authinfo" "Mode for editing .authinfo/.netrc files. @@ -2426,8 +2431,9 @@ hides passwords. The passwords are revealed when point moved into the password. (font-lock-add-keywords nil authinfo--keywords) (setq-local comment-start "#") (setq-local comment-end "") - (authinfo--hide-passwords (point-min) (point-max)) - (reveal-mode)) + (when authinfo-hide-elements-p + (authinfo--hide-passwords (point-min) (point-max)) + (reveal-mode))) (defvar authinfo--keywords '(("^#.*" . font-lock-comment-face) -- 2.29.2