emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug in file variables handling


From: Milan Zamazal
Subject: Bug in file variables handling
Date: Wed, 29 Dec 2004 09:55:12 +0100

In the recent Emacs CVS versions, the End: delimiter of file variables
may not be recognized correctly.  If there is no prefix before the
`Local Variables:' delimiter, file variables with names ending with
`end' terminate the file variables list prematurely.  For instance, the
following file variable list sets only the time-stamp-line-limit and
time-stamp-start variables, the rest of the list is not processed:

<!--
Local Variables:
time-stamp-line-limit: -15
time-stamp-start: "Last modified: "
time-stamp-end: "\\.$"
time-stamp-time-zone: "UTC"
time-stamp-format: "%:y-%02m-%02d %02H:%02M %Z"
End:
-->

The attached patch should fix the bug:

2004-12-29  Milan Zamazal  <address@hidden>

        * files.el (hack-local-variables): If there is no PREFIX, set it to
        "^"; redundant variable PREFIXLEN removed.

*** lisp/files.el.orig  Tue Dec 28 12:02:53 2004
--- lisp/files.el       Wed Dec 29 09:52:39 2004
***************
*** 2183,2189 ****
                                                   buffer-file-name)
                                                (concat "buffer "
                                                        (buffer-name))))))))))
!         (let (prefix prefixlen suffix beg
                (enable-local-eval enable-local-eval))
            ;; The prefix is what comes before "local variables:" in its line.
            ;; The suffix is what comes after "local variables:" in its line.
--- 2183,2189 ----
                                                   buffer-file-name)
                                                (concat "buffer "
                                                        (buffer-name))))))))))
!         (let (prefix suffix beg
                (enable-local-eval enable-local-eval))
            ;; The prefix is what comes before "local variables:" in its line.
            ;; The suffix is what comes after "local variables:" in its line.
***************
*** 2197,2204 ****
                      (buffer-substring (point)
                                        (progn (beginning-of-line) (point)))))
  
!           (if prefix (setq prefixlen (length prefix)
!                            prefix (regexp-quote prefix)))
            (if suffix (setq suffix (concat (regexp-quote suffix) "$")))
            (forward-line 1)
            (let ((startpos (point))
--- 2197,2203 ----
                      (buffer-substring (point)
                                        (progn (beginning-of-line) (point)))))
  
!           (setq prefix (if prefix (regexp-quote prefix) "^"))
            (if suffix (setq suffix (concat (regexp-quote suffix) "$")))
            (forward-line 1)
            (let ((startpos (point))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]