This commit does two things: - Renames def-advice! to defadvice!, in the spirit of naming convenience macros after the function/macro they enhance or replace. - Correct the names of advice functions to indicate visibility and intent. A public advice function like doom-set-jump-a is meant to be used elsewhere. A private one like +dired--cleanup-header-line-a shouldn't -- it likely won't work anywhere but the function(s) it was made to advise.
45 lines
1.2 KiB
EmacsLisp
45 lines
1.2 KiB
EmacsLisp
;;; input/chinese/config.el -*- lexical-binding: t; -*-
|
|
|
|
(use-package! pyim
|
|
:after-call after-find-file pre-command-hook
|
|
:config
|
|
(setq pyim-dcache-directory (concat doom-cache-dir "pyim/")
|
|
pyim-page-tooltip t
|
|
default-input-method "pyim"))
|
|
|
|
|
|
(use-package! pangu-spacing
|
|
:hook (text-mode . pangu-spacing-mode)
|
|
:config
|
|
;; Always insert `real' space in org-mode.
|
|
(setq-hook! 'org-mode-hook pangu-spacing-real-insert-separtor t))
|
|
|
|
|
|
(use-package! fcitx
|
|
:after evil
|
|
:config
|
|
(when (executable-find "fcitx-remote")
|
|
(fcitx-evil-turn-on)))
|
|
|
|
|
|
(use-package! ace-pinyin
|
|
:after avy
|
|
:init (setq ace-pinyin-use-avy t)
|
|
:config (ace-pinyin-global-mode t))
|
|
|
|
|
|
;;
|
|
;;; Hacks
|
|
|
|
(defadvice! +chinese--org-html-paragraph-a (paragraph contents info)
|
|
"Join consecutive Chinese lines into a single long line without unwanted space
|
|
when exporting org-mode to html."
|
|
:filter-args #'org-html-paragraph
|
|
(let* ((fix-regexp "[[:multibyte:]]")
|
|
(origin-contents contents)
|
|
(fixed-contents
|
|
(replace-regexp-in-string
|
|
(concat "\\(" fix-regexp "\\) *\n *\\(" fix-regexp "\\)")
|
|
"\\1\\2"
|
|
origin-contents)))
|
|
(list paragraph fixed-contents info)))
|