From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Joost Kremers Newsgroups: gmane.emacs.help Subject: Re: Use regex in ~/.emacs.d/init.el to match no_proxy. Date: Thu, 08 Apr 2021 08:24:19 +0200 Message-ID: <87tuohthld.fsf@fastmail.fm> References: <8635w3d4wr.fsf@x201.butler.org> <20210407071939.GA13640@tuxteam.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26573"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.5.11; emacs 27.2 Cc: help-gnu-emacs@gnu.org To: Hongyi Zhao Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Apr 08 08:29:55 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 1lUOAt-0006ox-Ey for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 08 Apr 2021 08:29:55 +0200 Original-Received: from localhost ([::1]:39802 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lUOAs-0004VI-8s for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 08 Apr 2021 02:29:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49274) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lUOAA-0004V8-NI for help-gnu-emacs@gnu.org; Thu, 08 Apr 2021 02:29:10 -0400 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]:50361) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lUOA7-0000tq-3E for help-gnu-emacs@gnu.org; Thu, 08 Apr 2021 02:29:10 -0400 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 10A965C00CF; Thu, 8 Apr 2021 02:29:06 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 08 Apr 2021 02:29:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= references:from:to:cc:subject:date:in-reply-to:message-id :mime-version:content-type; s=fm2; bh=8DtIbdmD1WfvhTlgfKQrOp/HOS Jy2Uy2qbGSu+DYiX4=; b=bsD1i71A+Gv1XVpj1yoVPqvH0j3Cbc9tIlPW1EF175 al3nZ8ovOfpfM8wDRH1j5XiSQreBipA6+ZvdHtBAfnStFxaYsreGKpqEvZyuHKa/ pNrFby/rRmC5h1ODhEWtkJmxr/W4ry5D0ZDar6VaoXUP9GCMrgW4dYKWl/OQVEJr Z8+bh5ICKrFd7dBQTpYQ46Pn7UF/6qlclaA4Nium4V84WJfebNxhJQE1Gzw7bR3q lJZo//V8E5yNFEIPAzooZzcZGnKXM5LixhkGEYh3GPFdxhfuwvcp365CTU8npFdB ftnpnuH2EXfPf7jKQr+sOAfZsSTXUNOkEbYHkr/jUHxw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=8DtIbd mD1WfvhTlgfKQrOp/HOSJy2Uy2qbGSu+DYiX4=; b=E9bByVv0HUgce5NMEl+PIO o4tdldUWSN/gc/iewgyBjd5u6zauP24pBo2uVOTGMsIGX0m3T58izbfP8sxC9TfH tIorkEaYoBBIFsdSDIkHOje7C03MzFBaQLg5gTtdzIgxLBiAHdWYpWtOGWeZrec/ UuRZCc06DBwRrMTHYsH2k7uL+IyE+8BLuRHq3exoWjuEF+0CIZgK4bO3G9m7gKew PNydoGXpJ5hEd3gy7YjeEswOdTRwYd6bQZ0AG5ivPwL/zJ61EmP3ofkdviDOPAbp dY3MiNwUZB5WrvknSKxRkZpsrTvp0Z4H6WCRAnamEJxj9cSZFjIZ685nqYIYRDww == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudejkedguddtkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpehffgfhvffuffgjkfggtgesthdtredttdertdenucfhrhhomheplfhoohhs thcumfhrvghmvghrshcuoehjohhoshhtkhhrvghmvghrshesfhgrshhtmhgrihhlrdhfmh eqnecuggftrfgrthhtvghrnhepvdeihfetueevkeduteehudeihedvlefgieejhedvteef geelleehhfejudeijeevnecukfhppeelhedrledurdduleejrdehjeenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehjohhoshhtkhhrvghmvghr shesfhgrshhtmhgrihhlrdhfmh X-ME-Proxy: Original-Received: from Lenovo.fastmail.com (ip5f5bc539.dynamic.kabel-deutschland.de [95.91.197.57]) by mail.messagingengine.com (Postfix) with ESMTPA id CAAE4108005F; Thu, 8 Apr 2021 02:29:04 -0400 (EDT) In-reply-to: Received-SPF: pass client-ip=66.111.4.28; envelope-from=joostkremers@fastmail.fm; helo=out4-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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:128892 Archived-At: 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