From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#37396: 26.3; execute-kbd-macro changes current buffer inside with-temp-buffer and similar forms Date: Fri, 13 Sep 2019 09:36:49 +0200 Message-ID: <01061656-2610-ffdf-7915-2408127dcb02@gmx.at> References: <83feea9a-66d6-0f02-d0cf-fa90f119c116@thompsonclan.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="65859"; mail-complaints-to="usenet@blaine.gmane.org" To: "Ryan C. Thompson" , 37396@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Sep 13 09:37:29 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1i8g93-000H1e-ES for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 Sep 2019 09:37:29 +0200 Original-Received: from localhost ([::1]:40950 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i8g91-0006j6-Fa for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 Sep 2019 03:37:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35702) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i8g8e-0006ft-0x for bug-gnu-emacs@gnu.org; Fri, 13 Sep 2019 03:37:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i8g8d-0003H3-5O for bug-gnu-emacs@gnu.org; Fri, 13 Sep 2019 03:37:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35466) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i8g8d-0003G7-0r for bug-gnu-emacs@gnu.org; Fri, 13 Sep 2019 03:37:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1i8g8c-0001bY-Tm for bug-gnu-emacs@gnu.org; Fri, 13 Sep 2019 03:37:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 13 Sep 2019 07:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37396 X-GNU-PR-Package: emacs Original-Received: via spool by 37396-submit@debbugs.gnu.org id=B37396.15683602186146 (code B ref 37396); Fri, 13 Sep 2019 07:37:02 +0000 Original-Received: (at 37396) by debbugs.gnu.org; 13 Sep 2019 07:36:58 +0000 Original-Received: from localhost ([127.0.0.1]:44286 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i8g8Y-0001b4-68 for submit@debbugs.gnu.org; Fri, 13 Sep 2019 03:36:58 -0400 Original-Received: from mout.gmx.net ([212.227.17.22]:59921) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i8g8X-0001ap-7g for 37396@debbugs.gnu.org; Fri, 13 Sep 2019 03:36:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1568360210; bh=VVY1WYhLrhBT5RyPlnggk5HmIeFhIugk1VmtwrighDE=; h=X-UI-Sender-Class:Subject:To:References:From:Date:In-Reply-To; b=CK8AucJZ3yco6NVZml51BTyYtekXnLceQt3Y8esJ0H75C/NVhEFGiTnvZg7dLqPbM Lvof7cVKjFLEbCQLqVcZg2tClP9A+hj+z/3WNy0hT2XIF0h1lWF3HQXiqUIiizGsNR wGqmPbVqL1GkJiPJhomQ9pmlak5qyfBWD3Ol5GNA= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [192.168.1.101] ([212.95.5.242]) by mail.gmx.com (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MjS9C-1iWVRI2lCM-00ktPD; Fri, 13 Sep 2019 09:36:50 +0200 In-Reply-To: <83feea9a-66d6-0f02-d0cf-fa90f119c116@thompsonclan.org> Content-Language: de-DE X-Provags-ID: V03:K1:X9vYYTFF++4PN8mFxWl6dG3NuVRu+DxfZ/3PnU3bHzmPwh63OtL Jy8BCLbOpp/OTIGC/hp4f9iD8+5sFI5RYuiiYV/8/61mpNJk9OHkyKCE2D3IJG86bV3wqIW dSLf3drfjIFB6g3p5hlxdAB+hjCLn6X45Czfu/fOSYKvcgjAZ5tgr2YdM7PSF50rKeu0xD2 QXUM54R+Oxyns+QvieBsA== X-UI-Out-Filterresults: notjunk:1;V03:K0:4aLs1SWsxDE=:jCM+s1P4m8yJF/+4A/FLjZ TzZBX9BwWkY9NbB6+Cwd2YQ2jVlS3xM2nk4BXmum7EGglbhaDGgh5onnNmSiIG/Z7GrMQk/nC lKxeoahKGIfB2oRiny2B9uKPl7sojb/4nB0RC5iVBdhDlILq5kJcPxT8UBXDYd8kRTe/osg2a BKW7oAG4Y89ZnBMND0SJjb9SEMpA5aTNkhhFgqLDjHUCosEm3vzGcjr2bKDeQR86pDWCglL42 UgZtIrEbglU5FMs1uCZZshDd5J4uvIu8v8oP/Q9A0u0tBi7Yx1bmcViiXZT4Bw4a6W+R24xKy dd657Vy5pMl7eFhtod2ybel7GauqW1O7/plAyKo9H9iBRkkCvAkwxFy7uODljmvzhcTZmblp0 B5BNJ+oK6HyziFQZe2/q1cEyaBd6DojpKqjg2zq2nWv5IqB8Va4vFdE8bklPNN/pAR8DuYRMC hsp/nqjOm+L0X2GfaZy980PFkyi8OBc1BpREYVv5ELKPyym7Fp6E4/+dWaT1/GuMmCzjIR/fZ kIrhLLCXIjbqGDKMAwN0TSdvcz5QWPvs937oe2dM1IKEKjPT2HGxwxaaRGUchx/CTKa+n7JTI BAVOP/S/pqKMfe/8Cv1yVJAsVo3FRjTPUhdgDe7yyOFr/YOysKHBgb1Ex+6xC+Y2/3qcTpX/f gD3aFQYcAzd1pkd+twu4sJioCWO2q4JqJy1xAHDkqoTOzKQ230hlg1KMY4Pt8uKngtHz1PF80 29WYJoXOjyvC3p5e5HQsBpuXEiRU5K8dcSJzDzUGM99vEiRYjYhLVrJHHMoA9gur0mFneV26 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:166383 Archived-At: > When inside a form that temporarily changes the current buffer, such > as "with-temp-buffer", running "execute-kbd-macro" appears to switch > the current buffer back to whatever buffer was current when the > current command started executing. 'execute-kbd-macro' calls command_loop_1 which sets the current buffer to the buffer shown in the selected window. > For example: > > (with-temp-buffer > (list > ;; Returns the temp buffer > (current-buffer) > (execute-kbd-macro "hello") > ;; Returns the buffer that was current when evaluation began > (current-buffer))) Try with (with-temp-buffer (let ((restore (window-buffer)) temp) (setq temp (current-buffer)) (set-window-buffer (selected-window) temp) (execute-kbd-macro "hello") (set-window-buffer (selected-window) restore) (list temp (current-buffer)))) martin