comparison lisp/textmodes/texinfo.el @ 46216:00a9017b1365

(texinfo-font-lock-keywords): Disable the automatic environment name update. (texinfo-clone-environment): Fix it not to incorrectly match prefixes.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sun, 07 Jul 2002 20:14:28 +0000
parents 5cc9ed7bc5b5
children c9585243ef9f
comparison
equal deleted inserted replaced
46215:0695dbe46ee5 46216:00a9017b1365
356 ("@\\(cite\\|x?ref\\|pxref\\|dfn\\|inforef\\){\\([^}]+\\)" 356 ("@\\(cite\\|x?ref\\|pxref\\|dfn\\|inforef\\){\\([^}]+\\)"
357 2 font-lock-constant-face) 357 2 font-lock-constant-face)
358 ("@\\(anchor\\){\\([^}]+\\)" 2 font-lock-type-face) 358 ("@\\(anchor\\){\\([^}]+\\)" 2 font-lock-type-face)
359 ("@\\(dmn\\|acronym\\|value\\){\\([^}]+\\)" 2 font-lock-builtin-face) 359 ("@\\(dmn\\|acronym\\|value\\){\\([^}]+\\)" 2 font-lock-builtin-face)
360 ("@\\(end\\|itemx?\\) +\\(.+\\)" 2 font-lock-keyword-face keep) 360 ("@\\(end\\|itemx?\\) +\\(.+\\)" 2 font-lock-keyword-face keep)
361 (,texinfo-environment-regexp 361 ;; (,texinfo-environment-regexp
362 1 (texinfo-clone-environment (match-beginning 1) (match-end 1)) keep) 362 ;; 1 (texinfo-clone-environment (match-beginning 1) (match-end 1)) keep)
363 (,(concat "^@" (regexp-opt (mapcar 'car texinfo-section-list) t) 363 (,(concat "^@" (regexp-opt (mapcar 'car texinfo-section-list) t)
364 ".*\n") 0 texinfo-heading-face t)) 364 ".*\n") 0 texinfo-heading-face t))
365 "Additional expressions to highlight in TeXinfo mode.") 365 "Additional expressions to highlight in TeXinfo mode.")
366 366
367 (defun texinfo-clone-environment (start end) 367 (defun texinfo-clone-environment (start end)
375 (if endp 375 (if endp
376 (texinfo-last-unended-begin) 376 (texinfo-last-unended-begin)
377 (forward-word 1) 377 (forward-word 1)
378 (texinfo-next-unmatched-end)) 378 (texinfo-next-unmatched-end))
379 (skip-syntax-forward "^w") 379 (skip-syntax-forward "^w")
380 (when (looking-at (regexp-quote (buffer-substring start end))) 380 (when (looking-at
381 (concat (regexp-quote (buffer-substring start end)) "\\>"))
381 (text-clone-create start end 'spread "\\w*"))))))) 382 (text-clone-create start end 'spread "\\w*")))))))
382 383
383 (defun texinfo-outline-level () 384 (defun texinfo-outline-level ()
384 ;; Calculate level of current texinfo outline heading. 385 ;; Calculate level of current texinfo outline heading.
385 (save-excursion 386 (save-excursion