From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Manuel Giraud via Users list for the GNU Emacs text editor Newsgroups: gmane.emacs.help Subject: Re: Printing alist pairs to a dedicated buffur Date: Sat, 20 Apr 2024 11:55:46 +0200 Message-ID: <87plukbbod.fsf@ledu-giraud.fr> References: <87bk65fpsz.fsf@ledu-giraud.fr> Reply-To: Manuel Giraud Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25893"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Heime via Users list for the GNU Emacs text editor To: Heime Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Apr 20 11:56:32 2024 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 1ry7SS-0006Up-68 for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 20 Apr 2024 11:56:32 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ry7Rr-00084e-Q4; Sat, 20 Apr 2024 05:55:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ry7Rp-00084R-J5 for help-gnu-emacs@gnu.org; Sat, 20 Apr 2024 05:55:53 -0400 Original-Received: from ledu-giraud.fr ([51.159.28.247]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ry7Rn-00068B-8o for help-gnu-emacs@gnu.org; Sat, 20 Apr 2024 05:55:53 -0400 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=L40rhU6E D5rnch9F77agPMdIyn1yh1WrcnYRPx7fmC0=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=u7S+kHQVan9CtY7Mk4VvKDXqEpVsXB FHr7zDTsboUHVKeKv3rbjh/zwy92QTIQZysUzOOHnE3z1nCOmMfw1NDA== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=L40rhU6ED5rnch9F 77agPMdIyn1yh1WrcnYRPx7fmC0=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=U5LhjMUMXr8F5RFrRLEq5d06Ih/ctlnTqllSMX HE09PCQeOj9Q6idyCVmhHN/Z2xdJSeRhH/tnPfIc9M61RzYTvuZPwv7kWGcjkgsUtGgqt2 ge0aAVEM4X2CJ8Xp8bqM/1+8/a4kZhD/385z98so2khLTXQGGEvuDNvAr1oaKPPoQN2hPT rNHv+Hl7LIgobchJyzqscIa+KL5iO85V+UDVw0lj0TvSlQq+zXzBv/Dh3hKuP3C4LSnsDI kD/DfnMjxPQPuk24rUb0/lUA9rkValaBgeSYiRAL7yALx1l+oA1shShOxd/b+95BiGP1nS yM4iuwzCW+IdMpHYCIhRNckw== Original-Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 49a66039 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sat, 20 Apr 2024 11:55:47 +0200 (CEST) In-Reply-To: (Heime's message of "Fri, 19 Apr 2024 19:42:34 +0000") Received-SPF: pass client-ip=51.159.28.247; envelope-from=manuel@ledu-giraud.fr; helo=ledu-giraud.fr 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, 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.29 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-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:146399 Archived-At: Heime writes: > This is how I am filling my alist named tema-lugar > > > (defun tema-mark (kfrz) > "Associate line number at cursor position with key phrase KFRZ." > (interactive "sString: ") > > (let ( (lnum (line-number-at-pos)) ) > > (setq-local tema-lugar > (append tema-lugar > (list (cons kfrz lnum)))) )) Hi, Maybe your error comes from this `setq-local'. I have used `defvar' which will create a global (i.e. visible everywhere in Emacs) variable. `setq-local' or `defvar-local' are used for *buffer-local* variables. Buffer-local variables are visible only from the buffer they were created. In your previous command, the first thing you did was to switch to another buffer that knows nothing about tema-lugar. I suggest you to read "(elisp) Buffer-Local Variables". HTH -- Manuel Giraud