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

Popular posts from this blog

hibernate - How to load global settings frequently used in application in Java -

python 3.x - Mapping specific letters onto a list of words -

objective c - Ownership modifiers with manual reference counting -