Function: bibtex-parse-field-text

bibtex-parse-field-text is a byte-compiled function defined in bibtex.el.gz.

Signature

(bibtex-parse-field-text)

Documentation

Parse the text part of a BibTeX field.

The text part is either a string, or an empty string, or a constant followed by one or more <# (string|constant)> pairs. If a syntactically correct text is found, a pair containing the start and end position of the text is returned, nil otherwise. Move point to end of field text.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/bibtex.el.gz
(defun bibtex-parse-field-text ()
  "Parse the text part of a BibTeX field.
The text part is either a string, or an empty string, or a constant followed
by one or more <# (string|constant)> pairs.  If a syntactically correct text
is found, a pair containing the start and end position of the text is
returned, nil otherwise.  Move point to end of field text."
  (let ((starting-point (point))
        end-point failure boundaries)
    (while (not (or end-point failure))
      (cond ((looking-at bibtex-field-const)
             (goto-char (match-end 0)))
            ((setq boundaries (bibtex-parse-field-string))
             (goto-char (cdr boundaries)))
            ((setq failure t)))
      (if (looking-at "[ \t\n]*#[ \t\n]*")
          (goto-char (match-end 0))
        (setq end-point (point))))
    (skip-chars-forward " \t\n")
    (if (and (not failure)
             end-point)
        (list starting-point end-point (point)))))