unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [bug] font-lock-add-keywords or related
@ 2004-07-02 10:03 Karl Chen
  2004-07-03 18:22 ` Richard Stallman
  0 siblings, 1 reply; 5+ messages in thread
From: Karl Chen @ 2004-07-02 10:03 UTC (permalink / raw)



This possible bug occurs in emacs cvs 2004-07-01 (probably related
to 2004-06-24 change) but not in emacs from about two weeks ago.

emacs -q /tmp/a.el

;; type this into a.el:

(global-font-lock-mode 1)

(progn
  (defun f ()
    (font-lock-add-keywords
     ;; nil '(("\\<\\(FIXME\\|TODO\\|XXX+\\)\\([:)]\\|$\\)" 1 font-lock-warning-face prepend))))
     nil '(("zzz"))))

  (add-hook 'find-file-hooks 'f)
  (revert-buffer nil t))


;; C-x C-s (save) and C-x C-e (evaluate) on global-font-lock-mode
;; line.  Now buffer is fontified.  Now evaluate the second sexp.
;; Now buffer is only minimally fontified (only strings and
;; comments)


-- 
Karl 2004-07-02 11:56

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [bug] font-lock-add-keywords or related
  2004-07-02 10:03 [bug] font-lock-add-keywords or related Karl Chen
@ 2004-07-03 18:22 ` Richard Stallman
  2004-07-03 22:55   ` Karl Chen
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Stallman @ 2004-07-03 18:22 UTC (permalink / raw)
  Cc: emacs-devel

    (progn
      (defun f ()
	(font-lock-add-keywords
	 ;; nil '(("\\<\\(FIXME\\|TODO\\|XXX+\\)\\([:)]\\|$\\)" 1 font-lock-warning-face prepend))))
	 nil '(("zzz"))))

      (add-hook 'find-file-hooks 'f)
      (revert-buffer nil t))

Can you  look at the data structures altered by font-lock-add-keywords
and see what is wrong in them afterward?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [bug] font-lock-add-keywords or related
  2004-07-03 18:22 ` Richard Stallman
@ 2004-07-03 22:55   ` Karl Chen
  2004-07-05 14:22     ` Richard Stallman
  0 siblings, 1 reply; 5+ messages in thread
From: Karl Chen @ 2004-07-03 22:55 UTC (permalink / raw)


>>>>> "rms" == Richard Stallman <rms@gnu.org> writes:
    rms> Can you look at the data structures altered by
    rms> font-lock-add-keywords and see what is wrong in them
    rms> afterward?


This fixes the bug.  (Actually I only debugged
font-lock-add-keywords but the second function below has such
similar code it's likely the same bug.)


--- font-lock.el	28 Jun 2004 04:45:01 +0200	1.223
+++ font-lock.el	04 Jul 2004 00:52:55 +0200	
@@ -693,7 +693,7 @@
 	   ;; If the keywords were compiled before, compile them again.
 	   (if was-compiled
 	       (set (make-local-variable 'font-lock-keywords)
-		    (font-lock-compile-keywords keywords t)))))))
+		    (font-lock-compile-keywords font-lock-keywords t)))))))
 
 (defun font-lock-update-removed-keyword-alist (mode keywords append)
   ;; Update `font-lock-removed-keywords-alist' when adding new
@@ -801,7 +801,7 @@
 	   ;; If the keywords were compiled before, compile them again.
 	   (if was-compiled
 	       (set (make-local-variable 'font-lock-keywords)
-		    (font-lock-compile-keywords keywords t)))))))
+		    (font-lock-compile-keywords font-lock-keywords t)))))))
  
 ;;; Font Lock Support mode.
 



-- 
Karl 2004-07-03 15:50

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [bug] font-lock-add-keywords or related
  2004-07-03 22:55   ` Karl Chen
@ 2004-07-05 14:22     ` Richard Stallman
  2004-07-09  9:53       ` Karl Chen
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Stallman @ 2004-07-05 14:22 UTC (permalink / raw)
  Cc: emacs-devel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 935 bytes --]

Your change looks correct to me.  Could someone please install it?
We don't need papers for this tiny change.


--- font-lock.el	28 Jun 2004 04:45:01 +0200	1.223
+++ font-lock.el	04 Jul 2004 00:52:55 +0200	
@@ -693,7 +693,7 @@
 	   ;; If the keywords were compiled before, compile them again.
 	   (if was-compiled
 	       (set (make-local-variable 'font-lock-keywords)
-		    (font-lock-compile-keywords keywords t)))))))
+		    (font-lock-compile-keywords font-lock-keywords t)))))))
 
 (defun font-lock-update-removed-keyword-alist (mode keywords append)
   ;; Update `font-lock-removed-keywords-alist' when adding new
@@ -801,7 +801,7 @@
 	   ;; If the keywords were compiled before, compile them again.
 	   (if was-compiled
 	       (set (make-local-variable 'font-lock-keywords)
-		    (font-lock-compile-keywords keywords t)))))))
+		    (font-lock-compile-keywords font-lock-keywords t)))))))
  
 ;;; Font Lock Support mode.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [bug] font-lock-add-keywords or related
  2004-07-05 14:22     ` Richard Stallman
@ 2004-07-09  9:53       ` Karl Chen
  0 siblings, 0 replies; 5+ messages in thread
From: Karl Chen @ 2004-07-09  9:53 UTC (permalink / raw)



In case everyone forgot or thought someone else would do it:
nobody has committed this yet.


>>>>> "rms" == Richard Stallman <rms@gnu.org> writes:
    rms> 
    rms> Your change looks correct to me.  Could someone please
    rms> install it?  We don't need papers for this tiny change.

-- 
Karl 2004-07-09 02:50

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-07-09  9:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-02 10:03 [bug] font-lock-add-keywords or related Karl Chen
2004-07-03 18:22 ` Richard Stallman
2004-07-03 22:55   ` Karl Chen
2004-07-05 14:22     ` Richard Stallman
2004-07-09  9:53       ` Karl Chen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).