\begin{mathematica} << /usr2/apps/mathematica/SystemFiles/Kernel/TextResources/English/Usage.m \end{mathematica} \begin{mathematica} hnl = {#, ToExpression[# <> "::usage"]}& /@ Names["System`*"]; \end{mathematica} \begin{mathematica} ( nousage = {}; obsolete = {}; option = {}; symbol = {}; attribute = {}; variable = {}; gprimitive = {}; gdirective = {}; constant = {}; function = {}; other = {}; Which[ !StringQ[#[[2]]], AppendTo[nousage, #[[1]]], StringMatchQ[#[[2]], "*is an obsolete*"], AppendTo[obsolete, #[[1]]], MemberQ[Attributes[#], Flat|OneIdentity|Listable|Orderless]& @ #[[1]], AppendTo[function, #[[1]]], StringMatchQ[#[[2]], "*is an option*"] || StringMatchQ[#[[2]], "*is a setting*"] || #[[1]] == "Automatic", AppendTo[option, #[[1]]], StringMatchQ[#[[2]], "*is a symbol*"] || StringMatchQ[#[[2]], "*is the symbol*"] || StringMatchQ[#[[2]], "*is the head*"] || #[[1]] == "List", AppendTo[symbol, #[[1]]], StringMatchQ[#[[2]], "*is an attribute*"], AppendTo[attribute, #[[1]]], StringTake[#[[1]], 1] == "$", AppendTo[variable, #[[1]]], StringMatchQ[#[[2]], "*is a@ primitive*"], AppendTo[gprimitive, #[[1]]], StringMatchQ[#[[2]], "*is a@ directive*"], AppendTo[gdirective, #[[1]]], MemberQ[Attributes[#], Constant]& @ #[[1]], AppendTo[constant, #[[1]]], True, AppendTo[other, #[[1]]] ]& /@ hnl; ) \end{mathematica} \begin{mathematica} {nousage, obsolete, function, option, symbol, attribute, variable, gprimitive, gdirective, constant, other}[[11]]; \end{mathematica} \begin{mathematica} strlist[x_List] := Fold[ (#1 <> " \"" <> #2 <> "\"")&, "", x] \end{mathematica} \begin{mathematica} (s = OpenWrite["/usr/contrib/share/xemacs/site-lisp/mma-font-lock.el"]; WriteString[s, ";;; This file was generated automatically by fontlock.m\n;;; Tomasz J. Cholewo \n(eval-when-compile (load-library \"make-regexp\"))\n(defvar math-font-lock-keywords (list\n"]; MapThread[ If[ Length[Symbol[#1]] > 0, WriteString[s, ";;; " <> #1 <> "s\n (cons (eval-when-compile (concat \"\\\\b\" (make-regexp '(" <> strlist[Symbol[#1]] <> ") t) \"\\\\b\")) font-lock-" <> #2 <> "-face)\n"]]&, {{"function", "option", "symbol", "attribute", "variable", "gprimitive", "gdirective", "constant", "other"}, {"keyword", "type", "type", "type", "function-name", "comment", "comment", "function-name", "preprocessor"}}]; WriteString[s, " )\n \"Mathematica 3.0 font-lock regular expressions\")\n(provide 'mma-font-lock)\n"]; Close[s];) \end{mathematica} \begin{mathematica} Select[#[[1]]& /@ hnl, MemberQ[ Attributes[#], Locked]&] . Out[19]= {} \end{mathematica}