emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Clarifying the C-c letter guideline


From: Jean Louis
Subject: Re: Clarifying the C-c letter guideline
Date: Sun, 14 Feb 2021 20:38:34 +0300
User-agent: Mutt/2.0 (3d08634) (2020-11-07)

* Philip Kaludercic <philipk@posteo.net> [2021-02-14 15:14]:
> 
> Hi,
> 
> a few days ago, there was a discussion on help-gnu-emacs[0],
> specifically on this one paragraph from (elisp) Key Binding Conventions:
> 
> > • 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.
> 
> There seems to be some uncertainty in how this should be
> interpreted. Does this mean that...
> 
> - No package/library/third-party code may ever bind a command or map to
>   C-c LETTER, under any circumstances (in the letter of the law).

Convention is not a law, rather normative example. There are third
party packages that are not public, or not free software, you may bind
such as you wish and do what you wish at your home or office, it is
free software, you can bind keys as you really wish and want.

As a normative example C-c LETTER keys shall be reserved for users, so
third party packages should not bind globally and automatically those.

> - A package/library/third-party code may bind a command or a map to C-c
>   LETTER, if the user is explicitly asked and he or she gives
>   permission (in the spirit of the law).

It is understandable that you can make programs to do whatever you
wish and program may ask user to decide on which key to bind some
function. It is not breaking any law. I just don't believe that
package that globally sets key on C-c LETTER would be accepted in
GNU ELPA or Non-GNU ELPA repository.

But I do not think that MELPA or other repository would object to it.

Short recursive grep in 2500 *.el packages from MELPA tells me that
there is almost no package binding anything on C-c LETTER.

They will rather suggest it to be bound by user or one will provide a
single function to bind all keys like it is in lorem-ipsum package
./lorem-ipsum-20190819.2042.el76:

In that sense, many packages decide to sugest to user to use C-c
LETTER for commands or prefix keys.

There is nothing wrong in suggesting it to user through interactive
function, artificial intelligence, to bind the key on some of
suggested keys or letters as that will then be decided by user and not
by programmer.

Function can also ask user to invoke manually the preferred key and to
bind it to such desired chosen key without suggesting to user series
or list of keys.

Jean


79 matches for ""C-c" in buffer: *grep*
      5:./dpaste-20160303.2113.el54:;;     (global-set-key (kbd "C-c p") 
'dpaste-region-or-buffer)
     40:./simple-call-tree-20180224.2056.el318:;; (global-set-key (kbd "C-c 
S") 'simple-call-tree-display-buffer)
     53:./project-root-20160408.1600.el56:;; (global-set-key (kbd "C-c p f") 
'project-root-find-file)
     54:./project-root-20160408.1600.el57:;; (global-set-key (kbd "C-c p g") 
'project-root-grep)
     55:./project-root-20160408.1600.el58:;; (global-set-key (kbd "C-c p a") 
'project-root-ack)
     56:./project-root-20160408.1600.el59:;; (global-set-key (kbd "C-c p d") 
'project-root-goto-root)
     57:./project-root-20160408.1600.el60:;; (global-set-key (kbd "C-c p p") 
'project-root-run-default-command)
     58:./project-root-20160408.1600.el61:;; (global-set-key (kbd "C-c p l") 
'project-root-browse-seen-projects)
     59:./project-root-20160408.1600.el63:;; (global-set-key (kbd "C-c p M-x")
     86:./scratch-ext-20140104.516.el56:;;     (global-set-key (kbd "C-c i") 
'scratch-ext-insert-newest-log)
     87:./scratch-ext-20140104.516.el57:;;     (global-set-key (kbd "C-c r") 
'scratch-ext-restore-last-scratch)
     91:./eyuml-20170413.2141.el32:;; (global-set-key (kbd "C-c a") 
'eyuml-create-activity-diagram)
     92:./eyuml-20170413.2141.el33:;; (global-set-key (kbd "C-c c") 
'eyuml-create-class-diagram)
     93:./eyuml-20170413.2141.el34:;; (global-set-key (kbd "C-c u") 
'eyuml-create-usecase-diagram)
    108:./helm-spaces-20161001.1409.el34:;; (global-set-key (kbd "C-c s") 
'helm-spaces)
    125:./jump-to-line-20130122.1653.el49:;; (global-set-key (kbd "C-c C-j") 
'jump-to-line) ; Jump
    126:./jump-to-line-20130122.1653.el50:;; (global-set-key (kbd "C-c b")   
'jtl-back)     ; Back
    135:./region-convert-20190104.1108.el40:;;;      (global-set-key (kbd "C-c 
r") 'region-convert)
    137:./org-mru-clock-20201019.824.el47:;;; (global-set-key (kbd "C-c C-x 
i") #'org-mru-clock-in)
    138:./org-mru-clock-20201019.824.el48:;;; (global-set-key (kbd "C-c C-x 
C-j") #'org-mru-clock-select-recent-task)
    139:./sqlup-mode-20190814.46.el51:;; (global-set-key (kbd "C-c u") 
'sqlup-capitalize-keywords-in-region)
    156:./ietf-docs-20190420.851.el37:;; (global-set-key (kbd "C-c i o") 
'ietf-docs-open-at-point)
    171:./helm-c-moccur-20151230.924.el492:;; e.x, (global-set-key (kbd "C-c 
f") (helm-c-moccur-define-occur-command "defun "))
    197:./hide-lines-20151127.1840.el46:;; (global-set-key (kbd "C-c /") 
'hide-lines)
    209:./org-gtd-20200825.1410.el74:;;   (global-set-key (kbd "C-c d c") 
'org-gtd-capture) ;; add item to inbox
    210:./org-gtd-20200825.1410.el75:;;   (global-set-key (kbd "C-c d p") 
'org-gtd-process-inbox) ;; process entire inbox
    211:./org-gtd-20200825.1410.el76:;;   (global-set-key (kbd "C-c d a") 
'org-agenda-list) ;; see what's on your plate today
    212:./org-gtd-20200825.1410.el77:;;   (global-set-key (kbd "C-c d n") 
'org-gtd-show-all-next) ;; see all NEXT items
    213:./org-gtd-20200825.1410.el78:;;   (global-set-key (kbd "C-c d s") 
'org-gtd-show-stuck-projects) ;; see projects that don't have a NEXT item
    221:./decide-20190201.2137.el127:;; (global-set-key (kbd "C-c r") 
'decide-roll-dice)
    223:./panda-20200917.520.el28:;;        (global-set-key (kbd "C-c b") 
'panda-map) ;; b for "Bamboo"
    225:./number-20170901.1312.el45:;; (global-set-key (kbd "C-c C-+") 
'number/add)
    226:./number-20170901.1312.el46:;; (global-set-key (kbd "C-c C--") 
'number/sub)
    227:./number-20170901.1312.el47:;; (global-set-key (kbd "C-c C-*") 
'number/multiply)
    228:./number-20170901.1312.el48:;; (global-set-key (kbd "C-c C-/") 
'number/divide)
    229:./number-20170901.1312.el49:;; (global-set-key (kbd "C-c C-0") 
'number/pad)
    230:./number-20170901.1312.el50:;; (global-set-key (kbd "C-c C-=") 
'number/eval)
    244:./string-inflection-20200927.747.el66:;;   (global-set-key (kbd "C-c 
C-u") 'string-inflection-all-cycle)
    247:./right-click-context-20190528.1832.el182:    (global-set-key (kbd 
\"C-c :\") #'right-click-context-menu)
    250:./helm-grepint-20200811.1616.el53:;;         (global-set-key (kbd "C-c 
g") #'helm-grepint-grep)
    251:./helm-grepint-20200811.1616.el54:;;         (global-set-key (kbd "C-c 
G") #'helm-grepint-grep-root)
    255:./auto-shell-command-20180817.1502.el51:;; (global-set-key (kbd "C-c 
C-m") 'ascmd:toggle) ; Temporarily on/off auto-shell-command run
    256:./auto-shell-command-20180817.1502.el52:;; (global-set-key (kbd "C-c 
C-,") 'ascmd:popup)  ; Pop up '*Auto Shell Command*'
    257:./auto-shell-command-20180817.1502.el53:;; (global-set-key (kbd "C-c 
C-.") 'ascmd:exec)   ; Exec-command specify file name
    277:./helm-bm-20160321.1331.el33:;; (global-set-key (kbd "C-c b") 'helm-bm)
    280:./helm-swoop-20200814.448.el49:;; (global-set-key (kbd "C-c M-i") 
'helm-multi-swoop)
    294:./heaven-and-hell-20190713.1830.el40:;; (global-set-key (kbd "C-c 
<f6>") 'heaven-and-hell-load-default-theme)
    309:./helm-git-grep-20170614.1411.el34:;; (global-set-key (kbd "C-c g") 
'helm-git-grep)
    311:./test-kitchen-20171129.2035.el44:;;   (global-set-key (kbd "C-c C-d") 
'test-kitchen-destroy)
    312:./test-kitchen-20171129.2035.el45:;;   (global-set-key (kbd "C-c C-t") 
'test-kitchen-test)
    313:./test-kitchen-20171129.2035.el46:;;   (global-set-key (kbd "C-c l") 
'test-kitchen-list)
    314:./test-kitchen-20171129.2035.el47:;;   (global-set-key (kbd "C-c 
C-kv") 'test-kitchen-verify)
    315:./test-kitchen-20171129.2035.el48:;;   (global-set-key (kbd "C-c 
C-kc") 'test-kitchen-converge)
    316:./quick-shell-keybind-20171023.613.el33:;;     (global-set-key (kbd 
"C-c C-t") #'quick-shell-keybind)
    360:./org-board-20200619.1016.el324:;;  (global-set-key (kbd "C-c o") 
org-board-keymap)
    364:./browse-kill-ring-20200210.921.el43:;; (global-set-key (kbd "C-c k") 
'browse-kill-ring)
    381:./lorem-ipsum-20190819.2042.el58:;; (global-set-key (kbd "C-c C-l s") 
'lorem-ipsum-insert-sentences)
    382:./lorem-ipsum-20190819.2042.el59:;; (global-set-key (kbd "C-c C-l p") 
'lorem-ipsum-insert-paragraphs)
    383:./lorem-ipsum-20190819.2042.el60:;; (global-set-key (kbd "C-c C-l l") 
'lorem-ipsum-insert-list)
    384:./lorem-ipsum-20190819.2042.el76:  (global-set-key (kbd "C-c l s") 
'lorem-ipsum-insert-sentences)
    385:./lorem-ipsum-20190819.2042.el77:  (global-set-key (kbd "C-c l p") 
'lorem-ipsum-insert-paragraphs)
    386:./lorem-ipsum-20190819.2042.el78:  (global-set-key (kbd "C-c l l") 
'lorem-ipsum-insert-list))
    387:./firefox-controller-20160529.55.el136:;;   | (global-set-key (kbd 
"C-c m L")
    388:./firefox-controller-20160529.55.el196:;;   | (global-set-key (kbd 
"C-c m g")
    389:./org-journal-20201019.1813.el421:(global-set-key (kbd "C-c C-j") 
'org-journal-new-entry)
    426:./org-working-set-20200914.456.el1030:     "- As above, but edit your 
.emacs and insert a setq-clause: (setq org-working-set-id \"XXX\"), where XXX 
is the id of your node. You might want to add a keybinding too, e.g. 
(global-set-key (kbd  \"C-c w\") 'org-working-set)"
    435:./iy-go-to-char-20150927.226.el52:;;     (global-set-key (kbd "C-c f") 
'iy-go-to-char)
    436:./iy-go-to-char-20150927.226.el53:;;     (global-set-key (kbd "C-c F") 
'iy-go-to-char-backward)
    437:./iy-go-to-char-20150927.226.el54:;;     (global-set-key (kbd "C-c ;") 
'iy-go-to-or-up-to-continue)
    438:./iy-go-to-char-20150927.226.el55:;;     (global-set-key (kbd "C-c ,") 
'iy-go-to-or-up-to-continue-backward)
    439:./iy-go-to-char-20150927.226.el59:;;     (global-set-key (kbd "C-c f") 
'iy-go-up-to-char)
    440:./iy-go-to-char-20150927.226.el60:;;     (global-set-key (kbd "C-c F") 
'iy-go-up-to-char-backward)
    443:./cbm-20171116.1240.el39:;; (global-set-key (kbd "C-c o") 
#'cbm-find-org-agenda-file)
    445:./quick-preview-20191017.1920.el36:;; (global-set-key (kbd "C-c q") 
'quick-preview-at-point)
    446:./sudo-edit-20200625.142.el40:;;     (global-set-key (kbd "C-c C-r") 
'sudo-edit)
    451:./helm-backup-20180911.614.el36:;; (global-set-key (kbd "C-c b") 
'helm-backup)
    455:./sharper-20201014.335.el26:;;       (global-set-key (kbd "C-c n") 
'sharper-main-transient) ;; For "n" for "dot NET"
    459:./todotxt-20200530.2337.el50:;;  - Bind 'todotxt' to some accelerator 
like C-c t: (global-set-key (kbd "C-c t") 'todotxt)
    465:./helm-sheet-20130630.1239.el31:;; (global-set-key (kbd "C-c s") 
'helm-sheet)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]