3

I am beginner using Emacs 23.4, and I wanted to try a web browser package. From Emacs wiki, I found eww. But when Emacs starts I get from *Warnings*:

File error: Cannot open load file, shr

I get the same thing when I do M-x load-library RET shr.

What I did for installing eww was saving the eww.el file in my ~/.emacs.d/ directory and added this:

(add-to-list 'load-path "~/.emacs.d/")
(require 'eww)

to my ~/.emacs file as well.

I didn't find the shr package to download on internet, and that is why I am lost. Thanks in advance.

Malabarba
  • 22,878
  • 6
  • 78
  • 163
Nicolas P
  • 53
  • 3
  • 1
    `eww` is built into Emacs 24.4, so you didn't need to download it, unless you have an older Emacs. `shr.el` is part of Emacs (again, I believe since very recently - at least I'm sure it relies on libxml, which was added not so long ago). You'll also want to read this http://www.emacswiki.org/InstallingPackages to figure out how to get Emacs packages with less version conflicts and update mechanism. – wvxvw Dec 14 '14 at 20:25

1 Answers1

6

shr and eww can't work in Emacs 23. Regardless of other incompatibilities, they require Emacs to have been compiled with libxml2 support, and that ability came in 24.1

If you want to try eww, you should install Emacs 24.4 or later ("later" currently meaning compiling from the source repository).

Note that eww is built into these versions (24.4+) of Emacs, so in general you shouldn't use downloaded versions of eww with them. Delete any such files from your config, otherwise you might be overriding the in-built version with an incompatible version.

phils
  • 48,657
  • 3
  • 76
  • 115
  • I have downloaded Emacs 24 but now I get `Cannot open load file, subr-x`. I searched but it doesn't seem to be a downloadable package. Should I add this to the question? I am new in SExchange – Nicolas P Dec 15 '14 at 03:05
  • Finally I was able to download `subr-x.el`, and now I don't have any error message. Also `M-x eww` seems to work. I still have a problem, though: now it get stuck in `Contacting host`, but I think that the original issue is solved. Thanks – Nicolas P Dec 15 '14 at 03:24
  • That *might* be ok, but you're now running Emacs 24 with libraries intended for Emacs 25. That's why eww was looking for a subr-x library. You should probably either (a) remove *all* of the eww-related libraries that you've downloaded, and simply use the version of eww built into Emacs 24.4; or (b) compile Emacs from source to get the very latest code. (I would strongly recommend starting with (a)). – phils Dec 15 '14 at 04:10
  • What do you mean by "all eww-related libraries that you've downloaded"? I simply downloaded a single file `eww.el` (and `subr-x.el`). And even if I remove those files from `~/.emacs.d`, I don't see any eww built into Emacs 24 (`M-x eww [No match]`) – Nicolas P Dec 15 '14 at 04:44
  • Yes, removing eww.el and subr-x.el is what I meant. I wasn't certain if those were the only files you'd downloaded while trying to get this working. Emacs 24.4 includes eww and `M-x eww` should absolutely work. Are you definitely using 24.4? – phils Dec 15 '14 at 05:07
  • Debian usually seems to lag behind the Emacs releases. I found http://www.reddit.com/r/emacs/comments/2kzj41/emacs_244_debian_packages/ and I think that issues compiling Emacs are out of scope for this Q&A (but if there's not already an appropriate question for that, go ahead and create one). – phils Dec 15 '14 at 05:48
  • I was using Emacs 24.3 since it seems to be the latest version in Debian wheezy repositories. However I installed 24.4 version after of downloading from Emacs official webpage and I can use eww without problems. Thank you for your help! :-) – Nicolas P Dec 15 '14 at 05:51