On Wed, Apr 07, 2021 at 09:26:42AM +0800, Hongyi Zhao wrote: [...] > Additional Comment: I also tried to use the eshell method to call this > function, but failed as shown below: > > M-x eshell RET > > ~ $ regexp-opt ("*.cn" "localhost" "10.0.0.0/8" "127.0.0.0/8" > "172.16.0.0/12" "192.168.0.0/16") I don't know about your other points, but can give a hint on this one. The `eshell' takes expressions in Lisp syntax, that means you have to write `(function arg1 arg2 ...)' instead of the more customary `function (arg1 arg2 ...)'. In your case: [1] (regexp-opt "*.cn" "localhost" "10.0.0.0/8" "127.0.0.0/8" "172.16.0.0/12" "192.168.0.0/16") will lead to the desired result. That's why: > Wrong type argument: list-or-vector-p, "Invalid function: \"*.cn\"" eshell complains here: it is trying to apply a function `".cn"' to the rest of the arguments. But there is no function with such a funny name (quotes and all). Eshell allows you to leave out the outermost parentheses, so instead of [1] you can also write [2] regexp-opt "*.cn" "localhost" "10.0.0.0/8" "127.0.0.0/8" "172.16.0.0/12" "192.168.0.0/16" as a convenience. Cheers - t