From: Kaushal Modi <kaushal.modi@gmail.com>
To: Emacs developers <emacs-devel@gnu.org>
Subject: Considering hi-lock-file-patterns as safe
Date: Tue, 16 Feb 2016 10:02:02 -0500 [thread overview]
Message-ID: <CAFyQvY1A9hWc5tVQFE0ZrNDMBL6ZY02A6iujY=sbcVJ+UZ=npQ@mail.gmail.com> (raw)
[-- 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 --]
next reply other threads:[~2016-02-16 15:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-16 15:02 Kaushal Modi [this message]
2016-02-17 23:17 ` Considering hi-lock-file-patterns as safe John Wiegley
2016-02-18 16:38 ` Kaushal Modi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAFyQvY1A9hWc5tVQFE0ZrNDMBL6ZY02A6iujY=sbcVJ+UZ=npQ@mail.gmail.com' \
--to=kaushal.modi@gmail.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.