pylint icon indicating copy to clipboard operation
pylint copied to clipboard

emacs binding use reserved bindings

Open pylint-bot opened this issue 11 years ago • 9 comments

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

pylint-bot avatar Sep 19 '14 23:09 pylint-bot

Original comment by Sylvain Thénault (BitBucket: sthenault, GitHub: @sthenault?):


Would you have an alternate key binding suggestion?

pylint-bot avatar Sep 22 '14 07:09 pylint-bot

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)"

pylint-bot avatar Nov 03 '14 10:11 pylint-bot

I think this would be better handled by someone that uses emacs. Closing this for now.

PCManticore avatar Jan 21 '17 17:01 PCManticore

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

sandrotosi avatar Jan 21 '17 18:01 sandrotosi

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.

PCManticore avatar Jan 22 '17 09:01 PCManticore

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

sandrotosi avatar Jan 22 '17 14:01 sandrotosi

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-bindings an empty function (for backwards compatibility), documenting that pylint may be called from Python mode using C-c C-v (and setting the variable pythong-check-command if necessary).
  • If the above is not possible, replacing C-c m by C-c C-n which seems unassigned in python mode and is in line with other key bindings introduced by that mode.

grothesque avatar Oct 05 '21 13:10 grothesque

@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?

DanielNoord avatar Dec 18 '21 21:12 DanielNoord

@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?

@DanielNoord

fwiw, I second what @grothesque suggests, it seems absolutely the way to go.

Hth!

S

absurd34 avatar Jun 14 '22 08:06 absurd34

After https://github.com/PyCQA/pylint/commit/b2462c91917bdf06db8708fb2999843f809909ff, no more Emacs

nickdrozd avatar Nov 22 '22 03:11 nickdrozd