--- Begin Message ---
Subject: |
26.0.50; semantic-ia-fast-jump jumps to a random place in buffer |
Date: |
Fri, 29 Sep 2017 16:23:54 +0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
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.
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#28645: 26.0.50; semantic-ia-fast-jump jumps to a random place in buffer |
Date: |
Sat, 30 Sep 2017 16:19:37 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:56.0) Gecko/20100101 Thunderbird/56.0 |
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!
--- End Message ---