[Emacs] Better keybind generation with noweb

This commit is contained in:
Lucien Cartier-Tilet 2021-07-30 18:03:30 +02:00
parent 848162b3c7
commit f04293d664
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA

View File

@ -70,7 +70,7 @@ doing this:
I dont understand why some people add two spaces behind a full stop, I dont understand why some people add two spaces behind a full stop,
I sure dont. Lets tell Emacs. I sure dont. Lets tell Emacs.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq sentence-end-double-space nil) (setq-default sentence-end-double-space nil)
#+end_src #+end_src
There is a minor mode in Emacs which allows to have a finer way of There is a minor mode in Emacs which allows to have a finer way of
@ -698,15 +698,19 @@ prefix them with a comma (Ive taken this habit from Spacemacs).
#+header: :tangle no :exports none :results value :cache yes #+header: :tangle no :exports none :results value :cache yes
#+begin_src emacs-lisp :var table=mu4e-keybindings-view-tbl #+begin_src emacs-lisp :var table=mu4e-keybindings-view-tbl
(mapconcat (lambda (line) (mapconcat (lambda (line)
(let ((key (car line)) (let* ((key (car line))
(function (cadr line)) (function (cadr line))
(function (if (or (string= "nil" function)
(string= "" function))
":ignore"
function))
(comment (caddr line))) (comment (caddr line)))
(format "\"%s\" %s" key (format "\"%s\" %s" key
(if (string= "" comment) (if (string= "" comment)
(if (string= "nil" function) (if (string= "nil" function)
"nil" "nil"
(concat "#'" function)) (concat "#'" function))
(format "'(%s :wk \"%s\")" (format "'(%s :which-key \"%s\")"
function function
(if (string= "" function) (if (string= "" function)
"nil" "nil"
@ -715,26 +719,26 @@ prefix them with a comma (Ive taken this habit from Spacemacs).
"\n") "\n")
#+end_src #+end_src
#+RESULTS[daed5b240a2fd64608b66fc9bf38bb73f1d90db2]: general-keybindings-gen #+RESULTS[fa2948b693499edc6458f60c46357955b8ace1fb]: general-keybindings-gen
#+begin_example #+begin_example
"&" #'mu4e-view-pipe "&" #'mu4e-view-pipe
"." '(mu4e-headers-split-adjust-width/body :wk "mu4e-headers width") "." '(mu4e-headers-split-adjust-width/body :which-key "mu4e-headers width")
"a" '(nil :wk "attachments") "a" '(:ignore :which-key "attachments")
"a&" #'mu4e-view-pipe-attachment "a&" #'mu4e-view-pipe-attachment
"aa" #'mu4e-view-attachment-action "aa" #'mu4e-view-attachment-action
"ao" #'mu4e-view-open-attachment "ao" #'mu4e-view-open-attachment
"aO" #'mu4e-view-open-attachment-with "aO" #'mu4e-view-open-attachment-with
"c" '(nil :wk "compose") "c" '(:ignore :which-key "compose")
"cc" #'mu4e-compose-new "cc" #'mu4e-compose-new
"ce" #'mu4e-compose-edit "ce" #'mu4e-compose-edit
"cf" #'mu4e-compose-forward "cf" #'mu4e-compose-forward
"cr" #'mu4e-compose-reply "cr" #'mu4e-compose-reply
"cR" #'mu4e-compose-resend "cR" #'mu4e-compose-resend
"g" '(nil :wk "go to") "g" '(:ignore :which-key "go to")
"gu" #'mu4e-view-go-to-url "gu" #'mu4e-view-go-to-url
"gX" #'mu4e-view-fetch-url "gX" #'mu4e-view-fetch-url
"l" #'mu4e-show-log "l" #'mu4e-show-log
"m" '(nil :wk "mark") "m" '(:ignore :which-key "mark")
"md" #'mu4e-view-mark-for-trash "md" #'mu4e-view-mark-for-trash
"mD" #'mu4e-view-mark-for-delete "mD" #'mu4e-view-mark-for-delete
"mm" #'mu4e-view-mark-for-move "mm" #'mu4e-view-mark-for-move
@ -742,8 +746,8 @@ prefix them with a comma (Ive taken this habit from Spacemacs).
"mR" #'mu4e-view-mark-for-read "mR" #'mu4e-view-mark-for-read
"mu" #'mu4e-view-mark-for-unread "mu" #'mu4e-view-mark-for-unread
"mU" #'mu4e-view-mark-for-unmark "mU" #'mu4e-view-mark-for-unmark
"t" '(nil :wk "thread") "t" '(:ignore :which-key "thread")
"T" '(nil :wk "toggle") "T" '(:ignore :which-key "toggle")
"Tc" #'mu4e-view-toggle-hide-cited "Tc" #'mu4e-view-toggle-hide-cited
"Th" #'mu4e-view-toggle-html "Th" #'mu4e-view-toggle-html
"n" #'mu4e-view-headers-next "n" #'mu4e-view-headers-next