From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kaushal Modi Newsgroups: gmane.emacs.devel Subject: Considering hi-lock-file-patterns as safe Date: Tue, 16 Feb 2016 10:02:02 -0500 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c2e4aed65b2b052be46cab X-Trace: ger.gmane.org 1455635036 20339 80.91.229.3 (16 Feb 2016 15:03:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 16 Feb 2016 15:03:56 +0000 (UTC) To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 16 16:03:54 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aVhA4-0003fx-5M for ged-emacs-devel@m.gmane.org; Tue, 16 Feb 2016 16:03:32 +0100 Original-Received: from localhost ([::1]:46859 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVhA2-0004nD-Kp for ged-emacs-devel@m.gmane.org; Tue, 16 Feb 2016 10:03:30 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45420) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVh9n-0004n5-04 for emacs-devel@gnu.org; Tue, 16 Feb 2016 10:03:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aVh9j-0008Dp-2c for emacs-devel@gnu.org; Tue, 16 Feb 2016 10:03:14 -0500 Original-Received: from mail-ob0-x229.google.com ([2607:f8b0:4003:c01::229]:35740) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVh9i-0008Dj-Qy for emacs-devel@gnu.org; Tue, 16 Feb 2016 10:03:11 -0500 Original-Received: by mail-ob0-x229.google.com with SMTP id xk3so261322427obc.2 for ; Tue, 16 Feb 2016 07:03:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=wrHi1NNn/PVlwxtLYmlcc6Ll3X/Lr95H8NjyE6r9nqM=; b=TbC4WaSj3upUqa2+E5ESfdc9KxQXAnizg/Lk2F0XgKi1s2gxlAPeEWV8+2lAPBsFeh gI9mtAWRYvgVWQdMYdQb0r1b5iOGAoMwmUDkxIoW28ZnCO+SP/x/M1SUKI9zPln7b4fu fWkUtbKvvd0t+Z92H8Zqb7pVZ72OtIFQTKT9TADXpyxf3R3TWxXdH2j8joej2N3H7UkE SSwO7gfIspFWzLks6uaJqmJY8jJCIprcGuSSjD75pN7cnAojHABHVYNq3b++GjwJQ41X KDN5xRUKjusurcbEP8TVsRVGj8dxUgTtRMD/WAVPu12O8vIGMRSqlVKu0jvsON6lhkeb 4TKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-type; bh=wrHi1NNn/PVlwxtLYmlcc6Ll3X/Lr95H8NjyE6r9nqM=; b=j323MNJ4osvbSyqsmIvLTyimkptGPrsKDxV6LyJhxN5EDpyuaOu7qL8KdiSY5WFbly gK+OxmW3QsB1Mnf5wJO2EyqFU4/Narm+VrEWHqvKvVfBEWFH9sAI36/GLKNqsCbug35Z VsHUK/jUcQAISKCektqtH8BipNPqwFtsKoqCwIxY2yUhl5o+AWovm068GyAmRTFi8WZJ 7yr83ZEwoU/tqdnUSzq6HbEfpWKINh8j1rkcKk4w4RhsRrxF7E3qazHVm52iJceGWrQu cE6gvZzD0vM8l0qKv14U+TzTX/XUhK5XlRvddrd4fWa/MiioLslbEBeEU/xk7sj2vkwr 414A== X-Gm-Message-State: AG10YOQlYHNNJ/nfnLWmRklo1HToy+G+8A4tksNJcUwGiiJqU+j9MbUBgl5OzlibHh9mEHQdEw4Wxhj87we/GA== X-Received: by 10.182.137.198 with SMTP id qk6mr17224231obb.5.1455634962076; Tue, 16 Feb 2016 07:02:42 -0800 (PST) Original-Received: by 10.202.201.73 with HTTP; Tue, 16 Feb 2016 07:02:02 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4003:c01::229 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:200036 Archived-At: --001a11c2e4aed65b2b052be46cab Content-Type: text/plain; charset=UTF-8 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 --001a11c2e4aed65b2b052be46cab Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi all,

I like the hi-lock-file-pattern= s feature in the hi-lock library. The good thing is that I do not need to w= rite the hi-lock patterns directly in the files where I need the highlighti= ng. The patterns can reside in the .dir-locals.el. That way I can get the h= ighlighting I like non-intrusively especially when I am working on a file w= ith 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 saf= e or if they want to save that "safe-state" to custom.el. It beco= mes annoying if you tend to change/update that variable a lot.
So I have this in my config:

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


So now I am wond= ering 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 wit= hout this hack.
<= br>
Also related, I'd like below as the default v= alue of hi-lock-file-patterns-policy:

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

What are people's thoughts = of this?

Thanks.

--
Kaushal= Modi
--001a11c2e4aed65b2b052be46cab--