From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Hongyi Zhao Newsgroups: gmane.emacs.help Subject: Re: Use regex in ~/.emacs.d/init.el to match no_proxy. Date: Thu, 8 Apr 2021 09:17:31 +0800 Message-ID: References: <8635w3d4wr.fsf@x201.butler.org> <20210407071939.GA13640@tuxteam.de> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26108"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs To: tomas@tuxteam.de Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Apr 08 03:18:11 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lUJJD-0006ed-8D for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 08 Apr 2021 03:18:11 +0200 Original-Received: from localhost ([::1]:38922 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lUJJC-0000Vh-8I for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 07 Apr 2021 21:18:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56980) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lUJIp-0000Vb-DY for help-gnu-emacs@gnu.org; Wed, 07 Apr 2021 21:17:47 -0400 Original-Received: from mail-lj1-x22f.google.com ([2a00:1450:4864:20::22f]:46701) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lUJIn-0003u0-QM for help-gnu-emacs@gnu.org; Wed, 07 Apr 2021 21:17:47 -0400 Original-Received: by mail-lj1-x22f.google.com with SMTP id u20so217640lja.13 for ; Wed, 07 Apr 2021 18:17:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9qhMrjAUrjq9+xjyaJBK8itpu7BrneTiVA+Kzk5nMuo=; b=JKCoiABfvwcaTATkBalIZuwyIbEjG34k+06U5PRu5uONnZSRcKZ8Svr98W8//VPoCN TV4gr8NFfLV0eNg4owJQxcCMkPKcEstYzfWB0ojihi4cdC04JfkxtXHAVqxtyWIrv49I 7fm8nuzOaCTcbnYEq5ukfkAZrKGj2JkEgtyfgbKAY1FtoeQHV0lLz/narPWcoLga+yqu 3WaPI4mLZl19HH4VpQPexDhlx8/rgehf0F51ONRyX2y27/QW9+rkMunKf3SxU4NY18qG ITym189k45TNGMkNeWDzeYthLppGsYfAHL4fa6LdWbif+5vfKPRtRB8nlcNRakh0V+Iu nbgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9qhMrjAUrjq9+xjyaJBK8itpu7BrneTiVA+Kzk5nMuo=; b=tGoWJi/3NhjNEOtP19qeYJLXVRFvvsh5AC8bXBXdkCz9QYEjBSfoP0OwQXG0HN3cP/ tcF/tVt2bNhUeqYa1svegL2MzLhIKzI6H1fHrr24Iefy9dqi9YtHI9BRAGMPkqGck+Q3 ld4gkal5c6xoNtOvfCKuvJz6HzLsle6YMH4e6erMq98Hq8lzlWQQOhkQGUYTopdUfhll iVYFz2c5jOERdNtVa0yq6aFxGPM2cScmL+L6tvtA/uuLPUHxNMRLuzM2hhRP0K5VcC1h kWxjjkFxF6OunUjM9VilwYcSJOXGnqgKx1LUZGHQfixtcmGyMbxOM5zTQtqQJhRZeJ5a iBoQ== X-Gm-Message-State: AOAM531B6L75zTxIS6Qt2nat2dbkSzej/DCkTnKY1HzxQcdR0eEtsaPL c7pAE6lV1RWJW39NN1bXSg8G/BRqZhLQqReAjXs= X-Google-Smtp-Source: ABdhPJziNnIfYmGh+nlwBwuZ5cyDmkWozQ/1aXffYnS7BNIABDTAgksf6HWEiHZGI8qp0W19SrI5b+gd7vHzVSpmuCM= X-Received: by 2002:a2e:99c4:: with SMTP id l4mr3906062ljj.13.1617844663141; Wed, 07 Apr 2021 18:17:43 -0700 (PDT) In-Reply-To: <20210407071939.GA13640@tuxteam.de> Received-SPF: pass client-ip=2a00:1450:4864:20::22f; envelope-from=hongyi.zhao@gmail.com; helo=mail-lj1-x22f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:128891 Archived-At: On Wed, Apr 7, 2021 at 3:19 PM 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 Theory and Simulation of Materials Hebei Polytechnic University of Science and Technology engineering NO. 552 North Gangtie Road, Xingtai, China