0

Been using Emacs 24 for more than an year, but not an expert. Following this answer I installed emacs25 from Kevin Kelly's repo. I haven't configured anything on this version yet and I still get an error message saying "Use font-lock-support-mode rather than calling lazy-lock-mode" every time I do M-x. Can someone explain this error and what to do about it?

I tried going to the customize menu and set value of font-lock-support-mode from "mode-specific" to "lazy-lock", but I couldn't save the changes beyond that session.

user128785
  • 45
  • 4

1 Answers1

0

The message you cite indicates that you're somehow trying to use lazy-lock-mode, and the message is telling you not to (because it's obsolete since Emacs-22).

This use might be either in your ~/.emacs or in some other initialization file (see the (emacs)Init File node of the Emacs manual). E.g. you might find the site-file via M-x find-library RET site-start RET, same with the default file.

Stefan
  • 26,154
  • 3
  • 46
  • 84
  • I don't understand how I'm using `lazy-lock-mode`. Fresh install, no init file, so how? – user128785 Feb 21 '18 at 09:47
  • Maybe a site-file? Try it with `emacs -q` and with `emacs --no-site-file`? Also do create your own `~/.emacs` and put a `(message "here I am")` in it so you see in `*Messages*` if it comes before or after the "error". – Stefan Feb 22 '18 at 04:07
  • With `emacs -q` I got the error at every key press -- just as earlier. But magically (i.e. unknown to me) `emacs --no-site-file` worked, i.e. it loaded my `.emacs` that I used with version `24.5.1`. So I didn't try the "here I am" message. Thanks, @Stefan! How can make this my default load setting? Could you point me to some blog post or relevant emacs help entry for `--no-site-file`? I am interested in learning. – user128785 Feb 22 '18 at 04:37
  • Stefan, I am accepting your answer, please add the tip that worked from the comment to the main answer. – user128785 Feb 22 '18 at 06:07
  • @user128785: `--no-site-file` is just a workaround. You need to find the corresponding site-file and fix it. I added some info about how to do that. – Stefan Feb 22 '18 at 08:11
  • `M-x find-library RET site-file RET` returned "Can't find library site-file". When I did `C-h d RET site-file` I was led to the variable `init-file-user` where this was written: "Setting ‘init-file-user’ does not prevent Emacs from loading ‘site-start.el’. The only way to do that is to use ‘--no-site-file’." :( May be I will ask a separate question for a workaround, if it exists. – user128785 Feb 22 '18 at 10:52
  • @user128785: Sorry, that was a typo, the file name is `site-start`, as you can see in `(emacs)Init File`. Have you tried with `default` ? – Stefan Feb 22 '18 at 13:46
  • I could find the library file `site-start`, but there is no mention of `lazy-lock-mode` there. About default: "Can't find library default". Stefan, if you don't mind, will you entertain some questions in the chat? (I am being prompted to move this discussion to the chat thread.) – user128785 Feb 23 '18 at 04:18
  • Then try: `emacs -Q` and then `M-x load-library RET lazy-lock RET`; `M-x debug-on-entry RET lazy-lock-mode RET`; `M-x load-library RET site-start RET`. Hopefully, this will give you a backtrace which will help you find the origin of the problem. – Stefan Feb 23 '18 at 13:25
  • Here are the results of each of these comments after `emacs -Q`: `M-x load-library RET lazy-lock RET`: "Package lazy-lock is obsolete!" `M-x debug-on-entry RET lazy-lock-mode RET`: Didn't do anything unusual. `M-x load-library RET site-start RET`: "No such file or directory, rng-auto" What does **rng-auto** mean? – user128785 Feb 24 '18 at 11:07
  • `rng-auto` here is the name of some Elisp library file which your `site-start` apparently tried to load unsuccessfully (it probably was part of some earlier version of nXML, before it got bundled as part of Emacs). Why don't you just remove this `site-start.el` which seems to be full of out-of-date stuff. – Stefan Feb 25 '18 at 13:02
  • Just did that! I had no idea I could do that without breaking something. So I renamed the file `site-start.el` in `/usr/share/emacs/site-lisp` to `site-start.el.bkp` and now running `emacs25` from the terminal opens Emacs without that annoying warning. After that, I also confidently removed my emacs24.5 so running just `emacs` from the terminal opens emacs25.3. Thanks @Stefan. :) – user128785 Feb 26 '18 at 09:34
  • Emacs does not come with a `site-start.el` since it's by definition a file that is specific to the installation site (i.e. your machine). IOW that file comes from *you* (or someone else who managed that machine earlier). – Stefan Feb 26 '18 at 13:05