On Wed, Feb 17, 2016 at 6:17 PM, John Wiegley wrote: > >>>>> Kaushal Modi writes: > > > 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. > > Do we have a precedent for doing this elsewhere? I don't see a single occurrence of (put 'SOME-VAR 'safe-local-variable 'identity) 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? -- Kaushal Modi