* bug#33040: 26.1.50; Epg prompt on Microsoft Windows differ from the GNU/Linux on when asking passphrase
@ 2018-10-14 15:53 Pierre Téchoueyres
2018-10-20 10:17 ` Eli Zaretskii
0 siblings, 1 reply; 8+ messages in thread
From: Pierre Téchoueyres @ 2018-10-14 15:53 UTC (permalink / raw)
To: 33040
[-- Attachment #1: Type: text/plain, Size: 1025 bytes --]
Hello everyone,
I've noticed an anoying problem when I need to decrypt a file from Emacs
on Windows. The prompt asking my passphrase is two lines whereas on
Gnu/Linux it's only one.
I've tracked this bug down to the epg--start fuction and try the
attached patch from some time now without noticing anything wrong.
The step to reproduce the bug are below:
1) Start Emacs with: emacs -Q
2) Execute the following commands in scratch buffer
#+BEGIN_SRC emacs-lisp
(require 'epg)
(setq epg-gpg-program "gpg2"
epa-pinentry-mode 'loopback)
;; open a gnupg encrypted file :
(find-file "~/.emacs.d/authinfo.gpg")
#+END_SRC
The result vary between Emacs on Microsoft windows and on GNU/Linux.
On Microsoft Windows:
#+BEGIN_VERSE
Passphrase for 7F4B4084DFC4EBD2 Pierre Téchoueyres <pierre.techoueyres@free.fr>
:
#+END_VERSE
Note the cariage return before the colon.
On GNU/Linux:
#+BEGIN_VERSE
Passphrase for 7F4B4084DFC4EBD2 Pierre Téchoueyres <pierre.techoueyres@free.fr>:
#+END_VERSE
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Unify-prompt-for-gnupg-passphrase-between-GNU-Linux-and-Microsoft-Windows --]
[-- Type: text/x-patch, Size: 1043 bytes --]
From 6e3935351b3e681fbb531818d3b2ae6db32e7b2b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pierre=20T=C3=A9choueyres?= <pierre.techoueyres@free.fr>
Date: Sun, 14 Oct 2018 17:49:12 +0200
Subject: [PATCH] Unify prompt for gnupg passphrase between GNU/Linux and
Windows.
* lisp/epg.el (epg--start): Use native locale coding system instead of
binary for Microsoft Windows and DOS.
---
lisp/epg.el | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lisp/epg.el b/lisp/epg.el
index 8f26cd34ee..000366d76a 100644
--- a/lisp/epg.el
+++ b/lisp/epg.el
@@ -655,7 +655,9 @@ epg--start
:command (cons (epg-context-program context)
args)
:connection-type 'pipe
- :coding '(binary . binary)
+ :coding (if (memq system-type '(ms-dos windows-nt))
+ (cons locale-coding-system locale-coding-system)
+ '(binary . binary))
:filter #'epg--process-filter
:stderr error-process
:noquery t)))
--
2.17.2
[-- Attachment #3: Type: text/plain, Size: 9 bytes --]
Pierre.
^ permalink raw reply related [flat|nested] 8+ messages in thread
* bug#33040: 26.1.50; Epg prompt on Microsoft Windows differ from the GNU/Linux on when asking passphrase
2018-10-14 15:53 bug#33040: 26.1.50; Epg prompt on Microsoft Windows differ from the GNU/Linux on when asking passphrase Pierre Téchoueyres
@ 2018-10-20 10:17 ` Eli Zaretskii
2018-10-24 16:55 ` Pierre Téchoueyres
0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2018-10-20 10:17 UTC (permalink / raw)
To: Pierre Téchoueyres; +Cc: 33040
> From: Pierre Téchoueyres <pierre.techoueyres@free.fr>
> Date: Sun, 14 Oct 2018 17:53:50 +0200
>
> diff --git a/lisp/epg.el b/lisp/epg.el
> index 8f26cd34ee..000366d76a 100644
> --- a/lisp/epg.el
> +++ b/lisp/epg.el
> @@ -655,7 +655,9 @@ epg--start
> :command (cons (epg-context-program context)
> args)
> :connection-type 'pipe
> - :coding '(binary . binary)
> + :coding (if (memq system-type '(ms-dos windows-nt))
> + (cons locale-coding-system locale-coding-system)
> + '(binary . binary))
> :filter #'epg--process-filter
> :stderr error-process
> :noquery t)))
Thanks.
I think a better solution is to use raw-text-unix on both Unix and
DOS/Windows. Can you try that and see if doing so produces good
results on both systems?
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#33040: 26.1.50; Epg prompt on Microsoft Windows differ from the GNU/Linux on when asking passphrase
2018-10-20 10:17 ` Eli Zaretskii
@ 2018-10-24 16:55 ` Pierre Téchoueyres
2018-10-24 17:40 ` Eli Zaretskii
0 siblings, 1 reply; 8+ messages in thread
From: Pierre Téchoueyres @ 2018-10-24 16:55 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 33040
Hello Eli,
I first tried your solution, but that didn't work as expected. Then I
tried using 'raw-text unconditionnaly and everything seems to work as
expected on Microsoft Windows and GNU/Linux.
I do as follow because I think that '(raw-text . raw-text) is the same
as 'raw-text for the :coding keyword.
- :coding '(binary . binary)
+ :coding 'raw-text
Should I prepare an ammended patch ?
Eli Zaretskii <eliz@gnu.org> writes:
> Thanks.
>
> I think a better solution is to use raw-text-unix on both Unix and
> DOS/Windows. Can you try that and see if doing so produces good
> results on both systems?
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#33040: 26.1.50; Epg prompt on Microsoft Windows differ from the GNU/Linux on when asking passphrase
2018-10-24 16:55 ` Pierre Téchoueyres
@ 2018-10-24 17:40 ` Eli Zaretskii
2018-10-24 18:08 ` Pierre Téchoueyres
0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2018-10-24 17:40 UTC (permalink / raw)
To: Pierre Téchoueyres; +Cc: 33040
> From: pierre.techoueyres@free.fr (Pierre Téchoueyres)
> Cc: 33040@debbugs.gnu.org
> Date: Wed, 24 Oct 2018 18:55:53 +0200
>
> I first tried your solution, but that didn't work as expected. Then I
> tried using 'raw-text unconditionnaly and everything seems to work as
> expected on Microsoft Windows and GNU/Linux.
>
> I do as follow because I think that '(raw-text . raw-text) is the same
> as 'raw-text for the :coding keyword.
>
> - :coding '(binary . binary)
> + :coding 'raw-text
>
> Should I prepare an ammended patch ?
Doesn't
: coding 'raw-text-unix
work on both Windows and GNU/Linux? Because I don't really understand
what "unconditionally" means in this context: I didn't suggest using
any conditions.
Thanks.
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#33040: 26.1.50; Epg prompt on Microsoft Windows differ from the GNU/Linux on when asking passphrase
2018-10-24 17:40 ` Eli Zaretskii
@ 2018-10-24 18:08 ` Pierre Téchoueyres
2018-10-24 18:35 ` Eli Zaretskii
0 siblings, 1 reply; 8+ messages in thread
From: Pierre Téchoueyres @ 2018-10-24 18:08 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 33040
Eli Zaretskii <eliz@gnu.org> writes:
> ...
> Doesn't
>
> : coding 'raw-text-unix
>
> work on both Windows and GNU/Linux?
No it doesn't on Windows. I guess it's because of the -unix part which
results in adding the CR before the colon (:).
> Because I don't really understand
> what "unconditionally" means in this context: I didn't suggest using
> any conditions.
Sorry, when :coding 'raw-text-unix didn't work as expected I first try
:coding (if (memq system-type '(ms-dos windows-nt))
'raw-text-dos
'raw-text-unix)
then I realized it was equivalent to :
:coding 'raw-text
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#33040: 26.1.50; Epg prompt on Microsoft Windows differ from the GNU/Linux on when asking passphrase
2018-10-24 18:08 ` Pierre Téchoueyres
@ 2018-10-24 18:35 ` Eli Zaretskii
2018-10-24 19:21 ` Pierre Téchoueyres
0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2018-10-24 18:35 UTC (permalink / raw)
To: Pierre Téchoueyres; +Cc: 33040
> From: pierre.techoueyres@free.fr (Pierre Téchoueyres)
> Cc: 33040@debbugs.gnu.org
> Date: Wed, 24 Oct 2018 20:08:07 +0200
>
> > Doesn't
> >
> > : coding 'raw-text-unix
> >
> > work on both Windows and GNU/Linux?
>
>
> No it doesn't on Windows. I guess it's because of the -unix part which
> results in adding the CR before the colon (:).
Right, I was confused and forgot that this was exactly the original
problem. So raw-text it is. And yes, please prepare a patch.
> Sorry, when :coding 'raw-text-unix didn't work as expected I first try
>
> :coding (if (memq system-type '(ms-dos windows-nt))
> 'raw-text-dos
> 'raw-text-unix)
>
> then I realized it was equivalent to :
> :coding 'raw-text
Actually, no: it isn't equivalent. Just raw-text tells Emacs to use
the default on encoding (thus -dos on Windows and -unix on GNU/Linux),
and to _detect_ the EOL format on decoding. But I don't think this is
a problem in this case, is it?
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#33040: 26.1.50; Epg prompt on Microsoft Windows differ from the GNU/Linux on when asking passphrase
2018-10-24 18:35 ` Eli Zaretskii
@ 2018-10-24 19:21 ` Pierre Téchoueyres
2018-10-27 9:38 ` Eli Zaretskii
0 siblings, 1 reply; 8+ messages in thread
From: Pierre Téchoueyres @ 2018-10-24 19:21 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 33040
[-- Attachment #1: Type: text/plain, Size: 41 bytes --]
Hello Eli,
please find the patch bellow.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: epg prompt patch --]
[-- Type: text/x-patch, Size: 920 bytes --]
From 32644ac1027114d3f4caaf2e25ae985241ab867b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pierre=20T=C3=A9choueyres?= <pierre.techoueyres@free.fr>
Date: Sun, 14 Oct 2018 17:49:12 +0200
Subject: [PATCH] Unify prompt for gnupg passphrase between GNU/Linux and
Windows.
* lisp/epg.el (epg--start): Use `raw-text' for coding system instead
of binary in order to avoid spurious carriage return on Microsoft
Windows and DOS when prompting for a password.
---
lisp/epg.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lisp/epg.el b/lisp/epg.el
index 8f26cd34ee..28afa59d8e 100644
--- a/lisp/epg.el
+++ b/lisp/epg.el
@@ -655,7 +655,7 @@ epg--start
:command (cons (epg-context-program context)
args)
:connection-type 'pipe
- :coding '(binary . binary)
+ :coding 'raw-text
:filter #'epg--process-filter
:stderr error-process
:noquery t)))
--
2.17.2
[-- Attachment #3: Type: text/plain, Size: 659 bytes --]
Eli Zaretskii <eliz@gnu.org> writes:
>> Sorry, when :coding 'raw-text-unix didn't work as expected I first try
>>
>> :coding (if (memq system-type '(ms-dos windows-nt))
>> 'raw-text-dos
>> 'raw-text-unix)
>>
>> then I realized it was equivalent to :
>> :coding 'raw-text
>
> Actually, no: it isn't equivalent. Just raw-text tells Emacs to use
> the default on encoding (thus -dos on Windows and -unix on GNU/Linux),
> and to _detect_ the EOL format on decoding. But I don't think this is
> a problem in this case, is it?
>
No, it isn't a problem, and on the contrary it's exactly what I want :
detect the EOL format for decoding.
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2018-10-27 9:38 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-14 15:53 bug#33040: 26.1.50; Epg prompt on Microsoft Windows differ from the GNU/Linux on when asking passphrase Pierre Téchoueyres
2018-10-20 10:17 ` Eli Zaretskii
2018-10-24 16:55 ` Pierre Téchoueyres
2018-10-24 17:40 ` Eli Zaretskii
2018-10-24 18:08 ` Pierre Téchoueyres
2018-10-24 18:35 ` Eli Zaretskii
2018-10-24 19:21 ` Pierre Téchoueyres
2018-10-27 9:38 ` Eli Zaretskii
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.