(Emacs)~fixed :pretty use-package keyword, impl on all +pretty calls

This commit is contained in:
2021-03-12 03:21:59 +00:00
parent 79b86425f2
commit 540ece0f63

View File

@@ -652,8 +652,9 @@ packages can leverage it.
(let ((arg args) (let ((arg args)
forms) forms)
(while arg (while arg
(let ((mode (car arg)) (let* ((carg (car arg))
(rest (cdr arg))) (mode (car carg))
(rest (cdr carg)))
(add-to-list (add-to-list
'forms 'forms
`(add-hook `(add-hook
@@ -1278,18 +1279,16 @@ pretty symbols to eshell.
("\\*e?shell\\*" ("\\*e?shell\\*"
(display-buffer-at-bottom) (display-buffer-at-bottom)
(window-height . 0.25)) (window-height . 0.25))
:pretty
(eshell-mode-hook
("lambda" . "λ")
("numberp" . "")
("t" . "𝕋")
("nil" . ""))
:general :general
(leader (leader
"tt" #'+shell/toggle-eshell) "tt" #'+shell/toggle-eshell)
:init :init
(with-eval-after-load "prog-mode"
(+pretty/set-alist
eshell-mode-hook
("lambda" . "λ")
("numberp" . "")
("t" . "𝕋")
("nil" . "")))
(add-hook (add-hook
'eshell-mode-hook 'eshell-mode-hook
(proc (proc
@@ -1788,13 +1787,11 @@ vanilla =org-goto=. Also records for auto insertion.
:display :display
("\\*Org Src.*" ("\\*Org Src.*"
(display-buffer-same-window)) (display-buffer-same-window))
:pretty
(org-mode-hook
("#+begin_src" . "")
("#+end_src" . ""))
:init :init
(with-eval-after-load "prog-mode"
(+pretty/set-alist
org-mode-hook
("#+begin_src" . "")
("#+end_src" . "")))
(with-eval-after-load "autoinsert" (with-eval-after-load "autoinsert"
(define-auto-insert '("\\.org\\'" . "Org skeleton") (define-auto-insert '("\\.org\\'" . "Org skeleton")
'("Enter title: " '("Enter title: "
@@ -1935,52 +1932,49 @@ opposing style.
:hook :hook
(c-mode-hook . auto-fill-mode) (c-mode-hook . auto-fill-mode)
(c++-mode-hook . auto-fill-mode) (c++-mode-hook . auto-fill-mode)
:pretty
(c-mode-hook
("puts" . "")
("fputs" . "ϕ")
("printf" . "ω")
("fprintf" . "Ω")
("->" . "")
("NULL" . "")
("true" . "")
("false" . "")
("char" . "")
("int" . "")
("float" . "")
("!" . "¬")
("&&" . "")
("||" . "")
("for" . "")
("return" . ""))
(c++-mode-hook
("nullptr" . "")
("string" . "𝕊")
("string" . "𝕊")
("vector" . "")
("puts" . "")
("fputs" . "ϕ")
("printf" . "ω")
("fprintf" . "Ω")
("->" . "")
("NULL" . "")
("true" . "")
("false" . "")
("char" . "")
("int" . "")
("float" . "")
("!" . "¬")
("&&" . "")
("||" . "")
("for" . "")
("return" . ""))
:init :init
(setq-default c-basic-offset 2) (setq-default c-basic-offset 2)
(setq c-default-style '((other . "user"))) (setq-default c-default-style '((other . "user")))
(with-eval-after-load "prog-mode"
(+pretty/set-alist
c-mode-hook
("puts" . "")
("fputs" . "ϕ")
("printf" . "ω")
("fprintf" . "Ω")
("->" . "")
("NULL" . "")
("true" . "")
("false" . "")
("char" . "")
("int" . "")
("float" . "")
("!" . "¬")
("&&" . "")
("||" . "")
("for" . "")
("return" . ""))
(+pretty/set-alist
c++-mode-hook
("nullptr" . "")
("string" . "𝕊")
("string" . "𝕊")
("vector" . "")
("puts" . "")
("fputs" . "ϕ")
("printf" . "ω")
("fprintf" . "Ω")
("->" . "")
("NULL" . "")
("true" . "")
("false" . "")
("char" . "")
("int" . "")
("float" . "")
("!" . "¬")
("&&" . "")
("||" . "")
("for" . "")
("return" . "")))
(with-eval-after-load "autoinsert" (with-eval-after-load "autoinsert"
(define-auto-insert (define-auto-insert
'("\\.c\\'" . "C skeleton") '("\\.c\\'" . "C skeleton")
@@ -2054,6 +2048,21 @@ Clang format for when:
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package ob-java (use-package ob-java
:straight nil :straight nil
:pretty
(java-mode-hook
("println" . "")
("printf" . "ω")
("null" . "")
("true" . "")
("false" . "")
("char" . "")
("int" . "")
("float" . "")
("!" . "¬")
("&&" . "")
("||" . "")
("for" . "")
("return" . ""))
:config :config
(with-eval-after-load "cc-mode" (with-eval-after-load "cc-mode"
(c-add-style (c-add-style
@@ -2088,23 +2097,7 @@ Clang format for when:
"Name of item: " "Name of item: "
str | "name" " {\n" str | "name" " {\n"
> _ "\n" > _ "\n"
"}\n")) "}\n")))
(+pretty/set-alist
java-mode-hook
("println" . "")
("printf" . "ω")
("null" . "")
("true" . "")
("false" . "")
("char" . "")
("int" . "")
("float" . "")
("!" . "¬")
("&&" . "")
("||" . "")
("for" . "")
("return" . "")))
#+end_src #+end_src
** Haskell ** Haskell
Haskell is a static lazy functional programming language (what a Haskell is a static lazy functional programming language (what a
@@ -2137,11 +2130,8 @@ Basic, haven't used python in this configuration yet.
(use-package python (use-package python
:defer t :defer t
:straight nil :straight nil
:init :pretty
(setq python-indent-offset 4) (python-mode-hook
:config
(+pretty/set-alist
python-mode-hook
("None" . "") ("None" . "")
("list" . "") ("list" . "")
("List" . "") ("List" . "")
@@ -2157,7 +2147,9 @@ Basic, haven't used python in this configuration yet.
("print" . "") ("print" . "")
("lambda" . "λ") ("lambda" . "λ")
("return" . "") ("return" . "")
("yield" . ""))) ("yield" . ""))
:init
(setq python-indent-offset 4))
#+end_src #+end_src
*** Python shell *** Python shell
Setup for python shell, including a toggle option Setup for python shell, including a toggle option
@@ -2213,20 +2205,18 @@ appropriately.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package lisp-mode (use-package lisp-mode
:straight nil :straight nil
:init :pretty
(with-eval-after-load "prog-mode" (emacs-lisp-mode-hook
(+pretty/set-alist ("lambda" . "λ")
emacs-lisp-mode-hook ("numberp" . "")
("lambda" . "λ") ("t" . "𝕋")
("numberp" . "") ("nil" . "")
("t" . "𝕋") ("and" . "")
("nil" . "") ("or" . "")
("and" . "") ("defun" . "ƒ")
("or" . "") ("for" . "")
("defun" . "ƒ") ("mapc" . "")
("for" . "") ("mapcar" . ""))
("mapc" . "")
("mapcar" . "")))
:config :config
(defun +modded/lisp-indent-function (indent-point state) (defun +modded/lisp-indent-function (indent-point state)
(let ((normal-indent (current-column)) (let ((normal-indent (current-column))