mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-23 07:19:15 +00:00
Add new user option password-colon-equivalents
* lisp/international/mule-conf.el (password-colon-equivalents): New defcustom. * lisp/comint.el (comint-password-prompt-regexp): * lisp/eshell/esh-mode.el (eshell-password-prompt-regexp): Use it. * lisp/net/tramp-compat.el (tramp-compat-password-colon-equivalents): New variable. * lisp/net/tramp.el (tramp-password-prompt-regexp): Use it.
This commit is contained in:
parent
609319da87
commit
a3edacd3f5
@ -383,7 +383,8 @@ This variable is buffer-local."
|
||||
"\\(?:" (regexp-opt password-word-equivalents) "\\|Response\\)"
|
||||
"\\(?:\\(?:, try\\)? *again\\| (empty for no passphrase)\\| (again)\\)?"
|
||||
;; "[[:alpha:]]" used to be "for", which fails to match non-English.
|
||||
"\\(?: [[:alpha:]]+ .+\\)?[[:blank:]]*[::៖][[:space:]]*\\'"
|
||||
"\\(?: [[:alpha:]]+ .+\\)?[[:blank:]]*"
|
||||
"[" (apply #'string password-colon-equivalents) "][[:space:]]*\\'"
|
||||
;; The ccrypt encryption dialog doesn't end with a colon, so
|
||||
;; treat it specially.
|
||||
"\\|^Enter encryption key: (repeat) *\\'"
|
||||
|
@ -172,7 +172,10 @@ inserted. They return the string as it should be inserted."
|
||||
:type 'hook)
|
||||
|
||||
(defcustom eshell-password-prompt-regexp
|
||||
(format "\\(%s\\)[^::៖]*[::៖]\\s *\\'" (regexp-opt password-word-equivalents))
|
||||
(format "%s[^%s]*[%s]\\s *\\'"
|
||||
(regexp-opt password-word-equivalents t)
|
||||
(apply #'string password-colon-equivalents)
|
||||
(apply #'string password-colon-equivalents))
|
||||
"Regexp matching prompts for passwords in the inferior process.
|
||||
This is used by `eshell-watch-for-password-prompt'."
|
||||
:type 'regexp
|
||||
|
@ -1734,6 +1734,19 @@ included; callers should bind `case-fold-search' to t."
|
||||
:version "27.1"
|
||||
:group 'processes)
|
||||
|
||||
;; (describe-char-fold-equivalences ?:)
|
||||
;; The last entry is taken from history.
|
||||
(defcustom password-colon-equivalents
|
||||
'(?\N{COLON}
|
||||
?\N{FULLWIDTH COLON}
|
||||
?\N{SMALL COLON}
|
||||
?\N{PRESENTATION FORM FOR VERTICAL COLON}
|
||||
?\N{KHMER SIGN CAMNUC PII KUUH})
|
||||
"List of characters equivalent to trailing colon in \"password\" prompts."
|
||||
:type '(repeat character)
|
||||
:version "30.1"
|
||||
:group 'processes)
|
||||
|
||||
;; The old code-pages library is obsoleted by coding systems based on
|
||||
;; the charsets defined in this file but might be required by user
|
||||
;; code.
|
||||
|
@ -275,6 +275,19 @@ Add the extension of F, if existing."
|
||||
(autoload 'netrc-parse "netrc")
|
||||
(netrc-parse file))))
|
||||
|
||||
;; User option `password-colon-equivalents' is new in Emacs 30.1.
|
||||
(if (boundp 'password-colon-equivalents)
|
||||
(defvaralias
|
||||
'tramp-compat-password-colon-equivalents
|
||||
'password-colon-equivalents)
|
||||
(defvar tramp-compat-password-colon-equivalents
|
||||
'(?\N{COLON}
|
||||
?\N{FULLWIDTH COLON}
|
||||
?\N{SMALL COLON}
|
||||
?\N{PRESENTATION FORM FOR VERTICAL COLON}
|
||||
?\N{KHMER SIGN CAMNUC PII KUUH})
|
||||
"List of characters equivalent to trailing colon in \"password\" prompts."))
|
||||
|
||||
(dolist (elt (all-completions "tramp-compat-" obarray 'functionp))
|
||||
(put (intern elt) 'tramp-suppress-trace t))
|
||||
|
||||
|
@ -641,10 +641,11 @@ This regexp must match both `tramp-initial-end-of-output' and
|
||||
:type 'regexp)
|
||||
|
||||
(defcustom tramp-password-prompt-regexp
|
||||
(rx
|
||||
bol (* nonl)
|
||||
(group (regexp (regexp-opt password-word-equivalents)))
|
||||
(* nonl) (any "::៖") (? "\^@") (* blank))
|
||||
(rx-to-string
|
||||
`(: bol (* nonl)
|
||||
(group (| . ,password-word-equivalents))
|
||||
(* nonl) (any . ,tramp-compat-password-colon-equivalents)
|
||||
(? "\^@") (* blank)))
|
||||
"Regexp matching password-like prompts.
|
||||
The regexp should match at end of buffer.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user