Here's an example of define-generic-mode
which sets up the regexp to have all the dates fontified using a custom face with some attributes chosen as examples:
(make-face 'my-date-face)
(set-face-attribute 'my-date-face nil :underline t)
(set-face-attribute 'my-date-face nil :family "times")
(set-face-attribute 'my-date-face nil :slant 'normal)
(set-face-attribute 'my-date-face nil :height '340)
(define-generic-mode my-date-mode
nil
nil
'(("\([0-9]+/[0-9]+/[0-9]+\)"
(1 'my-date-face)))
nil
nil)
Oh, and obviously, set the mode by M-x my-date-mode
. This can be done automatically via the auto-mode-alist (5th argument to define-generic-mode
).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…