[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Use regex in ~/.emacs.d/init.el to match no_proxy.
From: |
Joost Kremers |
Subject: |
Re: Use regex in ~/.emacs.d/init.el to match no_proxy. |
Date: |
Thu, 08 Apr 2021 08:24:19 +0200 |
User-agent: |
mu4e 1.5.11; emacs 27.2 |
On Thu, Apr 08 2021, Hongyi Zhao wrote:
>> 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"
>
> Still failed, as shown below:
>
> ~ $ regexp-opt "*.cn" "localhost" "10.0.0.0/8" "127.0.0.0/8"
> "172.16.0.0/12" "192.168.0.0/16"
> Wrong number of arguments: (1 . 2), 6
regexp-opt takes a list of strings, so you'd need:
regexp-opt ("*.cn" "localhost" "10.0.0.0/8" "127.0.0.0/8" "172.16.0.0/12"
"192.168.0.0/16")
But that doesn't work because the parens are taken as a Lisp expression, so its
first element needs to be a function. Quoting it doen't work either:
regexp-opt '("*.cn" "localhost" "10.0.0.0/8" "127.0.0.0/8" "172.16.0.0/12"
"192.168.0.0/16")
Because then eshell is waiting for the closing single quote. So just add the
parens around the entire expression:
(regexp-opt '("*.cn" "localhost" "10.0.0.0/8" "127.0.0.0/8" "172.16.0.0/12"
"192.168.0.0/16"))
For Lisp interaction, I'd recommend `M-x ielm`, though.
HTH
--
Joost Kremers
Life has its moments
- Use regex in ~/.emacs.d/init.el to match no_proxy., Hongyi Zhao, 2021/04/06
- Re: Use regex in ~/.emacs.d/init.el to match no_proxy., Leo Butler, 2021/04/06
- Re: Use regex in ~/.emacs.d/init.el to match no_proxy., Hongyi Zhao, 2021/04/06
- Re: Use regex in ~/.emacs.d/init.el to match no_proxy., Gregory Heytings, 2021/04/06
- Re: Use regex in ~/.emacs.d/init.el to match no_proxy., Hongyi Zhao, 2021/04/06
- Re: Use regex in ~/.emacs.d/init.el to match no_proxy., tomas, 2021/04/07
- Re: Use regex in ~/.emacs.d/init.el to match no_proxy., Hongyi Zhao, 2021/04/07
- Re: Use regex in ~/.emacs.d/init.el to match no_proxy.,
Joost Kremers <=
- Re: Use regex in ~/.emacs.d/init.el to match no_proxy., Hongyi Zhao, 2021/04/10
- Re: Use regex in ~/.emacs.d/init.el to match no_proxy., Joost Kremers, 2021/04/10
- Re: Use regex in ~/.emacs.d/init.el to match no_proxy., Hongyi Zhao, 2021/04/10
- Re: Use regex in ~/.emacs.d/init.el to match no_proxy., Joost Kremers, 2021/04/11
- Re: Use regex in ~/.emacs.d/init.el to match no_proxy., Tim Landscheidt, 2021/04/11
- Re: Use regex in ~/.emacs.d/init.el to match no_proxy., Hongyi Zhao, 2021/04/11
- Re: Use regex in ~/.emacs.d/init.el to match no_proxy., tomas, 2021/04/11
- RE: [External] : Re: Use regex in ~/.emacs.d/init.el to match no_proxy., Drew Adams, 2021/04/11
- Re: [External] : Re: Use regex in ~/.emacs.d/init.el to match no_proxy., tomas, 2021/04/12
- Re: Use regex in ~/.emacs.d/init.el to match no_proxy., Robert Thorpe, 2021/04/08