emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ielm-font-lock-keywords


From: Luc Teirlinck
Subject: ielm-font-lock-keywords
Date: Sat, 24 Apr 2004 21:00:37 -0500 (CDT)

Take:

(defvar ielm-font-lock-keywords
  (list
   (cons (concat "^" (regexp-quote ielm-prompt)) 'font-lock-keyword-face)
   '("\\(^\\*\\*\\*[^*]+\\*\\*\\*\\)\\(.*$\\)"
     (1 font-lock-comment-face)
     (2 font-lock-constant-face)))
  "Additional expressions to highlight in ielm buffers.")

There is (or should) be a problem with that.  It hardwires the value
that ielm-prompt has when ielm.el first gets loaded into
ielm-font-lock-keywords.  If the user later customizes ielm-prompt and
then starts an ielm run, ielm-font-lock-keywords _will_ have the wrong
value.  (I checked that.)  However, this does not seem to matter,
because comint-mode overrides the 'font-lock-keyword-face with
comint-highlight-prompt anyway.

Either making ielm-prompt into a keyword is necessary and then
inferior-emacs-lisp-mode should update ielm-font-lock-keywords (I
could make it do that) _or_ (I believe much more likely) making
ielm-prompt into a keyword is futile and then I believe the following
small patch should be applied (I could install it):

===File ~/ielm-diff-1=======================================
*** ielm.el     24 Apr 2004 16:31:00 -0500      1.38
--- ielm.el     24 Apr 2004 20:33:13 -0500      
***************
*** 160,168 ****
    (define-key ielm-map "\C-c\C-v" 'ielm-print-working-buffer))
  
  (defvar ielm-font-lock-keywords
!   (list
!    (cons (concat "^" (regexp-quote ielm-prompt)) 'font-lock-keyword-face)
!    '("\\(^\\*\\*\\*[^*]+\\*\\*\\*\\)\\(.*$\\)"
       (1 font-lock-comment-face)
       (2 font-lock-constant-face)))
    "Additional expressions to highlight in ielm buffers.")
--- 160,166 ----
    (define-key ielm-map "\C-c\C-v" 'ielm-print-working-buffer))
  
  (defvar ielm-font-lock-keywords
!   '(("\\(^\\*\\*\\*[^*]+\\*\\*\\*\\)\\(.*$\\)"
       (1 font-lock-comment-face)
       (2 font-lock-constant-face)))
    "Additional expressions to highlight in ielm buffers.")
============================================================




reply via email to

[Prev in Thread] Current Thread [Next in Thread]