elisp - Pass function return as argument to regexp-opt in emacs -
i want generate regexp's master list. example list:
(setq name-and-keyword-list (list '("pfoo" ("foo" "bar" "baz")) '("pbar" ("apples" "pears" "orange"))))
(regexp-opt '("foo" "bar" "baz"))
works , (car (cdr name-and-keyword-list))
returns (("foo" "bar" "baz"))
same argument passed regexp-opt
manually.
trying combine 1 call fails:
(regexp-opt (cdr(car name-and-keyword-list)))
returns wrong type argument: stringp, ("foo" "bar" "baz")
. there different way can access list elements valid argument regexp-opt
?
here's fix:
(setq name-and-keyword-list `(("pfoo" ("foo" "bar" "baz")) ("pbar" ("apples" "pears" "orange")))) (regexp-opt (cadar name-and-keyword-list))
Comments
Post a Comment