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