* Checking for safe font-lock keywords and hi-lock mode.
@ 2007-04-19 15:42 David Koppelman
0 siblings, 0 replies; only message in thread
From: David Koppelman @ 2007-04-19 15:42 UTC (permalink / raw)
To: emacs-devel
Is there any way to check whether font-lock keywords are safe? For
example, such a function might be named font-lock-pattern-safe and
used in the code below, where patterns might contain malicious code:
(font-lock-add-keywords nil
(apply 'append
(mapcar
(lambda (p) (if (font-lock-pattern-safe-p p) (list p) nil))
patterns))) )
A return of true would mean safe, nil would mean maybe dangerous.
My immediate concern is hi-lock and I would use such a function in
hi-lock-find-patterns. (This automatically grabs font lock patterns
from a file.) If no such function is available right now then
hi-lock-find-patterns should be off by default and if on should ask. I
can have a patch ready by Friday either safe checking (if possible) or
else using some mixture of configuration setting, user input and
whitelisting.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-04-19 15:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-19 15:42 Checking for safe font-lock keywords and hi-lock mode David Koppelman
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.