[Python-modules-team] Bug#438664: rst.el: RFE rst-compile "multifile" support

Trent W. Buck trentbuck at gmail.com
Sat Aug 18 19:50:11 UTC 2007


Package: python-docutils
Version: 0.4-4
Severity: wishlist
File: /usr/share/emacs/site-lisp/rst.el

[This is an upstream bug.]

The rst-compile function assumes the current buffer is the "master"
source file for a reST document.  When using the ..include::
directive, this is not necessarily the case.

In AuCTeX, a similar problem is solved by supporting a file-local
variable TeX-Master, which contains a string referring to the master
file.  I suggest the rst-compile function be similar extended to use
the reST-master file-local variable (if set), falling back on the
current behaviour (if not set).

An advantageous side effect is that files with a generic .txt
extension (or no extension) could be made to automatically use
rst-mode instead of the generic text-mode with the following elisp
(adapted from scheme48):

    (put 'reST-master 'safe-local-variable t)
    (add-hook 'hack-local-variables-hook
      (λ ()
         (when (and (boundp 'reST-master) reST-master)
           (rst-mode)
           (hack-local-variables-prop-line))))

References:

    http://www.gnu.org/software/auctex/manual/auctex/Multifile.html
    http://emacswiki.org/wiki/download/scheme48.el




More information about the Python-modules-team mailing list