From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Weiner Newsgroups: gmane.emacs.bugs Subject: bug#48294: Use 'with-current-buffer' byte-compiler warning seems wrong Date: Sun, 9 May 2021 14:09:23 -0400 Message-ID: References: <83zgx37uqm.fsf@gnu.org> Mime-Version: 1.0 (1.0) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34426"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 48294@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 09 20:10:59 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 1lfntL-0008pg-CY for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 09 May 2021 20:10:59 +0200 Original-Received: from localhost ([::1]:52436 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lfntK-0004Gp-Dh for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 09 May 2021 14:10:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42180) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lfnsT-0003Ip-KF for bug-gnu-emacs@gnu.org; Sun, 09 May 2021 14:10:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45031) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lfnsT-0002u9-Aw for bug-gnu-emacs@gnu.org; Sun, 09 May 2021 14:10:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lfnsT-0007HP-3o for bug-gnu-emacs@gnu.org; Sun, 09 May 2021 14:10:05 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robert Weiner Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 09 May 2021 18:10:04 +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.162058377827913 (code B ref 48294); Sun, 09 May 2021 18:10:04 +0000 Original-Received: (at 48294) by debbugs.gnu.org; 9 May 2021 18:09:38 +0000 Original-Received: from localhost ([127.0.0.1]:56569 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lfns1-0007G7-A9 for submit@debbugs.gnu.org; Sun, 09 May 2021 14:09:37 -0400 Original-Received: from mail-qt1-f182.google.com ([209.85.160.182]:45885) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lfnru-0007FX-VP for 48294@debbugs.gnu.org; Sun, 09 May 2021 14:09:34 -0400 Original-Received: by mail-qt1-f182.google.com with SMTP id j11so10379498qtn.12 for <48294@debbugs.gnu.org>; Sun, 09 May 2021 11:09:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=IJg4df36H0QN5L3w+Sd5LTkL+z2RMzwkCcR4iQsyIIg=; b=bJoNca2rTDnI5MBfArXy3eEvyx3MDzh5FqHLlK2IhQuBCk8WfQoj9WvZFxfpoxfp0c kOFVkv4x8AA9gfZfDosEXpDN/C7tB3iIWKYSjTUbWEJqtLaVKfVtU5P0O1/CDzHeOwiV Jyq8IRXgPY6AzN3TefZ5QFF5WnSyO/kkPhlG6NlD28dHX4aIgoBQuxtLOLJp1WNUg/kz 8c8+fl5REzx3MElbUV+g1Hy/y1gUPtI9fuP3ndrOhawI7pjQ3QtFu631J9zz4rjc/D9K /yKEhp2w6Ofa8WndN9rp+X7NOYAvlLLuK3yPwOwmmnv8qJ3g7x6lq+EbhPpvhbeZlk6P 3JHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=IJg4df36H0QN5L3w+Sd5LTkL+z2RMzwkCcR4iQsyIIg=; b=S2sUJjlTKDktvUAhE2s8XRtNSoF0z5ngocdrBkZ5XK0O8VWfnmSx7lkRnP5ahJAW2W YDnLu/G3xTltR/llwziKTmjVLIBc94Mpax/4+pr/i50FCCJgz/vW24yhJmw3ekdjH8Tc shdlLSRQXGt774CPu0EUi3dQl9XG0XJsNLYI6ZVnHP+FM0tCNngdrwe7NbNqR/5p71Rp SgE3QLqb7QSJ/sSJ4lmpFH05Xa77fsHkx33eLY25tOYQaTlncxd7aBKu36RorGOSIqS9 B+8dqEIdDcMpo+8cqdEDdAUuj0TrIE5Rx5DFSBZEbPTcH9iLvah4rBfVEbRyIl14qHdw xxHQ== X-Gm-Message-State: AOAM533azGivlryxZDvuWb3v/AmQEDYTQZGVy4L13dcBe/g7eRAyKs8+ asG8yiU13WjWNIWQSJ+4rkCLBxfn6Fc= X-Google-Smtp-Source: ABdhPJxEP0flh5SLyL3rH2KDQ9cfxEGNUi/Ghj1X/szClBwBzpM3z18nnenM8Ddw91f2/knIlB8CQw== X-Received: by 2002:a05:622a:88:: with SMTP id o8mr19758956qtw.39.1620583765301; Sun, 09 May 2021 11:09:25 -0700 (PDT) Original-Received: from ?IPv6:2600:1000:b14f:b389:31c9:e8e2:e782:65b5? ([2600:1000:b14f:b389:31c9:e8e2:e782:65b5]) by smtp.gmail.com with ESMTPSA id t128sm9524051qkh.50.2021.05.09.11.09.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 09 May 2021 11:09:24 -0700 (PDT) In-Reply-To: <83zgx37uqm.fsf@gnu.org> X-Mailer: iPhone Mail (18D70) 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:206102 Archived-At: Somtimes a nested function within the body of the with-current-buffer will c= hange the buffer and move point in the original buffer and this may largely o= nly be known at run-time. -- Bob > On May 9, 2021, at 12:11 PM, Eli Zaretskii wrote: >=20 > =EF=BB=BF >>=20 >> From: Robert Weiner >> Date: Sun, 9 May 2021 11:57:25 -0400 >> Cc: 48294@debbugs.gnu.org >>=20 >> 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-curre= nt-buffer' buffer, just as my >> (save-excursion (set-buffer ...)) code does. If I move the save-excursio= n into the with-current-buffer body, >> then it applies to the new buffer not the original one and if in that sam= e body we change buffers again to the >> original and move point, then that movement will stay in place. So the q= uestion is, what is the appropriate >> code that the byte-compiler will accept when you want to save your origin= al place before switching buffers.=20 >=20 > I don't understand: with-current-buffer doesn't change point of the > original buffer, so why do you need to save it?