From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Bastian Beischer Newsgroups: gmane.emacs.bugs Subject: bug#28645: Status: 26.0.50; semantic-ia-fast-jump jumps to a random place in buffer Date: Tue, 17 Oct 2017 14:30:35 +0200 Message-ID: <878tgalzx0.fsf@gmail.com> References: <873770y3f9.fsf@gmail.com> <937f31d2-2952-8e88-1dd4-81ee243cd1fd@yandex.ru> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1508243504 11877 195.159.176.226 (17 Oct 2017 12:31:44 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 17 Oct 2017 12:31:44 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: bug#28645 <28645@debbugs.gnu.org> To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 17 14:31:33 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 1e4R1Z-0007W5-1R for geb-bug-gnu-emacs@m.gmane.org; Tue, 17 Oct 2017 14:31:09 +0200 Original-Received: from localhost ([::1]:38278 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4R1g-0007tW-A1 for geb-bug-gnu-emacs@m.gmane.org; Tue, 17 Oct 2017 08:31:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41952) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4R1V-0007tF-HQ for bug-gnu-emacs@gnu.org; Tue, 17 Oct 2017 08:31:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4R1S-0005i8-EM for bug-gnu-emacs@gnu.org; Tue, 17 Oct 2017 08:31:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36328) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e4R1S-0005hw-B7 for bug-gnu-emacs@gnu.org; Tue, 17 Oct 2017 08:31:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e4R1S-0000Hy-4P for bug-gnu-emacs@gnu.org; Tue, 17 Oct 2017 08:31:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Bastian Beischer Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 17 Oct 2017 12:31: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.15082434491090 (code B ref 28645); Tue, 17 Oct 2017 12:31:02 +0000 Original-Received: (at 28645) by debbugs.gnu.org; 17 Oct 2017 12:30:49 +0000 Original-Received: from localhost ([127.0.0.1]:45009 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4R1F-0000HU-3c for submit@debbugs.gnu.org; Tue, 17 Oct 2017 08:30:49 -0400 Original-Received: from mail-wr0-f181.google.com ([209.85.128.181]:50718) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4R1C-0000HF-VB for 28645@debbugs.gnu.org; Tue, 17 Oct 2017 08:30:47 -0400 Original-Received: by mail-wr0-f181.google.com with SMTP id q42so1487729wrb.7 for <28645@debbugs.gnu.org>; Tue, 17 Oct 2017 05:30:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=7UvCjhoaxdCfUtMH1A2AWeApPd3zgdrkHSMxh0Dtxgg=; b=pTecmMC1kotSbczkwIU05NLKDXTZokp15aXkC8n0ihHpSf3kWybey6+E/tn/DdQLqD KL80+R7UTZltjeTrir6ydzi2RRmB7gsl7Vl8/SXkU1PiPH3aHlYsiS23w9CUQuXSu1O2 VjBdok4Hfn0vfZrCRw2O57eW1Cp/VklJfdDI6wnnZRkzdjR03fkIntnntl3uEvyRw7fl KNmkbyYT901AfHHVRunOD1RCAGhWAADRCEeH9cv2qNSyiSS4cNkjKylw6EOMpgN6YjkG /GDZ1Ebi/zBwiSDRgUW2qBvlMbHfaMPoRWlRQxD6fcCP8DK6dQl7e4fLlyX6TXFXeMh/ UX3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=7UvCjhoaxdCfUtMH1A2AWeApPd3zgdrkHSMxh0Dtxgg=; b=PBCWQ/nWuzuBAgn5AOQTAr6KilQYvImh9NObnQEKa7UnBmXiGOx58affap/jBze6F/ Y9az7imd9exQkOZRo3Mlcfwwp2ETdzyWH3ydh75qbUKRFL6wL7h4EpZcyj/2RZvGPIf6 yOeKrzCue6lgeC5Ow5Q+MYT3WpJcM//4FG/73roW79buwQnyI1Bw6Az/ppqVAVx5i1tI 6KZ4IKyMyPs6xdBItuSHO/aBTz0GuAgsYLeBZbPAjoxNDhFmJIk7HHhEFCoQe0et2ave 7rK4TRUdfEy45ifpjFH2hyvAHZTbZJjE1o6rM69lBAVrFN3l3XqJniqdh4UNdcNkJbTP AbFA== X-Gm-Message-State: AMCzsaX22o+b2jEJsNF9U+6PtA6VXPKg4/D72L/bmcuE9SD7q/32Y++k ajQHWardAMiGgccuusgN77V1Tg== X-Google-Smtp-Source: ABhQp+Tzj+fP79f/gLJZ8Uv2KG/4bDZJ/kQBTlyGyjYm+AS/HmCagIT79k6TdHIhZd5Csn2w473SKg== X-Received: by 10.223.197.141 with SMTP id m13mr3679502wrg.203.1508243440593; Tue, 17 Oct 2017 05:30:40 -0700 (PDT) Original-Received: from beischer-w520.gmail.com (priv-1b-5-156.physik.rwth-aachen.de. [134.61.5.156]) by smtp.gmail.com with ESMTPSA id u4sm6805098wre.1.2017.10.17.05.30.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 17 Oct 2017 05:30:39 -0700 (PDT) In-Reply-To: <937f31d2-2952-8e88-1dd4-81ee243cd1fd@yandex.ru> (Dmitry Gutov's message of "Tue, 17 Oct 2017 13:44:30 +0300") 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:138610 Archived-At: Dmitry Gutov writes: > On 10/16/17 1:21 PM, Bastian Beischer wrote: > >> =E2=80=8BI replaced =E2=80=8Bswitch-to-buffer with pop-to-buffer-same-wi= ndow in those functions >> which I'm using regularly and it fixes the problem. The CEDET functions = where >> I made the replacements and checked them are: >> >> semantic-analyze-proto-impl-toggle >> semantic-complete-jump >> semantic-decoration-include-visit >> semantic-ia--fast-jump-helper >> semantic-mrub-vist >> senator-jump >> senator-jump-regexp >> =E2=80=8Bsenator-go-to-up-reference >> It turns out that senator-jump and senator-jump-regexp don't exist in emacs but only in upstream CEDET. So no need to change these. >> =E2=80=8BI didn't make any other replacements because: >> >> a) For some of them I'm not sure if 'pop-to-buffer-same-window' or >> 'pop-to-buffer' =E2=80=8Bshould be used. >> b) I'm not using any of the other functions with matches so I wouldn't b= e able >> to test the change. >> >> Also, searching for 'switch-to-buffer' in non-CEDET related lisp files i= n the >> emacs sources reveals more places which need to be fixed, but I didn't g= o that >> far. However, probably somebody (tm) should check them all one-by-one :-( > > Could you send a patch with the replacements you did make? Sure: diff --git a/lisp/cedet/semantic/analyze/refs.el b/lisp/cedet/semantic/anal= yze/refs.el index 55fcd83043..a58479f505 100644 --- a/lisp/cedet/semantic/analyze/refs.el +++ b/lisp/cedet/semantic/analyze/refs.el @@ -348,7 +348,7 @@ Only works for tags in the global namespace." =20 (push-mark) (semantic-go-to-tag target) - (switch-to-buffer (current-buffer)) + (pop-to-buffer-same-windown (current-buffer)) (semantic-momentary-highlight-tag target)) ) =20 diff --git a/lisp/cedet/semantic/complete.el b/lisp/cedet/semantic/complete= .el index ff8e61e54d..325ca1f441 100644 --- a/lisp/cedet/semantic/complete.el +++ b/lisp/cedet/semantic/complete.el @@ -2120,7 +2120,7 @@ completion works." (when (semantic-tag-p tag) (push-mark) (semantic-go-to-tag tag) - (switch-to-buffer (current-buffer)) + (pop-to-buffer-same-window (current-buffer)) (semantic-momentary-highlight-tag tag) (message "%S: %s " (semantic-tag-class tag) diff --git a/lisp/cedet/semantic/decorate/include.el b/lisp/cedet/semantic/= decorate/include.el index 6876e5f3a4..4a86b9e4ee 100644 --- a/lisp/cedet/semantic/decorate/include.el +++ b/lisp/cedet/semantic/decorate/include.el @@ -467,7 +467,7 @@ its contents. (error "Could not location include %s" (semantic-tag-name tag))) ((get-file-buffer file) - (switch-to-buffer (get-file-buffer file))) + (pop-to-buffer-same-window (get-file-buffer file))) ((stringp file) (find-file file)) )))) diff --git a/lisp/cedet/semantic/mru-bookmark.el b/lisp/cedet/semantic/mru-= bookmark.el index 5fa58e08ea..24863de01b 100644 --- a/lisp/cedet/semantic/mru-bookmark.el +++ b/lisp/cedet/semantic/mru-bookmark.el @@ -113,7 +113,7 @@ Uses `semantic-go-to-tag' and highlighting." (forward-char o)) (error nil)) ;; make it visible - (switch-to-buffer (current-buffer)) + (pop-to-buffer-same-window (current-buffer)) (semantic-momentary-highlight-tag tag) )) =20 diff --git a/lisp/cedet/semantic/senator.el b/lisp/cedet/semantic/senator.el index e86658628b..d37345aa2d 100644 --- a/lisp/cedet/semantic/senator.el +++ b/lisp/cedet/semantic/senator.el @@ -530,11 +530,11 @@ Some tags such as includes have other reference featu= res." ;; A tag ((semantic-tag-p result) (semantic-go-to-tag result) - (switch-to-buffer (current-buffer)) + (pop-to-buffer-same-window (current-buffer)) (semantic-momentary-highlight-tag result)) ;; Buffers ((bufferp result) - (switch-to-buffer result) + (pop-to-buffer-same-window result) (pulse-momentary-highlight-one-line (point))) ;; Files ((and (stringp result) (file-exists-p result))