Function: tex-font-lock-verb

tex-font-lock-verb is a byte-compiled function defined in tex-mode.el.gz.

Signature

(tex-font-lock-verb START DELIM)

Documentation

Place syntax table properties on the \verb construct.

START is the position of the \ and DELIM is the delimiter char.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/tex-mode.el.gz
(defun tex-font-lock-verb (start delim)
  "Place syntax table properties on the \\verb construct.
START is the position of the \\ and DELIM is the delimiter char."
  ;; Do nothing if the \verb construct is itself inside a comment or
  ;; verbatim env.
  (unless (nth 8 (save-excursion (syntax-ppss start)))
    ;; Let's find the end and mark it.
    (let ((afterdelim (point)))
      (skip-chars-forward (string ?^ delim) (line-end-position))
      (if (eolp)
          ;; "LaTeX Error: \verb ended by end of line."
          ;; Remove the syntax-table property we've just put on the
          ;; start-delimiter, so it doesn't spill over subsequent lines.
          (put-text-property (1- afterdelim) afterdelim
                             'syntax-table nil)
        (when (eq (char-syntax (preceding-char)) ?/)
          (put-text-property (1- (point)) (point)
                             'syntax-table (string-to-syntax ".")))
        (put-text-property (point) (1+ (point))
                           'syntax-table (string-to-syntax "\""))))))