- (syntactically-sectionize
- #'(lambda (s e context depth)
- (let (face)
- (cond ((eq context 'string)
- ;;#### Should only do this is Lisp-like modes!
- (setq face
- (if (= depth 1)
- ;; really we should only use this if
- ;; in position 3 depth 1, but that's
- ;; too expensive to compute.
- 'font-lock-doc-string-face
- 'font-lock-string-face)))
- ((or (eq context 'comment)
- (eq context 'block-comment))
- (setq face 'font-lock-comment-face)
+ (let ((lisp-like (font-lock-lisp-like major-mode)))
+ (syntactically-sectionize
+ #'(lambda (s e context depth)
+ (let (face)
+ (cond ((eq context 'string)
+ (setq face
+ ;; #### It would be nice if we handled
+ ;; Python and other non-Lisp languages with
+ ;; docstrings correctly.
+ (if (and lisp-like (= depth 1))
+ ;; really we should only use this if
+ ;; in position 3 depth 1, but that's
+ ;; too expensive to compute.
+ 'font-lock-doc-string-face
+ 'font-lock-string-face)))
+ ((or (eq context 'comment)
+ (eq context 'block-comment))
+ (setq face 'font-lock-comment-face)