[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [BUG] No fontification when font-lock-add-keywords is passed nil as
From: |
Francis Litterio |
Subject: |
Re: [BUG] No fontification when font-lock-add-keywords is passed nil as the mode |
Date: |
Wed, 23 Jun 2004 14:25:14 -0400 |
User-agent: |
Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3.50 (windows-nt) |
Richard Stallman wrote:
> Does this fix it? Could people who are more familiar
> with font-lock mode verify this is correct? I have changed
> the format of a "compiled" keywords list, which might have introduced
> some bugs.
[patch omitted]
In addition to not fixing the original bug, the above patch to
font-lock.el introduced a new bug. Eval this form to see the below
backtrace:
(progn
(require 'font-lock)
(defun my-dired-mode-hook ()
(font-lock-add-keywords nil '(("^ d" 2 'highlight nil)))
(turn-on-font-lock))
(add-hook 'dired-mode-hook 'my-dired-mode-hook)
(dired "/"))
Debugger entered--Lisp error: (wrong-type-argument sequencep
dired-font-lock-keywords)
mapcar(font-lock-compile-keyword dired-font-lock-keywords)
(cons keywords (mapcar (quote font-lock-compile-keyword) keywords))
(cons t (cons keywords (mapcar ... keywords)))
(setq keywords (cons t (cons keywords ...)))
(if (eq (car-safe keywords) t) keywords (setq keywords (cons t ...)) (if (and
regexp ... ...) (nconc keywords ...)) keywords)
font-lock-compile-keywords(dired-font-lock-keywords t)
(set (make-local-variable (quote font-lock-keywords))
(font-lock-compile-keywords keywords t))
(if (eq (car font-lock-keywords) t) nil (set (make-local-variable ...)
(font-lock-compile-keywords keywords t)))
(unless (eq (car font-lock-keywords) t) (set (make-local-variable ...)
(font-lock-compile-keywords keywords t)))
(let* ((defaults ...) (keywords ...) (local ...) (removed-keywords ...)) (set
(make-local-variable ...) defaults) (when (nth 1 defaults) (set ... t)) (when
(nth 2 defaults) (set ... t)) (when (nth 3 defaults) (set ... ...) (dolist ...
...)) (when (nth 4 defaults) (set ... ...)) (dolist (x ...) (set ... ...)) (set
(make-local-variable ...) (font-lock-eval-keywords keywords)) (while local
(font-lock-add-keywords nil ... ...) (setq local ...)) (when removed-keywords
(font-lock-remove-keywords nil removed-keywords)) (unless (eq ... t) (set ...
...)))
(if font-lock-set-defaults nil (set (make-local-variable ...) t)
(make-local-variable (quote font-lock-fontified)) (make-local-variable (quote
font-lock-multiline)) (let* (... ... ... ...) (set ... defaults) (when ... ...)
(when ... ...) (when ... ... ...) (when ... ...) (dolist ... ...) (set ... ...)
(while local ... ...) (when removed-keywords ...) (unless ... ...)))
(unless font-lock-set-defaults (set (make-local-variable ...) t)
(make-local-variable (quote font-lock-fontified)) (make-local-variable (quote
font-lock-multiline)) (let* (... ... ... ...) (set ... defaults) (when ... ...)
(when ... ...) (when ... ... ...) (when ... ...) (dolist ... ...) (set ... ...)
(while local ... ...) (when removed-keywords ...) (unless ... ...)))
font-lock-set-defaults()
(cond (mode (let ... ...) (font-lock-update-removed-keyword-alist mode
keywords append)) (t (font-lock-set-defaults) (let ... ... ... ...)))
font-lock-add-keywords(nil (("^ d" 2 (quote highlight) nil)))
my-dired-mode-hook()
run-hooks(dired-mode-hook)
apply(run-hooks dired-mode-hook)
run-mode-hooks(dired-mode-hook)
dired-mode("c:/" "-al")
dired-internal-noselect("c:/" nil)
dired-noselect("/" nil)
dired("/")
(progn (require (quote font-lock)) (defun my-dired-mode-hook nil
(font-lock-add-keywords nil ...) (turn-on-font-lock)) (add-hook (quote
dired-mode-hook) (quote my-dired-mode-hook)) (dired "/"))
eval((progn (require (quote font-lock)) (defun my-dired-mode-hook nil
(font-lock-add-keywords nil ...) (turn-on-font-lock)) (add-hook (quote
dired-mode-hook) (quote my-dired-mode-hook)) (dired "/")))
eval-last-sexp-1(nil)
eval-last-sexp(nil)
call-interactively(eval-last-sexp)