From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.help Subject: Re: Elisp: can't read buffer content with with-current-buffer Date: Fri, 03 Jun 2022 08:25:57 +0200 Message-ID: <87a6auuuob.fsf@gnu.org> References: <8735gn9fq2.fsf@gmail.com> <87k09y3in7.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25673"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.7.26; emacs 29.0.50 Cc: help-gnu-emacs@gnu.org To: Alessandro Bertulli Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 03 08:34:20 2022 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 1nx0t1-0006Zk-Rz for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 03 Jun 2022 08:34:20 +0200 Original-Received: from localhost ([::1]:51330 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nx0t0-0005pl-G2 for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 03 Jun 2022 02:34:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55220) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nx0o6-0005Fm-1q for help-gnu-emacs@gnu.org; Fri, 03 Jun 2022 02:29:14 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:48312) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nx0o5-0003Tp-PT; Fri, 03 Jun 2022 02:29:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-reply-to:Date:Subject:To:From: References; bh=kQsCeZfRWV1UVCHK/g/p7KCIknFdWeftGdDAzdyUkDw=; b=XqKIp6FxGpTPrc bzjkrrAcuafoVtiRMH1VV2LZx057N9Nn3Eh2k/LRd1+B6q75f0TOoeDM1VdtBqYQsi1HEygJ9IHUu 40Xp94b3t4gs0FkCyAEi0vGahwrrlq6lEZqDAebSHGOE3uKWtVbeIjsmO4BW+yC9Ek+BmUM1g81CS 4o4+qA3aacXm080+rAR56AQGDjmRmgbNsnw85Q5MRJJEq/XZC+kLIcOnP7YwQD9rAPM/jIgsmzvRB /AmrVYXX7uWphkkoEOPWcCAvmDXcSQvMFnR9kuWi6X26/fHf50ZhXLZFHZRvhPiwFss5WQsdNpQxN I6XXJd20G7bAqBQFyD6g==; Original-Received: from auth2-smtp.messagingengine.com ([66.111.4.228]:53113) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nx0o5-00028Z-Hp; Fri, 03 Jun 2022 02:29:13 -0400 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailauth.nyi.internal (Postfix) with ESMTP id 5D14427C0054; Fri, 3 Jun 2022 02:29:12 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Fri, 03 Jun 2022 02:29:12 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrleehgddutdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfhgfhffvvefuffgjkfggtgesthdtredttdertdenucfhrhhomhepvfgrshhs ihhlohcujfhorhhnuceothhsughhsehgnhhurdhorhhgqeenucggtffrrghtthgvrhhnpe dujedtheduvdelffejkeetgedvheelhedvueefhfeukeekkeehvdfggeegffevgfenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhorhhnod hmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdekieejfeekjeekgedqieefhedv leekqdhtshguhheppehgnhhurdhorhhgsehfrghsthhmrghilhdrfhhm X-ME-Proxy: Feedback-ID: ib2b94485:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 3 Jun 2022 02:29:11 -0400 (EDT) In-reply-to: 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" Xref: news.gmane.io gmane.emacs.help:137491 Archived-At: Alessandro Bertulli writes: Hi Alessandro, > Thanks Tassilo, it now works! Great. > However, now I have a next problem. I have this function for debug: > > (defun run-java-main-method (mainClass) > > (interactive > (completing-read "Run main method: " (get-main-method-list))) > (message "Read %s" mainClass) > ) > > So that it simply echoes the entered text. Minibuffer completion works > fine (I use Vertico), but when pressing RET I got this error (I report > the debugger output, got by setting debug-on-error to t): > > Debugger entered--Lisp error: (wrong-type-argument listp > "/home/alessandro/akka/src/main/java/com/example/Ak...") > call-interactively(run-java-main-method nil nil) > command-execute(run-java-main-method) > > I don't get it. Where is it expecting a list? A function receives a list of arguments and `interactive' is supposed to get a list (or a string which is interpreted according its spec). So this should do: (defun run-java-main-method (mainClass) (interactive (list (completing-read "Run main method: " (get-main-method-list)))) (message "Read %s" mainClass)) Bye, Tassilo