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

Jumps to the bottom of the buffer when used with emacs-lsp autocomplete #12

Open
XO39 opened this issue May 23, 2022 · 5 comments
Open

Comments

@XO39
Copy link

XO39 commented May 23, 2022

The update before the last one caused Emacs to stop working properly every time I launch it. Had to disable line-reminder back then. The last update resolved that issue, but brought along a new issue, that is when even I use autocomplete, it jumps to the bottom of the buffer. Had to disable it again.

@jcs090218
Copy link
Member

jcs090218 commented May 23, 2022

Sorry for the inconvenience!

The launch issue was caused by saving custom-file while starting up Emacs. So I have the fix in:

(defun line-reminder--custom-file-saving ()
"Return t if we are saving `custom-file'."
(and (or print-escape-control-characters inhibit-read-only)
(equal (buffer-file-name) (ignore-errors (expand-file-name custom-file)))))

I reckon the solution may not be ideal. But I couldn't think of any part of the code that would make the buffer jump to the bottom. 😅 What was the last working version for you?

@XO39
Copy link
Author

XO39 commented May 23, 2022

Not exactly sure, but I think it was working fine up to this commit 1dff70a
It was the first update after Emacs-28.1-universal on 2022-04-04 (from Emacs For Mac OS X).
IIRC I've just finished updating Emacs (with brew), then updated Emacs packages (including line-reminder), after restarting Emacs things went south. I had to disable all the packages then enable them one by one to find out which was causing the issue.

@jcs090218 jcs090218 mentioned this issue May 23, 2022
@jcs090218
Copy link
Member

jcs090218 commented May 23, 2022

The diff look like this: (#13)

-(defun line-reminder--custom-file-saving ()
-  "Return t if we are saving `custom-file'."
-  (and (or print-escape-control-characters inhibit-read-only)
-       (equal (buffer-file-name) (ignore-errors (expand-file-name custom-file)))))
-
 (defun line-reminder--is-valid-situation-p (&optional beg end)
   "Return non-nil, if the conditions are matched.

 Arguments BEG and END are passed in by before/after change functions."
-  (and
-   (not (line-reminder--custom-file-saving))
-   (not buffer-read-only)
-   (not (line-reminder--contain-list-string-regexp
-         line-reminder-ignore-buffer-names (buffer-name)))
-   (not (memq this-command line-reminder-disable-commands))
-   (if (and beg end) (and (<= beg (point-max)) (<= end (point-max))) t)))
+  (and (not buffer-read-only)
+       (not (line-reminder--contain-list-string-regexp
+             line-reminder-ignore-buffer-names (buffer-name)))
+       (not (memq this-command line-reminder-disable-commands))
+       (if (and beg end) (and (<= beg (point-max)) (<= end (point-max))) t)))

My assumption is this bug is caused by the newer version of Emacs, and not the changes I made?

@jcs090218
Copy link
Member

I have tried to remove ~/.emacs.d/elpa/ and install everything from fresh Emacs, but still could not reproduce this issue. Does it affect when using emacs -q? Or does it only appears to conflict with auto-complete?

@XO39
Copy link
Author

XO39 commented May 26, 2022

Sorry for the late reply, I've been busy like crazy these days.

I'll try to investigate more when I have more time, maybe this weekend. I'll be back to you if I found anything useful.

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