From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Nicolas P. Rougier (inria)" Newsgroups: gmane.emacs.devel Subject: Re: call-interactively behavior Date: Fri, 10 Mar 2023 19:16:27 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36017"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.8.14; emacs 28.2 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Mar 10 19:19:31 2023 Return-path: Envelope-to: ged-emacs-devel@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 1pahL1-00099X-Cg for ged-emacs-devel@m.gmane-mx.org; Fri, 10 Mar 2023 19:19:31 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pahKD-00089P-Vk; Fri, 10 Mar 2023 13:18:42 -0500 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 1pahK8-00088c-8r for emacs-devel@gnu.org; Fri, 10 Mar 2023 13:18:36 -0500 Original-Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pahK6-0007go-0G for emacs-devel@gnu.org; Fri, 10 Mar 2023 13:18:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=references:from:to:subject:date:in-reply-to:message-id: mime-version:content-transfer-encoding; bh=Riieei4MqetpJo+pgzgfWTO5qOwn+vvZ9+WOSUYQXNk=; b=ec58/GgWP7ZbSHAkByiRVltB8cuRkYD0LHSsSfUGoJ375HTP/n4jXfpf /Z0oIOrIoxYqv12yPw3ubidWD7+gY0I7SASi76zFo1M7I7KEh6xg33qDs 0mm2Bn9ee7j0Ke3vHgW8PgYXOb6PVZADJUMAJSC8Gf9kha0AHpRzgMPtn Q=; Authentication-Results: mail3-relais-sop.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=nicolas.rougier@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="5.98,250,1673910000"; d="scan'208";a="49837139" Original-Received: from 91-160-114-139.subs.proxad.net (HELO M-E7-NPR) ([91.160.114.139]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Mar 2023 19:18:32 +0100 In-reply-to: Received-SPF: pass client-ip=192.134.164.104; envelope-from=nicolas.rougier@inria.fr; helo=mail3-relais-sop.national.inria.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, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:304252 Archived-At: Nicolas P. Rougier (inria) [2023-03-10 at 07:38] wrote: > Hi all, >=20 > I'm trying to use call-interactively using the following code: >=20 > #+begin_src=20 > (with-current-buffer (get-buffer-create "hippie-test") > (setq-local hippie-expand-try-functions-list > '(try-complete-file-name-partially > try-complete-file-name)) > (text-mode) > (use-local-map (copy-keymap text-mode-map)) > (local-set-key (kbd "TAB") 'hippie-expand) >=20 > (insert "~/D") > (call-interactively (key-binding (kbd "TAB"))) > (call-interactively (key-binding (kbd "TAB"))) > (call-interactively (key-binding (kbd "TAB")))) > #+end_src >=20 > In my home root, there are 3 directoriess: ~/Desktop,=20 > ~/Downloads=20 > and ~/Documents. >=20 > When I execute the code above, the final content in the buffer=20 > is: > ~/Desktop/../../ >=20 > If I switch to the buffer, insert "~/D" and hit tab three times,=20 > I=20 > cycle over the three directories above, which is the expected=20 > behavior. My question is thus: why I don't get the same behavior=20 > and what would be the proper way to simulate the tab key press=20 > (or=20 > any other key)? >=20 > Nicolas Partially answering my question, it seems that evaluating=20 repeatedly the code works but it is not clear why. Maybe some=20 events need to be flushed? #+begin_src (with-current-buffer "hippie-test" (call-interactively (key-binding (kbd "TAB")))) #+end_sc Nicolas --=20 Nicolas P. Rougier =E2=80=94=E2=80=94 www.labri.fr/perso/nrougier Institute of Neurodegenerative Diseases, Bordeaux