Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 205815
Collapse All | Expand All

(-)rst.el.org (-14 / +24 lines)
Lines 2199-2218 Link Here
2199
  (when (boundp 'font-lock-support-mode)
2199
  (when (boundp 'font-lock-support-mode)
2200
    ;; rst-mode has its own mind about font-lock-support-mode
2200
    ;; rst-mode has its own mind about font-lock-support-mode
2201
    (make-local-variable 'font-lock-support-mode)
2201
    (make-local-variable 'font-lock-support-mode)
2202
    (cond
2202
    ;; jit-lock-mode replaced lazy-lock-mode in GNU Emacs 22
2203
     ((and (not rst-mode-lazy) (not font-lock-support-mode)))
2203
    (let ((jit-or-lazy-lock-mode
2204
     ;; No support mode set and none required - leave it alone
2204
           (cond
2205
     ((or (not font-lock-support-mode) ;; No support mode set (but required)
2205
            ((fboundp 'jit-lock-mode) 'jit-lock-mode)
2206
	  (symbolp font-lock-support-mode)) ;; or a fixed mode for all
2206
            ((fboundp 'lazy-lock-mode) 'lazy-lock-mode)
2207
      (setq font-lock-support-mode
2207
            ;; if neither lazy-lock nor jit-lock is supported,
2208
	    (list (cons 'rst-mode (and rst-mode-lazy 'lazy-lock-mode))
2208
            ;; tell user and disable rst-mode-lazy
2209
		  (cons t font-lock-support-mode))))
2209
            (t (when rst-mode-lazy
2210
     ((and (listp font-lock-support-mode)
2210
                 (message "Disabled lazy fontification, because no known support mode found.")
2211
	   (not (assoc 'rst-mode font-lock-support-mode)))
2211
                 (setq rst-mode-lazy nil))))))
2212
      ;; A list of modes missing rst-mode
2212
      (cond
2213
      (setq font-lock-support-mode
2213
       ((and (not rst-mode-lazy) (not font-lock-support-mode)))
2214
	    (append '((cons 'rst-mode (and rst-mode-lazy 'lazy-lock-mode)))
2214
       ;; No support mode set and none required - leave it alone
2215
		    font-lock-support-mode)))))
2215
       ((or (not font-lock-support-mode) ;; No support mode set (but required)
2216
	    (symbolp font-lock-support-mode)) ;; or a fixed mode for all
2217
	(setq font-lock-support-mode
2218
	      (list (cons 'rst-mode (and rst-mode-lazy jit-or-lazy-lock-mode))
2219
		    (cons t font-lock-support-mode))))
2220
       ((and (listp font-lock-support-mode)
2221
	     (not (assoc 'rst-mode font-lock-support-mode)))
2222
	;; A list of modes missing rst-mode
2223
	(setq font-lock-support-mode
2224
	      (cons (cons 'rst-mode (and rst-mode-lazy jit-or-lazy-lock-mode))
2225
		    font-lock-support-mode))))))
2216
2226
2217
  ;; Names and hooks
2227
  ;; Names and hooks
2218
  (setq mode-name "reST")
2228
  (setq mode-name "reST")

Return to bug 205815