Subject: Re: bug#31151: 27.0.50; error "Recursive ‘require’ for feature ‘mm-decode’"

From: Tino Calancha <[email-masked]>
Date: Sat, 14 Apr 2018 19:26:06 +0900

Stefan Husmann <[email-masked]> writes:

> Hello,
>
> I think the latest change on master on the file broke the build process
> for emacs.
Thank you very much.
It happens after commit 'Don't bind image commands on non-image links in
Gnus' (4575ae5a9c5589ac903362486951f0d36c8ff8ee)

I think it's OK if we drop the
(require 'shr)
at the top of the file.

--8<-----------------------------cut here---------------start------------->8---
commit ca280c00237653a0898d81387d4d069996b99901
Author: Tino Calancha <[email-masked]>
Date:   Sat Apr 14 19:01:03 2018 +0900

    Fix circular dependency for mm-decode
    
    * lisp/gnus/mm-decode.el: Do not require shr.el at the top
    of the file; `mm-shr' already requires shr.el in its body, and
    this function is the only `mm-convert-shr-links' caller (Bug#31151).
    
    Declare used variables defined in shr.el, `shr-image-map' and `shr-map'.

diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el
index 69fc770ec7..18c5837dd5 100644
--- a/lisp/gnus/mm-decode.el
+++ b/lisp/gnus/mm-decode.el
@@ -25,7 +25,6 @@
 
 (require 'mail-parse)
 (require 'mm-bodies)
-(require 'shr)
 (eval-when-compile (require 'cl-lib))
 
 (autoload 'gnus-map-function "gnus-util")
@@ -1842,6 +1841,8 @@ mm-shr
 	   (let ((inhibit-read-only t))
 	     (delete-region min max))))))))
 
+(defvar shr-image-map)
+(defvar shr-map)
 (autoload 'widget-convert-button "wid-edit")
 (defvar widget-keymap)
 
--8<-----------------------------cut here---------------end--------------->8---