help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: parens matching not matching all matching parens


From: Stefan Monnier
Subject: Re: parens matching not matching all matching parens
Date: Fri, 17 Sep 2004 18:22:42 GMT
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (gnu/linux)

> (define-generic-mode 'rtf-generic-mode
>    nil
>    nil
>    (list "\\\\\\([a-z]+\\(-?[0-9]+\\)? ?\\)")
>    (list "\\.[rR][tT][fF]")
>    nil)

Try

(defvar rtf-font-lock-keywords
  '("\\\\\\([a-z]+\\(-?[0-9]+\\)? ?\\)"))

(defvar rtf-mode-syntax-table
  (let ((st (make-syntax-table)))
    (modify-syntax-entry ?\( "." st)
    (modify-syntax-entry ?\) "." st)
    (modify-syntax-entry ?\[ "." st)
    (modify-syntax-entry ?\] "." st)
    st))

;;;###autoload
(add-to-list 'auto-mode-alist '("\\.[rR][tT][fF]\\'" . rtf-mode))

(define-derived-mode rtf-mode text-mode "RTF"
  "Major mode for Rich Text Format."
  (set (make-local-variable 'font-lock-defaults)
       '(rtf-font-lock-keywords)))


-- Stefan

reply via email to

[Prev in Thread] Current Thread [Next in Thread]