From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Augusto Stoffel Newsgroups: gmane.emacs.devel Subject: Re: call-interactively behavior Date: Sat, 11 Mar 2023 11:52:36 +0100 Message-ID: <87zg8jpnkb.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8321"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-devel@gnu.org To: "Nicolas P. Rougier (inria)" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Mar 11 11:53:29 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 1pawqv-0001vC-Cg for ged-emacs-devel@m.gmane-mx.org; Sat, 11 Mar 2023 11:53:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pawqD-0001Kt-MU; Sat, 11 Mar 2023 05:52:45 -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 1pawq9-0001J0-W8 for emacs-devel@gnu.org; Sat, 11 Mar 2023 05:52:43 -0500 Original-Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pawq8-0001Tx-Al for emacs-devel@gnu.org; Sat, 11 Mar 2023 05:52:41 -0500 Original-Received: by mail-ed1-x52b.google.com with SMTP id g10so1732793eda.1 for ; Sat, 11 Mar 2023 02:52:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678531958; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=oxLN1i+VBbZn4yXxd9WLxHj/0UJJbPgDuIEEWLSH6Sg=; b=B+6Sk9AIT/8ijPfxx5WnEw/bcbFgwZzW+mUGAI/cXjPEKBVDVDS7Ug9+FxdqhHBGd3 YQKTcuvRlqQOR/c2p7XqagKkcID5oFwT4vGl4O/gScTc5mwCcfKq5jFpqvC0tbLVs/Rg S54h3D4dU/03eAqQKHMwdHaXWQSLL/XTWkRUu8sBRq94eR7XhakMg0COqYXgEcjjZrmO GpXV37/ohYqONdsGCpiOcvzucnGG6P4G1x262O0N8mD21Ou9UGNSSWm/HHnrK+fYUG/7 kg83Nfz+aTriYq0JBr2zJQczKHBwIkBdgBPM+rsjUNvImE5ivTCaneSiJoFg/v8exiwb Z3iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678531958; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=oxLN1i+VBbZn4yXxd9WLxHj/0UJJbPgDuIEEWLSH6Sg=; b=N76DaD3q7uTJE74lPqY3QdIhsU9Le4jEHUOFOxREHN+kN+BFQpqFwmL5FuVzHAeGwl mHZm8UiMEyu+tFGvBk36Ztip9nWcVXHxnY4EVdjsxpneUK72Hi6NN8awwL0lI8lC6Txb eYKA5KYTHB2mjFaXWRZRs6XSQzmLh1+lGG7UVxU3xMNyaTGLZZ2QLfV4GnVMi5IOhElm eW3GYXg/RFRQ+QXL/L/j9edfz/J3LBfwM1/O3tXVnbQHvVjHS8/1Krp4t57P8KHBOnEP TvO/9KalElhgrNXpxhKVdJJJhxIiFDx//JB+g24RipVGcc2Vsoy3aZXCkc3BSmZS8g1o jwwA== X-Gm-Message-State: AO0yUKU1NDeVnSvVXT4tCckJcnH+V0gKqu8e0Mws8gO9lFpiG37bvbz+ lDKFxcpNkDOEGF/xgZS51BiKbAucxl/M0w== X-Google-Smtp-Source: AK7set/KDCnrp7mcV/ROAWTwLB+tpaHXxs5tkZwLXxscekCuEUUpcQeYvz1TogOwHYOotymWyLVqKg== X-Received: by 2002:aa7:c642:0:b0:4ae:eb0f:4220 with SMTP id z2-20020aa7c642000000b004aeeb0f4220mr24309280edr.38.1678531958074; Sat, 11 Mar 2023 02:52:38 -0800 (PST) Original-Received: from ars3 ([2a02:8109:8ac0:56d0::8b3a]) by smtp.gmail.com with ESMTPSA id hz17-20020a1709072cf100b008dceec0fd4csm975177ejc.73.2023.03.11.02.52.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Mar 2023 02:52:37 -0800 (PST) In-Reply-To: (Nicolas P. Rougier's message of "Fri, 10 Mar 2023 19:16:27 +0100") Received-SPF: pass client-ip=2a00:1450:4864:20::52b; envelope-from=arstoffel@gmail.com; helo=mail-ed1-x52b.google.com 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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:304284 Archived-At: I suppose you want to use `execute-kbd-macro'? On Fri, 10 Mar 2023 at 19:16, Nicolas P. Rougier (inria) wrote: > Nicolas P. Rougier (inria) [2023-03-10 at 07:38] wrote: >> Hi all, >> >> I'm trying to use call-interactively using the following code: >> >> #+begin_src >> (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) >> >> (insert "~/D") >> (call-interactively (key-binding (kbd "TAB"))) >> (call-interactively (key-binding (kbd "TAB"))) >> (call-interactively (key-binding (kbd "TAB")))) >> #+end_src >> >> In my home root, there are 3 directoriess: ~/Desktop, >> ~/Downloads >> and ~/Documents. >> >> When I execute the code above, the final content in the buffer >> is: >> ~/Desktop/../../ >> >> If I switch to the buffer, insert "~/D" and hit tab three times, >> I >> cycle over the three directories above, which is the expected >> behavior. My question is thus: why I don't get the same behavior >> and what would be the proper way to simulate the tab key press >> (or >> any other key)? >> >> Nicolas > > Partially answering my question, it seems that evaluating > repeatedly the code works but it is not clear why. Maybe some > events need to be flushed? > > #+begin_src > (with-current-buffer "hippie-test" > (call-interactively (key-binding (kbd "TAB")))) > #+end_sc > > Nicolas