all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Considering hi-lock-file-patterns as safe
@ 2016-02-16 15:02 Kaushal Modi
  2016-02-17 23:17 ` John Wiegley
  0 siblings, 1 reply; 3+ messages in thread
From: Kaushal Modi @ 2016-02-16 15:02 UTC (permalink / raw)
  To: Emacs developers

[-- Attachment #1: Type: text/plain, Size: 1526 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 2062 bytes --]

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

end of thread, other threads:[~2016-02-18 16:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-16 15:02 Considering hi-lock-file-patterns as safe Kaushal Modi
2016-02-17 23:17 ` John Wiegley
2016-02-18 16:38   ` Kaushal Modi

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.