Bug 250100 - rst-mode breaks under Emacs 22
rst-mode breaks under Emacs 22
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: python-docutils (Show other bugs)
7
All Linux
low Severity low
: ---
: ---
Assigned To: Toshio Ernie Kuratomi
Fedora Extras Quality Assurance
http://bugs.debian.org/cgi-bin/bugrep...
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-07-30 10:36 EDT by Vadim Nasardinov
Modified: 2007-11-30 17:12 EST (History)
0 users

See Also:
Fixed In Version: 0.4-6.fc7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-08-24 01:40:29 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Vadim Nasardinov 2007-07-30 10:36:29 EDT
The reST mode provided by
/usr/share/doc/python-docutils-0.4/editors/emacs/rst.el does not work
in Emacs 22:

| $ rpm -qf /usr/share/doc/python-docutils-0.4/editors/emacs/rst.el
| python-docutils-0.4-4.fc7


In my ~/.emacs, I have:

 | (add-to-list
 |         'load-path
 |         "/usr/share/doc/python-docutils-0.4/editors/emacs/")
 | (add-to-list 'auto-mode-alist '("\\.rst\\'" . rst-mode))
 | 
 | ;; rst-mode doesn't automatically estabilish the rst bindings.  It's
 | ;; still on their TODO list for some reason.
 | 
 | (add-hook 'rst-mode-hook 'rst-text-mode-bindings)
 | 
 | (require 'rst)
 | 
 | ;; $ rpm -ql python-docutils | grep bin/
 | ;; /usr/bin/rst2html
 | ;; /usr/bin/rst2latex
 | ;; /usr/bin/rst2newlatex
 | ;; /usr/bin/rst2pseudoxml
 | ;; /usr/bin/rst2s5
 | ;; /usr/bin/rst2xml
 | 
 | (setq rst-compile-toolsets
 |       '((html      . ("rst2html" ".html" nil))
 |         (latex     . ("rst2latex" ".tex" nil))
 |         (newlatex  . ("rst2newlatex" ".tex" nil))
 |         (pseudoxml . ("rst2pseudoxml" ".xml" nil))
 |         (s5        . ("rst2s5" ".xml" nil))
 |         (xml       . ("rst2xml" ".xml" nil))))

When I open an *.rst document, I get the following error:

 | Debugger entered--Lisp error: (void-function lazy-lock-mode)
 |   lazy-lock-mode(t)
 |   font-lock-turn-on-thing-lock()
 |   font-lock-mode-internal(t)
 |   font-lock-default-function(t)
 |   font-lock-mode()
 |   turn-on-font-lock()
 |   turn-on-font-lock-if-enabled()
 |   global-font-lock-mode-enable-in-buffers()
 |   global-font-lock-mode-check-buffers()
 |   run-hooks(find-file-hook)
 |   after-find-file(nil t)
 |   find-file-noselect-1(#<buffer test-doc.rst>
 |                        "/var/tmp/test-doc.rst"
 |                        nil nil
 |                        "/var/tmp/test-doc.rst"
 |                        (822572 2056))
 |   find-file-noselect("/var/tmp/test-doc.rst" nil nil t)
 |   find-file("/var/tmp/test-doc.rst" t)
 |   call-interactively(find-file)

According to http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=418446,
this is because Emacs 22 no longer provides the function
LAZY-LOCK-MODE.  Instead, JIT-LOCK-MODE should be used.

For now, I can work around this by including the following in my
~/.emacs:

  (defun lazy-lock-mode (arg)
    (jit-lock-mode arg))

The Debian bug referenced above provides a patch against rst.el that
would make it work in Emacs 22 (but it would it break for Emacs 21).

A more robust patch would make rst.el work in both Emacs 21 and 22 by
testing for the presence of LAZY-LOCK-MODE with FBOUNDP and using
JIT-LOCK-MODE when LAZY-LOCK-MODE is not fbound.
Comment 1 Toshio Kuratomi 2007-07-30 13:11:49 EDT
Hi,  Thanks for pointing this out.

I'm not a LISPer so I'll take a look at applying the Debian patch but I might
have to recruit someone to help me modify it to work with either emacs 21 or 22.
Comment 2 Toshio Ernie Kuratomi 2007-08-13 02:54:26 EDT
I've built a new package with an rst.el checkout from the docutils upstream svn.
 Please test it and let me know if it works for you.  Here's a URL to download
it from koji::

http://koji.fedoraproject.org/packages/python-docutils/0.4/5.fc7/noarch/python-docutils-0.4-5.fc7.noarch.rpm
Comment 3 Fedora Update System 2007-08-13 13:02:58 EDT
python-docutils-0.4-5.fc7 has been pushed to the Fedora 7 testing repository.  If problems still persist, please make note of it in this bug report.
Comment 4 Vadim Nasardinov 2007-08-13 14:10:49 EDT
Re: comment #2

> I've built a new package with an rst.el checkout from the
> docutils upstream svn.  Please test it and let me know if it
> works for you.

It does work for me in Emacs 22.  The only thing that I found slightly
confusing is that the new RPM ships *two* different versions of
rst.el:

| $ rpm -ql python-docutils | grep rst.el
| /usr/share/doc/python-docutils-0.4/editors/emacs/rst.el
| /usr/share/doc/python-docutils-0.4/editors/rst.el

Is this by design?  So that people can continue using the old version,
if they choose to?  If so, it might have made sense to mention this in
the changelog:

| $ rpm -q --changelog python-docutils | head -3
| * Sun Aug 12 2007 Toshio Kuratomi <a.badger@gmail.com> 0.4-5
| - Make License tag conform to the new Licensing Policy.
| - Fix the rst emacs mode (RH BZ 250100)

I had to adjust the LOAD-PATH to pick up the updated version.  I had
to change

 (add-to-list 'load-path
              "/usr/share/doc/python-docutils-0.4/editors/emacs/")

to

 (add-to-list 'load-path
              "/usr/share/doc/python-docutils-0.4/editors/")

in my ~/.emacs.  People who fail to adjust their LOAD-PATH in a
similar fashion will continue to load the old version of rst.el.

Other than that, it seems fine for now.  (I haven't done any editing
to in the rst-mode to verify that everything else works.  I've just
verified that font-locking works.)

Thanks.
Comment 5 Toshio Ernie Kuratomi 2007-08-13 17:16:13 EDT
(In reply to comment #4)
> Re: comment #2
> 
> > I've built a new package with an rst.el checkout from the
> > docutils upstream svn.  Please test it and let me know if it
> > works for you.
> 
> It does work for me in Emacs 22.  The only thing that I found slightly
> confusing is that the new RPM ships *two* different versions of
> rst.el:
> 
Ick.  That's a bug in my packaging.  Here's a new version with only the new rst.el:
http://koji.fedoraproject.org/packages/python-docutils/0.4/6.fc7/noarch/python-docutils-0.4-6.fc7.noarch.rpm
Comment 6 Fedora Update System 2007-08-13 18:52:32 EDT
python-docutils-0.4-6.fc7 has been pushed to the Fedora 7 testing repository.  If problems still persist, please make note of it in this bug report.
Comment 7 Toshio Ernie Kuratomi 2007-08-20 14:24:35 EDT
Ping?  Did this update work for you?  I'll be pushing this package tonight
unless I hear something negative from you :-)
Comment 8 Vadim Nasardinov 2007-08-21 12:15:41 EDT
Yes, it seems to work.

I installed the new RPM:

|$ curl -O \
|http://koji.fedoraproject.org/packages/python-docutils/0.4/6.fc7/noarch/python-docutils-0.4-6.fc7.noarch.rpm

|  % Total  % Received % Xferd  Average Speed   Time   Time     Time  Current
|                               Dload  Upload   Total  Spent    Left  Speed
|100 1504k  100 1504k  0     0  1109k      0  0:00:01 0:00:01 --:--:-- 1572k
|$ sudo rpm -Uvh python-docutils-0.4-6.fc7.noarch.rpm 
|Password:
|Preparing...                ########################################### [100%]
|   1:python-docutils        ########################################### [100%]

so that

|$ rpm -qf /usr/share/doc/python-docutils-0.4/editors/emacs/rst.el
|python-docutils-0.4-6.fc7

I changed my ~/.emacs back to

 (add-to-list 'load-path
              "/usr/share/doc/python-docutils-0.4/editors/emacs/")

Opened a new Emacs instance.

Started IELM:

  M-x ielm

And verified that I was picking up rst.el from the correct location:

 | *** Welcome to IELM ***  Type (describe-mode) for help.
 | ELISP> (locate-library "rst")
 | "/usr/share/doc/python-docutils-0.4/editors/emacs/rst.el"

Opened a sample .rst file.  Font-lock seems to work.

Thanks.
Comment 9 Fedora Update System 2007-08-24 01:40:19 EDT
python-docutils-0.4-6.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.