Function: allout-file-vars-section-data

allout-file-vars-section-data is a byte-compiled function defined in allout.el.gz.

Signature

(allout-file-vars-section-data)

Documentation

Return data identifying the file-vars section, or nil if none.

Returns a list of the form (BEGINNING-POINT PREFIX-STRING SUFFIX-STRING).

Source Code

;; Defined in /usr/src/emacs/lisp/allout.el.gz
;;;_   > allout-file-vars-section-data ()
(defun allout-file-vars-section-data ()
  "Return data identifying the file-vars section, or nil if none.

Returns a list of the form (BEGINNING-POINT PREFIX-STRING SUFFIX-STRING)."
  ;; minimally gleaned from emacs 21.4 files.el hack-local-variables function.
  (let (beg prefix suffix)
    (save-excursion
      (goto-char (point-max))
      (search-backward "\n\^L" (max (- (point-max) 3000) (point-min)) 'move)
      (if (let ((case-fold-search t))
	    (not (search-forward "Local Variables:" nil t)))
          nil
        (setq beg (- (point) 16))
        (setq suffix (buffer-substring-no-properties
                      (point)
                      (progn (if (search-forward "\n" nil t)
                                 (forward-char -1))
                             (point))))
        (setq prefix (buffer-substring-no-properties
                      (progn (if (search-backward "\n" nil t)
                                 (forward-char 1))
                             (point))
                      beg))
        (list beg prefix suffix))
      )
    )
  )