From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#28645: Status: 26.0.50; semantic-ia-fast-jump jumps to a random place in buffer Date: Wed, 04 Oct 2017 11:03:17 +0200 Message-ID: <59D4A3D5.2030005@gmx.at> References: <873770y3f9.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1507107885 22737 195.159.176.226 (4 Oct 2017 09:04:45 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 4 Oct 2017 09:04:45 +0000 (UTC) Cc: dgutov@yandex.ru To: Bastian Beischer , bug#28645 <28645@debbugs.gnu.org> Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 04 11:04:37 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dzfbH-0003rI-9z for geb-bug-gnu-emacs@m.gmane.org; Wed, 04 Oct 2017 11:04:19 +0200 Original-Received: from localhost ([::1]:33803 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzfbK-0006F9-0i for geb-bug-gnu-emacs@m.gmane.org; Wed, 04 Oct 2017 05:04:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53415) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzfb6-0006AD-FT for bug-gnu-emacs@gnu.org; Wed, 04 Oct 2017 05:04:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dzfb0-0006qV-Or for bug-gnu-emacs@gnu.org; Wed, 04 Oct 2017 05:04:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:38804) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dzfb0-0006qP-LK for bug-gnu-emacs@gnu.org; Wed, 04 Oct 2017 05:04:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dzfb0-0004Ts-DK for bug-gnu-emacs@gnu.org; Wed, 04 Oct 2017 05:04:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 04 Oct 2017 09:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28645 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 28645-submit@debbugs.gnu.org id=B28645.150710781717170 (code B ref 28645); Wed, 04 Oct 2017 09:04:02 +0000 Original-Received: (at 28645) by debbugs.gnu.org; 4 Oct 2017 09:03:37 +0000 Original-Received: from localhost ([127.0.0.1]:47481 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dzfab-0004Ss-Hf for submit@debbugs.gnu.org; Wed, 04 Oct 2017 05:03:37 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:57313) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dzfaX-0004Sb-RQ for 28645@debbugs.gnu.org; Wed, 04 Oct 2017 05:03:36 -0400 Original-Received: from [192.168.1.100] ([46.125.250.31]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MBnPX-1e8A2r4A0V-00AniP; Wed, 04 Oct 2017 11:03:27 +0200 In-Reply-To: <873770y3f9.fsf@gmail.com> X-Provags-ID: V03:K0:hb4w/tbIBraEuy7crfVERUtYQvNqsRefK8WmSXV2ZCniN/5VS/Y ZTedqpaWlM42PJTLZbhN2Og4VDHAn3R8IVbth2e81i1k00PLNwpfAs2ke/mkqY8O7bMOcV7 id1/SQvaCk7w7kV0YLWM7RPolkHhy/dtceTGkZw2EKErWONHTyDb3QiPDF42n62mIP66Rlp BrZ/68ScF+q1pNN+ziv4Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:1IRucKdcrtI=:6gVp+X9IjTR0Ho2nUb/Gf9 mb7wtKmczb5SK79kavkrZY8BY+dfuph3bWUHtrQrJddgutZfFFODzAO6p7K4V+NH1NF9m/rNB WlISCLAT4URBWllDW8x8L2NQP9GZonU444+4ZEeCmElycz9J2Qp3H5nXa+V9jlVJMD36AisPl lV+pV0+lQ4Hkly8wj7y85qKhKXuHkyNqLWMoKSguX5JJ/1i7AERvJSzFZMJSO2p20zy8WksTN oYaAgjnWELgOCZB8P6SIp/A/yfNyufuvc1njtMw/svGKmit/Lr8yucvTCnkc4FGduvsbfx+vE JfRcakD6KEjDf6HQq5abnlqxPoWCJaGaH3M16k/Q2vpk67wgAK34oonDhnAp+VWpgSvRcgJTN q3wYQX0bXVBPnu/pVWfYBkjNl77zp1cfL5RfkUW2iQs3UWPFm9jxzl9gdS2D1sODXtxBnt+Lo 0i6rpzUCovO6T6x2QAnR+pP8Ptr2elVP29d4cLgHVYXp2dtJXA6UtXLw026iJ2MWhljf5PnUJ WQRWPVDthsj1YDneEyYd3208s9M3Ihfe5RiZfff8HfieXL6EUzr+KIAz9LSzZT0aYX6i2qbQc WnQgvIKkZ4M9lENIPwTtOkUg+Qyktvc6GpVCyYjr4IehElPsCEucwG6WlTwxHeawBBppypZpr sle8pvBQ7YooOaeeZf4n9h+plKR1ll3rYvu5T4+KnnU7T4fymhS1MHKBVaXqPF9l7Z2nTB8va F/paty1tl23xlZcvXTdFVSw0O94Zq4FcrgV7saAYK0OD3nr4/rXrMXzdrlOaF4MmJOW8ndBz 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: 208.118.235.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:137883 Archived-At: > I would also be grateful for a little bit of background information. A= t > which point did it become necessary to use 'pop-to-buffer' instead of > 'switch-to-buffer'? Apparently 'semantic-ia-fast-jump' et al worked fi= ne > in older emacs versions. > > When is it ok to use 'switch-to-buffer'? There are numerous occurences= > of it throughout emacs... Consider the following scenario: (1) =E2=80=98switch-to-buffer-preserve-window-point=E2=80=99 is t (it is = so by default). (2) An application explicitly sets point in a buffer that is currently not displayed in the selected window to a value different from the value of =E2=80=98window-point=E2=80=99 of that window at the last t= ime this buffer was displayed there. (3) The application wants to switch to the buffer in the selected window with =E2=80=98window-point=E2=80=99 at the position of point assigne= d in (2). If the application used =E2=80=98switch-to-buffer=E2=80=99 in (3), then =E2= =80=98window-point=E2=80=99 will be reset to the old location of =E2=80=98window-point=E2=80=99 which= is obviously not what the application wants. So to get what it wants, an application either has to bind =E2=80=98switch-to-buffer-preserve-window-point=E2=80=99= to nil around the =E2=80=98switch-to-buffer=E2=80=99 call or use =E2=80=98pop-to= -buffer-same-window=E2=80=99 (=E2=80=98display-buffer-same-window=E2=80=99 if the window may remain un= selected) instead. IMHO applications should never call =E2=80=98switch-to-buffer=E2=80=99. = They should either call =E2=80=98pop-to-buffer=E2=80=99 - if the user is supposed to = now continue working in the window showing the buffer - and =E2=80=98display-buffer=E2= =80=99 in all other cases. Both allow the user to control how to display the buffer. Only if there is a clear preference that the buffer should be shown in the _selected_ window, the =E2=80=98-same-window=E2=80=99 functions shoul= d be called. And programmers should be aware that at the time they want to show a buffer in the selected window, that window might be the minibuffer window or a window dedicated to some other buffer. martin