unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#24553: 25.1; epa ignores epg-gpg-program in very confusing way
@ 2016-09-27  8:15 16emacsbug
  2016-09-29  3:07 ` Nick Helm
  2017-03-10 20:16 ` Glenn Morris
  0 siblings, 2 replies; 5+ messages in thread
From: 16emacsbug @ 2016-09-27  8:15 UTC (permalink / raw)
  To: 24553



I need to edit some files that decrypt properly with gpg 1.4 but not gpg
2.1.  I have both installed on my system, with 1.4 as /usr/bin/gpg1 and
2.1 as /usr/bin/gpg2.  The bug is that emacs ignores the epg-gpg-program
variable *except* in error messages, which is very confusing.  To
reproduce this problem, do the following:

  * Run strace -o /tmp/log emacs -Q
  * Eval expression (setq epg-gpg-program "/usr/bin/gpg1")
  * Open a gpg-encrypted file

By examining /tmp/log, or running ps, you can see that emacs is
executing a command like the following:

        /usr/bin/gpg2 --no-tty --status-fd 1 --yes --enable-progress-filter --command-fd 0 --output /tmp/epg-output6602ygi --decrypt -- /tmp/x.gpg

However, when it fails to decrypt, it prints the message:  Error while
decrypting with "/usr/bin/gpg1."  This is obviously very frustrating
since gpg1 can in fact decrypt the file.  Ideally emacs should obey
epg-gpg-program, but if it doesn't, it should properly report what
failed.




In GNU Emacs 25.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.20.9)
 of 2016-09-18 built on juergen
Windowing system distributor 'The X.Org Foundation', version 11.0.11804000
System Description:	Arch Linux

Configured using:
 'configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
 --localstatedir=/var --with-x-toolkit=gtk3 --with-xft
 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe
 -fstack-protector-strong' CPPFLAGS=-D_FORTIFY_SOURCE=2
 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS
NOTIFY ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11

Important settings:
  value of $LANG: C
  locale-coding-system: nil

Major mode: Lisp Interaction

Minor modes in effect:
  diff-auto-refine-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
Loading /u/dm/.emacs.local...done
For information about GNU Emacs and the GNU system, type <f1> C-a.
Source file ‘/usr/share/emacs/site-lisp/notmuch-parser.el’ newer than byte-compiled file
Loading ~/.dot/elisp/my-notmuch (compiled; note, source file is newer)...
Loading /u/dm/.dot/elisp/notmuch-identities.el (source)...done
calling notmuch-address-message-insinuate is no longer needed
Loading ~/.dot/elisp/my-notmuch (compiled; note, source file is newer)...done

Load-path shadows:
/usr/share/emacs/site-lisp/haskell-mode/haskell-modules hides /usr/share/emacs/site-lisp/haskell-mode/build-24.5.1/haskell-modules
/usr/share/emacs/site-lisp/haskell-mode/haskell-utils hides /usr/share/emacs/site-lisp/haskell-mode/build-24.5.1/haskell-utils
/usr/share/emacs/site-lisp/haskell-mode/w3m-haddock hides /usr/share/emacs/site-lisp/haskell-mode/build-24.5.1/w3m-haddock
/usr/share/emacs/site-lisp/haskell-mode/haskell-presentation-mode hides /usr/share/emacs/site-lisp/haskell-mode/build-24.5.1/haskell-presentation-mode
/usr/share/emacs/site-lisp/haskell-mode/haskell-checkers hides /usr/share/emacs/site-lisp/haskell-mode/build-24.5.1/haskell-checkers
/usr/share/emacs/site-lisp/haskell-mode/inf-haskell hides /usr/share/emacs/site-lisp/haskell-mode/build-24.5.1/inf-haskell
/usr/share/emacs/site-lisp/haskell-mode/haskell-align-imports hides /usr/share/emacs/site-lisp/haskell-mode/build-24.5.1/haskell-align-imports
/usr/share/emacs/site-lisp/haskell-mode/haskell-customize hides /usr/share/emacs/site-lisp/haskell-mode/build-24.5.1/haskell-customize
/usr/share/emacs/site-lisp/haskell-mode/haskell-cabal hides /usr/share/emacs/site-lisp/haskell-mode/build-24.5.1/haskell-cabal
/usr/share/emacs/site-lisp/haskell-mode/haskell-collapse hides /usr/share/emacs/site-lisp/haskell-mode/build-24.5.1/haskell-collapse
/usr/share/emacs/site-lisp/haskell-mode/haskell-load hides /usr/share/emacs/site-lisp/haskell-mode/build-24.5.1/haskell-load
/usr/share/emacs/site-lisp/haskell-mode/haskell hides /usr/share/emacs/site-lisp/haskell-mode/build-24.5.1/haskell
/usr/share/emacs/site-lisp/haskell-mode/haskell-commands hides /usr/share/emacs/site-lisp/haskell-mode/build-24.5.1/haskell-commands
/usr/share/emacs/site-lisp/haskell-mode/haskell-hoogle hides /usr/share/emacs/site-lisp/haskell-mode/build-24.5.1/haskell-hoogle
/usr/share/emacs/site-lisp/haskell-mode/haskell-decl-scan hides /usr/share/emacs/site-lisp/haskell-mode/build-24.5.1/haskell-decl-scan
/usr/share/emacs/site-lisp/haskell-mode/haskell-navigate-imports hides /usr/share/emacs/site-lisp/haskell-mode/build-24.5.1/haskell-navigate-imports
/usr/share/emacs/site-lisp/haskell-mode/haskell-sort-imports hides /usr/share/emacs/site-lisp/haskell-mode/build-24.5.1/haskell-sort-imports
/usr/share/emacs/site-lisp/haskell-mode/haskell-completions hides /usr/share/emacs/site-lisp/haskell-mode/build-24.5.1/haskell-completions
/usr/share/emacs/site-lisp/haskell-mode/haskell-unicode-input-method hides /usr/share/emacs/site-lisp/haskell-mode/build-24.5.1/haskell-unicode-input-method
/usr/share/emacs/site-lisp/haskell-mode/haskell-repl hides /usr/share/emacs/site-lisp/haskell-mode/build-24.5.1/haskell-repl
/usr/share/emacs/site-lisp/haskell-mode/haskell-process hides /usr/share/emacs/site-lisp/haskell-mode/build-24.5.1/haskell-process
/usr/share/emacs/site-lisp/haskell-mode/haskell-sandbox hides /usr/share/emacs/site-lisp/haskell-mode/build-24.5.1/haskell-sandbox
/usr/share/emacs/site-lisp/haskell-mode/highlight-uses-mode hides /usr/share/emacs/site-lisp/haskell-mode/build-24.5.1/highlight-uses-mode
/usr/share/emacs/site-lisp/haskell-mode/haskell-c2hs hides /usr/share/emacs/site-lisp/haskell-mode/build-24.5.1/haskell-c2hs
/usr/share/emacs/site-lisp/haskell-mode/haskell-compat hides /usr/share/emacs/site-lisp/haskell-mode/build-24.5.1/haskell-compat
/usr/share/emacs/site-lisp/haskell-mode/haskell-font-lock hides /usr/share/emacs/site-lisp/haskell-mode/build-24.5.1/haskell-font-lock
/usr/share/emacs/site-lisp/haskell-mode/haskell-compile hides /usr/share/emacs/site-lisp/haskell-mode/build-24.5.1/haskell-compile
/usr/share/emacs/site-lisp/haskell-mode/haskell-move-nested hides /usr/share/emacs/site-lisp/haskell-mode/build-24.5.1/haskell-move-nested
/usr/share/emacs/site-lisp/haskell-mode/haskell-indent hides /usr/share/emacs/site-lisp/haskell-mode/build-24.5.1/haskell-indent
/usr/share/emacs/site-lisp/haskell-mode/haskell-menu hides /usr/share/emacs/site-lisp/haskell-mode/build-24.5.1/haskell-menu
/usr/share/emacs/site-lisp/haskell-mode/haskell-session hides /usr/share/emacs/site-lisp/haskell-mode/build-24.5.1/haskell-session
/usr/share/emacs/site-lisp/haskell-mode/haskell-string hides /usr/share/emacs/site-lisp/haskell-mode/build-24.5.1/haskell-string
/usr/share/emacs/site-lisp/haskell-mode/haskell-doc hides /usr/share/emacs/site-lisp/haskell-mode/build-24.5.1/haskell-doc
/usr/share/emacs/site-lisp/haskell-mode/ghci-script-mode hides /usr/share/emacs/site-lisp/haskell-mode/build-24.5.1/ghci-script-mode
/usr/share/emacs/site-lisp/haskell-mode/haskell-lexeme hides /usr/share/emacs/site-lisp/haskell-mode/build-24.5.1/haskell-lexeme
/usr/share/emacs/site-lisp/haskell-mode/haskell-interactive-mode hides /usr/share/emacs/site-lisp/haskell-mode/build-24.5.1/haskell-interactive-mode
/usr/share/emacs/site-lisp/haskell-mode/ghc-core hides /usr/share/emacs/site-lisp/haskell-mode/build-24.5.1/ghc-core
/usr/share/emacs/site-lisp/haskell-mode/haskell-indentation hides /usr/share/emacs/site-lisp/haskell-mode/build-24.5.1/haskell-indentation
/usr/share/emacs/site-lisp/haskell-mode/haskell-complete-module hides /usr/share/emacs/site-lisp/haskell-mode/build-24.5.1/haskell-complete-module
/usr/share/emacs/site-lisp/haskell-mode/haskell-debug hides /usr/share/emacs/site-lisp/haskell-mode/build-24.5.1/haskell-debug
/usr/share/emacs/site-lisp/flim/hex-util hides /usr/share/emacs/25.1/lisp/hex-util
/usr/share/emacs/site-lisp/flim/md4 hides /usr/share/emacs/25.1/lisp/md4
/usr/share/emacs/site-lisp/flim/sasl-ntlm hides /usr/share/emacs/25.1/lisp/net/sasl-ntlm
/usr/share/emacs/site-lisp/flim/hmac-md5 hides /usr/share/emacs/25.1/lisp/net/hmac-md5
/usr/share/emacs/site-lisp/flim/sasl hides /usr/share/emacs/25.1/lisp/net/sasl
/usr/share/emacs/site-lisp/flim/ntlm hides /usr/share/emacs/25.1/lisp/net/ntlm
/usr/share/emacs/site-lisp/flim/hmac-def hides /usr/share/emacs/25.1/lisp/net/hmac-def
/usr/share/emacs/site-lisp/flim/sasl-cram hides /usr/share/emacs/25.1/lisp/net/sasl-cram
/usr/share/emacs/site-lisp/flim/sasl-digest hides /usr/share/emacs/25.1/lisp/net/sasl-digest
/usr/share/emacs/site-lisp/semi/smime hides /usr/share/emacs/25.1/lisp/gnus/smime
/usr/share/emacs/site-lisp/semi/pgg-parse hides /usr/share/emacs/25.1/lisp/obsolete/pgg-parse
/usr/share/emacs/site-lisp/semi/pgg-def hides /usr/share/emacs/25.1/lisp/obsolete/pgg-def
/usr/share/emacs/site-lisp/semi/pgg-pgp5 hides /usr/share/emacs/25.1/lisp/obsolete/pgg-pgp5
/usr/share/emacs/site-lisp/semi/pgg-gpg hides /usr/share/emacs/25.1/lisp/obsolete/pgg-gpg
/usr/share/emacs/site-lisp/semi/pgg hides /usr/share/emacs/25.1/lisp/obsolete/pgg
/usr/share/emacs/site-lisp/semi/pgg-pgp hides /usr/share/emacs/25.1/lisp/obsolete/pgg-pgp

Features:
(shadow sort flyspell ispell mail-extr emacsbug sendmail notmuch hl-line
notmuch-message notmuch-maildir-fcc notmuch-hello edmacro kmacro
wid-edit notmuch-tree notmuch-show notmuch-print notmuch-crypto
notmuch-mua notmuch-address notmuch-company notmuch-parser notmuch-wash
diff-mode easy-mmode coolj notmuch-query goto-addr thingatpt icalendar
diary-lib diary-loaddefs cal-menu calendar cal-loaddefs notmuch-tag crm
notmuch-lib notmuch-version cl message idna dired format-spec rfc822 mml
mailabbrev mail-utils gmm-utils mailheader mm-view mml-smime mml-sec
password-cache epg gnus-util smime mel mime-def alist mcharset mcs-20
mcs-e20 pces pces-e20 pces-20 broken pcustom path-util poe pym static
apel-ver product mm-decode mm-bodies mm-encode mailcap mail-parse
rfc2231 rfc2047 rfc2045 ietf-drums mm-util help-fns mail-prsvr warnings
server time-date finder-inf package epg-config seq byte-opt gv bytecomp
byte-compile cl-extra help-mode easymenu cconv viper viper-ex viper-macs
viper-mous viper-cmd viper-keym ring viper-util viper-init advice
proof-site proof-autoloads pg-vars haskell-mode-autoloads cc-styles
cc-align cc-engine cc-vars cc-defs cl-loaddefs pcase cl-lib mule-util
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register
page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock
font-lock syntax facemenu font-core frame cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese charscript case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote dbusbind inotify dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty make-network-process emacs)

Memory information:
((conses 16 208677 7152)
 (symbols 48 31752 0)
 (miscs 40 214 946)
 (strings 32 52762 7347)
 (string-bytes 1 1545196)
 (vectors 16 24034)
 (vector-slots 8 573560 5264)
 (floats 8 217 6)
 (intervals 56 543 318)
 (buffers 976 158))





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

* bug#24553: 25.1; epa ignores epg-gpg-program in very confusing way
  2016-09-27  8:15 bug#24553: 25.1; epa ignores epg-gpg-program in very confusing way 16emacsbug
@ 2016-09-29  3:07 ` Nick Helm
  2016-09-29 15:53   ` Daiki Ueno
  2017-03-10 20:16 ` Glenn Morris
  1 sibling, 1 reply; 5+ messages in thread
From: Nick Helm @ 2016-09-29  3:07 UTC (permalink / raw)
  To: 24553


> I need to edit some files that decrypt properly with gpg 1.4 but not gpg
> 2.1.  I have both installed on my system, with 1.4 as /usr/bin/gpg1 and
> 2.1 as /usr/bin/gpg2.  The bug is that emacs ignores the epg-gpg-program
> variable *except* in error messages, which is very confusing.  

> Ideally emacs should obey epg-gpg-program ...

I have a similar problem with epg-gpg-program. See bug#24229
(https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24229) for some
discussion that might be relevant.





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

* bug#24553: 25.1; epa ignores epg-gpg-program in very confusing way
  2016-09-29  3:07 ` Nick Helm
@ 2016-09-29 15:53   ` Daiki Ueno
  2016-10-03 17:41     ` Ted Zlatanov
  0 siblings, 1 reply; 5+ messages in thread
From: Daiki Ueno @ 2016-09-29 15:53 UTC (permalink / raw)
  To: Nick Helm; +Cc: 24553

Nick Helm <nick@tenpoint.co.nz> writes:

>> I need to edit some files that decrypt properly with gpg 1.4 but not gpg
>> 2.1.  I have both installed on my system, with 1.4 as /usr/bin/gpg1 and
>> 2.1 as /usr/bin/gpg2.  The bug is that emacs ignores the epg-gpg-program
>> variable *except* in error messages, which is very confusing.  
>
>> Ideally emacs should obey epg-gpg-program ...
>
> I have a similar problem with epg-gpg-program. See bug#24229
> (https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24229) for some
> discussion that might be relevant.

And I want to close this as a duplicate of that bug.  Is there still
anything we can technically do for this?  Isn't it enough to suggest:

  M-: (custom-set-variables '(epg-gpg-program "gpg1" t))

instead of setq?





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

* bug#24553: 25.1; epa ignores epg-gpg-program in very confusing way
  2016-09-29 15:53   ` Daiki Ueno
@ 2016-10-03 17:41     ` Ted Zlatanov
  0 siblings, 0 replies; 5+ messages in thread
From: Ted Zlatanov @ 2016-10-03 17:41 UTC (permalink / raw)
  To: Daiki Ueno; +Cc: 24553, Nick Helm

On Thu, 29 Sep 2016 17:53:09 +0200 Daiki Ueno <ueno@gnu.org> wrote: 

DU> Nick Helm <nick@tenpoint.co.nz> writes:
>>> I need to edit some files that decrypt properly with gpg 1.4 but not gpg
>>> 2.1.  I have both installed on my system, with 1.4 as /usr/bin/gpg1 and
>>> 2.1 as /usr/bin/gpg2.  The bug is that emacs ignores the epg-gpg-program
>>> variable *except* in error messages, which is very confusing.  
>> 
>>> Ideally emacs should obey epg-gpg-program ...
>> 
>> I have a similar problem with epg-gpg-program. See bug#24229
>> (https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24229) for some
>> discussion that might be relevant.

DU> And I want to close this as a duplicate of that bug.  Is there still
DU> anything we can technically do for this?  Isn't it enough to suggest:

DU>   M-: (custom-set-variables '(epg-gpg-program "gpg1" t))

DU> instead of setq?

Respectfully, the usability bug here is different: EPA/EPG only uses the
customized value, while the log message only uses the actual value in
the variable. So the log messages should be adjusted, if you want to
keep using the customized value only in EPA/EPG. And perhaps they should
catch and mention the case where the customized value is not the same as
the variable value, again for usability's sake.

HTH
Ted





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

* bug#24553: 25.1; epa ignores epg-gpg-program in very confusing way
  2016-09-27  8:15 bug#24553: 25.1; epa ignores epg-gpg-program in very confusing way 16emacsbug
  2016-09-29  3:07 ` Nick Helm
@ 2017-03-10 20:16 ` Glenn Morris
  1 sibling, 0 replies; 5+ messages in thread
From: Glenn Morris @ 2017-03-10 20:16 UTC (permalink / raw)
  To: 24553-done

Version: 26.1

16emacsbug@nospam.scs.stanford.edu wrote:

> However, when it fails to decrypt, it prints the message:  Error while
> decrypting with "/usr/bin/gpg1."  This is obviously very frustrating
> since gpg1 can in fact decrypt the file.  Ideally emacs should obey
> epg-gpg-program, but if it doesn't, it should properly report what
> failed.

Thanks for the report. The following improves the error message.

commit b2f20aa (HEAD, master)
Date:   Fri Mar 10 15:14:33 2017 -0500

    Small improvement for epa-display-error (bug#24553)
    
    * lisp/epa.el (epa-display-error): Report the actual program in use.

diff --git a/lisp/epa.el b/lisp/epa.el
index 4378c09..52963b6 100644
--- a/lisp/epa.el
+++ b/lisp/epa.el
@@ -628,7 +628,7 @@ If SECRET is non-nil, list secret keys instead of public keys."
 		       (`import-keys "Error while importing keys with \"%s\":")
 		       (`export-keys "Error while exporting keys with \"%s\":")
 		       (_ "Error while executing \"%s\":\n\n"))
-		     epg-gpg-program)
+		     (epg-context-program context))
 		    "\n\n"
 		    (epg-context-error-output context)))
 	  (epa-info-mode)





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

end of thread, other threads:[~2017-03-10 20:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-27  8:15 bug#24553: 25.1; epa ignores epg-gpg-program in very confusing way 16emacsbug
2016-09-29  3:07 ` Nick Helm
2016-09-29 15:53   ` Daiki Ueno
2016-10-03 17:41     ` Ted Zlatanov
2017-03-10 20:16 ` Glenn Morris

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