From: Hongyi Zhao <hongyi.zhao@gmail.com>
To: tomas@tuxteam.de
Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: Re: Use regex in ~/.emacs.d/init.el to match no_proxy.
Date: Thu, 8 Apr 2021 09:17:31 +0800 [thread overview]
Message-ID: <CAGP6POK=_sZRBb0RXhM1-zvP7rBf0b1htsnYRGy7oVSwuUY0ww@mail.gmail.com> (raw)
In-Reply-To: <20210407071939.GA13640@tuxteam.de>
On Wed, Apr 7, 2021 at 3:19 PM <tomas@tuxteam.de> wrote:
>
> 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"
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
>
> as a convenience.
>
> Cheers
> - t
--
Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Polytechnic University of Science and Technology engineering
NO. 552 North Gangtie Road, Xingtai, China
next prev parent reply other threads:[~2021-04-08 1:17 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-06 8:22 Use regex in ~/.emacs.d/init.el to match no_proxy Hongyi Zhao
2021-04-06 11:32 ` Leo Butler
2021-04-06 16:26 ` Hongyi Zhao
2021-04-06 16:56 ` Gregory Heytings
2021-04-07 1:26 ` Hongyi Zhao
2021-04-07 7:19 ` tomas
2021-04-08 1:17 ` Hongyi Zhao [this message]
2021-04-08 6:24 ` Joost Kremers
2021-04-10 13:49 ` Hongyi Zhao
2021-04-10 14:05 ` Joost Kremers
2021-04-11 0:04 ` Hongyi Zhao
2021-04-11 11:12 ` Joost Kremers
2021-04-11 12:33 ` Tim Landscheidt
2021-04-11 13:17 ` Hongyi Zhao
2021-04-11 13:47 ` tomas
2021-04-11 21:47 ` [External] : " Drew Adams
2021-04-12 7:46 ` tomas
2021-04-08 7:00 ` Robert Thorpe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAGP6POK=_sZRBb0RXhM1-zvP7rBf0b1htsnYRGy7oVSwuUY0ww@mail.gmail.com' \
--to=hongyi.zhao@gmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=tomas@tuxteam.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).