From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.help Subject: Re: [SOLVED with `eval']: Why I cannot use this variable in macro call from function? Date: Wed, 9 Jun 2021 13:56:45 +0300 Message-ID: References: <20210608202326.GG14693@tuxteam.de> <20210609060959.GA21706@tuxteam.de> <20210609065129.GB21706@tuxteam.de> <20210609073928.GC21706@tuxteam.de> <20210609085406.GH21706@tuxteam.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23702"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.0.7+183 (3d24855) (2021-05-28) 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 Wed Jun 09 13:02:02 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 1lqvyE-00061l-1k for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 09 Jun 2021 13:02:02 +0200 Original-Received: from localhost ([::1]:60764 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lqvyD-0007wz-3u for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 09 Jun 2021 07:02:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52204) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqvxe-0007wN-M9 for help-gnu-emacs@gnu.org; Wed, 09 Jun 2021 07:01:26 -0400 Original-Received: from stw1.rcdrun.com ([217.170.207.13]:36829) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqvxb-0000OJ-Ey for help-gnu-emacs@gnu.org; Wed, 09 Jun 2021 07:01:25 -0400 Original-Received: from localhost ([::ffff:197.157.0.23]) (AUTH: PLAIN admin, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 00000000000AE2EE.0000000060C09F7E.0000647C; Wed, 09 Jun 2021 04:01:17 -0700 Mail-Followup-To: tomas@tuxteam.de, Help GNU Emacs Content-Disposition: inline In-Reply-To: <20210609085406.GH21706@tuxteam.de> Received-SPF: pass client-ip=217.170.207.13; envelope-from=bugs@gnu.support; helo=stw1.rcdrun.com X-Spam_score_int: -3 X-Spam_score: -0.4 X-Spam_bar: / X-Spam_report: (-0.4 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_SORBS_WEB=1.5, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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:130669 Archived-At: * tomas@tuxteam.de [2021-06-09 11:54]: > On Wed, Jun 09, 2021 at 11:22:38AM +0300, Jean Louis wrote: > > * tomas@tuxteam.de [2021-06-09 10:40]: > > > You snipped the (for me) interesting part: did you notice how > > > `eval' jumps over the local declaration? > > > > Do you mean variables within `let'? > > Yes, it doesn't see them :) Maybe in theory it does not see, but in reality it does see it as `list' is evaluated before `eval', so the interned `rcd-symbol' and variable `description' they get evaluated before `eval'. (defun rcd-db-completing-table-history (table) "Return symbol of history variable for TABLE. If TABLE is \"businesses\" the symbol will become `rcd-db-completing-table-history-businesses' and it will be used for functions `completing-read' and `read-from-minibuffer' history. If a dynamically generated variable does not exist, it will be generated on the fly." (let ((rcd-symbol (intern (concat "rcd-db-completing-table-history-" table))) (description (format "History for table `%s'" table))) (if (boundp rcd-symbol) rcd-symbol (eval (list 'defvar rcd-symbol nil description))))) -- Jean Take action in Free Software Foundation campaigns: https://www.fsf.org/campaigns In support of Richard M. Stallman https://stallmansupport.org/