Skip to content

gnuplot-mode doesn't respect user's electric-indent-mode settings #85

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

Open
ShimmerFairy opened this issue May 7, 2025 · 0 comments
Open

Comments

@ShimmerFairy
Copy link

ShimmerFairy commented May 7, 2025

Normally, if you have electric-indent-mode disabled, then RET (aka C-m) does nothing more than insert a newline; if you want to insert a newline and automatically indent the next line, you'd type C-j to invoke newline-and-indent. However, gnuplot-mode clobbers the existing definition of RET to behave the same as C-j, which forces this behavior on users who have explicitly chosen not to use it:

    (define-key map "\C-m"        #'newline-and-indent)

The proper thing to do is to simply not do this at all; gnuplot-mode already sets the indent-line-function variable, and that's really all that's needed for electric-indent-mode to automatically indent whenever a newline is inserted. gnuplot-mode should be leaving all electricity-related functionality in the hands of that minor mode (this includes its remapping of the } key to gnuplot-electric-insert, which also shouldn't be done).

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

1 participant