unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#29729: [PATCH] Support French password prompts in shell
@ 2017-12-16  2:19 Ian Johnson
  2017-12-22 14:13 ` Eli Zaretskii
  2018-08-16  0:30 ` Noam Postavsky
  0 siblings, 2 replies; 5+ messages in thread
From: Ian Johnson @ 2017-12-16  2:19 UTC (permalink / raw)
  To: 29729

[-- Attachment #1: Type: text/plain, Size: 433 bytes --]

I noticed that French password prompts in `shell-mode' weren't detected
as such by `comint-watch-for-password-prompt' due to a space between the
password prompt and the colon (as in `Mot de passe :'), so I modified
`comint-password-prompt-regexp' to detect this space (as well as
non-breaking spaces before and after the colon, which is used by sudo).

Please let me know if I missed anything, as this is my first patch.
Thank you!


[-- Attachment #2: Patch for French password prompt detection --]
[-- Type: text/x-patch, Size: 1313 bytes --]

From 0d6d4e79e8fe94ae2f7424c2fac1b50b49d891d6 Mon Sep 17 00:00:00 2001
From: Ian Johnson <ianprime0509@gmail.com>
Date: Fri, 15 Dec 2017 21:03:22 -0500
Subject: [PATCH] Support French password prompts in shell

French punctuation rules require a space (preferably non-breaking)
before the colon, but password prompts following this rule were not
identified properly by `comint-watch-for-password-prompt'.

 * lisp/comint.el (comint-password-prompt-regexp): support
   spaces (including non-breaking spaces) before and after password
   prompt colon.
---
 lisp/comint.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/comint.el b/lisp/comint.el
index aa7dab28f3..414ffd0f49 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -363,7 +363,7 @@ comint-password-prompt-regexp
    "\\(?:" (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:]]+ .+\\)?[::៖]\\s *\\'")
+   "\\(?: [[:alpha:]]+ .+\\)?[\\s  ]*[::៖][\\s  ]*\\'")
   "Regexp matching prompts for passwords in the inferior process.
 This is used by `comint-watch-for-password-prompt'."
   :version "26.1"
-- 
2.15.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#29729: [PATCH] Support French password prompts in shell
  2017-12-16  2:19 bug#29729: [PATCH] Support French password prompts in shell Ian Johnson
@ 2017-12-22 14:13 ` Eli Zaretskii
  2018-08-16  0:30 ` Noam Postavsky
  1 sibling, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2017-12-22 14:13 UTC (permalink / raw)
  To: Ian Johnson; +Cc: 29729-done

> From: Ian Johnson <ianprime0509@gmail.com>
> Date: Fri, 15 Dec 2017 21:19:10 -0500
> 
> I noticed that French password prompts in `shell-mode' weren't detected
> as such by `comint-watch-for-password-prompt' due to a space between the
> password prompt and the colon (as in `Mot de passe :'), so I modified
> `comint-password-prompt-regexp' to detect this space (as well as
> non-breaking spaces before and after the colon, which is used by sudo).

Thanks, pushed to the master branch.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#29729: [PATCH] Support French password prompts in shell
  2017-12-16  2:19 bug#29729: [PATCH] Support French password prompts in shell Ian Johnson
  2017-12-22 14:13 ` Eli Zaretskii
@ 2018-08-16  0:30 ` Noam Postavsky
  2018-08-16 13:27   ` Eli Zaretskii
  1 sibling, 1 reply; 5+ messages in thread
From: Noam Postavsky @ 2018-08-16  0:30 UTC (permalink / raw)
  To: Ian Johnson; +Cc: 29729

Ian Johnson <ianprime0509@gmail.com> writes:

> +   "\\(?: [[:alpha:]]+ .+\\)?[\\s  ]*[::៖][\\s  ]*\\'")

Actually, shouldn't that [\\s  ] be [[:whitespace:] ] (and perhaps
better written [[:whitespace:]\u00A0])?  [\\s ] matches backslash, "s",
and space, not whitespace syntax characters.

Or maybe it should rather be [[:blank:]].






^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#29729: [PATCH] Support French password prompts in shell
  2018-08-16  0:30 ` Noam Postavsky
@ 2018-08-16 13:27   ` Eli Zaretskii
  2018-08-24 11:49     ` Noam Postavsky
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2018-08-16 13:27 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: 29729, ianprime0509

> From: Noam Postavsky <npostavs@gmail.com>
> Date: Wed, 15 Aug 2018 20:30:43 -0400
> Cc: 29729@debbugs.gnu.org
> 
> Ian Johnson <ianprime0509@gmail.com> writes:
> 
> > +   "\\(?: [[:alpha:]]+ .+\\)?[\\s  ]*[::៖][\\s  ]*\\'")
> 
> Actually, shouldn't that [\\s  ] be [[:whitespace:] ] (and perhaps
> better written [[:whitespace:]\u00A0])?  [\\s ] matches backslash, "s",
> and space, not whitespace syntax characters.
> 
> Or maybe it should rather be [[:blank:]].

I think [:blank:] is indeed what is needed here.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#29729: [PATCH] Support French password prompts in shell
  2018-08-16 13:27   ` Eli Zaretskii
@ 2018-08-24 11:49     ` Noam Postavsky
  0 siblings, 0 replies; 5+ messages in thread
From: Noam Postavsky @ 2018-08-24 11:49 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 29729, ianprime0509

tags 29729 fixed
quit

Eli Zaretskii <eliz@gnu.org> writes:

>> > +   "\\(?: [[:alpha:]]+ .+\\)?[\\s  ]*[::៖][\\s  ]*\\'")
>> 
>> Actually, shouldn't that [\\s  ] be [[:whitespace:] ] (and perhaps
>> better written [[:whitespace:]\u00A0])?  [\\s ] matches backslash, "s",
>> and space, not whitespace syntax characters.
>> 
>> Or maybe it should rather be [[:blank:]].
>
> I think [:blank:] is indeed what is needed here.

Done in master.

[1: 74277b0e88]: 2018-08-23 22:49:04 -0400
  Fix comint-password-prompt-regexp
  https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=74277b0e88197c169acfc16025e0e116230c021e





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-08-24 11:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-16  2:19 bug#29729: [PATCH] Support French password prompts in shell Ian Johnson
2017-12-22 14:13 ` Eli Zaretskii
2018-08-16  0:30 ` Noam Postavsky
2018-08-16 13:27   ` Eli Zaretskii
2018-08-24 11:49     ` Noam Postavsky

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).