Function: reftex-index-phrase-match-is-indexed

reftex-index-phrase-match-is-indexed is a byte-compiled function defined in reftex-index.el.gz.

Signature

(reftex-index-phrase-match-is-indexed BEG END)

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/reftex-index.el.gz
(defun reftex-index-phrase-match-is-indexed (beg end)
  ;; Check if match is in an argument of an index macro, or if an
  ;; index macro is directly attached to the match.
  (save-excursion
    (goto-char end)
    (let* ((all-macros (reftex-what-macro t))
;           (this-macro (car (car all-macros)))
           (before-macro
            (and (> beg 2)
                 (goto-char (1- beg))
                 (memq (char-after (point)) '(?\] ?\}))
                 (car (reftex-what-macro 1))))
           (after-macro
            (and (goto-char end)
                 (looking-at "\\(\\\\[a-zA-Z]+\\*?\\)[[{]")
                 (match-string 1)))
           macro)
      (or (catch 'matched
            (while (setq macro (pop all-macros))
              (if (member (car macro) reftex-macros-with-index)
                  (throw 'matched t)))
            nil)
          (and before-macro
               (member before-macro reftex-macros-with-index))
          (and after-macro
               (member after-macro reftex-macros-with-index))))))