in the emacs source.
Here is how I set the hi-lock-text-patterns in my .dir-locals.el
((text-mode . ((hi-lock-file-patterns . (;; UVM_WARNING
("^\\s-*\\(UVM_WARNING\\)\\s-+[^:]"
(1 '(:inherit default
:foreground "black"
:background "orange"
:height 1.1)
prepend))
("^\\s-*\\(UVM_WARNING\\s-+:\\s-+[1-9][0-9]*\\)"
(1 '(:inherit default
:foreground "black"
:background "orange"
:box (:line-width 2 :color "green")
:height 1.1
:weight bold)
prepend))
;; UVM_ERROR
("^\\s-*\\(UVM_ERROR\\)\\s-+[^:]"
(1 '(:inherit default
:foreground "white"
:background "red"
:height 1.1)
prepend))
("^\\s-*\\(UVM_ERROR\\s-+:\\s-+[1-9][0-9]*\\)"
(1 '(:inherit default
:foreground "white"
:background "red"
:box (:line-width 2 :color "green")
:height 1.1
:weight bold)
prepend)))))))
As I couldn't figure out how to qualify that alist value of hi-lock-file-patterns, I used 'identity as the qualifier.
But I do see instances of marking variables as safe (just not using 'identity, which understandably is very risky):
24793:(put 'sh-shell 'safe-local-variable 'symbolp)
25436:(put 'sort-fold-case 'safe-local-variable 'booleanp)
25510:(put 'sort-numeric-base 'safe-local-variable 'integerp)
28175:(put 'time-stamp-format 'safe-local-variable 'stringp)
28176:(put 'time-stamp-time-zone 'safe-local-variable 'string-or-null-p)
28177:(put 'time-stamp-line-limit 'safe-local-variable 'integerp)
28178:(put 'time-stamp-start 'safe-local-variable 'stringp)
28179:(put 'time-stamp-end 'safe-local-variable 'stringp)
28180:(put 'time-stamp-inserts-lines 'safe-local-variable 'symbolp)
So the question would be:
- If we were to mark hi-lock-file-patterns as safe in hi-lock.el itself, what would be a valid qualifier so that I can set its value as shown above in my .dir-locals.el?