unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* 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

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 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).