Subject: bug#28645: closed (Re: bug#28645: 26.0.50; semantic-ia-fast-jump jumps to a random place in buffer)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 30 Sep 2017 14:20:02 +0000

Your bug report

#28645: 26.0.50; semantic-ia-fast-jump jumps to a random place in buffer

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
28645: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=28645
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#28645: 26.0.50; semantic-ia-fast-jump jumps to a random place in buffer
From: Dmitry Gutov <[email-masked]>
To: martin rudalics <[email-masked]>, Constantine <[email-masked]>, [email-masked]
Date: Sat, 30 Sep 2017 16:19:37 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

On 9/29/17 8:18 PM, martin rudalics wrote:
>  > +  (let (switch-to-buffer-preserve-window-point)
>  > +    (switch-to-buffer (current-buffer)))
> 
> I think (pop-to-buffer-same-window (current-buffer)) should be used
> instead.

Done.

Thanks all!

Subject: 26.0.50; semantic-ia-fast-jump jumps to a random place in buffer
From: Constantine <[email-masked]>
To: [email-masked]
Date: Fri, 29 Sep 2017 16:23:54 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

When declaration is in another buffer, semantic-ia-fast-jump often
jumps to this buffer, but to incorrect line. However if the
declaration is in the same buffer where the command was used, it always
— as far as I've seen — jumps to the correct line.

Steps to reproduce:

1. Create the following 2 files with the following content:
     $ grep -n "" myfunc.h test.cpp
     myfunc.h:1:void myfunc1() {
     myfunc.h:2:}
     myfunc.h:3:void myfunc2() {
     myfunc.h:4:}
     test.cpp:1:#include "myfunc.h"
     test.cpp:2:
     test.cpp:3:int main() {
     test.cpp:4:     myfunc1();
     test.cpp:5:     myfunc2();
     test.cpp:6:}
2. Run emacs -Q test.cpp
3. Enable `M-x semantic-mode`
4. Put cursor into "myfunc2", and type `M-x semantic-ia-fast-jump`
     (you'll see it jumped to the correct declaration at myfunc.h file)
5. Use `C-x b RET` to switch back to test.cpp
6. Put cursor into "myfunc1", and type `M-x semantic-ia-fast-jump`

Result: it jumped to "myfunc2" declaration, not to "myfunc1" as it ought to.

I also want to note that though ATM I am using emacs-git, I've seen the
problem for don't remember how long, just didn't report.