On Sun, Jul 30, 2017 at 10:59 PM, Stefan Monnier wrote: > See some comments below. One thing, tho: an alternative would be to put > it into its own file, which would give it more visibility Fine by me. Should we perhaps do the same for SCSS mode? On Mon, Jul 31, 2017 at 8:39 AM, Steve Purcell wrote: > +(defconst less-font-lock-keywords > '(;; Variables > - ("@[a-z_-][a-z-_0-9]*" . font-lock-constant-face) > + ("@[a-z_-][a-z-_0-9]*" . font-lock-variable-name-face) > ("&" . font-lock-preprocessor-face) > ;; Mixins > - ("\\(?:[ \t{;]\\|^\\)\\(\\.[a-z_-][a-z-_0-9]*\\)[ \t]*;" . (1 font-lock-keyword-face))) > - ) > + ("\\(?:[ \t{;]\\|^\\)\\(\\.[a-z_-][a-z-_0-9]*\\)[ \t]*;" . > + (1 font-lock-keyword-face)))) > > Is it important to limit those to ASCII chars? If not, then it's better > to use [[:alpha:]_-] and [[:alnum:]_-] in the above regexps. > > > Unsure, but it’s likely safe to allow non-ASCII alphanumeric chars. I'm not sure either, but the Less compiler didn't like some non-ASCII characters I fed to it, so I suspect it only allows ASCII characters in variable names. On Mon, Jul 31, 2017 at 2:44 PM, Stefan Monnier wrote: > The safety info may need to be autoloaded, indeed (IIUC we have > a misfeature in there: we should enable the major mode (when possible) > before checking safety of the local vars). I've removed the autoloads from the defcustoms. How does one autoload safety info? On Wed, Aug 2, 2017 at 4:16 AM, Tom Tromey wrote: > It seems dangerous to me to mark these both as safe. A file could > specify a dangerous command and then say it's ok to run it on save. > > Probably the command should not be :safe. > > Maybe the other variables defined after this should also not be safe. > > Tom I think you're right, that seems particularly unsafe to me too. Maybe `less-css-output-file-name' shouldn't be marked safe either, since it may specify the name of an important file can get overwritten without a confirmation. I've updated the diffs based on your feedback. Thank you all for your comments so far. -- Simen