Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

M-. on a symbol doesn't always move the cursor to the right position #391

Open
lokedhs opened this issue Jun 15, 2017 · 6 comments
Open

Comments

@lokedhs
Copy link

lokedhs commented Jun 15, 2017

If you press M-. on a symbol that is defined in a file that is already opened, the cursor doesn't move to the correct location. The problem only happens on recent versions of Emacs.

The cause of the problem is a change in behaviour of goto-char. It no longer can be used to move the cursor in an inactive buffer. The old behaviour can be restored by setting switch-to-buffer-preserve-window-point to nil.

The root cause is is in SLIME the cursor is set using goto-char, and later the buffer is displayed using pop-to-buffer. This no longer works, and according to a discussion on emacs-devel, the function set-window-point should be used instead.

Here is the discussion on emacs-devel: https://lists.gnu.org/archive/html/emacs-devel/2017-06/msg00227.html

@luismbo
Copy link
Member

luismbo commented Jun 15, 2017 via email

@lokedhs
Copy link
Author

lokedhs commented Jun 15, 2017

Based on the discussion on the mailing list, I think the only reliable solution to this is to change the behaviour of the code so that it switches to the buffer before moving the cursor. I think the propoer solution is to use pop-to-buffer first, and then place the cursor at the correct location using goto-char.

@luismbo
Copy link
Member

luismbo commented Jun 15, 2017 via email

@lokedhs
Copy link
Author

lokedhs commented Jun 15, 2017

I can give it a try. I'll look at it in the next few days or so.

@luismbo
Copy link
Member

luismbo commented Dec 28, 2017

@lokedhs any news? :-)

@lokedhs
Copy link
Author

lokedhs commented Jan 1, 2018

Actually, I haven't looked at it since this was discussed last. If I recall correctly, the code was quite complictaed, and there was no obvious simple way to make the change.

I changed the Emacs configuration variable to revert to the old behaviour and I haven't bothered with this since. This is of course not ideal, and a proper solution should be implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants