GNU bug report logs - #40247
27.0.90; mailcap-mime-data erased when parsing mime parts

Previous Next

Package: emacs;

Reported by: Juan José García Ripoll <juanjose.garcia.ripoll <at> csic.es>

Date: Thu, 26 Mar 2020 22:54:03 UTC

Severity: normal

Tags: fixed, moreinfo

Found in version 27.0.90

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 40247 in the body.
You can then email your comments to 40247 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#40247; Package emacs. (Thu, 26 Mar 2020 22:54:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juan José García Ripoll <juanjose.garcia.ripoll <at> csic.es>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 26 Mar 2020 22:54:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Juan José García Ripoll
 <juanjose.garcia.ripoll <at> csic.es>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.90; mailcap-mime-data erased when parsing mime parts
Date: Thu, 26 Mar 2020 23:53:44 +0100
Symptoms:
- Start Emacs in a system without ~/.mailcap
- Launch Gnus
- Open an email / news that has some part in text/html
- mailcap-mime-data is erased and none of the default viewers are
available any more.

The problem persits if Emacs is customized using mailcap-add

Moreover, this deletion happens every time a mime part is decoded,
because, as shown in this commit
http://git.savannah.gnu.org/cgit/emacs.git/commit/lisp/net/mailcap.el?h=emacs-27&id=a5a967b43dd2810635d7a06ea70510c4a8e5c10f
mailcap-mime-info involes mailcap-parse-mailcaps with "force" set to T
every time Emacs tries to compute the list of viewers associated to a
mime part -- does not matter whether the part is displayed inline or
externally; the mere visualization of the email causes mailcap-mime-data
to be erased.

This bug breaks systems that do not rely on .mailcap for defining
external viewers. In particular, it breaks systems that require
pdf-tools or doc-view to view certain attachments. It also deletes
Emacs' traditional association list betwee mime types and actions.


In GNU Emacs 27.0.90 (build 5, x86_64-w64-mingw32)
 of 2020-03-25 built on DESKTOP-3A8AAJ0
Repository revision: 4860530f3c130c6f854ea83dcc03f59e535a33ba
Repository branch: emacs-27
Windowing system distributor 'Microsoft Corp.', version 10.0.18363
System Description: Microsoft Windows 10 Pro for Workstations (v10.0.1909.18363.720)

Recent messages:
Loading c:/Users/juanj/OneDrive/Library/Emacs/init.el (source)...
Truncate long lines enabled
Loading dired...done
Loading sendmail...done
Loading gnus...done
Loading c:/Users/juanj/OneDrive/Library/Emacs/init.el (source)...done
For information about GNU Emacs and the GNU system, type C-h C-a.


Configured using:
 'configure --without-dbus --host=x86_64-w64-mingw32
 --without-compress-install 'CFLAGS=-O2 -static -g3''

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY W32NOTIFY ACL GNUTLS LIBXML2
HARFBUZZ ZLIB TOOLKIT_SCROLL_BARS MODULES THREADS JSON PDUMPER LCMS2 GMP

Important settings:
  value of $LANG: ESN
  locale-coding-system: cp1252

Major mode: Help

Minor modes in effect:
  ido-vertical-mode: t
  save-place-mode: t
  savehist-mode: t
  gcmh-mode: t
  override-global-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
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort vc-git diff-mode mailalias bbdb-mua bbdb-com crm bbdb
bbdb-site timezone org-mime ox-org org-protocol ox-reveal cl ox-odt
rng-loc rng-uri rng-parse rng-match rng-dt rng-util rng-pttrn nxml-parse
nxml-ns nxml-enc xmltok nxml-util ox-latex ox-icalendar ox-html table
ox-ascii ox-publish ox org-element avl-tree generator org org-macro
org-footnote org-pcomplete pcomplete org-list org-faces org-entities
org-version ob-python ob ob-tangle org-src ob-ref ob-lob ob-table ob-exp
ob-comint comint ansi-color ring ob-emacs-lisp ob-core ob-eval org-table
ol org-keys org-compat org-macs org-loaddefs noutline outline face-remap
mail-extr warnings emacsbug message rmc puny format-spec rfc822 mml
mml-sec epa derived epg epg-config mailabbrev gmm-utils mailheader
eieio-opt speedbar sb-image ezimage dframe cal-menu calendar
cal-loaddefs thingatpt help-fns radix-tree benchmark-init-modes
mm-decode mm-bodies mm-encode mail-parse rfc2231 debug backtrace
find-func mailcap pcase ido-vertical-mode ido gnus-win gnus nnheader
gnus-util rmail rmail-loaddefs text-property-search time-date sendmail
rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils dired
dired-loaddefs grayscale-theme saveplace savehist edmacro kmacro
cus-edit cus-start cus-load wid-edit benchmark-init advice gcmh diminish
cl-extra help-mode use-package use-package-ensure use-package-delight
use-package-diminish use-package-bind-key bind-key easy-mmode
use-package-core finder-inf tex-site info package easymenu browse-url
url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache json subr-x map url-vars seq byte-opt gv
bytecomp byte-compile cconv cl-loaddefs cl-lib tooltip eldoc electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel dos-w32 ls-lisp
disp-table term/w32-win w32-win w32-vars term/common-win tool-bar dnd
fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core term/tty-colors frame minibuffer 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 composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray
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 threads w32notify w32
lcms2 multi-tty make-network-process emacs)

Memory information:
((conses 16 406075 136288)
 (symbols 48 26199 18)
 (strings 32 147191 19372)
 (string-bytes 1 3986907)
 (vectors 16 49708)
 (vector-slots 8 1378984 300360)
 (floats 8 246 907)
 (intervals 56 690 197)
 (buffers 1000 16))

-- 
Juan José García Ripoll

Quantum Information and Foundations Group
Institute of Fundamental Physics IFF-CSIC
Calle Serrano 113b, Madrid 28006 Spain
http://quinfog.hbar.es - http://juanjose.garcia.ripoll




Added indication that bug 40247 blocks39200 Request was from Eli Zaretskii <eliz <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 27 Mar 2020 07:13:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40247; Package emacs. (Sun, 28 Jun 2020 17:12:01 GMT) Full text and rfc822 format available.

Message #10 received at 40247 <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Juan José García Ripoll
 <juanjose.garcia.ripoll <at> csic.es>
Cc: 40247 <at> debbugs.gnu.org
Subject: Re: bug#40247: 27.0.90; mailcap-mime-data erased when parsing mime
 parts
Date: Sun, 28 Jun 2020 18:11:00 +0100
Juan José García Ripoll <juanjose.garcia.ripoll <at> csic.es> writes:

> Symptoms:
> - Start Emacs in a system without ~/.mailcap
> - Launch Gnus
> - Open an email / news that has some part in text/html
> - mailcap-mime-data is erased and none of the default viewers are
> available any more.

I think this is a symptom of the fix for bug#36771, and therefore
affects systems with mailcap files as well.

Since it affects me too and block Emacs 27.1, I plan to look into it in
about a week's time if no-one beats me to it.

Thanks,

-- 
Basil




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40247; Package emacs. (Sun, 28 Jun 2020 17:21:01 GMT) Full text and rfc822 format available.

Message #13 received at 40247 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Cc: juanjose.garcia.ripoll <at> csic.es, 40247 <at> debbugs.gnu.org
Subject: Re: bug#40247: 27.0.90;
 mailcap-mime-data erased when parsing mime parts
Date: Sun, 28 Jun 2020 20:20:16 +0300
> From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
> Date: Sun, 28 Jun 2020 18:11:00 +0100
> Cc: 40247 <at> debbugs.gnu.org
> 
> I think this is a symptom of the fix for bug#36771, and therefore
> affects systems with mailcap files as well.
> 
> Since it affects me too and block Emacs 27.1, I plan to look into it in
> about a week's time if no-one beats me to it.

That might be too late: we hope to have the first RC this week or the
next.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40247; Package emacs. (Sun, 28 Jun 2020 17:46:02 GMT) Full text and rfc822 format available.

Message #16 received at 40247 <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: juanjose.garcia.ripoll <at> csic.es, 40247 <at> debbugs.gnu.org
Subject: Re: bug#40247: 27.0.90; mailcap-mime-data erased when parsing mime
 parts
Date: Sun, 28 Jun 2020 18:45:19 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
>> Date: Sun, 28 Jun 2020 18:11:00 +0100
>> Cc: 40247 <at> debbugs.gnu.org
>> 
>> I think this is a symptom of the fix for bug#36771, and therefore
>> affects systems with mailcap files as well.
>> 
>> Since it affects me too and block Emacs 27.1, I plan to look into it in
>> about a week's time if no-one beats me to it.
>
> That might be too late: we hope to have the first RC this week or the
> next.

That just means the bug won't be fixed until 27.2 or 28.1, right?

Unfortunately my hands are completely tied until Thursday (I shouldn't
even be writing this email!), and either way I think the fix will
involve non-trivial code changes.

Should bug#39200 therefore be marked as no longer blocked by this?

Thanks,

-- 
Basil




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40247; Package emacs. (Sun, 28 Jun 2020 18:20:01 GMT) Full text and rfc822 format available.

Message #19 received at 40247 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Cc: juanjose.garcia.ripoll <at> csic.es, 40247 <at> debbugs.gnu.org
Subject: Re: bug#40247: 27.0.90; mailcap-mime-data erased when parsing mime
 parts
Date: Sun, 28 Jun 2020 21:19:16 +0300
> From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
> Cc: juanjose.garcia.ripoll <at> csic.es,  40247 <at> debbugs.gnu.org
> Date: Sun, 28 Jun 2020 18:45:19 +0100
> 
> > That might be too late: we hope to have the first RC this week or the
> > next.
> 
> That just means the bug won't be fixed until 27.2 or 28.1, right?

Could be, yes.

> Unfortunately my hands are completely tied until Thursday (I shouldn't
> even be writing this email!), and either way I think the fix will
> involve non-trivial code changes.

That's okay, the bug doesn't sound too bad to me.

> Should bug#39200 therefore be marked as no longer blocked by this?

I don't really mind, those blocking attributes are advisory only.
This bug has been open for many moons and no one seemed to care too
much, so I don't see how it could be really blocking.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40247; Package emacs. (Sun, 02 Aug 2020 06:21:01 GMT) Full text and rfc822 format available.

Message #22 received at 40247 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Juan José García Ripoll
 <juanjose.garcia.ripoll <at> csic.es>
Cc: 40247 <at> debbugs.gnu.org
Subject: Re: bug#40247: 27.0.90; mailcap-mime-data erased when parsing mime
 parts
Date: Sun, 02 Aug 2020 08:20:23 +0200
Juan José García Ripoll <juanjose.garcia.ripoll <at> csic.es> writes:

> Symptoms:
> - Start Emacs in a system without ~/.mailcap
> - Launch Gnus
> - Open an email / news that has some part in text/html
> - mailcap-mime-data is erased and none of the default viewers are
> available any more.
>
> The problem persits if Emacs is customized using mailcap-add

Oops.  This is all such a mess -- we have defaults coming from Emacs via
mailcap-mime-data, system defaults from /etc and user defaults from
~/.mailcap and mailcap-add...

The problem is that we don't keep track of where and how things are
added -- it's all just stored in mailcap-mime-data, and reconstructing
the precedence (for instance, when the user edits ~/.mailcap) is
impossible.

The fix I made in October is clearly wrong, but it basically works for
the basic (and common) "respect my ~/.mailcap" file case.

But I'm not quite sure how to go about fixing this bug...  Hm.  I think
perhaps we have to stop messing about with the mailcap-mime-data
variable when we compute the precedence.  So mailcap-parse-mailcaps
should heed all the files, and mailcap-mime-info, but store the computed
data in a new variable, that will then be consulted when trying to
determine what viewers to use.

I'll take a whack at implementing it that way and then see how that goes.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40247; Package emacs. (Sun, 02 Aug 2020 07:06:02 GMT) Full text and rfc822 format available.

Message #25 received at 40247 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Juan José García Ripoll
 <juanjose.garcia.ripoll <at> csic.es>
Cc: 40247 <at> debbugs.gnu.org
Subject: Re: bug#40247: 27.0.90; mailcap-mime-data erased when parsing mime
 parts
Date: Sun, 02 Aug 2020 09:05:05 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> I'll take a whack at implementing it that way and then see how that goes.

I've now done so in Emacs 28.1.  Could you try this and see if it works
as expected now?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 02 Aug 2020 07:06:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40247; Package emacs. (Mon, 03 Aug 2020 14:42:02 GMT) Full text and rfc822 format available.

Message #30 received at 40247 <at> debbugs.gnu.org (full text, mbox):

From: Juan José García-Ripoll
 <juanjose.garcia.ripoll <at> csic.es>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 40247 <at> debbugs.gnu.org
Subject: Re: bug#40247: 27.0.90;
 mailcap-mime-data erased when parsing mime parts
Date: Mon, 03 Aug 2020 16:41:14 +0200
Seems to work now. At least it does not fail after the steps I
showed.

Could this fix be backported to emacs-27? I cannot install emacs-27 if
it is going to break my mail reading setup.

-- 
Juan José García Ripoll

Quantum Information and Foundations Group
Institute of Fundamental Physics IFF-CSIC
Calle Serrano 113b, Madrid 28006 Spain
http://quinfog.hbar.es - http://juanjose.garcia.ripoll




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40247; Package emacs. (Tue, 04 Aug 2020 08:37:01 GMT) Full text and rfc822 format available.

Message #33 received at 40247 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Juan José García-Ripoll
 <juanjose.garcia.ripoll <at> csic.es>
Cc: 40247 <at> debbugs.gnu.org
Subject: Re: bug#40247: 27.0.90; mailcap-mime-data erased when parsing mime
 parts
Date: Tue, 04 Aug 2020 10:35:53 +0200
Juan José García-Ripoll <juanjose.garcia.ripoll <at> csic.es> writes:

> Seems to work now. At least it does not fail after the steps I
> showed.

OK; closing, then.

> Could this fix be backported to emacs-27? I cannot install emacs-27 if
> it is going to break my mail reading setup.

I'm a bit worried about backporting...  I mean, the current emacs-27
behaviour is clearly a bug, but I'm not sure that the emacs-28 behaviour
is exactly...  correct?  The mailcap parsing precedence has never been
explicitly defined, which reflects all these "well, that didn't work,
then" changes to the code base over the years.

So I think it would make sense to have these changes in Emacs 28 for a
while first to see whether it ruins somebody's setup before
backporting.  However, Emacs 27.1 is going to be released in a very
short time (allegedly), so these changes won't make it into that
release.  But perhaps into Emacs 27.2.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 04 Aug 2020 08:37:01 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 40247 <at> debbugs.gnu.org and Juan José García Ripoll <juanjose.garcia.ripoll <at> csic.es> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 04 Aug 2020 08:37:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 01 Sep 2020 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 209 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.