From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Al Haji-Ali Newsgroups: gmane.emacs.bugs Subject: bug#73446: 29.1; Curious behaviour with with-current-buffer and read-string Date: Tue, 24 Sep 2024 09:19:56 +0100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2521"; mail-complaints-to="usenet@ciao.gmane.io" To: 73446@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 24 10:31:09 2024 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 1st0wu-0000Pp-37 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 24 Sep 2024 10:31:08 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1st0wb-0006yq-3T; Tue, 24 Sep 2024 04:30:49 -0400 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 1st0wR-0006Tc-8E for bug-gnu-emacs@gnu.org; Tue, 24 Sep 2024 04:30:39 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1st0wQ-0001zT-VB for bug-gnu-emacs@gnu.org; Tue, 24 Sep 2024 04:30:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=Mz7mPPvyIvfsubFts6eT7NPRGrON2fmRRHLCfXrzVlY=; b=t3KDeYgQlGA2oyYvGVFp4QaPrzQAKwmPalCPRyW84CGZVNnGWC1UUqQN8rSv6HKcxBUrOy12mHUcsrz5aJJHfsYN2Y3EHgMyBLR/Ozy29qywlMGoM2fGhAI7m7gZKgdsLY978VEHygGTQB+nz+CLM18aGfuHPxk7BSaBBaYDOhWcKVJf7f8udPiOgkyce7vo17ag0U6+/EEjy1CKcpxviRGR1rkiiW4rx5gByG6ODMO6KUGIxNvidlW2/17l0IUMP05v/a95J4Jt0ZC1XRO0uqCKH4eBWg2AuwxTezqJCVqZCoIKp/wFGsypBYx0pK4Kp+DugEmM/okSfR6lQaLO5Q==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1st0wo-0001mh-C0 for bug-gnu-emacs@gnu.org; Tue, 24 Sep 2024 04:31:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Al Haji-Ali Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 24 Sep 2024 08:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 73446 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.17271666336633 (code B ref -1); Tue, 24 Sep 2024 08:31:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 24 Sep 2024 08:30:33 +0000 Original-Received: from localhost ([127.0.0.1]:45238 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1st0wK-0001io-Ft for submit@debbugs.gnu.org; Tue, 24 Sep 2024 04:30:32 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:47668) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1st0wJ-0001gh-3X for submit@debbugs.gnu.org; Tue, 24 Sep 2024 04:30:31 -0400 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 1st0vu-0004Tk-GV for bug-gnu-emacs@gnu.org; Tue, 24 Sep 2024 04:30:06 -0400 Original-Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1st0vs-0001la-Gr for bug-gnu-emacs@gnu.org; Tue, 24 Sep 2024 04:30:06 -0400 Original-Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-42cb1e623d1so50342725e9.0 for ; Tue, 24 Sep 2024 01:30:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727166602; x=1727771402; darn=gnu.org; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=Mz7mPPvyIvfsubFts6eT7NPRGrON2fmRRHLCfXrzVlY=; b=FrvfE4af6ojh3nxKHqX8kF0uZ5SoD1o0LlaHDSLCiApTg80W8UCKr9+uybDmdlk7aU JmwBbitj08EZjBe4eUgv6BV1RE1qIjnLyaGqqs+w3tfrV2BbYo0LwvAtQaQNre90VLQF dgeX2jrtwVaqJ0pJiWIBIdN5q8XHFe/zZi1cZaozIoDXgvZKRWgbT26IGn68bv7CHk7A r6pAygLz7DNLptT3mqz0g8b6/Y+CBSCFQuS2Q2ps9mKZ1RGlchNnsL5HNzq6lbI5dPMX eJt/6xNqWP2qyCysaWvka3Lvdd3/PNwbHhqmNSTaqMfbOfoyaPXINjKcf/lIEsSaLUyo 1Waw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727166602; x=1727771402; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Mz7mPPvyIvfsubFts6eT7NPRGrON2fmRRHLCfXrzVlY=; b=H+Fz4P4uWBlWbzVl9/UwMzK7VmvmnTugM8tYXYfq3ZMO0/fL7gUI8VZC3eiC5WzkFg ZISSynzhEPyvqxDWY/Efe4vjQGsqtsXVP4h2G5oAf357tW41Zn/Zevx+TZ3pzPExhRo7 gSRrw6QIS8WC6Q3gHOepT2jAEO5sa6Jd5vR9hLTNp3eqlkVrHZIQd5k23yWxjrSEKb4n MnyP6cUEk7mz7DDqo1byW+GdOtrvHrybWQSljw5Ivp+qhEWdeFvcvl26Vu1eP3LIEQHa 4XrT1EzJo6zDPpQbIgdsZY+HK9/4Cc5PNM7HYVGcej79NvSxSxldaBELHw1oLh9ABbeJ 6vRQ== X-Gm-Message-State: AOJu0YwJu1AbuuJct7FH8RylYvRpaBrvJIATlDYt0gfMfIkwQOgl+iyM WJRkz7LJeUihHQgxEtDlFq558d5nXHul5BYKt4MJq8s2OiCEWisS4JvRag== X-Google-Smtp-Source: AGHT+IEfKAswJhmUAty8FvH81INsnAJ5esR4RUfCY259L0AChcPIbPoS7a45rRy3MMeaIMlZRvPL5g== X-Received: by 2002:a05:600c:3b0f:b0:42c:bdb0:c625 with SMTP id 5b1f17b1804b1-42e7ac2341fmr105816045e9.14.1727166602190; Tue, 24 Sep 2024 01:30:02 -0700 (PDT) Original-Received: from localhost ([137.195.27.88]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37cbc2d2588sm928914f8f.63.2024.09.24.01.30.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Sep 2024 01:30:01 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=abdo.haji.ali@gmail.com; helo=mail-wm1-x32e.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: 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:292312 Archived-At: Consider this code snippet: ,---- | (with-current-buffer (get-buffer "*scratch*") | (message "START point %S %S" (current-buffer) (point)) | (goto-char 10) | (message "BEFORE point %S %S" (current-buffer) (point)) | (with-current-buffer (get-buffer "*Messages*") ;; some random buffer | (read-string "Test: ")) | (message "AFTER point %S %S" (current-buffer) (point))) `---- Assuming that *scratch* has a point at something other than 10 and *is visible in a window*, I get this output in Messages ,---- | START point # 2952 | BEFORE point # 10 | AFTER point # 2952 `---- I was expecting (point) AFTER to be 100, as it was BEFORE. This only happens when `read-string` is called and when `with-current-buffer` is nested, and only when *scratch* is visible in a window. I can easily solve this issue with `save-excursion`, but I thought this might be an unintended behaviour worth reporting. Best regards, -- Al