emacs-devel
[Top][All Lists]
Advanced

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

Considering hi-lock-file-patterns as safe


From: Kaushal Modi
Subject: Considering hi-lock-file-patterns as safe
Date: Tue, 16 Feb 2016 10:02:02 -0500

Hi all,

I like the hi-lock-file-patterns feature in the hi-lock library. The good thing is that I do not need to write the hi-lock patterns directly in the files where I need the highlighting. The patterns can reside in the .dir-locals.el. That way I can get the highlighting I like non-intrusively especially when I am working on a file with users using editors other than emacs. Or even if they are using emacs, I don't have to force my highlighting style on them.

But by default, customizing the hi-lock-file-patterns in .dir-locals.el is not convenient as it would always ask the user if the pattern is safe or if they want to save that "safe-state" to custom.el. It becomes annoying if you tend to change/update that variable a lot.

So I have this in my config:

    ;; Mark the `hi-lock-file-patterns' variable as safe so that it can be
    ;; set in `.dir-locals.el' files.
    (put 'hi-lock-file-patterns 'safe-local-variable 'identity)


So now I am wondering if this variable can be marked permanently as safe within the library itself. That way people can customize it in their .dir-locals.el files without this hack.

Also related, I'd like below as the default value of hi-lock-file-patterns-policy:

    ;; Don't ask before highlighting any Hi-Lock: pattern found in a file
    ;; Below, (lambda (pattern) t) simply always returns `t' regardless of
    ;; what the `pattern' input is.
    (setq hi-lock-file-patterns-policy (lambda (pattern) t))

What are people's thoughts of this?

Thanks.

--
Kaushal Modi

reply via email to

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