From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Sean McAfee Newsgroups: gmane.emacs.bugs Subject: bug#35334: 26.2; Changes to position of point are undone during with-current-buffer if window is visible but not current Date: Fri, 19 Apr 2019 21:00:02 -0700 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000b8b45c0586ee450d" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="186124"; mail-complaints-to="usenet@blaine.gmane.org" To: 35334@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Apr 20 06:01:23 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.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hHhBr-000mId-1x for geb-bug-gnu-emacs@m.gmane.org; Sat, 20 Apr 2019 06:01:23 +0200 Original-Received: from localhost ([127.0.0.1]:36566 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHhBq-0000rc-4K for geb-bug-gnu-emacs@m.gmane.org; Sat, 20 Apr 2019 00:01:22 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:37194) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHhBZ-0000ln-K5 for bug-gnu-emacs@gnu.org; Sat, 20 Apr 2019 00:01:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hHhBW-0005Vp-6W for bug-gnu-emacs@gnu.org; Sat, 20 Apr 2019 00:01:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59985) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hHhBW-0005Vf-1I for bug-gnu-emacs@gnu.org; Sat, 20 Apr 2019 00:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hHhBV-0002S6-S6 for bug-gnu-emacs@gnu.org; Sat, 20 Apr 2019 00:01:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Sean McAfee Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 20 Apr 2019 04:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 35334 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.15557328279367 (code B ref -1); Sat, 20 Apr 2019 04:01:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 20 Apr 2019 04:00:27 +0000 Original-Received: from localhost ([127.0.0.1]:45296 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hHhAx-0002R0-7H for submit@debbugs.gnu.org; Sat, 20 Apr 2019 00:00:27 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:50940) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hHhAw-0002Qo-8I for submit@debbugs.gnu.org; Sat, 20 Apr 2019 00:00:26 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:39648) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hHhAp-0004xD-HB for submit@debbugs.gnu.org; Sat, 20 Apr 2019 00:00:21 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:37085) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHhAn-0000Rq-Vj for bug-gnu-emacs@gnu.org; Sat, 20 Apr 2019 00:00:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hHhAm-0004uu-4G for bug-gnu-emacs@gnu.org; Sat, 20 Apr 2019 00:00:17 -0400 Original-Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:33659) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hHhAl-0004tD-Qw for bug-gnu-emacs@gnu.org; Sat, 20 Apr 2019 00:00:16 -0400 Original-Received: by mail-wr1-x436.google.com with SMTP id k1so7750085wrw.0 for ; Fri, 19 Apr 2019 21:00:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=HYSgTdxWQkltej0gxXC0NwQUm7CYGhD+uev5FFMdpGs=; b=uZVVl4yya6s9niA09c/pZcmX9i8LughdHbDyxA2lcwv3nYNPv6nAKK7OcpxsnsKpdj NQFdCuW+JZx3/VR7/OAj7mK5bG2E2xf5rSWhYA9GQMBvrltJnn2d2+oYpr9IMABOqKh/ 1Ga261XEONM/oVssesHvu657mp0Uj0euVowKeAKGiIKWBULU3pCgCNnYiWYCdKPd42Fz eqZ4Fmftmr4jKuNpa2kS26jaUkJmpaBPnaBCzkHEjdHLBlT6cFaIbNZn5sZPJxNY3h4g pvfgx/bTc2MNUvIyQYeF02Ha4f+/LwzZ5yD3vtfwswRdNpCj1/lr4fzyCtWzaEwfNi0I IUZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=HYSgTdxWQkltej0gxXC0NwQUm7CYGhD+uev5FFMdpGs=; b=n8F1SgmHu4nhy24pOvjEVj9hbLGWcsvBtnBtYOKYcAA0kF6OCwwGRmau7bJs8aEhvL 6UGXi+Kmm9qsS0ZUbmjWI/rkLWxfyQ8Kr6NMnGurYiI0TG4Je7uf4Trk5rVwpvoitU3+ Srtr30UC4Oj2m9V2oOeK4dFgYsbVUIbSpKI8+V8aZN7fI1BWu3CFcMeycwAhIXmy4t00 LdCwGXTMQlAVRzTyfwZWWvaIANTeAxfomZlnq6uLZzQEDsi8rzpOTt8/BkFX6OSx2zBk odtoi8KeTh9cIyUc6Jvf+zZ6KRD8bL2DCNSKhv7D5yCOMsYZDEUvQVa79kAlC67P3Wjw nt8g== X-Gm-Message-State: APjAAAVqiwX88PvUnl75OxxWDiMK9rFm/e2xm6iYaW3ZE0xk6j1EsavM MlYEMuYdwq+O4yA9wXX1N4+hlDsV4j4pRMu8GbVs8b7w X-Google-Smtp-Source: APXvYqz/mVJgwiulFoPdiW0atQR1n0f51jm+UvaZX6cDr4KQhdCKvbBdBPb09YAM6zXaJsKfeVPfjfo5RBuYSyqbd+8= X-Received: by 2002:a5d:5745:: with SMTP id q5mr5358268wrw.118.1555732813623; Fri, 19 Apr 2019 21:00:13 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:157881 Archived-At: --000000000000b8b45c0586ee450d Content-Type: text/plain; charset="UTF-8" Starting from emacs -Q: Create a new buffer named "a". Insert ten asterisks and move point to the beginning of the buffer. Split the window and select the scratch buffer in one of them, leaving buffer "a" visible in the other. In the scratch buffer, evaluate this Lisp expression: (with-current-buffer "a" (goto-char 5) (insert "foo")) You can see "foo" inserted at position 5 in buffer "a", but point remains at the beginning of the buffer. Go to buffer "a", delete the "foo", and move to the beginning of the buffer again. Go to the scratch buffer and make it the sole visible window. Evaluate the above Lisp expression again. Go to buffer "a". "foo" has been inserted at position 5 as before, but now point is at position 8, after the "foo". I would expect point to move to position 8 in both cases, and I don't see anything in the documentation for with-current-buffer or goto-char to suggest that it ever wouldn't. In GNU Emacs 26.2 (build 1, x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2019-04-19 built on SeanMc Windowing system distributor 'The X.Org Foundation', version 11.0.11906000 System Description: Ubuntu 18.04.2 LTS Recent messages: C-x C-g is undefined C-. is undefined Undo! C-. is undefined nil Undo! Mark activated nil Quit Undo! Configured features: XAW3D XPM JPEG TIFF GIF PNG SOUND GPM DBUS GSETTINGS GLIB NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS LUCID X11 XDBE XIM THREADS LCMS2 Important settings: value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: Fundamental Minor modes in effect: tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib dired dired-loaddefs format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils elec-pair time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 96878 15032) (symbols 48 20303 1) (miscs 40 69 168) (strings 32 29315 1561) (string-bytes 1 758564) (vectors 16 14757) (vector-slots 8 508710 8162) (floats 8 51 278) (intervals 56 278 13) (buffers 992 12)) --000000000000b8b45c0586ee450d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Startin= g from emacs -Q:

Create a new buffer named "a".=C2=A0 Inse= rt ten asterisks and move point to
the beginning of the buffer.

S= plit the window and select the scratch buffer in one of them, leaving
bu= ffer "a" visible in the other.=C2=A0 In the scratch buffer, evalu= ate this
Lisp expression:

(with-current-buffer "a" (got= o-char 5) (insert "foo"))

You can see "foo" inse= rted at position 5 in buffer "a", but point
remains at the beg= inning of the buffer.

Go to buffer "a", delete the "f= oo", and move to the beginning of the
buffer again.=C2=A0 Go to the= scratch buffer and make it the sole visible
window.=C2=A0 Evaluate the = above Lisp expression again.=C2=A0 Go to buffer "a".
"foo= " has been inserted at position 5 as before, but now point is at
po= sition 8, after the "foo".

I would expect point to move to= position 8 in both cases, and I don't
see anything in the documenta= tion for with-current-buffer or goto-char
to suggest that it ever wouldn= 't.



In GNU Emacs 26.2 (build 1, x86_64-pc-linux-gnu, X t= oolkit, Xaw3d scroll bars)
=C2=A0of 2019-04-19 built on SeanMc
Window= ing system distributor 'The X.Org Foundation', version 11.0.1190600= 0
System Description:=C2=A0=C2=A0=C2=A0 Ubuntu 18.04.2 LTS

Recent= messages:
C-x C-g is undefined
C-. is undefined
Undo!
C-. is u= ndefined
nil
Undo!
Mark activated
nil
Quit
Undo!

C= onfigured features:
XAW3D XPM JPEG TIFF GIF PNG SOUND GPM DBUS GSETTINGS= GLIB NOTIFY ACL
LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT = ZLIB
TOOLKIT_SCROLL_BARS LUCID X11 XDBE XIM THREADS LCMS2

Importa= nt settings:
=C2=A0 value of $LANG: en_US.UTF-8
=C2=A0 value of $XMOD= IFIERS: @im=3Dibus
=C2=A0 locale-coding-system: utf-8-unix

Major = mode: Fundamental

Minor modes in effect:
=C2=A0 tooltip-mode: t=C2=A0 global-eldoc-mode: t
=C2=A0 electric-indent-mode: t
=C2=A0 m= ouse-wheel-mode: t
=C2=A0 tool-bar-mode: t
=C2=A0 menu-bar-mode: t=C2=A0 file-name-shadow-mode: t
=C2=A0 global-font-lock-mode: t
=C2= =A0 font-lock-mode: t
=C2=A0 blink-cursor-mode: t
=C2=A0 auto-composi= tion-mode: t
=C2=A0 auto-encryption-mode: t
=C2=A0 auto-compression-m= ode: t
=C2=A0 line-number-mode: t
=C2=A0 transient-mark-mode: t
Load-path shadows:
None found.

Features:
(shadow sort mail-e= xtr emacsbug message rmc puny seq byte-opt gv
bytecomp byte-compile ccon= v cl-loaddefs cl-lib dired dired-loaddefs
format-spec rfc822 mml easymen= u mml-sec password-cache epa derived epg
epg-config gnus-util rmail rmai= l-loaddefs mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev g= mm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prs= vr mail-utils elec-pair time-date
mule-util tooltip eldoc electric uniqu= ify ediff-hook vc-hooks
lisp-float-type mwheel term/x-win x-win term/com= mon-win x-dnd tool-bar
dnd fontset image regexp-opt fringe tabulated-lis= t replace newcomment
text-mode elisp-mode lisp-mode prog-mode register p= age menu-bar
rfn-eshadow isearch timer select scroll-bar mouse jit-lock = font-lock
syntax facemenu font-core term/tty-colors frame cl-generic cha= m georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao kor= ean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech europea= n
ethiopic indian cyrillic chinese composite charscript charprop
case= -table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer
cl-p= reloaded nadvice loaddefs button faces cus-face macroexp files
text-prop= erties overlay sha1 md5 base64 format env code-pages mule
custom widget = hashtable-print-readable backquote threads dbusbind
inotify lcms2 dynami= c-setting system-font-setting font-render-setting
x-toolkit x multi-tty = make-network-process emacs)

Memory information:
((conses 16 96878= 15032)
=C2=A0(symbols 48 20303 1)
=C2=A0(miscs 40 69 168)
=C2=A0(= strings 32 29315 1561)
=C2=A0(string-bytes 1 758564)
=C2=A0(vectors 1= 6 14757)
=C2=A0(vector-slots 8 508710 8162)
=C2=A0(floats 8 51 278)=C2=A0(intervals 56 278 13)
=C2=A0(buffers 992 12))

--000000000000b8b45c0586ee450d--