summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKΓ©vin Le Gouguec <kevin.legouguec@gmail.com>2020-09-18 15:34:12 +0200
committerKΓ©vin Le Gouguec <kevin.legouguec@gmail.com>2020-09-18 15:34:12 +0200
commitd15862594a31be740e325fc5a601d7d4c3231861 (patch)
treecf47199d960272d7129e1bc0769a434a8aba923f
parent4f27c30d9b736d7d9be80d5d74092c6d3fcb5bc1 (diff)
downloaddotfiles-d15862594a31be740e325fc5a601d7d4c3231861.tar.xz
Simplify pair notations
I find pcase patterns easier to grok than cons cells, dotted pairs, cars and cdrs.
-rw-r--r--.emacs40
1 files changed, 20 insertions, 20 deletions
diff --git a/.emacs b/.emacs
index d25d2ef..bfea698 100644
--- a/.emacs
+++ b/.emacs
@@ -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.