From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#48294: Use 'with-current-buffer' byte-compiler warning seems wrong Date: Sun, 09 May 2021 19:11:13 +0300 Message-ID: <83zgx37uqm.fsf@gnu.org> References: <83k0o88h7o.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8512"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 48294@debbugs.gnu.org To: rswgnu@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 09 18:12:13 2021 Return-path: Envelope-to: geb-bug-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 1lfm2P-00027W-38 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 09 May 2021 18:12:13 +0200 Original-Received: from localhost ([::1]:50032 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lfm2O-0007LM-3J for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 09 May 2021 12:12:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52066) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lfm2H-0007JN-LL for bug-gnu-emacs@gnu.org; Sun, 09 May 2021 12:12:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44522) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lfm2E-0005xl-4a for bug-gnu-emacs@gnu.org; Sun, 09 May 2021 12:12:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lfm2E-0001B7-0J for bug-gnu-emacs@gnu.org; Sun, 09 May 2021 12:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 09 May 2021 16:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48294 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Original-Received: via spool by 48294-submit@debbugs.gnu.org id=B48294.16205766784522 (code B ref 48294); Sun, 09 May 2021 16:12:01 +0000 Original-Received: (at 48294) by debbugs.gnu.org; 9 May 2021 16:11:18 +0000 Original-Received: from localhost ([127.0.0.1]:56065 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lfm1V-0001As-UF for submit@debbugs.gnu.org; Sun, 09 May 2021 12:11:18 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:41642) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lfm1U-0001Am-E8 for 48294@debbugs.gnu.org; Sun, 09 May 2021 12:11:16 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:36850) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lfm1P-0005A7-9d; Sun, 09 May 2021 12:11:11 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4377 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lfm1O-0007oW-Oe; Sun, 09 May 2021 12:11:11 -0400 In-Reply-To: (message from Robert Weiner on Sun, 9 May 2021 11:57:25 -0400) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:206086 Archived-At: > From: Robert Weiner > Date: Sun, 9 May 2021 11:57:25 -0400 > Cc: 48294@debbugs.gnu.org > > Thanks for the feedback. Everything you wrote is very clear. The issue, however, is that I want to save > point in the current buffer prior to switching context to the 'with-current-buffer' buffer, just as my > (save-excursion (set-buffer ...)) code does. If I move the save-excursion into the with-current-buffer body, > then it applies to the new buffer not the original one and if in that same body we change buffers again to the > original and move point, then that movement will stay in place. So the question is, what is the appropriate > code that the byte-compiler will accept when you want to save your original place before switching buffers. I don't understand: with-current-buffer doesn't change point of the original buffer, so why do you need to save it?