default key bindings violate conventions #137

Closed
aspiers opened this Issue Sep 20, 2013 · 5 comments

Projects

None yet

3 participants

@aspiers
Collaborator
aspiers commented Sep 20, 2013

The official emacs key binding conventions state:

Don't define C-c letter as a key in Lisp programs. Sequences consisting of C-c and a letter (either upper or lower case) are reserved for users; they are the only sequences reserved for users, so do not block them.
Changing all the Emacs major modes to respect this convention was a lot of work; abandoning this convention would make that work go to waste, and inconvenience users. Please comply with it.

and the section on Keymaps and Minor Modes reiterates this:

The key sequences bound in a minor mode should consist of C-c followed by one of .,/?`'"[]|~!#$%^&*()-_+=. (The other punctuation characters are reserved for major modes.)

but org2blog defines the following keys:

  (define-key org2blog/wp-map (kbd "C-c p") 'org2blog/wp-post-buffer-and-publish)
  (define-key org2blog/wp-map (kbd "C-c P") 'org2blog/wp-post-buffer-as-page-and-publish)
  (define-key org2blog/wp-map (kbd "C-c d") 'org2blog/wp-post-buffer)
  (define-key org2blog/wp-map (kbd "C-c D") 'org2blog/wp-post-buffer-as-page)
  (define-key org2blog/wp-map (kbd "C-c t") 'org2blog/wp-complete-category)

In my case this overrides personal keybindings of mine.

I suggest that the prefix be made customizable, and defaults to something like "C-c M-w".

@aspiers
Collaborator
aspiers commented Sep 20, 2013

I'm working on a patch for this.

@aspiers aspiers pushed a commit to aspiers/org2blog that referenced this issue Sep 20, 2013
Adam Spiers + Adam Spiers fix minor mode keymap prefix and allow customization (fixes #137) 72698b2
@aspiers aspiers pushed a commit to aspiers/org2blog that referenced this issue Sep 20, 2013
Adam Spiers + Adam Spiers fix minor mode keymap prefix and allow customization (fixes #137)
The official emacs key binding conventions state:

    Don't define C-c letter as a key in Lisp programs. Sequences
    consisting of C-c and a letter (either upper or lower case) are
    reserved for users; they are the only sequences reserved for users,
    so do not block them.

    Changing all the Emacs major modes to respect this convention was a
    lot of work; abandoning this convention would make that work go to
    waste, and inconvenience users. Please comply with it.

but org2blog defines the following keys:

  (define-key org2blog/wp-map (kbd "C-c p") 'org2blog/wp-post-buffer-and-publish)
  (define-key org2blog/wp-map (kbd "C-c P") 'org2blog/wp-post-buffer-as-page-and-publish)
  (define-key org2blog/wp-map (kbd "C-c d") 'org2blog/wp-post-buffer)
  (define-key org2blog/wp-map (kbd "C-c D") 'org2blog/wp-post-buffer-as-page)
  (define-key org2blog/wp-map (kbd "C-c t") 'org2blog/wp-complete-category)

This commit makes the prefix customizable via a new
`org2blog/wp-keymap-prefix' variable, whose default is "C-c M-p".  After
changing it, `org2blog/wp-reload-entry-mode-map' must be called before
it takes effect."
2acaea5
@aspiers aspiers pushed a commit to aspiers/org2blog that referenced this issue Sep 20, 2013
Adam Spiers + Adam Spiers fix minor mode keymap prefix and allow customization (fixes #137)
The official emacs key binding conventions state:

    Don't define C-c letter as a key in Lisp programs. Sequences
    consisting of C-c and a letter (either upper or lower case) are
    reserved for users; they are the only sequences reserved for users,
    so do not block them.

    Changing all the Emacs major modes to respect this convention was a
    lot of work; abandoning this convention would make that work go to
    waste, and inconvenience users. Please comply with it.

but org2blog defines the following keys:

  (define-key org2blog/wp-map (kbd "C-c p") 'org2blog/wp-post-buffer-and-publish)
  (define-key org2blog/wp-map (kbd "C-c P") 'org2blog/wp-post-buffer-as-page-and-publish)
  (define-key org2blog/wp-map (kbd "C-c d") 'org2blog/wp-post-buffer)
  (define-key org2blog/wp-map (kbd "C-c D") 'org2blog/wp-post-buffer-as-page)
  (define-key org2blog/wp-map (kbd "C-c t") 'org2blog/wp-complete-category)

This commit makes the prefix customizable via a new
`org2blog/wp-keymap-prefix' variable, whose default is "C-c M-p".  After
changing it, `org2blog/wp-reload-entry-mode-map' must be called before
it takes effect.
4e4dc51
@aspiers aspiers pushed a commit to aspiers/org2blog that referenced this issue Sep 20, 2013
Adam Spiers + Adam Spiers fix minor mode keymap prefix and allow customization (fixes #137)
The official emacs key binding conventions state:

    Don't define C-c letter as a key in Lisp programs. Sequences
    consisting of C-c and a letter (either upper or lower case) are
    reserved for users; they are the only sequences reserved for users,
    so do not block them.

    Changing all the Emacs major modes to respect this convention was a
    lot of work; abandoning this convention would make that work go to
    waste, and inconvenience users. Please comply with it.

but org2blog defines the following keys:

  (define-key org2blog/wp-map (kbd "C-c p") 'org2blog/wp-post-buffer-and-publish)
  (define-key org2blog/wp-map (kbd "C-c P") 'org2blog/wp-post-buffer-as-page-and-publish)
  (define-key org2blog/wp-map (kbd "C-c d") 'org2blog/wp-post-buffer)
  (define-key org2blog/wp-map (kbd "C-c D") 'org2blog/wp-post-buffer-as-page)
  (define-key org2blog/wp-map (kbd "C-c t") 'org2blog/wp-complete-category)

This commit makes the prefix customizable via a new
`org2blog/wp-keymap-prefix' variable, whose default is "C-c M-p".  After
changing it, `org2blog/wp-reload-entry-mode-map' must be called before
it takes effect.
01b321f
@aspiers aspiers pushed a commit to aspiers/org2blog that referenced this issue Sep 20, 2013
Adam Spiers fix minor mode keymap prefix and allow customization (fixes #137)
The official emacs key binding conventions state:

    Don't define C-c letter as a key in Lisp programs. Sequences
    consisting of C-c and a letter (either upper or lower case) are
    reserved for users; they are the only sequences reserved for users,
    so do not block them.

    Changing all the Emacs major modes to respect this convention was a
    lot of work; abandoning this convention would make that work go to
    waste, and inconvenience users. Please comply with it.

but org2blog defines the following keys:

  (define-key org2blog/wp-map (kbd "C-c p") 'org2blog/wp-post-buffer-and-publish)
  (define-key org2blog/wp-map (kbd "C-c P") 'org2blog/wp-post-buffer-as-page-and-publish)
  (define-key org2blog/wp-map (kbd "C-c d") 'org2blog/wp-post-buffer)
  (define-key org2blog/wp-map (kbd "C-c D") 'org2blog/wp-post-buffer-as-page)
  (define-key org2blog/wp-map (kbd "C-c t") 'org2blog/wp-complete-category)

This commit makes the prefix customizable via a new
`org2blog/wp-keymap-prefix' variable, whose default is "C-c M-p".  After
changing it, `org2blog/wp-reload-entry-mode-map' must be called before
it takes effect.
ded682f
@aspiers aspiers pushed a commit to aspiers/org2blog that referenced this issue Sep 20, 2013
Adam Spiers fix minor mode keymap prefix and allow customization (fixes #137)
The official emacs key binding conventions state:

    Don't define C-c letter as a key in Lisp programs. Sequences
    consisting of C-c and a letter (either upper or lower case) are
    reserved for users; they are the only sequences reserved for users,
    so do not block them.

    Changing all the Emacs major modes to respect this convention was a
    lot of work; abandoning this convention would make that work go to
    waste, and inconvenience users. Please comply with it.

but org2blog defines the following keys:

  (define-key org2blog/wp-map (kbd "C-c p") 'org2blog/wp-post-buffer-and-publish)
  (define-key org2blog/wp-map (kbd "C-c P") 'org2blog/wp-post-buffer-as-page-and-publish)
  (define-key org2blog/wp-map (kbd "C-c d") 'org2blog/wp-post-buffer)
  (define-key org2blog/wp-map (kbd "C-c D") 'org2blog/wp-post-buffer-as-page)
  (define-key org2blog/wp-map (kbd "C-c t") 'org2blog/wp-complete-category)

This commit makes the prefix customizable via a new
`org2blog/wp-keymap-prefix' variable, whose default is "C-c M-p".  After
changing it, `org2blog/wp-reload-entry-mode-map' must be called before
it takes effect.
fded83d
@tntdynamight

IMHO that part of the convention was rendered invalid when emacs decided to distribute with orgmode, which completely ignores this convention and has a myriad more keybindings. Yes, org-mode is a major mode, but if you are already in a major mode taking over so many C-c keybindings, why would you be bothered by 4 more in a minor mode tightly integrated with that major mode?

Also, how is customization NOT allowed? Why don't you just change it?

@aspiers
Collaborator
aspiers commented Nov 25, 2013

IMHO that part of the convention was rendered invalid when emacs decided to distribute with orgmode, which completely ignores this convention

No it doesn't. What makes you say that?

@aspiers aspiers pushed a commit to aspiers/org2blog that referenced this issue Mar 20, 2014
Adam Spiers fix minor mode keymap prefix and allow customization (fixes #137)
The official emacs key binding conventions state:

    Don't define C-c letter as a key in Lisp programs. Sequences
    consisting of C-c and a letter (either upper or lower case) are
    reserved for users; they are the only sequences reserved for users,
    so do not block them.

    Changing all the Emacs major modes to respect this convention was a
    lot of work; abandoning this convention would make that work go to
    waste, and inconvenience users. Please comply with it.

but org2blog defines the following keys:

  (define-key org2blog/wp-map (kbd "C-c p") 'org2blog/wp-post-buffer-and-publish)
  (define-key org2blog/wp-map (kbd "C-c P") 'org2blog/wp-post-buffer-as-page-and-publish)
  (define-key org2blog/wp-map (kbd "C-c d") 'org2blog/wp-post-buffer)
  (define-key org2blog/wp-map (kbd "C-c D") 'org2blog/wp-post-buffer-as-page)
  (define-key org2blog/wp-map (kbd "C-c t") 'org2blog/wp-complete-category)

This commit makes the prefix customizable via a new
`org2blog/wp-keymap-prefix' variable, whose default is "C-c M-p".  After
changing it, `org2blog/wp-reload-entry-mode-map' must be called before
it takes effect.
0124878
@aspiers aspiers pushed a commit to aspiers/org2blog that referenced this issue Mar 20, 2014
Adam Spiers fix minor mode keymap prefix and allow customization (fixes #137)
The official emacs key binding conventions state:

    Don't define C-c letter as a key in Lisp programs. Sequences
    consisting of C-c and a letter (either upper or lower case) are
    reserved for users; they are the only sequences reserved for users,
    so do not block them.

    Changing all the Emacs major modes to respect this convention was a
    lot of work; abandoning this convention would make that work go to
    waste, and inconvenience users. Please comply with it.

but org2blog defines the following keys:

  (define-key org2blog/wp-map (kbd "C-c p") 'org2blog/wp-post-buffer-and-publish)
  (define-key org2blog/wp-map (kbd "C-c P") 'org2blog/wp-post-buffer-as-page-and-publish)
  (define-key org2blog/wp-map (kbd "C-c d") 'org2blog/wp-post-buffer)
  (define-key org2blog/wp-map (kbd "C-c D") 'org2blog/wp-post-buffer-as-page)
  (define-key org2blog/wp-map (kbd "C-c t") 'org2blog/wp-complete-category)

This commit makes the prefix customizable via a new
`org2blog/wp-keymap-prefix' variable, whose default is "C-c M-p".  After
changing it, `org2blog/wp-reload-entry-mode-map' must be called before
it takes effect.
ce7b386
@punchagan
Owner

@aspiers I finally found time to look at this. Apologies! I think this should be merged. How do you think we should proceed with merging this? Merge it straight away? Tag a new version?

@aspiers
Collaborator
aspiers commented May 30, 2014

@punchagan No worries! I can't think of any reason not to merge straight away but maybe I'm missing something? Oh, well, actually the Travis build failing might be a good reason ;-) But that aside, I guess it could be considered a backwards-incompatible change, which would warrant a new version number?

@punchagan punchagan added a commit that closed this issue May 30, 2014
@punchagan Adam Spiers + fix minor mode keymap prefix and allow customization (fixes #137)
The official emacs key binding conventions state:

    Don't define C-c letter as a key in Lisp programs. Sequences
    consisting of C-c and a letter (either upper or lower case) are
    reserved for users; they are the only sequences reserved for users,
    so do not block them.

    Changing all the Emacs major modes to respect this convention was a
    lot of work; abandoning this convention would make that work go to
    waste, and inconvenience users. Please comply with it.

but org2blog defines the following keys:

  (define-key org2blog/wp-map (kbd "C-c p") 'org2blog/wp-post-buffer-and-publish)
  (define-key org2blog/wp-map (kbd "C-c P") 'org2blog/wp-post-buffer-as-page-and-publish)
  (define-key org2blog/wp-map (kbd "C-c d") 'org2blog/wp-post-buffer)
  (define-key org2blog/wp-map (kbd "C-c D") 'org2blog/wp-post-buffer-as-page)
  (define-key org2blog/wp-map (kbd "C-c t") 'org2blog/wp-complete-category)

This commit makes the prefix customizable via a new
`org2blog/wp-keymap-prefix' variable, whose default is "C-c M-p".  After
changing it, `org2blog/wp-reload-entry-mode-map' must be called before
it takes effect.
8c31af6
@punchagan punchagan closed this in 8c31af6 May 30, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment