From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17065 invoked by alias); 30 Mar 2018 20:11:07 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 23291 Received: (qmail 21994 invoked by uid 1010); 30 Mar 2018 20:11:07 -0000 X-Qmail-Scanner-Diagnostics: from mail-qt0-f175.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.216.175):SA:0(-1.9/5.0):. Processed in 3.99123 secs); 30 Mar 2018 20:11:07 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_PASS, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: mikachu@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=NNmco8lTSzhRseqSCfsiMVLSOXjA74pL+srKWLZ8zEA=; b=EuixVlXaxWYHOQBw7lCi85Z9/XXR6lYCtII0pT9m50tykTXVBcXQWvOU+LPCqu0QSq VPm6EVl+jEmnm2cm+0Rm8WBhcxIGlJpQgAQy/O4qMHNj4VRQ2hJFmf+lXhhxu0xH39oj 9VBiYTlR+ZxpWR4lPqukGfRFaxV812aXh++7XODifAAd4bbBIX+/hK+RdFlnShTDFcin DQo7uNjE896noBzh33LhVB3TMjZNfwdGnW/PZjBgbGOEih7RseREPziDeuwLxurW1TkX gbu0aJJYPpAarG3EL07RRMXqmFO+mdEYhjyv6GKycHcSEa/RBy90EkIy8zwUEuki5e2Q lkHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=NNmco8lTSzhRseqSCfsiMVLSOXjA74pL+srKWLZ8zEA=; b=Z3sM9RsGbm5jFfXJMjXA34ecGjctlM338/1GfYQ6nq/OO3K5InEjo+qiMMLUdtDDVb aWt6T84QnooXjs2UxwV7Bk3gDP2sI2RaSk44/+9YvcDKfGEuH+fpxBUlh+6ek8f3Eg0D wrzshl80xjdo5nh16+k1zMBo0CH/zygrlgrz8YDJBzG7lBV1ZLAB3BGOy7mU1Fhtkfjh xxy5Dn9jH34SxR7EB8oWeLlWXmsD22uhfqKM9uPTzQC8kKHfXXopKtBi4VpyOmlpItlF szCox/SYG4hocRC7hjm9AmjoZqSXKVu2RQQc+0VQbmX9G1Si97ijWlCCCPW032mV33LO FvGw== X-Gm-Message-State: ALQs6tB6QI6dDZU0284YT19MbtoHtAUD10dQf9XFVUTynUZ2pbgatLGI h5CPLmgR/XY5M6f0HotlppaBMpSA1Q/le8Ie/ww= X-Google-Smtp-Source: AIpwx4+SIuA2bQw+JLLVXgPZffdU3iM9k/Q1cA4axPlhdAhz6paLQWsZHNISuX9xeT6opfy/2QDoN06Zbd4747sGCbU= X-Received: by 10.200.26.148 with SMTP id x20mr613966qtj.288.1522440660447; Fri, 30 Mar 2018 13:11:00 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <9e0faf6b-b19e-b6d6-0eb7-6ea20b2c2154@eastlink.ca> References: <9e0faf6b-b19e-b6d6-0eb7-6ea20b2c2154@eastlink.ca> From: Mikael Magnusson Date: Fri, 30 Mar 2018 22:10:59 +0200 Message-ID: Subject: Re: local unfunction To: Ray Andrews Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" On Fri, Mar 30, 2018 at 6:11 PM, Ray Andrews wrote: > Is it possible to unfunction something just within another function? I've > tried: > > unset -fm .... > > ... but the functions remain dead after the calling function returns. I can > of course just resource them, but I'll bet the unset can be made local. If it's okay to also cancel all other side effects, you can use a subshell, function() hey { normal stuff here ( unfunction foo foo a=5 # this will also disappear after the ) ) } -- Mikael Magnusson