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 14:12:43 +0100 Message-ID: References: <86msjxdzd3.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1200"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 73446@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 24 15:22:02 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 1st5UP-000Ad0-Lu for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 24 Sep 2024 15:22:01 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1st5U4-0001iV-IU; Tue, 24 Sep 2024 09:21:40 -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 1st5U2-0001au-EL for bug-gnu-emacs@gnu.org; Tue, 24 Sep 2024 09:21:38 -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 1st5U2-0002gr-5U for bug-gnu-emacs@gnu.org; Tue, 24 Sep 2024 09:21: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:References:In-Reply-To:From:To:Subject; bh=S/zl5Gg8m5z/wMKD+76Kl7UKEEqOkOgDO7AAao/v/xc=; b=N9i35pbIehk6NAubQuqUZ5wBZqbEFnY4XNtRAnAHiQ+5/wapJVkHPVDh3tn3keIeTpBRmocUdJWfAxO73VngiUZ2CwcHiujSFPSnL4+He87vbt8q6fth4U8UNhgUaiP2oPe5/Sqy0UhPMEDOzofreh98Xs+PgD48zctljg65pEHsxVTCU2YZ6L+Q7V4ZX1q9Vg/FJ7fgFMFBAYhLQnyVa8IEg996tEo6hWOdbXhtXFO5rY6DAB84Fd2AQVRgEtw3OkJpY1H4H39oQq2Ca+GStbDplRolL2z9YEs+5u99DMQ9hFTlQ7mbWa26OkV6dj+M4wz9wc/fXTEDzFbHRDdIAA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1st5UQ-0000oa-B8 for bug-gnu-emacs@gnu.org; Tue, 24 Sep 2024 09:22: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 13:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73446 X-GNU-PR-Package: emacs Original-Received: via spool by 73446-submit@debbugs.gnu.org id=B73446.17271840973095 (code B ref 73446); Tue, 24 Sep 2024 13:22:02 +0000 Original-Received: (at 73446) by debbugs.gnu.org; 24 Sep 2024 13:21:37 +0000 Original-Received: from localhost ([127.0.0.1]:45548 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1st5U0-0000np-Ke for submit@debbugs.gnu.org; Tue, 24 Sep 2024 09:21:36 -0400 Original-Received: from mail-wm1-f41.google.com ([209.85.128.41]:58837) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1st5Tw-0000nK-EX for 73446@debbugs.gnu.org; Tue, 24 Sep 2024 09:21:35 -0400 Original-Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-42cb2191107so45524925e9.1 for <73446@debbugs.gnu.org>; Tue, 24 Sep 2024 06:21:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727184002; x=1727788802; darn=debbugs.gnu.org; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=S/zl5Gg8m5z/wMKD+76Kl7UKEEqOkOgDO7AAao/v/xc=; b=VfYS95wk38rZxul82WkP4VNk3LR5tkSOli1wB56AvKqYiJJDtvQ/3Nkz73pAbgwscO UuM+myX/AiQWCRop8EEo3TmIbAuK++iKseyaNYGpXtbwC4yMZITcf4hFPIlstMAiXb6T T1F/LCGOBkbMUoVpirm9GOAgYN9hQ1v3P4XN5kaUMmg8uQB7orbjlaGlJ1Jl3IpCteXc 1SAaKpUFffwB0PqtntX3g6sDHAq6Spyr7cKetTSefuuxMNwyB891Ir8swhZEG4aGeRlx 5YiHKTIXFybD7FnETqWbO0y/xor2wKRmToHh0gjRoXe4wuH3Q6rb3hq2SCTh6HkV1QI5 9xeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727184002; x=1727788802; h=mime-version: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=S/zl5Gg8m5z/wMKD+76Kl7UKEEqOkOgDO7AAao/v/xc=; b=h9+UnWN8/kCqQPwT/Nrubcu2QtK1+3zuqyyvWfG+D1SEVjHjR1tunsC+A0uH4MQHtT jM7GqjCpv7KhZO6OIBdwRqqCcSzSEy1UMbWYzAdB2ZgzO91lshWbgHxGuO6PAOUclwLU lEXDl27msSoRAhj1KxN6i5qxfw96jwRVmf7dyrTMDZvPqyqeZiVnOj0VzKW3bc4h2LZp EIdZvR2vG1tnUeJQSfL1u5xleVot0ao+BBxkMtYyuBolxTDAX1zZPKDBiP1OP8Xypnxa 924nb01aMU/Wy7JP4msQA6/QXaHvp1+MbDesmGp7Z5HGcSyasgl3krbIifP4X4JYQHSK jDoA== X-Gm-Message-State: AOJu0Yxk5GRYQR/WTvsBQUNcwL4I4/s8TZWRV4bhwsbaZocZmU/ohWiZ yVayBoNHgnU9T4dNI7jvXxoec2pXIHdvqE8EWx1PQF9HdHOuksd6 X-Google-Smtp-Source: AGHT+IElo++O/eY74ZYDVByZ3X5f7/PtfL1Dnus/i5XN7txENsafq7DUyaxBnZ3XPZShX8q18BMKMw== X-Received: by 2002:a05:600c:3c87:b0:426:50e1:ea6e with SMTP id 5b1f17b1804b1-42e7c16fe77mr99495255e9.18.1727184001897; Tue, 24 Sep 2024 06:20:01 -0700 (PDT) Original-Received: from localhost ([137.195.27.88]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42e902c66d0sm21854645e9.41.2024.09.24.06.20.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Sep 2024 06:20:01 -0700 (PDT) In-Reply-To: <86msjxdzd3.fsf@gnu.org> 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:292332 Archived-At: > I can't reproduce this, but see switch-to-buffer-preserve-window-point. Oh, is it maybe emacsen specific? I have `switch-to-buffer-preserve-window-point` set to t, but setting it to `nil` gives the same result. Here's how I can reproduce the problem: 1. Open 'emacs -Q'. 2. Paste the following into the scratch buffer (progn (defun test-bug-73446 nil (let ((buf1 "test1") (buf2 "test2")) (switch-to-buffer (get-buffer-create buf1)) (insert (make-string 20 ?H)) (goto-char 1) (switch-to-buffer (get-buffer-create buf2)) (let ((switch-to-buffer-preserve-window-point t) start before after) (display-buffer buf1 'display-buffer-use-some-window) (with-current-buffer (get-buffer buf1) (setq start (point)) (goto-char 10) (setq before (point)) (with-current-buffer (get-buffer buf2) ;; some random buffer (read-string "Test: ")) (setq after (point))) (list start before after)))) (message "%S" (test-bug-73446))) 3. Press `C-x c-e` (or call `eval-last-sexp`) 3. Press return when the prompt "Test: " appears. 4. I see the output (1 10 1), instead of (1 10 10) as I would expect. Best regards, -- Al