help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Selective Font Lock Case Sensitivity


From: Jacob Gerlach
Subject: Re: Selective Font Lock Case Sensitivity
Date: Wed, 16 Apr 2014 11:41:19 -0700 (PDT)
User-agent: G2/1.0

I'm having trouble implementing this, I think because of some more basic lisp 
understanding deficiency. 

I'm constructing entries for my-font-lock-keywords by using mapc to work from a 
master list.

The function called by mapc adds a backquoted list to my keyword list. Before 
trying to adjust case sensitivity, it looked like:

(defun add-to-my-keyword-list (input)
   (add-to-list 'my-font-lock-keywords
               `( 
                ,(;;non-buggy-code here for anchor)
                ,(regexp-opt (cadr input))
                (my-pre-form)
                nil
                (0 font-lock-keyword-face))))

My trouble is getting (regexp-opt (cadr input)) to properly expand to an 
argument for re-search-forward.

The closest I've been able to come is to use

(lambda (limit)
  (let ((case-fold-search t))
    `(re-search-forward ,(regexp-opt ,@(cadr input)) limit t)))

In this case, (cadr input) is evaluated, but (regexp-opt is not. The 
constructed list reads
...
(\` (re-search-forward (\,@ (regexp-opt
...

Is this an easy fix?


reply via email to

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