line-reminder
line-reminder copied to clipboard
Jumps to the bottom of the buffer when used with emacs-lsp autocomplete
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.
Sorry for the inconvenience!
The launch issue was caused by saving custom-file while starting up Emacs. So I have the fix in:
https://github.com/emacs-vs/line-reminder/blob/c0cebef629a98556f5696f78436f4d8428ce8135/line-reminder.el#L417-L420
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?
Not exactly sure, but I think it was working fine up to this commit 1dff70a13a8057d580dac1ac199e8abbaa1b1a58
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.
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?
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?
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.