diff options
| author | KΓ©vin Le Gouguec <kevin.legouguec@gmail.com> | 2020-09-18 15:34:12 +0200 |
|---|---|---|
| committer | KΓ©vin Le Gouguec <kevin.legouguec@gmail.com> | 2020-09-18 15:34:12 +0200 |
| commit | d15862594a31be740e325fc5a601d7d4c3231861 (patch) | |
| tree | cf47199d960272d7129e1bc0769a434a8aba923f | |
| parent | 4f27c30d9b736d7d9be80d5d74092c6d3fcb5bc1 (diff) | |
| download | dotfiles-d15862594a31be740e325fc5a601d7d4c3231861.tar.xz | |
Simplify pair notations
I find pcase patterns easier to grok than cons cells, dotted pairs,
cars and cdrs.
| -rw-r--r-- | .emacs | 40 |
1 files changed, 20 insertions, 20 deletions
@@ -51,21 +51,21 @@ "my/symbols" "UTF-8" "π°" t "Input arbitrary Unicode symbols with other arbitrary symbols.") -(mapc (lambda (item) - (quail-defrule (car item) (cdr item) "my/symbols")) - (list - ;; Punctuation - '("..." ?β¦) - ;; Math symbols - '("~~" ?β) '("~~_" ?β) '("~=" ?β
) '("~_" ?β) - '("=_" ?β‘) '("^=" ?β) '(":=" ?β) - '("-->" ?β) '("-/>" ?β) '("==>" ?β) '("=/>" ?β) - '("<--" ?β) '("</-" ?β) '("<==" ?β) '("</=" ?β) - '("<->" ?β) '("<=>" ?β) - ;; Emojis - '("\\o/" ?π) '("\\m/" ?π€) - ;; Pictograms - '("/!\\" ?β ))) +(pcase-dolist + (`(,key ,translation) + '(;; Punctuation + ("..." ?β¦) + ;; Math symbols + ("~~" ?β) ("~~_" ?β) ("~=" ?β
) ("~_" ?β) + ("=_" ?β‘) ("^=" ?β) (":=" ?β) + ("-->" ?β) ("-/>" ?β) ("==>" ?β) ("=/>" ?β) + ("<--" ?β) ("</-" ?β) ("<==" ?β) ("</=" ?β) + ("<->" ?β) ("<=>" ?β) + ;; Emojis + ("\\o/" ?π) ("\\m/" ?π€) + ;; Pictograms + ("/!\\" ?β ))) + (quail-defrule key translation "my/symbols")) (defmacro my/make-input-toggle (input-method) (let ((fsym (intern (format "my/toggle-input-%s" input-method))) @@ -131,20 +131,20 @@ (declare (indent defun)) `(defvar ,name (let ((map (define-prefix-command ',name))) - (pcase-dolist (`(,key . ,fun) ,bindings) + (pcase-dolist (`(,key ,fun) ,bindings) (define-key map key fun)) map) ,doc)) (my/define-prefix-command my/display-map "Keymap for display-related commands." - '(("t" . toggle-truncate-lines) - ("v" . visual-line-mode))) + '(("t" toggle-truncate-lines) + ("v" visual-line-mode))) (my/define-prefix-command my/input-map "Keymap for input methods shortcuts." - `(("t" . ,(my/make-input-toggle TeX)) - ("u" . ,(my/make-input-toggle my/symbols)))) + `(("t" ,(my/make-input-toggle TeX)) + ("u" ,(my/make-input-toggle my/symbols)))) ;; C-c [[:alpha:]] is reserved for users - let's make good use of it. |
