From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Douglas Lewan Newsgroups: gmane.emacs.help Subject: Re: Compiling a recursive macro Date: Fri, 12 Jun 2020 12:11:56 -0400 Message-ID: References: <22b55d6d-f719-98d9-f8c8-e72e7fc43497@gmail.com> <87lfkt47bl.fsf@web.de> <87ftb1469o.fsf@web.de> <36ad9384-bfe0-e250-153e-e5872e99dc65@gmail.com> <874krg4l00.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="112155"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 12 18:12:47 2020 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 1jjmIP-000T4o-TX for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 12 Jun 2020 18:12:45 +0200 Original-Received: from localhost ([::1]:33698 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jjmIO-0001xL-Uj for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 12 Jun 2020 12:12:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59564) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jjmHq-0001vJ-2I for help-gnu-emacs@gnu.org; Fri, 12 Jun 2020 12:12:11 -0400 Original-Received: from mail-qk1-x732.google.com ([2607:f8b0:4864:20::732]:40642) by eggs.gnu.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jjmHn-0002BV-0M for help-gnu-emacs@gnu.org; Fri, 12 Jun 2020 12:12:08 -0400 Original-Received: by mail-qk1-x732.google.com with SMTP id c185so9483493qke.7 for ; Fri, 12 Jun 2020 09:12:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=C0iB0EJr5LoHYbX+9X5GPBBnFpZujvWlGI3CspIByiI=; b=CPYdquQ2C1cbBCHQn0PkVYYxZYmZVnNF4aQbncN1gXGgzNu9sfNQ4544gd+XcYXQ/O 2Kq9pvnOxRro9kLIjmpCY6waxzzdwiSZjpc+tqg9FefrwxKgX6KHuBenRhawhtQNempY x56WAVh3hwsuwLFJBGVOKzwiFt0bfumsg/Xd5TYVpu7IUEycGvmYtl9hBCsVaVjdz182 lFLk9Nf1BRW5bBVx+cZteX4G5KVoKtzqibOAse3Ayd2HisrGMmwSIFIxZP6GudOj52lL ohzXCultytgTM+4yTLLVMq7UmhFOFdCsWK5gSshlufDZWnHa2m6nwmswUhn2qTcsE3e6 EiXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=C0iB0EJr5LoHYbX+9X5GPBBnFpZujvWlGI3CspIByiI=; b=FffEy9MueEK+coMdY082zH1cDgoyK45FnoXOkQJL7T4EZxOsYJnIEZvl5qTvoCdJlM kQPHE7TW0Kut0U/zYmC3iEsgBM9yywjQ7tLx1N7hnqJdyjPcq4VovwAXgMYZuhnfXmMO fiQGFA6J/GFv4W8nu/gnQ0YmTSyjd1pLx5L5NduzsLHsvLregGK4c+AZpqHah3ShAPXp Q9jZlOOXuJ0at2qkBc+4eYMAWBmrfp/LP8lY1Kk3xpxrPDiYME4wCjAowOBUovz82Kyk TOJ/EN6FV2LLf/zuIIQjd3D6GZOn+IOKKI0ziLd8tEn4RfZg7tppBc7S2OUU7y0S6ciX rMbg== X-Gm-Message-State: AOAM533rXK0YUqCwkSqe3l42pku2ZUCTwacDJxkiMPQGZgQGU6btb1Tm Q/NzeINK9mQ+QRPp3ATvxPxP2wobeA== X-Google-Smtp-Source: ABdhPJwe1DvZAoHDqDF6FtEdA7uGitzRdilsQIl0kuLjAE9tYhEqb5OC5sIJDN2FY2fYmmfrPAVB9g== X-Received: by 2002:a37:9c91:: with SMTP id f139mr3844755qke.371.1591978318697; Fri, 12 Jun 2020 09:11:58 -0700 (PDT) Original-Received: from [192.168.43.104] ([172.58.236.143]) by smtp.gmail.com with ESMTPSA id a15sm4581897qkl.20.2020.06.12.09.11.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Jun 2020 09:11:57 -0700 (PDT) In-Reply-To: <874krg4l00.fsf@web.de> Content-Language: en-US Received-SPF: pass client-ip=2607:f8b0:4864:20::732; envelope-from=d.lewan2000@gmail.com; helo=mail-qk1-x732.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN 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:123360 Archived-At: On 6/12/20 6:49 AM, Michael Heerdegen wrote: > Douglas Lewan writes: > >> They are buffer-local. Definition of such a variable spans the tree of >> buffers in question. I suppose I could just define them in the root >> buffer, but then I'd also need to use a specialized getter instead of >> the variable itself. The latter definitely seems preferable to me. If >> there's a way to do this with emacs lisp's natural scoping, I'm more >> than happy to learn. > If you want to use local variables: `make-local-variable' makes a > variable local in the current buffer, `make-variable-buffer-local' > generally; both are functions (not special forms or macros). And the > getter is `buffer-local-value'; also a function. > > Michael. Indeed. The macros I've written wrap (make-local-variable), but contain logic that reflects the structure that I'm working with. The package is intended to be generic, so expecting the user to rewrite the logic over and over seems inappropriate. BTW both (make-local-variable) and (make-variable-buffer-local) are written in C, so they can have direct and transparent access to symbols. That's a luxury that mere emacs lisp programmers don't have with functions. -- ,Doug d.lewan2000@gmail.com (908) 720 7908 If this is what winning looks like, I'd hate to see what losing is.