rougier / nano-modeline

GNU Emacs / N Λ N O Modeline
GNU General Public License v3.0
175 stars 31 forks source link

nano-modeline causes odd behavior in Info-mode with emacs-28.0.60 #14

Closed plattfot closed 1 year ago

plattfot commented 2 years ago

Description

Notice some strange behavior when using nano-modeline and navigating in Info-mode. When going back or up from a section next-line would jump two lines and previous-line would go to the previous line but at the start of that line.

Expected behavior

After going back or up from a section that next-line or previous-line would behave as normal and go to the next line or previous line.

Version

Using emacs-pgtk-native-comp-28.0.60-212.69977ea from the flat channel, commit: e015e7093eb9dff16abb5ae909fee61ba77fc677 with guix

(emacs-version)
"GNU Emacs 28.0.60 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0)"

Repro

Clone a fresh copy of this repo and checkout the latest commit as of this writing.

(cd /tmp && git clone https://github.com/rougier/nano-modeline.git)
(cd /tmp/nano-modeline && git checkout 2de3884)

Create a file at /tmp/init.el with the content:

(require 'nano-modeline "/tmp/nano-modeline/nano-modeline.el")
(nano-modeline-mode 1)

Run emacs with just nano-modeline enabled

emacs -Q -l /tmp/init.el

Then M-x info, press m (Info-menu) type Emacs and hit enter to go to the Emacs manual. Press u (Info-up) to go back up and press C-n (next-line) and it will skip the manual under Emacs and go to the next. After that the behavior is normal.

Run emacs without nano-modeline

emacs -Q 

And do the same steps as above and it will go the manual under Emacs.

plattfot commented 2 years ago

Found the issue, it's in nano-modeline-info-breadcrumbs function. The fix is simply to wrap the body in a save-mark-and-excursion (you might get away with just a save-excursion), that way the forward-line in the body will not affect the cursor outside the function. I would create a PR for this but I haven't sign the fsf copyright assignment yet. It's on my to do list, but will probably take a while.

rougier commented 2 years ago

Thanks for the report and the fix! I'm waiting for your PR then.

plattfot commented 2 years ago

Sorry for the radio silence. I just sent in the final papers to fsf for the copyright assignment, it took a while due to holidays and legal at work.

When I get confirmation from fsf that they have the copyright assignment I'll open up a PR. If you haven't fixed the bug already?

rougier commented 2 years ago

If you make the PR, that would be great!

plattfot commented 2 years ago

Created PR #31. Still waiting on hearing back from fsf about the copyright assignment. I've tried contacting them twice but still no word. Not sure how long this process should take. Feel like this is taking a bit longer than normal…

But I figured I can at least create the PR for people to test out.

plattfot commented 2 years ago

Just an update on my fsf copyright assignment. I finally heard back and reason for it taking time is the disclaimer, it needs to be reviewed by lawyers. No idea how long that will take. But I'll update this issue when I hear from fsf again.

DamienCassou commented 2 years ago

I'm getting weird behavior with isearch as well. The save-excursion fixes it, thank you!

plattfot commented 1 year ago

Sorry for the radio silence. I just received an email that my copyright assignment is now finally done! They finally had some time to review the disclaimer, which raised some questions and that resulted in my employer redoing the disclaimer, removing all the modifications they did. Then it just took a few days for the process to go through.

Feel free to close this issue.