pylint
pylint copied to clipboard
emacs binding use reserved bindings
Originally reported by: BitBucket: sandrotosi, GitHub: @sandrotosi?
Hello, I'm forwarding http://www.logilab.org/ticket/62365 , https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=613646
pylint.el defines the following key bindings
C-c m l pylint C-c m n next-error C-c m p previous-error
According to http://www.gnu.org/software/emacs/elisp/html_node/Key-Binding-Conventions.html such sequences are reserved for the user.
This is annoying for emacs users who rely on these conventions.
- Bitbucket: https://bitbucket.org/logilab/pylint/issue/344
Original comment by Sylvain Thénault (BitBucket: sthenault, GitHub: @sthenault?):
Would you have an alternate key binding suggestion?
Original comment by BitBucket: sandrotosi, GitHub: @sandrotosi?:
Well no :) I'm actually not a user of pylint in emacs, so my simple suggestion would be "dont use any standard key binding and/or those in the most common workflow for python programmers in emacs (like the most common python mode or similar)"
I think this would be better handled by someone that uses emacs. Closing this for now.
i dont think that just closing this issue makes the problem go away... eventually someone knowledgeable of emacs will come across this and address it. simply closing a still valid report appears the wrong course of action
I understand your argument. I just feel that these sort of issues will lurk in our bug tracker even more, especially when no one from the committer's list is having a particular interest in the emacs integration. Closing it doesn't make the problem go away, but at least it reduces the list of issues for which we won't have a solution. Ideally, this could live outside of Pylint's main repository, it could have been an external package from the start.
i see your point, but as long as emacs support remains in the main package, these bugs deserves to stay open and visible to possible contributors. i know it's annoying and disctracting (i'm having the same problem with a project i maintain), one solution is to kill this integration, another (possibly the better) is to find a emacs-pylint user and "recruit" them as a contributor - both of those are though tho
Reporter of the original Debian bug here.
If my understanding is correct the pylint upstream package does not by default set the controversial key bindings. It only provides a function that does so if the user chooses to call it from his Emacs' init file. So, it's the Debian packaging that violates Emacs conventions by assigning 'C-c m' by default.
Still, the default key bindings set by the function pylint-add-key-bindings could be improved:
First of all, the key binding to run pylint (C-c m l) is not necessary anyway since Emacs default python mode already defines C-c C-v (python-check) that will run (e)pylint if it is installed (and if pyflakes is not). The preferred checking command can be configured through the variable python-check-command.
The other bindings, 'C-c m n' and 'C-c m p' are just alternative bindings for next-error and previous-error that already have global key bindings anyway.
Finally, pylint-insert-ignore-comment ('C-c m i') is a command that tends to be used less regularly and does not require a default key binding. It can be called from the menu or by typing 'M-x p-i-i-c'.
So, I suggest to either:
- Make
pylint-add-key-bindingsan empty function (for backwards compatibility), documenting that pylint may be called from Python mode usingC-c C-v(and setting the variablepythong-check-commandif necessary). - If the above is not possible, replacing
C-c mbyC-c C-nwhich seems unassigned in python mode and is in line with other key bindings introduced by that mode.
@grothesque Since none of the current maintainers and contributors of pylint use emacs (as far as I know) I think we would happily use your suggestions as they seem reasonable (from a non emacs-user perspective).
Would you be willing to open a PR for this?
@grothesque Since none of the current maintainers and contributors of
pylintuse emacs (as far as I know) I think we would happily use your suggestions as they seem reasonable (from a non emacs-user perspective).Would you be willing to open a PR for this?
@DanielNoord
fwiw, I second what @grothesque suggests, it seems absolutely the way to go.
Hth!
S
After https://github.com/PyCQA/pylint/commit/b2462c91917bdf06db8708fb2999843f809909ff, no more Emacs