diff --git a/docs/index.html b/docs/index.html index 8132762..f5e7405 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,7 +1,7 @@ - + Nasy Emacs 配置 @@ -51,419 +51,428 @@

Nasy Emacs 配置

Table of Contents

+
+zenodo.7790390.svg +
-

新配置文件尙在加工中

-
+

1. 新配置文件尙在加工中

+

此處留些許文字以方便諸君使用

-
-

安裝 Install

-
+

2. 安裝 Install

+

克隆到 .emacs.d

@@ -474,20 +483,18 @@

安裝 Install

-
-

生成 el 文件 Generate el files

-
+

2.1. 生成 el 文件 Generate el files

+
make generate -j
 
-
-

生成 elc 與 eln 文件 Generate elc & eln files (可選 optional)

-
+

2.2. 生成 elc 與 eln 文件 Generate elc & eln files (可選 optional)

+
make config -j
 
@@ -495,28 +502,25 @@

-
-

更新 Update

-
+

3. 更新 Update

+

簡而言之兩步

-
-

更新倉庫 Update repo

-
+

3.1. 更新倉庫 Update repo

+
make update
 
-
-

更新 Update straight (可選 optional)

-
+

3.2. 更新 Update straight (可選 optional)

+

同時更新 elc 與 eln

@@ -528,10 +532,9 @@

更新 Update straight (可選

-
-

自定義

-
+

4. 自定義

+

自定義文件全位于~芄蘭~有~芄蘭.el~與~custom.el~

@@ -541,57 +544,55 @@

自定義

-
-

頟外

-
+

5. 頟外

+
-

Python isort

-
+

5.1. Python isort

+
;;; python-isort.el --- Utility to sort Python imports -*- lexical-binding: t; -*-
 
-(require 'reformatter)
+(require 'reformatter)
 
-(defcustom python-isort-command "isort"
+(defcustom python-isort-command "isort"
   "Name of the `isort` executable."
-  :group 'nasy
-  :type 'string)
+  :group 'nasy
+  :type 'string)
 
-(defvar python-isort--base-args '("--quiet" "--atomic")
+(defvar python-isort--base-args '("--quiet" "--atomic")
   "Base arguments to pass to isort.")
 
-(defcustom python-isort-extra-args nil
+(defcustom python-isort-extra-args nil
   "Extra arguments to pass to isort."
-  :group 'nasy
-  :type '(repeat string))
+  :group 'nasy
+  :type '(repeat string))
 
 ;;;###autoload (autoload 'python-isort-buffer "python-isort" nil t)
 ;;;###autoload (autoload 'python-isort-region "python-isort" nil t)
 ;;;###autoload (autoload 'python-isort-on-save-mode "python-isort" nil t)
-(reformatter-define python-isort
+(reformatter-define python-isort
   :program python-isort-command
   :args (python-isort--make-args beg end)
   :lighter " isort"
-  :group 'python-isort)
+  :group 'python-isort)
 
-(defun python-isort--make-args (beg end)
+(defun python-isort--make-args (beg end)
   "Helper to build the argument list for isort for span BEG to END."
   (append python-isort--base-args
           python-isort-extra-args
-          '("-")))
+          '("-")))
 
-(provide 'python-isort)
+(provide 'python-isort)
 ;;; python-isort.el ends here
 
-
-

外皃 Theme

-
+

5.2. 外皃 Theme

+

外皃

@@ -600,10 +601,9 @@

外皃 Theme

Nasy's Emacs Theme

-
-

Colors

-
+

5.2.1. Colors

+
;;; 彩.el --- Nasy's Emacs theme colors.  -*- lexical-binding: t; -*-
 
@@ -612,183 +612,183 @@ 

Colors

;;; Code: ;;; 正色 -(defconst n-青 "#00ffff") -(defconst n-赤 "#c3272b") -(defconst n-白 "#ffffff") ;; 精白 -(defconst n-黑 "#000000") -(defconst n-黄 "#fff143") ;; 不知其法而用鵝黃 +(defconst n-青 "#00ffff") +(defconst n-赤 "#c3272b") +(defconst n-白 "#ffffff") ;; 精白 +(defconst n-黑 "#000000") +(defconst n-黄 "#fff143") ;; 不知其法而用鵝黃 ;;; 間色 -(defconst n-紺青 "#3f4470") -(defconst n-鴉青 "#424c50") -(defconst n-靛藍 "#065279") -(defconst n-羣青 "#2e59a7") -(defconst n-深竹月 "#2e62cd") -(defconst n-寶藍 "#4b5cc4") -(defconst n-青冥 "#3271ae") -(defconst n-靛青 "#177CB0") -(defconst n-湖藍 "#30DFF3") -(defconst n--青 "#00ffff") - -(defconst n-松绿 "#057748") -(defconst n-官緑 "#2a6e3f") -(defconst n-青青 "#4f6f46") -(defconst n-蒼翠 "#519a73") -(defconst n-菉竹 "#698e6a") -(defconst n-竹靑 "#789262") -(defconst n-春辰 "#a9be7b") -(defconst n-松花 "#bce672") -(defconst n-歐碧 "#c0d695") -(defconst n-龍泉靑瓷 "#c8e6c6") -(defconst n-水緑 "#d4f2e7") -(defconst n-水黄 "#ddeec4") -(defconst n-春緑 "#e3efd1") -(defconst n-蔥青 "#edfebb") - -(defconst n-絳 "#510312") -(defconst n-胭脂 "#960018") -(defconst n-綪 "#b13546") -(defconst n-品红 "#F00056") -(defconst n-朱 "#ff0000") -(defconst n-火红 "#FF2D51") -(defconst n-丹 "#ff4c00") -(defconst n-妃 "#ed5736") -(defconst n-海棠 "#DB5A6B") -(defconst n-桃红 "#f47983") -(defconst n-鳳仙粉 "#FF9393") -(defconst n-粉红 "#ffb3a7") -(defconst n-露玫瑰 "#ffe4e1") - - -(defconst n-墨 "#50616D") -(defconst n-蒼青 "#7397ab") -(defconst n-墨灰 "#758A99") - -(defconst n-养生主 "#b49b7f") - -(defconst n-茶 "#B35C44") -(defconst n-鱼肚 "#FCEFE8") -(defconst n-珈琲椶 "#705438") -(defconst n-紙棕 "#D2B38C") -(defconst n-向日黃 "#FFC34D") -(defconst n-缟 "#F2ECDE") -(defconst n-牙 "#EEDEB0") -(defconst n-米灰 "#D3CBAF") -(defconst n-芽灰 "#E3DBBF") -(defconst n-胡粉 "#FFFAE8") -(defconst n-蠟白 "#FEF8DE") -(defconst n-富春紡 "#FEF4B4") -(defconst n-鹅黄 "#FFF143") -(defconst n-嬭油 "#fffdd0") -(defconst n-鸭黄 "#FAFF72") -(defconst n-蛤粉 "#fdfff4") -(defconst n-荼 "#F3F9F1") -(defconst n-素 "#E0F0E9") -(defconst n-霜 "#E9F1F6") -(defconst n-漆 "#161823") -(defconst n-黛 "#4A4266") -(defconst n-丁香 "#CCA4E3") -(defconst n-青莲 "#801DAE") -(defconst n-淡紫丁香 "#e6cfe6") -(defconst n-水紅 "#f3d3e7") -(defconst n-長萅蕐 "#FF47D1") -(defconst n-紫扇貝 "#923A60") - -(provide ') +(defconst n-紺青 "#3f4470") +(defconst n-鴉青 "#424c50") +(defconst n-靛藍 "#065279") +(defconst n-羣青 "#2e59a7") +(defconst n-深竹月 "#2e62cd") +(defconst n-寶藍 "#4b5cc4") +(defconst n-青冥 "#3271ae") +(defconst n-靛青 "#177CB0") +(defconst n-湖藍 "#30DFF3") +(defconst n--青 "#00ffff") + +(defconst n-松绿 "#057748") +(defconst n-官緑 "#2a6e3f") +(defconst n-青青 "#4f6f46") +(defconst n-蒼翠 "#519a73") +(defconst n-菉竹 "#698e6a") +(defconst n-竹靑 "#789262") +(defconst n-春辰 "#a9be7b") +(defconst n-松花 "#bce672") +(defconst n-歐碧 "#c0d695") +(defconst n-龍泉靑瓷 "#c8e6c6") +(defconst n-水緑 "#d4f2e7") +(defconst n-水黄 "#ddeec4") +(defconst n-春緑 "#e3efd1") +(defconst n-蔥青 "#edfebb") +(defconst n-断肠 "#ecebc2") + +(defconst n-絳 "#510312") +(defconst n-胭脂 "#960018") +(defconst n-綪 "#b13546") +(defconst n-品红 "#F00056") +(defconst n-朱 "#ff0000") +(defconst n-火红 "#FF2D51") +(defconst n-丹 "#ff4c00") +(defconst n-妃 "#ed5736") +(defconst n-海棠 "#DB5A6B") +(defconst n-桃红 "#f47983") +(defconst n-鳳仙粉 "#FF9393") +(defconst n-粉红 "#ffb3a7") +(defconst n-露玫瑰 "#ffe4e1") + + +(defconst n-墨 "#50616D") +(defconst n-蒼青 "#7397ab") +(defconst n-墨灰 "#758A99") + +(defconst n-养生主 "#b49b7f") + +(defconst n-茶 "#B35C44") +(defconst n-鱼肚 "#FCEFE8") +(defconst n-珈琲椶 "#705438") +(defconst n-紙棕 "#D2B38C") +(defconst n-向日黃 "#FFC34D") +(defconst n-缟 "#F2ECDE") +(defconst n-牙 "#EEDEB0") +(defconst n-米灰 "#D3CBAF") +(defconst n-芽灰 "#E3DBBF") +(defconst n-胡粉 "#FFFAE8") +(defconst n-蠟白 "#FEF8DE") +(defconst n-富春紡 "#FEF4B4") +(defconst n-鹅黄 "#FFF143") +(defconst n-嬭油 "#fffdd0") +(defconst n-鸭黄 "#FAFF72") +(defconst n-蛤粉 "#fdfff4") +(defconst n-荼 "#F3F9F1") +(defconst n-素 "#E0F0E9") +(defconst n-霜 "#E9F1F6") +(defconst n-漆 "#161823") +(defconst n-黛 "#4A4266") +(defconst n-丁香 "#CCA4E3") +(defconst n-青莲 "#801DAE") +(defconst n-淡紫丁香 "#e6cfe6") +(defconst n-水紅 "#f3d3e7") +(defconst n-長萅蕐 "#FF47D1") +(defconst n-紫扇貝 "#923A60") + +(provide ') ;;; 彩.el ends here
-
-

Definition

-
+

5.2.2. Definition

+
-
(defgroup nasy-theme nil
+
(defgroup nasy-theme nil
   "Options of Nasy's theme."
-  :group 'faces)
+  :group 'faces)
 
-(defcustom nasy-theme-light/dark 'light
+(defcustom nasy-theme-light/dark 'light
   "Nasy theme uses light theme or dark theme?"
-  :group 'nasy-theme
-  :type 'symbol)
+  :group 'nasy-theme
+  :type 'symbol)
 
-(defcustom nasy-theme-org-scale t
+(defcustom nasy-theme-org-scale t
   "Nasy theme uses scale up in `org-mode' or not."
-  :group 'nasy-theme
-  :type 'boolean)
+  :group 'nasy-theme
+  :type 'boolean)
 
-(defcustom nasy-theme-underlines-list '(comment constant dash-string keyword hl-line)
+(defcustom nasy-theme-underlines-list '(comment constant dash-string hl-line)
   "Nasy theme uses underline on list.
 
  Should be one or more in `comment', `hl-line', `constant', `dash-string', `keyword'."
-  :group 'nasy-theme
-  :type '(list symbol))
+  :group 'nasy-theme
+  :type '(list symbol))
 
-(defcustom nasy-theme-fixed-pitch-font "Recursive Mono Casual Static"
+(defcustom nasy-theme-fixed-pitch-font "Recursive Mono Casual Static"
   "Nasy theme fixed pitch font."
-  :group 'nasy-theme
-  :type 'string)
+  :group 'nasy-theme
+  :type 'string)
 
-(defcustom nasy-theme-variable-pitch-font "Cardo"
+(defcustom nasy-theme-variable-pitch-font "Cardo"
   "Nasy theme variable pitch font."
-  :group 'nasy-theme
-  :type 'string)
+  :group 'nasy-theme
+  :type 'string)
 
-(defcustom nasy-theme-variable-pitch-font-weight 'regular
+(defcustom nasy-theme-variable-pitch-font-weight 'regular
   "Nasy theme variable pitch font weight."
-  :group 'nasy-theme
-  :type 'symbol)
+  :group 'nasy-theme
+  :type 'symbol)
 
-(defcustom nasy-theme-fixed-pitch-font-scale 1.0
+(defcustom nasy-theme-fixed-pitch-font-scale 1.0
   "Nasy theme fixed pitch font scale."
-  :group 'nasy-theme
-  :type 'float)
+  :group 'nasy-theme
+  :type 'float)
 
-(defcustom nasy-theme-variable-pitch-font-scale 1.3
+(defcustom nasy-theme-variable-pitch-font-scale 1.3
   "Nasy theme variable pitch font scale."
-  :group 'nasy-theme
-  :type 'float)
+  :group 'nasy-theme
+  :type 'float)
 
-(defcustom nasy-theme-rescale-f/v-pitch-font t
+(defcustom nasy-theme-rescale-f/v-pitch-font t
   "Nasy theme rescale f/v-pitch-font or not."
-  :group 'nasy-theme
-  :type 'boolean)
+  :group 'nasy-theme
+  :type 'boolean)
 
-(defun nasy-theme--light?dark (light dark)
+(defun nasy-theme--light?dark (light dark)
   "Determine using the LIGHT or the DARK color of nasy-theme."
-  (if (eq nasy-theme-light/dark 'light)
+  (if (eq nasy-theme-light/dark 'light)
       light
     dark))
-(defalias '--l?d #'nasy-theme--light?dark)
+(defalias '--l?d #'nasy-theme--light?dark)
 
-(defun nasy-theme--scale? (scale)
+(defun nasy-theme--scale? (scale)
   "Determine using `org-mode' SCALE or not."
-  (if nasy-theme-org-scale
+  (if nasy-theme-org-scale
       scale
     1))
-(defalias '--s? #'nasy-theme--scale?)
+(defalias '--s? #'nasy-theme--scale?)
 
-(defun nasy-theme--check-underline-list (sym)
+(defun nasy-theme--check-underline-list (sym)
   "Check if SYM in `nasy-theme-underlines-list' or not."
-  (when (memq sym nasy-theme-underlines-list)
+  (when (memq sym nasy-theme-underlines-list)
     t))
-(defalias '--u? #'nasy-theme--check-underline-list)
+(defalias '--u? #'nasy-theme--check-underline-list)
 
-(defun nasy-theme--rescale-font ()
+(defun nasy-theme--rescale-font ()
   "Nasy theme rescale font."
-  (when nasy-theme-rescale-f/v-pitch-font
-    (setf (alist-get
+  (when nasy-theme-rescale-f/v-pitch-font
+    (setf (alist-get
            nasy-theme-fixed-pitch-font
            face-font-rescale-alist
-           nasy-theme-fixed-pitch-font-scale nil 'string=)
+           nasy-theme-fixed-pitch-font-scale nil 'string=)
           nasy-theme-fixed-pitch-font-scale)
-    (setf (alist-get
+    (setf (alist-get
            nasy-theme-variable-pitch-font
            face-font-rescale-alist
-           nasy-theme-variable-pitch-font-scale nil 'string=)
+           nasy-theme-variable-pitch-font-scale nil 'string=)
           nasy-theme-variable-pitch-font-scale)))
 
 (nasy-theme--rescale-font)
@@ -796,17 +796,16 @@ 

Definition

-
-

Theme

-
+

5.2.3. Theme

+
-
(deftheme nasy)
+
(deftheme nasy)
 
-(let* ((class  '((class color) (min-colors 88) (background light)))
-       (classd '((class color) (min-colors 88) (background dark)))
+(let* ((class  '((class color) (min-colors 88) (background light)))
+       (classd '((class color) (min-colors 88) (background dark)))
        (n/淺背景    "#f4daefb6e3b6")  ;; (color-lighten-name n-缟 1.45)
-       (n/深背景    "#f109ea21da05")  ;; (color-darken-name n-缟 1.45)
+       (n/深背景    "#F109ea21da05")  ;; (color-darken-name n-缟 1.45)
        (n/深深背景  "#ef20e757d52d")  ;; (color-darken-name n-缟 2.9)
        (nd/淺背景   "#1667187123a5")  ;; (color-lighten-name n-漆 1.45)
        (nd/淺淺背景 "#16b918ca2427")  ;; (color-lighten-name n-漆 2.9)
@@ -831,415 +830,417 @@ 

Theme

(n/黛缟 (--l?d n-黛 n-缟)) (n/黛霜 (--l?d n-黛 n-霜))) (custom-theme-set-faces - 'nasy + 'nasy ;;; essential styles - `(default ((,class (:foreground ,n/墨缟 :background ,n/缟漆)))) + `(default ((,class (:foreground ,n/墨缟 :background ,n/缟漆)))) ;;; Basic - `(bold ((,class (:weight bold)))) - `(button ((,class (:box (:line-width 1) :underline t :weight bold)))) - `(cursor ((,class (:background ,n/黛霜 :foreground ,n/霜黛)))) - `(error ((,class (:background ,n-鳳仙粉 :foreground ,n-紫扇貝 :weight bold)))) - `(escape-glyph ((,class (:foreground ,n-茶)))) - `(fixed-pitch + `(bold ((,class (:weight bold)))) + `(button ((,class (:box (:line-width 1) :underline t :weight bold)))) + `(cursor ((,class (:background ,n/黛霜 :foreground ,n/霜黛)))) + `(error ((,class (:background ,n-鳳仙粉 :foreground ,n-紫扇貝 :weight bold)))) + `(escape-glyph ((,class (:foreground ,n-茶)))) + `(fixed-pitch ((,class (:family ,nasy-theme-fixed-pitch-font)))) - `(fixed-pitch-serif ((t (:inherit fixed-pitch)))) - `(fringe ((,class (:background ,n/缟漆 :foreground ,n/墨缟)))) - `(header-line ((,class (:background ,n-荼 + `(fixed-pitch-serif ((t (:inherit fixed-pitch)))) + `(fringe ((,class (:background ,n/缟漆 :foreground ,n/墨缟)))) + `(header-line ((,class (:background ,n-荼 :box (:line-width 2 :style released-button) :extend t :foreground ,n/靛青湖藍)))) - `(highlight ((,class (:background ,n-米灰 + `(highlight ((,class (:background ,n-米灰 :distant-foreground ,n/霜黛)))) - `(internal-border ((,class (:background ,n/缟漆)))) - `(link ((,class (:foreground ,n-靛青 :underline t)))) - `(link-visited ((,class (:foreground ,n-青莲 :underline t)))) - `(region ((,class (:background ,n-蠟白 :distant-foreground ,n/墨缟 :extend t)))) - `(secondary-selection ((,class (:background ,n-芽灰)))) - `(success ((,class (:background ,n-鱼肚 :foreground ,n-靛青 :weight bold)))) - `(variable-pitch + `(internal-border ((,class (:background ,n/缟漆)))) + `(link ((,class (:foreground ,n-靛青 :underline t)))) + `(link-visited ((,class (:foreground ,n-青莲 :underline t)))) + `(region ((,class (:background ,n-蠟白 :distant-foreground ,n/墨缟 :extend t)))) + `(secondary-selection ((,class (:background ,n-芽灰)))) + `(success ((,class (:background ,n-鱼肚 :foreground ,n-靛青 :weight bold)))) + `(variable-pitch ((,class (:family ,nasy-theme-variable-pitch-font :weight ,nasy-theme-variable-pitch-font-weight)))) - `(warning ((,class (:background ,n-富春紡 :foreground ,n-珈琲椶 :weight bold)))) + `(warning ((,class (:background ,n-富春紡 :foreground ,n-珈琲椶 :weight bold)))) ;;; centaur-tabs - `(centaur-tabs-default + `(centaur-tabs-default ((,class (:background ,n-米灰 :foreground ,n-墨)))) - `(centaur-tabs-selected + `(centaur-tabs-selected ((,class (:background ,n-富春紡 :foreground ,n-墨)))) - `(centaur-tabs-selected-modified + `(centaur-tabs-selected-modified ((,class (:background ,n-富春紡 :foreground ,n-墨 :slant italic)))) - `(centaur-tabs-unselected + `(centaur-tabs-unselected ((,class (:background ,n-春緑 :foreground ,n-墨灰)))) - `(centaur-tabs-unselected-modified + `(centaur-tabs-unselected-modified ((,class (:background ,n-水黄 :foreground ,n-墨灰 :slant italic)))) - `(centaur-tabs-active-bar-face + `(centaur-tabs-active-bar-face ((,class (:background ,n-墨)))) ;;; company - `(company-box-scrollbar + `(company-box-scrollbar ((,class (:background ,n/黛缟 :box (:line-width 2 :style released-button) :extend t :foreground ,n/缟黛)))) - `(company-box-selection + `(company-box-selection ((,class (:inherit company-box-scrollbar)))) - `(company-echo-common + `(company-echo-common ((,class (:background ,n-茶 :foreground ,n-缟)))) - `(company-preview-common + `(company-preview-common ((,class (:background ,n-荼 :foreground ,n-墨 :slant italic :weight bold)))) - `(company-scrollbar-bg + `(company-scrollbar-bg ((,class (:background ,n-牙)))) - `(company-scrollbar-fg + `(company-scrollbar-fg ((,class (:background ,n-茶 :foreground ,n-缟)))) - `(company-tooltip + `(company-tooltip ((,class (:background ,n/霜黛 :foreground ,n/黛霜)))) - `(company-tooltip-common + `(company-tooltip-common ((,class (:background ,n-素 :foreground ,n-松绿 :weight bold)))) - `(company-tooltip-common-selection + `(company-tooltip-common-selection ((,class (:background ,n/黛缟 :foreground ,n-松花 :inherit company-tooltip-common)))) - `(company-tooltip-selection + `(company-tooltip-selection ((,class (:background ,n/黛缟 :box (:style released-button) :extend t :foreground ,n/缟黛)))) ;;; counsel & ivy - `(all-the-icons-ivy-rich-icon-face + `(all-the-icons-ivy-rich-icon-face ((t (:box (:line-width 2 :style released-button) :inherit default)))) - `(ivy-current-match + `(ivy-current-match ((,class (:background ,n/黛缟 :extend t :foreground ,n/缟墨 :weight bold)))) - `(ivy-highlight-face + `(ivy-highlight-face ((,class (:inherit counsel-active-mode)))) - `(ivy-minibuffer-match-face-1 + `(ivy-minibuffer-match-face-1 ((,class (:background ,n-松花 :foreground ,n-墨 :weight bold)))) - `(ivy-minibuffer-match-face-2 + `(ivy-minibuffer-match-face-2 ((,class (:background ,n-鹅黄 :foreground ,n-墨 :weight bold)))) - `(ivy-minibuffer-match-face-3 + `(ivy-minibuffer-match-face-3 ((,class (:background ,n-丁香 :foreground ,n-墨 :weight bold)))) - `(ivy-minibuffer-match-face-4 + `(ivy-minibuffer-match-face-4 ((,class (:background ,n-火红 :foreground ,n-墨 :weight bold)))) ;;; customize faces - `(custom-button + `(custom-button ((,class (:box (:line-width 2 :style released-button) :foreground ,n/霜黛 :background ,n/黛霜)))) - `(custom-button-mouse + `(custom-button-mouse ((,class (:box (:line-width 2 :style released-button) :background ,n/霜黛 :foreground ,n/黛霜)))) - `(custom-button-pressed + `(custom-button-pressed ((,class (:box (:line-width 2 :style pressed-button) :inherit custom-button)))) - `(custom-button-pressed-unraised + `(custom-button-pressed-unraised ((,class (:foreground ,n-青莲 :inherit custom-button-unraised)))) - `(custom-button-unraised + `(custom-button-unraised ((,class (:underline t)))) - `(custom-comment + `(custom-comment ((,class (:background ,n/霜黛 :foreground ,n/黛霜)))) - `(custom-group-tag + `(custom-group-tag ((,class (:foreground ,n-靛青 :height 1.4 :slant normal :weight bold :inherit variable-pitch)))) - `(custom-group-subtitle + `(custom-group-subtitle ((,class (:foreground ,n/墨缟 :height 1.2 :underline t :weight bold)))) - `(custom-variable-obsolete + `(custom-variable-obsolete ((,class (:foreground ,n/黛霜 :strike-through t)))) - `(custom-variable-tag + `(custom-variable-tag ((,class (:foreground ,n-靛青 :slant normal :weight bold)))) ;;; dashboard - `(dashboard-heading - ((,class (:inherit font-lock-string-face :underline ,(--u? 'dash-string))))) - `(widget-button + `(dashboard-heading + ((,class (:inherit font-lock-string-face :underline ,(--u? 'dash-string))))) + `(widget-button ((,class (:weight unspecified)))) ;;; display-fill-column-indicator-mode - `(fill-column-indicator ((,class (:background ,n-湖藍 :foreground ,n-靛青)))) + `(fill-column-indicator ((,class (:background ,n-湖藍 :foreground ,n-靛青)))) ;;; flycheck - `(flycheck-warning ((,class (:background ,n-牙 + `(flycheck-warning ((,class (:background ,n-牙 :underline (:style wave :color ,n-丁香))))) ;;; font-lock faces - `(font-lock-bracket-face + `(font-lock-bracket-face ((,class (:foreground ,n-茶)))) - `(font-lock-builtin-face + `(font-lock-builtin-face ((,class (:foreground ,n-黛 :weight bold)))) - `(font-lock-comment-delimiter-face + `(font-lock-comment-delimiter-face ((,class (:foreground ,n-墨 :weight bold - :underline ,(--u? 'comment))))) - `(font-lock-comment-face + :underline ,(--u? 'comment))))) + `(font-lock-comment-face ((,class (:foreground ,n-墨 :weight light :slant italic - :underline ,(--u? 'comment))))) - `(font-lock-constant-face + :underline ,(--u? 'comment))))) + `(font-lock-constant-face ((,class (:foreground ,n-黛 - :underline ,(--u? 'constant) + :underline ,(--u? 'constant) :weight bold)))) - `(font-lock-delimiter-face + `(font-lock-delimiter-face ((,class (:foreground ,n-蒼翠 :background ,n/深深背景)))) - `(font-lock-doc-face + `(font-lock-doc-face ((,class (:background ,n-春緑 :foreground ,n-墨 :weight light :extend t)))) - `(font-lock-doc-markup-face + `(font-lock-doc-markup-face ((,class (:inherit font-lock-constant-face)))) - `(font-lock-escape-face + `(font-lock-escape-face ((,class (:foreground ,n-丁香)))) - `(font-lock-function-name-face + `(font-lock-function-name-face ((,class (:background ,n/深背景 :foreground ,n-墨 :weight bold)))) - `(font-lock-keyword-face + `(font-lock-keyword-face ((,class (:foreground ,n-黛 :weight bold - :underline ,(--u? 'keyword))) + :underline ,(--u? 'keyword) + :background ,n-断肠)) (,classd (:foreground ,n-缟 :weight bold - :underline ,(--u? 'keyword))))) - `(font-lock-misc-punctuation-face + :underline ,(--u? 'keyword))))) + `(font-lock-misc-punctuation-face ((,class (:inherit font-lock-punctuation-face)))) - `(font-lock-negation-char-face + `(font-lock-negation-char-face ((,class (:foreground ,n-珈琲椶)))) - `(font-lock-number-face + `(font-lock-number-face ((,class (:foreground ,n-深竹月)))) - `(font-lock-operator-face - ((,class (:foreground ,n-羣青)))) - `(font-lock-preprocessor-face + `(font-lock-operator-face + ((,class (:foreground ,n-羣青 + :background ,n-露玫瑰)))) + `(font-lock-preprocessor-face ((,class (:foreground ,n-紙棕 :slant italic)))) - `(font-lock-property-face + `(font-lock-property-face ((,class (:foreground ,n-靛藍 :slant italic)))) - `(font-lock-punctuation-face - ((,class (:foreground ,n-蔥青)))) - `(font-lock-regexp-grouping-backslash + `(font-lock-punctuation-face + ((,class (:foreground ,n-春辰)))) + `(font-lock-regexp-grouping-backslash ((,class (:background ,n-淡紫丁香)))) - `(font-lock-regexp-grouping-construct + `(font-lock-regexp-grouping-construct ((,class (:background ,n-淡紫丁香)))) - `(font-lock-string-face + `(font-lock-string-face ((,class (:background ,n/淺背景 :foreground ,n-青青)))) - `(font-lock-type-face + `(font-lock-type-face ((,class (:background ,n/深深背景 :foreground ,n-墨 :slant italic :weight bold)))) - `(font-lock-variable-name-face + `(font-lock-variable-name-face ((,class (:foreground ,n-墨 :slant italic)))) - `(font-lock-warning-face + `(font-lock-warning-face ((,class (:background ,n-鸭黄 :foreground ,n-墨 :weight bold)))) ;;; highlight ;; highlight-indents-guide - `(highlight-indent-guides-even-face + `(highlight-indent-guides-even-face ((,class (:background ,n-水黄)))) - `(highlight-indent-guides-odd-face + `(highlight-indent-guides-odd-face ((,class (:background ,n-春緑)))) ;; hl-line - `(hl-line ((,class (:underline ,(--u? 'hl-line) + `(hl-line ((,class (:underline ,(--u? 'hl-line) ;; :background ,n-芽灰 ;; :distant-foreground ,n-墨 :extend t :weight bold)))) ;;; minibuffer - `(minibuffer-prompt ((,class (:foreground ,n-松绿 :weight bold + `(minibuffer-prompt ((,class (:foreground ,n-松绿 :weight bold :underline t)))) ;;; mode line - `(doom-modeline-battery-charging + `(doom-modeline-battery-charging ((,class (:foreground ,n-寶藍)))) - `(doom-modeline-battery-full + `(doom-modeline-battery-full ((,class (:foreground ,n-松绿)))) - `(doom-modeline-buffer-file + `(doom-modeline-buffer-file ((,class (:foreground ,n-墨 :weight light)))) - `(doom-modeline-buffer-minor-mode + `(doom-modeline-buffer-minor-mode ((,class (:inherit mode-line)))) - `(doom-modeline-buffer-modified + `(doom-modeline-buffer-modified ((,class (:foreground ,n-火红 :inherit mode-line :weight bold)))) - `(doom-modeline-buffer-major-mode + `(doom-modeline-buffer-major-mode ((,class (:foreground ,n-火红 :weight light)))) - `(doom-modeline-buffer-path + `(doom-modeline-buffer-path ((,class (:foreground ,n-墨 :weight light)))) - `(doom-modeline-debug + `(doom-modeline-debug ((,class (:foreground ,n-墨 :weight light)))) - `(doom-modeline-info + `(doom-modeline-info ((,class (:foreground ,n-靛青 :inherit mode-line :weight light)))) - `(doom-modeline-lsp-error + `(doom-modeline-lsp-error ((,class (:inherit doom-modeline-urgent)))) - `(doom-modeline-lsp-running + `(doom-modeline-lsp-running ((,class (:inherit doom-modeline-warning)))) - `(doom-modeline-lsp-warning + `(doom-modeline-lsp-warning ((,class (:inherit doom-modeline-warning)))) - `(doom-modeline-buffer-minor-mode + `(doom-modeline-buffer-minor-mode ((,class (:inherit mode-line :background nil)))) - `(doom-modeline-project-dir + `(doom-modeline-project-dir ((,class (:foreground ,n-青青 :weight bold)))) - `(doom-modeline-urgent + `(doom-modeline-urgent ((,class (:foreground ,n-品红 :inherit mode-line :weight bold)))) - `(doom-modeline-warning + `(doom-modeline-warning ((,class (:foreground ,n-松花 :inherit mode-line :weight bold)))) - `(mode-line ((,class (:background ,n-胡粉 :weight light)))) - `(mode-line-inactive ((,class (:background ,n-素 :weight light)))) + `(mode-line ((,class (:background ,n-胡粉 :weight light)))) + `(mode-line-inactive ((,class (:background ,n-素 :weight light)))) ;;; orderless - `(orderless-match-face-0 + `(orderless-match-face-0 ((,class (:background ,n-富春紡 :foreground ,n-蒼翠 :weight bold)))) - `(orderless-match-face-1 + `(orderless-match-face-1 ((,class (:background ,n-鳳仙粉 :foreground ,n-珈琲椶 :weight bold)))) - `(orderless-match-face-2 + `(orderless-match-face-2 ((,class (:background ,n-龍泉靑瓷 :foreground ,n-靛青 :weight bold)))) - `(orderless-match-face-3 + `(orderless-match-face-3 ((,class (:background ,n-紙棕 :foreground ,n-松绿 :weight bold)))) ;;; org mode - `(org-block + `(org-block ((,class (:background ,n/淺背景 :foreground ,n-墨 :extend t)) (,classd (:background ,nd/淺背景 :foreground ,n-缟 :extend t)))) - `(org-block-begin-line + `(org-block-begin-line ((,class (:background ,n-嬭油 :box (:line-width 1 :style released-button) :extend t :foreground ,n/墨缟 :weight bold :slant italic)))) - `(org-cite-key + `(org-cite-key ((,class (:foreground ,n-松绿)) (,classd (:foreground ,n-蔥青)))) - `(org-code ((,class (:background ,n-米灰 + `(org-code ((,class (:background ,n-米灰 :foreground ,n-墨 :inheit fixed-pitch)))) - `(org-document-title + `(org-document-title ((,class (:background ,n-富春紡 :extend t :foreground ,n/墨缟 :height ,(--s? 1.7) :weight bold)))) - `(org-document-info + `(org-document-info ((,class (:extend nil :foreground ,n/墨缟 :height ,(--s? 1.2) :slant italic)))) - `(org-document-info-keyword + `(org-document-info-keyword ((,class (:background ,n/素墨 :foreground ,n/墨缟 :height ,(--s? 1.2) :slant italic)))) - `(org-done + `(org-done ((,class (:box (:line-width 2 :style released-button) :foreground ,n/墨缟)))) - `(org-headline-done + `(org-headline-done ((,class (:underline (:color ,n-松花))))) - `(org-list-dt ((,class (:height ,(--s? 1.1) :weight bold)))) - `(org-meta-line + `(org-list-dt ((,class (:height ,(--s? 1.1) :weight bold)))) + `(org-meta-line ((,class (:inherit font-lock-comment-face :underline nil)))) - `(org-property-value ((,class (:foreground ,n-松绿)))) - `(org-roam-link + `(org-property-value ((,class (:foreground ,n-松绿)))) + `(org-roam-link ((,class (:inherit org-link :overline t :underline t)))) - `(org-special-keyword ((,class (:foreground ,n-深竹月)))) - `(org-superstar-header-bullet ((,class (:background ,n-富春紡)))) - `(org-superstar-item ((,class (:foreground ,n-靛青)))) - `(org-tag + `(org-special-keyword ((,class (:foreground ,n-深竹月)))) + `(org-superstar-header-bullet ((,class (:background ,n-富春紡)))) + `(org-superstar-item ((,class (:foreground ,n-靛青)))) + `(org-tag ((,class (:background ,n/牙黛 :box t :foreground ,n/墨缟 :slant normal :underline nil :weight bold)))) - `(org-verbatim ((,class (:background ,n-春緑 + `(org-verbatim ((,class (:background ,n-春緑 :foreground ,n-墨 :inheit fixed-pitch)))) ;;; Outline ;; Also the org-levels - `(outline-1 + `(outline-1 ((,class (:background ,n-霜 :extend nil :foreground ,n-靛青 :height ,(--s? 1.4) :overline t :weight bold)))) - `(outline-2 + `(outline-2 ((,class (:background ,n-露玫瑰 :extend nil :foreground ,n-紫扇貝 :height ,(--s? 1.2) :overline t :weight bold)))) - `(outline-3 + `(outline-3 ((,class (:background ,n-春緑 :extend nil :foreground ,n-松绿 :height ,(--s? 1.1) :overline t :weight bold)))) - `(outline-4 + `(outline-4 ((,class (:background ,n-淡紫丁香 :extend nil :foreground ,n/青莲丁香 :height ,(--s? 1.1) :overline t :weight bold)))) - `(outline-5 + `(outline-5 ((,class (:extend t :foreground ,n-靛青 :height ,(--s? 1.1) :slant italic :weight normal)))) - `(outline-6 + `(outline-6 ((,class (:extend t :foreground ,n-茶 :height ,(--s? 1.1) :slant italic :weight normal)))) - `(outline-7 + `(outline-7 ((,class (:extend t :foreground ,n-松绿 :height ,(--s? 1.1) :slant italic :weight normal)))) - `(outline-8 + `(outline-8 ((,class (:extend t :foreground ,n/青莲丁香 :height ,(--s? 1.1) @@ -1247,77 +1248,74 @@

Theme

:weight normal)))) ;;; page break lines - `(page-break-lines + `(page-break-lines ((,class (:inherit font-lock-comment-face :slant normal :underline nil)))) ;;; Show parens - `(show-paren-match ((,class (:background ,n-丁香)))) - `(show-paren-mismatch ((,class (:background ,n-鳳仙粉)))) + `(show-paren-match ((,class (:background ,n-丁香)))) + `(show-paren-mismatch ((,class (:background ,n-鳳仙粉)))) ;;; tab-line and tab-bar - `(tab-line ((t (:inherit mode-line)))) - `(tab-line-tab ((t (:inherit mode-line)))) - `(tab-line-tab-inactive ((t (:inherit mode-line-inactive)))) - `(tab-line-tab-face-inactive-alternating ((t (:inherit mode-line-inactive)))) - `(tab-line-tab-current ((t (:inherit mode-line :foreground ,n-富春紡)))) - `(tab-line-highlight ((t (:inherit tab-line-tab)))) + `(tab-line ((t (:inherit mode-line)))) + `(tab-line-tab ((t (:inherit mode-line)))) + `(tab-line-tab-inactive ((t (:inherit mode-line-inactive)))) + `(tab-line-tab-face-inactive-alternating ((t (:inherit mode-line-inactive)))) + `(tab-line-tab-current ((t (:inherit mode-line :foreground ,n-富春紡)))) + `(tab-line-highlight ((t (:inherit tab-line-tab)))) - `(tab-bar ((t (:inherit tab-line)))) - `(tab-bar-tab ((t (:inherit tab-line-tab)))) - `(tab-bar-tab-inactive ((t (:inherit tab-line-tab-inactive)))) + `(tab-bar ((t (:inherit tab-line)))) + `(tab-bar-tab ((t (:inherit tab-line-tab)))) + `(tab-bar-tab-inactive ((t (:inherit tab-line-tab-inactive)))) ;;; term - `(term-color-black ((,class (:background ,n-墨 :foreground ,n-墨)))) - `(term-color-blue ((,class (:background ,n-靛青 :foreground ,n-靛青)))) - `(term-color-cyan ((,class (:background ,n-湖藍 :foreground ,n-湖藍)))) - `(term-color-green ((,class (:background ,n-松绿 :foreground ,n-松绿)))) - `(term-color-magenta ((,class (:background ,n-長萅蕐 :foreground ,n-長萅蕐)))) - `(term-color-red ((,class (:background ,n-火红 :foreground ,n-火红)))) - `(term-color-white ((,class (:background ,n-缟 :foreground ,n-缟)))) - `(term-color-yellow ((,class (:background ,n-紙棕 :foreground ,n-紙棕)))) - `(vterm-color-inverse-video + `(term-color-black ((,class (:background ,n-墨 :foreground ,n-墨)))) + `(term-color-blue ((,class (:background ,n-靛青 :foreground ,n-靛青)))) + `(term-color-cyan ((,class (:background ,n-湖藍 :foreground ,n-湖藍)))) + `(term-color-green ((,class (:background ,n-松绿 :foreground ,n-松绿)))) + `(term-color-magenta ((,class (:background ,n-長萅蕐 :foreground ,n-長萅蕐)))) + `(term-color-red ((,class (:background ,n-火红 :foreground ,n-火红)))) + `(term-color-white ((,class (:background ,n-缟 :foreground ,n-缟)))) + `(term-color-yellow ((,class (:background ,n-紙棕 :foreground ,n-紙棕)))) + `(vterm-color-inverse-video ((,class (:background ,n-墨)))) ;;; vertico - `(vertico-mouse ((,class (:background ,n-紙棕 + `(vertico-mouse ((,class (:background ,n-紙棕 :inherit highlight)))) ;;; which-func - `(which-func ((,class (:foreground ,n-青青 :weight light)))))) + `(which-func ((,class (:foreground ,n-青青 :weight light)))))) ;;;###autoload -(and load-file-name - (boundp 'custom-theme-load-path) - (add-to-list 'custom-theme-load-path +(and load-file-name + (boundp 'custom-theme-load-path) + (add-to-list 'custom-theme-load-path (file-name-as-directory (file-name-directory load-file-name)))) -(provide-theme 'nasy) +(provide-theme 'nasy)
-
-

-
+

5.3.

+
- -
-

Single Function to Center Emacs Window on Screen

-
+

5.3.1. Single Function to Center Emacs Window on Screen

+
;;;###autoload
-(defun nasy/frame-recenter (&optional frame)
+(defun nasy/frame-recenter (&optional frame)
   "Center FRAME on the screen.
 FRAME can be a frame name, a terminal name, or a frame.
 If FRAME is omitted or nil, use currently selected frame."
-  (interactive)
-  (unless (eq 'maximised (frame-parameter nil 'fullscreen))
-    (let* ((frame (or (and (boundp 'frame) frame) (selected-frame)))
+  (interactive)
+  (unless (eq 'maximised (frame-parameter nil 'fullscreen))
+    (let* ((frame (or (and (boundp 'frame) frame) (selected-frame)))
            (frame-w (frame-pixel-width frame))
            (frame-h (frame-pixel-height frame))
             ;; frame-monitor-workarea returns (x y width height) for the monitor
@@ -1325,17 +1323,16 @@ 

Single Function to Cen (monitor-h (nth 3 (frame-monitor-workarea frame))) (center (list (/ (- monitor-w frame-w) 2) (/ (- monitor-h frame-h) 2)))) - (apply 'set-frame-position (flatten-list (list frame center)))))) + (apply 'set-frame-position (flatten-list (list frame center))))))

-
-

配置

-
+

6. 配置

+

國風・鄭風・蔓艸

@@ -1348,10 +1345,9 @@

配置

邂逅相遇、與子偕臧

-
-

-
+

6.1.

+

吾學埶不精所述設定必有遺屚朢恕

@@ -1365,10 +1361,9 @@

-
-

-
+

6.2.

+

譯 el 至 elc 與 eln

@@ -1381,16 +1376,16 @@

;;; Code: -(require 'comp) +(require 'comp) -(setq load-prefer-newer t +(setq load-prefer-newer t native-comp-deferred-compilation nil org-roam-v2-ack t nasy--require nil) (message "\n\n---------------- 下載與加載 ----------------\n\n") -(add-to-list 'load-path (locate-user-emacs-file "桃夭/擊鼓")) +(add-to-list 'load-path (locate-user-emacs-file "桃夭/擊鼓")) (load (locate-user-emacs-file "桃夭/擊鼓/擊鼓.el")) @@ -1400,59 +1395,58 @@

(message "\n\n---------------- Run hooks ----------------\n\n") (run-hooks - 'after-init-hook - 'emacs-startup-hook - 'nasy/config-before-hook - 'nasy/config-after-hook - 'nasy-first-key-hook - 'org-mode-hook - 'org-first-key-hook - 'prog-mode-hook - 'pre-command-hook) + 'after-init-hook + 'emacs-startup-hook + 'nasy/config-before-hook + 'nasy/config-after-hook + 'nasy-first-key-hook + 'org-mode-hook + 'org-first-key-hook + 'prog-mode-hook + 'pre-command-hook) (message "\n\n---------------- Wait straight.el ----------------\n\n") -(when (native-comp-available-p) - (while (or comp-files-queue +(when (native-comp-available-p) + (while (or comp-files-queue (> (comp-async-runnings) 0)) (sleep-for 2))) -(unless (and (boundp 'nasy-first-p) +(unless (and (boundp 'nasy-first-p) nasy-first-p) (message "\n\n---------------- Build elc in 桃夭 ----------------\n\n") (byte-recompile-directory (locate-user-emacs-file "桃夭/") 0 t) - (when (native-comp-available-p) + (when (native-comp-available-p) (message "\n\n---------------- Build eln in 桃夭 ----------------") - (dolist (folder '("擊鼓" "風雨" "緑衣" + (dolist (folder '("擊鼓" "風雨" "緑衣" "月出" "庭燎" "日月" "麐之趾" "小曐")) (message "\n\n---------------- Build eln of %s ----------------" folder) - (dolist (elf (directory-files-recursively + (dolist (elf (directory-files-recursively (locate-user-emacs-file (concat "桃夭/" folder)) "\\.el$")) (native-compile elf) - (while (or comp-files-queue + (while (or comp-files-queue (> (comp-async-runnings) 0)) (sleep-for 2)))) - (while (or comp-files-queue + (while (or comp-files-queue (> (comp-async-runnings) 0)) (sleep-for 2)))) -(provide ') +(provide ') ;;; 譯.el ends here
-
-

early-init

-
+

6.3.early-init

+
-
(unless (boundp '*nasy*)
+
(unless (boundp '*nasy*)
   (load (locate-user-emacs-file"early-init.el") nil t))
 
@@ -1469,10 +1463,10 @@

early-init

;;; Code: -(setq - ad-redefinition-action 'accept +(setq + ad-redefinition-action 'accept fast-but-imprecise-scrolling t - ffap-machine-p-known 'reject + ffap-machine-p-known 'reject gc-cons-percentage 1.0 gc-cons-threshold most-positive-fixnum idle-update-delay 1 @@ -1480,89 +1474,88 @@

early-init

inhibit-default-init t inhibit-startup-message t inhibit-startup-screen t - initial-major-mode 'fundamental-mode + initial-major-mode 'fundamental-mode load-prefer-newer t native-comp-async-jobs-number 10 package-enable-at-startup nil read-process-output-max #x10000 redisplay-skip-fontification-on-input t - native-comp-async-report-warnings-errors 'silent) + native-comp-async-report-warnings-errors 'silent) -(setq initial-scratch-message +(setq initial-scratch-message (concat ";; Happy hacking, " user-login-name " - Emacs ♥ you!\n\n")) -(let ((old-file-name-handler-alist file-name-handler-alist)) +(let ((old-file-name-handler-alist file-name-handler-alist)) - (setq-default file-name-handler-alist nil) + (setq-default file-name-handler-alist nil) - (defun nasy/restore-default () + (defun nasy/restore-default () "Restore gc setting to default." - (setq file-name-handler-alist + (setq file-name-handler-alist (delete-dups (append file-name-handler-alist old-file-name-handler-alist)) inhibit-trace nil)) - (add-hook 'emacs-startup-hook #'nasy/restore-default)) + (add-hook 'emacs-startup-hook #'nasy/restore-default)) (set-language-environment "UTF-8") -(setq selection-coding-system 'utf-8) +(setq selection-coding-system 'utf-8) -(defconst *nasy* "20221109") +(defconst *nasy* "20221109") -(defconst *is-a-mac* (eq system-type 'darwin)) +(defconst *is-a-mac* (eq system-type 'darwin)) -(defconst *nasy-custom* (concat (expand-file-name user-emacs-directory) "芄蘭/")) -(defconst *nasy-site* (concat (expand-file-name user-emacs-directory) "木瓜/")) -(defconst *nasy-dir* (concat (expand-file-name user-emacs-directory) "萚兮/")) -(defconst *nasy-etc* (concat *nasy-dir* "恆/")) -(defconst *nasy-var* (concat *nasy-dir* "時/")) +(defconst *nasy-custom* (concat (expand-file-name user-emacs-directory) "芄蘭/")) +(defconst *nasy-site* (concat (expand-file-name user-emacs-directory) "木瓜/")) +(defconst *nasy-dir* (concat (expand-file-name user-emacs-directory) "萚兮/")) +(defconst *nasy-etc* (concat *nasy-dir* "恆/")) +(defconst *nasy-var* (concat *nasy-dir* "時/")) -(when (boundp 'native-comp-eln-load-path) - (add-to-list 'native-comp-eln-load-path (concat *nasy-var* "eln/"))) +(when (boundp 'native-comp-eln-load-path) + (add-to-list 'native-comp-eln-load-path (concat *nasy-var* "eln/"))) -(when (fboundp 'startup-redirect-eln-cache) +(when (fboundp 'startup-redirect-eln-cache) (startup-redirect-eln-cache (convert-standard-filename (concat *nasy-var* "eln/")))) -(defvar *debug* (or (getenv-internal "DEBUG") init-file-debug)) -(setq inhibit-trace (not *debug*)) +(defvar *debug* (or (getenv-internal "DEBUG") init-file-debug)) +(setq inhibit-trace (not *debug*)) -(defvar native-comp-deferred-compilation-deny-list nil) +(defvar native-comp-deferred-compilation-deny-list nil) -(defvar nasy--require nil +(defvar nasy--require nil "Require all packages.") -(defvar nasy-pdump nil +(defvar nasy-pdump nil "Use pdump.") -(setq async-byte-compile-log-file (concat *nasy-var* "async-bytecomp.log") +(setq async-byte-compile-log-file (concat *nasy-var* "async-bytecomp.log") debug-on-error *debug* jka-compr-verbose *debug*) -(defvar nasy-first-key-hook nil +(defvar nasy-first-key-hook nil "The hook to run functions before press first key.") -(provide 'early-init) +(provide 'early-init) ;;; early-init.el ends here
-
-

擊鼓

-
+

6.4. 擊鼓

+
-
(add-to-list 'load-path (locate-user-emacs-file  "桃夭/擊鼓"))
-(require '擊鼓)
+
(add-to-list 'load-path (locate-user-emacs-file  "桃夭/擊鼓"))
+(require '擊鼓)
 
@@ -1589,133 +1582,129 @@

擊鼓

啓勭組件

-
-

-
+

6.4.1.

+

以 raxod502 之 straight.el 載入包以 setup.el.

-
-

整置文件   convenience

-
+

6.4.2. 整置文件   convenience

+
(with-no-warnings
   (customize-set-variable
-   'abbrev-file-name
+   'abbrev-file-name
    (concat *nasy-etc* "abbrev.el") "Customized by Nasy.")
   (customize-set-variable
-   'auto-save-list-file-prefix
+   'auto-save-list-file-prefix
    (concat *nasy-var* "auto-save/sessions/") "Customized by Nasy.")
   (customize-set-variable
-   'auto-save-file-name-transforms
-   `((".*" ,(concat *nasy-var* "auto-save/") t))
+   'auto-save-file-name-transforms
+   `((".*" ,(concat *nasy-var* "auto-save/") t))
     "Customized by Nasy.")
   (customize-set-variable
-   'bookmark-default-file
+   'bookmark-default-file
    (concat *nasy-var* "bookmarks.el") "Customized by Nasy.")
   (customize-set-variable
-   'dirvish-cache-dir
+   'dirvish-cache-dir
    (concat *nasy-var* "dirvish/") "Customized by Nasy.")
   (customize-set-variable
-   'eshell-aliases-file
+   'eshell-aliases-file
    (concat *nasy-etc* "eshell/aliases") "Customized by Nasy.")
   (customize-set-variable
-   'eshell-directory-name
+   'eshell-directory-name
    (concat *nasy-var* "eshell/") "Customized by Nasy.")
   (customize-set-variable
-   'save-place-file
+   'save-place-file
    (concat *nasy-var* "save-place.el") "Customized by Nasy.")
   (customize-set-variable
-   'svg-lib-icons-dir
+   'svg-lib-icons-dir
    (concat *nasy-var* "svg-lib/") "Customized by Nasy.")
   (customize-set-variable
-   'tramp-auto-save-directory
+   'tramp-auto-save-directory
    (concat *nasy-var* "tramp/auto-save/") "Customized by Nasy.")
   (customize-set-variable
-   'tramp-persistency-file-name
+   'tramp-persistency-file-name
    (concat *nasy-var* "tramp/persistency.el") "Customized by Nasy.")
   (customize-set-variable
-   'url-cache-directory
+   'url-cache-directory
    (concat *nasy-var* "url/cache/") "Customized by Nasy.")
   (customize-set-variable
-   'url-configuration-directory
+   'url-configuration-directory
    (concat *nasy-var* "url/configuration/") "Customized by Nasy."))
 
-
-

straight

-
+

6.4.3. straight

+
-
(setq-default straight-vc-git-default-clone-depth     1
+
(setq-default straight-vc-git-default-clone-depth     1
               straight-repository-branch              "develop"
               straight-enable-use-package-integration nil
               straight-enable-package-integration     nil
               straight-check-for-modifications        nil
               straight-fix-flycheck                   t)
 
-(defvar bootstrap-version)
-(let ((bootstrap-file
+(defvar bootstrap-version)
+(let ((bootstrap-file
        (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
       (bootstrap-version 6))
-  (unless (file-exists-p bootstrap-file)
-    (with-current-buffer
+  (unless (file-exists-p bootstrap-file)
+    (with-current-buffer
         (url-retrieve-synchronously
          "https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
-         'silent 'inhibit-cookies)
+         'silent 'inhibit-cookies)
       (goto-char (point-max))
       (eval-print-last-sexp)))
-  (load bootstrap-file nil 'nomessage))
+  (load bootstrap-file nil 'nomessage))
 
 
-(defun nasy/-s-u-p (package)
+(defun nasy/-s-u-p (package)
   "Handle special PACKAGE var."
-  (if (boundp package)
-      (when (eval package)
+  (if (boundp package)
+      (when (eval package)
         (straight-use-package (eval package)))
     (straight-use-package package)))
 
-(defun nasy/sup (&rest packages-sets)
+(defun nasy/sup (&rest packages-sets)
   "Straight use multiple PACKAGES-SETS."
-  (cl-loop for packages-set in packages-sets
+  (cl-loop for packages-set in packages-sets
            when (not (null packages-set))
            do
-           (cl-loop for package in packages-set
+           (cl-loop for package in packages-set
                     do
-                    (cond ((symbolp package)
+                    (cond ((symbolp package)
                            (nasy/-s-u-p package))
                           ((listp package)
-                           (dolist (p package)
+                           (dolist (p package)
                              (nasy/-s-u-p p)))
                           (t (error "???"))))))
 
-(defmacro sup (package &optional req)
+(defmacro sup (package &optional req)
   "Straight use PACKAGE and or require it if REQ."
-  (when (and (listp package) (or (eq '\` (car package))
-                                 (eq 'quote (car package))))
-      (setq package (eval package)))
-  (let ((pkg (if (symbolp package) package (car package)))
+  (when (and (listp package) (or (eq '\` (car package))
+                                 (eq 'quote (car package))))
+      (setq package (eval package)))
+  (let ((pkg (if (symbolp package) package (car package)))
         bs)
-    (push `(straight-use-package ',package) bs)
-    (when (eval req)
-      (if (eq (eval req) t)
-          (push `(require ',pkg) bs)
-        (push `(require ,req) bs)))
+    (push `(straight-use-package ',package) bs)
+    (when (eval req)
+      (if (eq (eval req) t)
+          (push `(require ',pkg) bs)
+        (push `(require ,req) bs)))
     (macroexp-progn (nreverse bs))))
 
-
-

Elpaca

-
+

6.4.4. Elpaca

+

https://github.com/progfolio/elpaca

@@ -1757,16 +1746,15 @@

Elpaca

-
-

-
+

6.4.5.

+
-
(defun nasy/-package-filter (name &rest _)
+
(defun nasy/-package-filter (name &rest _)
   "Ignore package NAME if *no-packages* is t."
-  (let ((sym (intern (format "*no-%s*" name))))
-    (if (and (boundp sym) sym)
-        (progn
+  (let ((sym (intern (format "*no-%s*" name))))
+    (if (and (boundp sym) sym)
+        (progn
           (message "Ignore package: %s" name)
           nil)
       t)))
@@ -1774,10 +1762,9 @@ 

-
-

Leaf

-
+

6.4.6. Leaf

+
;; (eval-and-compile
 ;;   (setq leaf-defaults '(:leaf-autoload nil :leaf-defun nil :leaf-defer t))
@@ -1788,10 +1775,9 @@ 

Leaf

-
-

use-package

-
+

6.4.7. use-package

+
;; (eval-when-compile
 ;;   (require 'use-package)
@@ -1817,10 +1803,9 @@ 

use-package

-
-

Setup EL

-
+

6.4.8. Setup EL

+

setup.el provides a macro to ease repetitive configuration patterns in Emacs. This is done by providing context sensitive local macros, that expand to regular, pure EmacsLisp.

@@ -1834,179 +1819,178 @@

Setup EL

-
(sup 'setup)
-(require 'setup)
+
(sup 'setup)
+(require 'setup)
 (setup-define :doc
-  (lambda (&rest _) nil)
+  (lambda (&rest _) nil)
   :documentation "The one line doc for the setup package.")
 (setup-define :tag
-  (lambda (&rest _) nil)
+  (lambda (&rest _) nil)
   :documentation "The one line doc for the setup package.")
 (setup-define :url
-  (lambda (&rest _) nil)
+  (lambda (&rest _) nil)
   :documentation "The one line doc for the setup package.")
 
 (setup-define :sup
-  (lambda (name) `(sup ',name))
+  (lambda (name) `(sup ',name))
   :documentation "Customize variables."
-  :debug '(sexp)
+  :debug '(sexp)
   :repeatable t)
 
 (setup-define :opt
-  (lambda (name val) `(customize-set-variable ',name ,val "Customized by Nasy."))
+  (lambda (name val) `(customize-set-variable ',name ,val "Customized by Nasy."))
   :documentation "Customize variables."
   :after-loaded t
   :repeatable t)
 
 (setup-define :opt*
-  (lambda (name val) `(customize-set-variable ',name ,val "Customized by Nasy."))
+  (lambda (name val) `(customize-set-variable ',name ,val "Customized by Nasy."))
   :documentation "Customize variables."
-  :debug '(sexp form)
+  :debug '(sexp form)
   :repeatable t)
 
 (setup-define :opts
-  (lambda (nsv)
-    (let ((names (car nsv))
+  (lambda (nsv)
+    (let ((names (car nsv))
           (val (cdr nsv))
           bs)
-      (dolist (name (if (listp names) names (list names)))
-        (push `(customize-set-variable ',name ,val "Customized by Nasy.") bs))
+      (dolist (name (if (listp names) names (list names)))
+        (push `(customize-set-variable ',name ,val "Customized by Nasy.") bs))
       (macroexp-progn (nreverse bs))))
   :documentation "Customize variables."
   :after-loaded t
   :repeatable t)
 
 (setup-define :opts*
-  (lambda (nsv)
-    (let ((names (car nsv))
+  (lambda (nsv)
+    (let ((names (car nsv))
           (val (cdr nsv))
           bs)
-      (dolist (name (if (listp names) names (list names)))
-        (push `(customize-set-variable ',name ,val "Customized by Nasy.") bs))
+      (dolist (name (if (listp names) names (list names)))
+        (push `(customize-set-variable ',name ,val "Customized by Nasy.") bs))
       (macroexp-progn (nreverse bs))))
   :documentation "Customize variables."
   :repeatable t)
 
 (setup-define :custom
-  (lambda (name val) `(customize-set-variable ',name ,val "Customized by Nasy."))
+  (lambda (name val) `(customize-set-variable ',name ,val "Customized by Nasy."))
   :documentation "Customize variables."
-  :debug '(sexp form)
+  :debug '(sexp form)
   :after-loaded t
   :repeatable t)
 
 (setup-define :customs
-  (lambda (nsv)
-    (let ((names (car nsv))
+  (lambda (nsv)
+    (let ((names (car nsv))
           (val (cdr nsv))
           bs)
-      (dolist (name (if (listp names) names (list names)))
-        (push `(customize-set-variable ',name ,val "Customized by Nasy.") bs))
+      (dolist (name (if (listp names) names (list names)))
+        (push `(customize-set-variable ',name ,val "Customized by Nasy.") bs))
       (macroexp-progn (nreverse bs))))
   :documentation "Customize variables."
   :repeatable t)
 
 (setup-define :customs*
-  (lambda (names val)
-    (let (bs)
-      (dolist (name names)
-        (push `(customize-set-variable ',name ,val "Customized by Nasy.") bs))
+  (lambda (names val)
+    (let (bs)
+      (dolist (name names)
+        (push `(customize-set-variable ',name ,val "Customized by Nasy.") bs))
       (macroexp-progn (nreverse bs))))
   :documentation "Customize variables."
   :repeatable t)
 
 (setup-define :hooks
-  (lambda (hook func)
-    `(add-hook ',hook #',func))
+  (lambda (hook func)
+    `(add-hook ',hook #',func))
   :documentation "Add pairs of hooks."
   :repeatable t)
 
 (setup-define :init
-  (lambda (&rest body) (macroexp-progn body))
+  (lambda (&rest body) (macroexp-progn body))
   :documentation "Init keywords like use-package and leaf.")
 
 (setup-define :load-after
-  (lambda (&rest features)
-    (let ((body `(require ',(setup-get 'feature))))
-      (dolist (feature (nreverse features))
-        (setq body `(with-eval-after-load ',feature ,body)))
+  (lambda (&rest features)
+    (let ((body `(require ',(setup-get 'feature))))
+      (dolist (feature (nreverse features))
+        (setq body `(with-eval-after-load ',feature ,body)))
       body))
   :documentation "Load the current feature after FEATURES.")
 
 (setup-define :load-first
-  (lambda (&rest features)
-    `(:first-key*
+  (lambda (&rest features)
+    `(:first-key*
       (:load-after ,@features))))
 
 (setup-define :after
-  (lambda (feature &rest body)
-    `(with-eval-after-load ',feature ,@body))
+  (lambda (feature &rest body)
+    `(with-eval-after-load ',feature ,@body))
   :documentation "Eval BODY after FEATURE."
   :after-loaded t
   :indent 1)
 
 (setup-define :after*
-  (lambda (feature &rest body)
-    `(with-eval-after-load ',feature ,@body))
+  (lambda (feature &rest body)
+    `(with-eval-after-load ',feature ,@body))
   :documentation "Eval BODY after FEATURE."
   :indent 1)
 
 (setup-define :quit
- #'setup-quit
+ #'setup-quit
  :documentation "Unconditionally abort the evaluation of the current body.")
 
 (setup-define :first-key
-  (lambda (name) `(add-hook 'nasy-first-key-hook #',name))
+  (lambda (name) `(add-hook 'nasy-first-key-hook #',name))
   :documentation "Add to `nasy-first-key-hook'."
   :repeatable t)
 
 (setup-define :first-key*
-  (lambda (&rest body) `(add-hook 'nasy-first-key-hook #'(lambda () (progn ,@body))))
+  (lambda (&rest body) `(add-hook 'nasy-first-key-hook #'(lambda () (progn ,@body))))
   :documentation "Add to `nasy-first-key-hook'.")
 
 (setup-define :first-org
-  (lambda (name) `(add-hook 'nasy-org-first-key-hook #',name))
+  (lambda (name) `(add-hook 'nasy-org-first-key-hook #',name))
   :documentation "Add to `nasy-first-key-hook'."
   :repeatable t)
 
 (setup-define :first-org*
-  (lambda (&rest body) `(add-hook 'nasy-org-first-key-hook #'(lambda () (progn ,@body))))
+  (lambda (&rest body) `(add-hook 'nasy-org-first-key-hook #'(lambda () (progn ,@body))))
   :documentation "Add to `nasy-first-key-hook'.")
 
 (setup-define :advice
-  (lambda (symbol where function)
-    `(advice-add ',symbol ,where ,function))
+  (lambda (symbol where function)
+    `(advice-add ',symbol ,where ,function))
   :documentation "Add a piece of advice on a function.
  See `advice-add' for more details."
   :after-loaded t
-  :debug '(sexp sexp function-form)
-  :ensure '(nil nil func)
+  :debug '(sexp sexp function-form)
+  :ensure '(nil nil func)
   :repeatable t)
 
 (setup-define :mode-hook
-  (lambda (&rest body)
-    `(add-hook ',(setup-get 'hook) #'(lambda () (progn ,@body))))
+  (lambda (&rest body)
+    `(add-hook ',(setup-get 'hook) #'(lambda () (progn ,@body))))
   :documentation "Add to the mode hook.")
 
 (setup-define :autoload
-  (lambda (func)
-    (let ((fn (if (memq (car-safe func) '(quote function))
+  (lambda (func)
+    (let ((fn (if (memq (car-safe func) '(quote function))
                   (cadr func)
                 func)))
-      `(unless (fboundp (quote ,fn))
-         (autoload (function ,fn) ,(symbol-name (setup-get 'feature)) nil t))))
+      `(unless (fboundp (quote ,fn))
+         (autoload (function ,fn) ,(symbol-name (setup-get 'feature)) nil t))))
   :documentation "Autoload COMMAND if not already bound."
   :repeatable t
-  :signature '(FUNC ...))
+  :signature '(FUNC ...))
 
-(advice-add 'setup :before-while #'nasy/-package-filter)
+(advice-add 'setup :before-while #'nasy/-package-filter)
 
-
-

包之墬阯 load-path

-
+

6.4.9. 包之墬阯 load-path

+

straight 載入本墬包即可。

@@ -2023,27 +2007,27 @@

包之墬阯 load-path

;; (format "桃夭/%s" (symbol-name repo)) ;; user-emacs-directory))))) -(defmacro nasy/config-path (config) +(defmacro nasy/config-path (config) "Nasy CONFIG path." (locate-user-emacs-file (format "桃夭/%s" (symbol-name config)))) -(defmacro nasy/extra-repo (repo &optional path &rest body) +(defmacro nasy/extra-repo (repo &optional path &rest body) "Nasy extra local site-lisp REPO." - (let ((path (or path (symbol-name repo)))) - `(sup - '(,repo + (let ((path (or path (symbol-name repo)))) + `(sup + '(,repo ,@body :local-repo ,(locate-user-emacs-file (format "木瓜/%s" path)))))) -(defmacro nasy/-repo (repo &rest body) +(defmacro nasy/-repo (repo &rest body) "Nasy extra local site-lisp REPO." - (let ((path (symbol-name repo))) - `(sup - '(,repo + (let ((path (symbol-name repo))) + `(sup + '(,repo ,@body :local-repo ,(locate-user-emacs-file (format "木瓜/nasy/%s" path)))))) @@ -2051,47 +2035,44 @@

包之墬阯 load-path

-
-

melpa/elpa 之外

-
+

6.4.10. melpa/elpa 之外

+
(straight-register-package
- '(keytar :type git
+ '(keytar :type git
           :host github
           :repo "emacs-grammarly/keytar"))
 
 (straight-register-package
- '(point-history :type git
+ '(point-history :type git
                  :host github
                  :repo "blue0513/point-history"))
 
 (straight-register-package
- '(vundo :type git
+ '(vundo :type git
          :host github
          :repo "casouri/vundo"))
 
-
-

載入

-
+

6.4.11. 載入

+
;; (sup '(org :type git
 ;;            :repo "https://git.tecosaur.net/tec/org-mode.git"
 ;;            :branch "dev"))
-(sup 'org)
-(sup 'org-contrib)
-(sup 'gcmh)
+(sup 'org)
+(sup 'org-contrib)
+(sup 'gcmh)
 
-
-
自定義
-
+
6.4.11.1. 自定義
+

例子~芄蘭之例~、个人配置~芄蘭~與自定義~custom-file~

@@ -2101,17 +2082,16 @@
自定義

-
(add-to-list 'load-path *nasy-custom*)
+
(add-to-list 'load-path *nasy-custom*)
 
-(require '芄蘭)
+(require '芄蘭)
 
-
-
自定義例
-
+
6.4.11.2. 自定義例
+
;; (leaf custom-settings
 ;;   :custom
@@ -2132,11 +2112,11 @@ 
自定義例
;; *no-tree-sitter-indent*) ;; . t)) -(setup custom-settings +(setup custom-settings (:opt* *debug* nil - *theme* 'nasy)) + *theme* 'nasy)) -(setup disabled-packages +(setup disabled-packages (:opts* ((*no-eldoc-overlay* *no-highlight-indent-guides* @@ -2145,146 +2125,144 @@
自定義例
*no-tree-sitter-indent*) . t))) -(provide '芄蘭之例) +(provide '芄蘭之例)
-
-
-
+
6.4.11.3.
+
-
(eval-and-compile
-  (message "載包: %s" (if nasy--require
+
(eval-and-compile
+  (message "載包: %s" (if nasy--require
                           "是"
                         "否"))
-  (sup 'org nasy--require)
+  (sup 'org nasy--require)
   ;; (sup '(org :type git
   ;;            :repo "https://git.tecosaur.net/tec/org-mode.git"
   ;;            :branch "dev"))
-  (sup 'org-contrib nasy--require)
-  (sup 'gcmh nasy--require)
-  (sup 'setup nasy--require)
+  (sup 'org-contrib nasy--require)
+  (sup 'gcmh nasy--require)
+  (sup 'setup nasy--require)
 
   ;; 風雨
-  (sup 'beacon nasy--require)
-  (sup 'expand-region nasy--require)
-  (sup 'flycheck nasy--require)
-  (sup 'treemacs nasy--require)
-  (sup 'avy nasy--require)
-  (sup 'beacon nasy--require)
-  (sup 'dashboard nasy--require)
-  (sup 'doom-modeline nasy--require)
-  (sup 'flycheck nasy--require)
-  (sup 'ibuffer nasy--require)
-  (sup 'projectile nasy--require)
-  (sup 'smartparens nasy--require)
-  (sup `(:local-repo ,(concat *nasy-site* "nasy/nasy-theme")
+  (sup 'beacon nasy--require)
+  (sup 'expand-region nasy--require)
+  (sup 'flycheck nasy--require)
+  (sup 'treemacs nasy--require)
+  (sup 'avy nasy--require)
+  (sup 'beacon nasy--require)
+  (sup 'dashboard nasy--require)
+  (sup 'doom-modeline nasy--require)
+  (sup 'flycheck nasy--require)
+  (sup 'ibuffer nasy--require)
+  (sup 'projectile nasy--require)
+  (sup 'smartparens nasy--require)
+  (sup `(:local-repo ,(concat *nasy-site* "nasy/nasy-theme")
             :files ("彩.el"))
        nasy--require)
 
   ;; 緑衣
-  (sup 'alert nasy--require)
-  (sup 'all-the-icons-completion nasy--require)
-  (sup 'anzu nasy--require)
-  (sup 'avy nasy--require)
-  (sup 'beginend nasy--require)
-  (sup 'cape nasy--require)
-  (sup 'company nasy--require)
-  (sup 'consult nasy--require)
-  (sup 'consult-dir nasy--require)
-  (sup 'consult-flycheck nasy--require)
-  (sup '(copilot :host github :repo "zerolfx/copilot.el"
-                 :files ("dist" "copilot.el"))
+  (sup 'alert nasy--require)
+  (sup 'anzu nasy--require)
+  (sup 'avy nasy--require)
+  (sup 'beginend nasy--require)
+  (sup 'cape nasy--require)
+  (sup 'company nasy--require)
+  (sup 'consult nasy--require)
+  (sup 'consult-dir nasy--require)
+  (sup 'consult-flycheck nasy--require)
+  (sup '(copilot :host github :repo "zerolfx/copilot.el"
+                 :files ("dist" "*.el"))
        nasy--require)
-  (sup 'corfu nasy--require)
-  (sup `(corfu-extensions
+  (sup 'corfu nasy--require)
+  (sup `(corfu-extensions
          :local-repo ,(concat (straight--repos-dir "corfu") "extensions"))
        nasy--require)
-  (sup 'easy-kill nasy--require)
-  (sup 'elisp-demos nasy--require)
-  (sup 'embark-consult nasy--require)
-  (sup 'embark nasy--require)
-  (sup 'flycheck nasy--require)
-  (sup 'helpful nasy--require)
-  (sup 'keyfreq nasy--require)
-  (sup 'marginalia nasy--require)
-  (sup 'orderless nasy--require)
-  (sup 'page-break-lines nasy--require)
-  (sup 'projectile nasy--require)
-  (sup '(emacs-session
+  (sup 'easy-kill nasy--require)
+  (sup 'elisp-demos nasy--require)
+  (sup 'embark-consult nasy--require)
+  (sup 'embark nasy--require)
+  (sup 'flycheck nasy--require)
+  (sup 'helpful nasy--require)
+  (sup 'keyfreq nasy--require)
+  (sup 'marginalia nasy--require)
+  (sup 'orderless nasy--require)
+  (sup 'page-break-lines nasy--require)
+  (sup 'projectile nasy--require)
+  (sup '(emacs-session
          :repo "https://git.sr.ht/~nasy/emacs-session"
          :type git
          :host nil)
        nasy--require)
-  (sup 'savehist nasy--require)
-  (sup 'spatial-navigate nasy--require)
-  (sup 'sudo-edit nasy--require)
-  (sup 'switch-window nasy--require)
-  (sup 'transient nasy--require)
-  (sup 'treesit-auto nasy--require)
-  (sup 'unfill nasy--require)
-  (sup 'valign nasy--require)
-  (sup '(vertico :files (:defaults "extensions/*")) nasy--require)
-  (sup 'vlf nasy--require)
-  (sup 'wgrep nasy--require)
-  (sup 'which-key nasy--require)
-  (sup 'whitespace-cleanup-mode nasy--require)
+  (sup 'savehist nasy--require)
+  (sup 'spatial-navigate nasy--require)
+  (sup 'sudo-edit nasy--require)
+  (sup 'switch-window nasy--require)
+  (sup 'transient nasy--require)
+  (sup 'treesit-auto nasy--require)
+  (sup 'unfill nasy--require)
+  (sup 'valign nasy--require)
+  (sup '(vertico :files (:defaults "extensions/*")) nasy--require)
+  (sup 'vlf nasy--require)
+  (sup 'wgrep nasy--require)
+  (sup 'which-key nasy--require)
+  (sup 'whitespace-cleanup-mode nasy--require)
 
   ;; 月出
-  (sup 'abridge-diff nasy--require)
-  (sup 'ansi-color nasy--require)
-  (sup 'async nasy--require)
-  (sup 'beacon nasy--require)
-  (sup 'beacon nasy--require)
-  (sup 'color-identifiers-mode nasy--require)
-  (sup 'corfu nasy--require)
-  (sup 'default-text-scale nasy--require)
-  (sup 'diff-hl nasy--require)
-  (sup 'dired-collapse nasy--require)
-  (sup 'dired-filter nasy--require)
-  (sup 'dired-hacks nasy--require)
-  (sup 'dired-narrow nasy--require)
-  (sup 'dired-rainbow nasy--require)
-  (sup 'dirvish nasy--require)
-  (sup 'eldoc-box nasy--require)
-  (sup 'eldoc-box nasy--require)
-  (sup 'eldoc-overlay nasy--require)
-  (sup 'expand-region nasy--require)
-  (sup 'f nasy--require)
-  (sup 'find-file-in-project nasy--require)
-  (sup 'ftable nasy--require)
-  (sup 'git-gutter nasy--require)
-  (sup 'highlight-indent-guides nasy--require)
-  (sup 'highlight-tail nasy--require)
-  (sup 'imenu-list nasy--require)
-  (sup 'kind-icon nasy--require)
-  (sup 'license-snippets nasy--require)
-  (sup 'mixed-pitch nasy--require)
-  (sup 'mmm-mode nasy--require)
-  (sup 'multiple-cursors nasy--require)
-  (sup 'pcre2el nasy--require)
-  (sup 'persistent-scratch nasy--require)
-  (sup 'point-history nasy--require)
-  (sup 'rainbow-delimiters nasy--require)
-  (sup 'rainbow-mode nasy--require)
-  (sup 'shellcop nasy--require)
-  (sup 'smartparens nasy--require)
-  (sup 'symbol-overlay nasy--require)
-
-  (sup 'treemacs nasy--require)
+  (sup 'abridge-diff nasy--require)
+  (sup 'ansi-color nasy--require)
+  (sup 'async nasy--require)
+  (sup 'beacon nasy--require)
+  (sup 'beacon nasy--require)
+  (sup 'color-identifiers-mode nasy--require)
+  (sup 'corfu nasy--require)
+  (sup 'default-text-scale nasy--require)
+  (sup 'diff-hl nasy--require)
+  (sup 'dired-collapse nasy--require)
+  (sup 'dired-filter nasy--require)
+  (sup 'dired-hacks nasy--require)
+  (sup 'dired-narrow nasy--require)
+  (sup 'dired-rainbow nasy--require)
+  (sup 'dirvish nasy--require)
+  (sup 'eldoc-box nasy--require)
+  (sup 'eldoc-box nasy--require)
+  (sup 'eldoc-overlay nasy--require)
+  (sup 'expand-region nasy--require)
+  (sup 'f nasy--require)
+  (sup 'find-file-in-project nasy--require)
+  (sup 'ftable nasy--require)
+  (sup 'git-gutter nasy--require)
+  (sup 'highlight-indent-guides nasy--require)
+  (sup 'highlight-tail nasy--require)
+  (sup 'imenu-list nasy--require)
+  (sup 'kind-icon nasy--require)
+  (sup 'license-snippets nasy--require)
+  (sup 'mixed-pitch nasy--require)
+  (sup 'mmm-mode nasy--require)
+  (sup 'multiple-cursors nasy--require)
+  (sup 'pcre2el nasy--require)
+  (sup 'persistent-scratch nasy--require)
+  (sup 'point-history nasy--require)
+  (sup 'rainbow-delimiters nasy--require)
+  (sup 'rainbow-mode nasy--require)
+  (sup 'shellcop nasy--require)
+  (sup 'smartparens nasy--require)
+  (sup 'symbol-overlay nasy--require)
+
+  (sup 'treemacs nasy--require)
   ;; (sup 'treemacs-icons-dired nasy--require)
-  (sup 'treemacs-magit nasy--require)
-  (sup 'treemacs-projectile nasy--require)
-  (sup 'undo-propose nasy--require)
-  (sup 'visual-fill-column nasy--require)
-  (sup 'vundo nasy--require)
-  (sup 'which-key nasy--require)
-  (sup 'winum nasy--require)
-  (sup 'writeroom-mode nasy--require)
-  (sup 'yasnippet nasy--require)
-  (sup 'yasnippet-snippets nasy--require)
+  (sup 'treemacs-magit nasy--require)
+  (sup 'treemacs-projectile nasy--require)
+  (sup 'undo-propose nasy--require)
+  (sup 'visual-fill-column nasy--require)
+  (sup 'vundo nasy--require)
+  (sup 'which-key nasy--require)
+  (sup 'winum nasy--require)
+  (sup 'writeroom-mode nasy--require)
+  (sup 'yasnippet nasy--require)
+  (sup 'yasnippet-snippets nasy--require)
 
   ;; (sup 'tsc nasy--require)
   ;; (sup 'tree-sitter nasy--require)
@@ -2293,147 +2271,154 @@ 
;; (sup '(ts-fold :type git :host github :repo "jcs090218/ts-fold") nasy--require) ;; 庭燎 - (sup 'all-the-icons nasy--require) - (sup 'consult nasy--require) - (sup 'dash nasy--require) - (sup 'projectile nasy--require) - (sup 'cal-china-x nasy--require) - (sup 'centaur-tabs nasy--require) - (sup 'dashboard nasy--require) - (sup 'doom-themes nasy--require) - (sup 'pretty-mode nasy--require) - (sup 'nyan-mode nasy--require) - (sup 'minions nasy--require) - (sup 'doom-modeline nasy--require) - (sup `(nasy-theme :local-repo ,(concat *nasy-site* "nasy/nasy-theme")) nasy--require) + (sup 'nerd-icons nasy--require) + (sup 'nerd-icons-completion nasy--require) + (sup 'nerd-icons-ibuffer nasy--require) + (sup 'treemacs-nerd-icons nasy--require) + (sup 'consult nasy--require) + (sup 'dash nasy--require) + (sup 'projectile nasy--require) + (sup 'cal-china-x nasy--require) + (sup 'centaur-tabs nasy--require) + (sup 'dashboard nasy--require) + (sup 'doom-themes nasy--require) + (sup 'pretty-mode nasy--require) + (sup 'ligature nasy--require) + (sup 'nyan-mode nasy--require) + (sup 'minions nasy--require) + (sup 'doom-modeline nasy--require) + (sup `(nasy-theme :local-repo ,(concat *nasy-site* "nasy/nasy-theme")) nasy--require) ;; 日月 - (sup 'alert nasy--require) - (sup 'carbon-now-sh nasy--require) - (sup 'cheat-sh nasy--require) - (sup 'rime nasy--require) - (sup 'esup nasy--require) - (sup 'explain-pause-mode nasy--require) - (sup 'gptel nasy--require) - (sup 'grab-mac-link nasy--require) - (sup 'htmlize nasy--require) - (sup 'indent-tools nasy--require) - (sup 'list-unicode-display nasy--require) - (sup 'magit nasy--require) - (sup 'forge nasy--require) - (sup 'magit-delta nasy--require) - (sup 'magit-org-todos nasy--require) - (sup 'magit-todos nasy--require) + (sup 'alert nasy--require) + (sup 'carbon-now-sh nasy--require) + (sup 'cheat-sh nasy--require) + (sup 'rime nasy--require) + (sup 'esup nasy--require) + (sup 'explain-pause-mode nasy--require) + (sup 'gptel nasy--require) + (sup 'grab-mac-link nasy--require) + (sup 'htmlize nasy--require) + (sup 'indent-tools nasy--require) + (sup 'list-unicode-display nasy--require) + (sup 'magit nasy--require) + (sup 'forge nasy--require) + (sup 'magit-delta nasy--require) + (sup 'magit-org-todos nasy--require) + (sup 'magit-todos nasy--require) ;; (sup ;; '(mind-wave :type git :host github :repo "manateelazycat/mind-wave" ;; :files ("*.el" "*.py")) ;; nasy--require) - (sup '(openai :type git :host github :repo "emacs-openai/openai")) - (sup '(nasy-emacs-ai :type git :host github :repo "nasyxx/nasy-emacs-ai") + (sup '(openai :type git :host github :repo "emacs-openai/openai")) + (sup '(nasy-emacs-ai :type git :host github :repo "nasyxx/nasy-emacs-ai") nasy--require) - (sup 'pdf-tools nasy--require) - (sup 'prettier nasy--require) - (sup 'request nasy--require) - (sup 'svg-clock nasy--require) + (sup 'pdf-tools nasy--require) + (sup 'prettier nasy--require) + (sup 'request nasy--require) + (sup 'svg-clock nasy--require) (with-no-warnings - (setq vterm-always-compile-module t)) - (sup 'vterm nasy--require) - (sup '(vterm-toggle :build (:not native-compile)) nasy--require) - (sup 'wakatime-mode nasy--require) + (setq vterm-always-compile-module t)) + (sup 'vterm nasy--require) + (sup '(vterm-toggle :build (:not native-compile)) nasy--require) + (sup 'wakatime-mode nasy--require) ;; 麐之趾 - (sup 'cdlatex nasy--require) - (sup 'reformatter nasy--require) - (sup `(bibtex-tidy :local-repo ,(concat *nasy-site* "nasy/bibtex-tidy-mode")) + (sup 'apheleia nasy--require) + (sup 'cdlatex nasy--require) + (sup 'reformatter nasy--require) + (sup `(bibtex-tidy :local-repo ,(concat *nasy-site* "nasy/bibtex-tidy-mode")) nasy--require) - (sup 'lsp-mode nasy--require) - (sup 'lsp-ui nasy--require) - (sup 'lsp-treemacs nasy--require) - (sup `(flex-mode :local-repo ,(concat *nasy-site* "villadora")) nasy--require) - (sup 'haskell-mode nasy--require) - (sup 'lsp-haskell nasy--require) - (sup 'dap-mode nasy--require) - (sup 'elisp-def nasy--require) - (sup 'highlight-quoted nasy--require) - (sup '(ipretty :type git :repo "https://framagit.org/steckerhalter/ipretty.git") + (sup 'lsp-mode nasy--require) + (sup 'lsp-ui nasy--require) + (sup 'lsp-treemacs nasy--require) + (sup `(flex-mode :local-repo ,(concat *nasy-site* "villadora")) nasy--require) + (sup 'haskell-mode nasy--require) + (sup 'lsp-haskell nasy--require) + (sup 'dap-mode nasy--require) + (sup 'elisp-def nasy--require) + (sup 'highlight-quoted nasy--require) + (sup '(ipretty :type git :repo "https://framagit.org/steckerhalter/ipretty.git") nasy--require) - (sup 'macrostep nasy--require) + (sup 'macrostep nasy--require) (with-no-warnings - (setq parinfer-rust-auto-download nil + (setq parinfer-rust-auto-download nil parinfer-rust-library (concat *nasy-var* "parinfer-rust/parinfer-rust-darwin.so"))) - (sup 'parinfer-rust-mode nasy--require) - (sup `(tex-site + (sup 'parinfer-rust-mode nasy--require) + (sup `(tex-site :type git :host nil :repo "https://git.savannah.gnu.org/git/auctex.git" - :pre-build ,(pcase system-type - (`berkeley-unix '("gmake")) - (_ '( ;; also for macos - `("bash" "-c" "cd" ,(straight--repos-dir "auctex")) + :pre-build ,(pcase system-type + (`berkeley-unix '("gmake")) + (_ '( ;; also for macos + `("bash" "-c" "cd" ,(straight--repos-dir "auctex")) ("./autogen.sh") ("./configure" "--without-texmf-dir" "--with-lispdir=.") ("gmake"))))) nasy--require) - (sup 'markdown-mode nasy--require) - (sup 'nix-mode nasy--require) - (sup '(nushell-mode :type git :host github :repo "azzamsa/emacs-nushell")) - (sup 'citeproc nasy--require) - (sup - '(org-ai :type git :host github :repo "rksm/org-ai" + (sup 'markdown-mode nasy--require) + (sup 'nix-mode nasy--require) + (sup '(nushell-mode :type git :host github :repo "azzamsa/emacs-nushell")) + (sup 'citeproc nasy--require) + (sup + '(org-ai :type git :host github :repo "rksm/org-ai" :local-repo "org-ai" :files ("*.el" "README.md" "snippets")) nasy--require) - (sup 'org-appear nasy--require) - (sup 'org-fragtog nasy--require) - (sup 'org-latex-impatient nasy--require) - (sup 'org-modern nasy--require) - (sup '(org-rainbow-tags :host github :repo "KaratasFurkan/org-rainbow-tags") + (sup 'org-appear nasy--require) + (sup 'org-fragtog nasy--require) + (sup 'org-latex-impatient nasy--require) + (sup 'org-modern nasy--require) + (sup '(org-rainbow-tags :host github :repo "KaratasFurkan/org-rainbow-tags") + nasy--require) + (sup 'org-roam nasy--require) + (sup 'elpy nasy--require) + (sup 'python-black nasy--require) + (sup 'lsp-pyright nasy--require) + (sup `(lsp-pylance :local-repo ,(concat *nasy-site* "nasy/lsp-pylance"))) + (sup `(python-isort :local-repo ,(concat *nasy-site* "nasy/python-isort")) nasy--require) - (sup 'org-roam nasy--require) - (sup 'elpy nasy--require) - (sup 'python-black nasy--require) - (sup 'lsp-pyright nasy--require) - (sup `(python-isort :local-repo ,(concat *nasy-site* "nasy/python-isort")) + (sup 'restclient nasy--require) + (sup 'company-restclient nasy--require) + (sup 'ob-restclient nasy--require) + (sup 'yaml-mode nasy--require) + (sup 'ob-elvish nasy--require) + (sup 'elvish-mode nasy--require) + (sup '(typst-ts-mode :host sourcehut :type git :repo "meow_king/typst-ts-mode") nasy--require) - (sup 'restclient nasy--require) - (sup 'company-restclient nasy--require) - (sup 'ob-restclient nasy--require) - (sup 'yaml-mode nasy--require) - (sup 'ob-elvish nasy--require) - (sup 'elvish-mode nasy--require) ;; (sup 'toml-mode nasy--require) ;; 小曐 - (sup 'git-blamed nasy--require) - (sup 'git-messenger nasy--require) - (sup 'git-modes nasy--require) - (sup 'git-timemachine nasy--require) - (sup 'wgrep nasy--require) - (sup 'rg nasy--require) - (sup 'company-dict nasy--require) - (sup 'company-math nasy--require) - (sup 'flycheck-package nasy--require) - (sup 'ibuffer-vc nasy--require) - (sup 'all-the-icons-ibuffer nasy--require) - (sup 'nix-buffer nasy--require) - (sup 'nix-update nasy--require) - (sup 'nixpkgs-fmt nasy--require) - (sup 'thingopt nasy--require) - (sup 'haskell-snippets nasy--require)) + (sup 'git-blamed nasy--require) + (sup 'git-messenger nasy--require) + (sup 'git-modes nasy--require) + (sup 'git-timemachine nasy--require) + (sup 'wgrep nasy--require) + (sup 'rg nasy--require) + (sup 'company-dict nasy--require) + (sup 'company-math nasy--require) + (sup 'flycheck-package nasy--require) + (sup 'ibuffer-vc nasy--require) + ;; (sup 'all-the-icons-ibuffer nasy--require) + (sup 'nix-buffer nasy--require) + (sup 'nix-update nasy--require) + (sup 'nixpkgs-fmt nasy--require) + (sup 'thingopt nasy--require) + (sup 'haskell-snippets nasy--require))
-
-

風雨

-
+

6.5. 風雨

+
-
(add-to-list 'load-path (locate-user-emacs-file  "桃夭/風雨"))
-(require '風雨)
-(add-hook #'nasy-first-key-hook #'(lambda () (require '風雨時用)))
+
(add-to-list 'load-path (locate-user-emacs-file  "桃夭/風雨"))
+(require '風雨)
+(add-hook 'nasy-first-key-hook #'(lambda () (require '風雨時用)))
 
@@ -2452,118 +2437,115 @@

風雨

函數與宏定製其文宜其用之

-
-

恆用之

-
+

6.5.1. 恆用之

+
-
-
+
6.5.1.1.
+
-
(defvar nasy/config-before-hook nil
+
(defvar nasy/config-before-hook nil
   "Hook to run config functions before load custom.el.")
 
-(defvar nasy/config-after-hook nil
+(defvar nasy/config-after-hook nil
   "Hook to run config functions after load custom.el.")
 
-(add-hook 'nasy/config-after-hook
-          #'(lambda () (message "Hi~ Hope you have fun with this config.")))
+(add-hook 'nasy/config-after-hook
+          #'(lambda () (message "Hi~ Hope you have fun with this config.")))
 
-(defvar nasy--defer-loads nil
+(defvar nasy--defer-loads nil
   "Nasy defer load packages.")
 
-(defvar nasy--defer-load-hook nil
+(defvar nasy--defer-load-hook nil
   "Nasy defer load hook.")
 
-
-
函數
-
+
6.5.1.2. 函數
+
-
(defun nasy/change-char-width (char width)
+
(defun nasy/change-char-width (char width)
   "Change CHAR width to WIDTH."
-  (let ((table (make-char-table nil)))
+  (let ((table (make-char-table nil)))
     (set-char-table-parent table char-width-table)
     (set-char-table-range table char width)
-    (setq char-width-table table)))
+    (setq char-width-table table)))
 
 
 ;;;###autoload
-(defun nasy/enlist (exp)
+(defun nasy/enlist (exp)
  "Return EXP wrapped in a list, or as-is if already a list."
- (declare (pure t) (side-effect-free t))
- (if (listp exp) exp (list exp)))
+ (declare (pure t) (side-effect-free t))
+ (if (listp exp) exp (list exp)))
 
 
-(defun nasy/run-hook-once-on (hook on-hook)
+(defun nasy/run-hook-once-on (hook on-hook)
   "Run HOOK on ON-HOOK once."
-  (let ((fn (intern (format "nasy-once-hook--%s-on-%s" hook on-hook)))
+  (let ((fn (intern (format "nasy-once-hook--%s-on-%s" hook on-hook)))
         (hook* hook))
     (fset
      fn
-     (lambda (&rest _)
+     (lambda (&rest _)
        (run-hooks hook*)
        (set hook* nil)))
     (add-hook on-hook fn)))
 
-(defun nasy/defer-load ()
+(defun nasy/defer-load ()
   (nasy/sup nasy--defer-loads)
-  (run-hooks 'nasy--defer-load-hook))
+  (run-hooks 'nasy--defer-load-hook))
 
-(add-hook 'nasy-first-key-hook #'nasy/defer-load -1)
+(add-hook 'nasy-first-key-hook #'nasy/defer-load -1)
 
 
   ;;;###autoload
-(defun stop-minimizing-window ()
+(defun stop-minimizing-window ()
   "Stop minimizing window under macOS."
-  (interactive)
-  (unless (and *is-a-mac*
+  (interactive)
+  (unless (and *is-a-mac*
                window-system)
     (suspend-frame)))
 
-
-
-
+
6.5.1.3.
+
-
(cl-eval-when (compile eval load)
-  (if (fboundp 'with-eval-after-load)
-      (defalias 'after-x 'with-eval-after-load)
-    (defmacro after-x (feature &rest body)
+
(cl-eval-when (compile eval load)
+  (if (fboundp 'with-eval-after-load)
+      (defalias 'after-x 'with-eval-after-load)
+    (defmacro after-x (feature &rest body)
       "Eval BODY afetr FEATURE have loaded."
-      (declare (indent defun))
-      `(eval-after-load ,feature
-         '(progn ,@body)))))
+      (declare (indent defun))
+      `(eval-after-load ,feature
+         '(progn ,@body)))))
 
- -
-
字体
-
+
+
6.5.1.4. 字軆
+
-
(defvar nasy/font-change-hook nil
+
(defvar nasy/font-change-hook nil
   "Hooks to run after font changed.")
 
-(defvar nasy--cus-font nil)
-(defvar nasy--set-font nil)
+(defvar nasy--cus-font nil)
+(defvar nasy--set-font nil)
 
-(defun nasy/-set-font (&rest _)
+(defun nasy/-set-font (&rest _)
   "Font."
-  (setq nasy--set-font t)
-  (setup nasy-font
+  (setq nasy--set-font t)
+  (setup nasy-font
     (:doc "字軆初值")
     (:opt*
-     *font-main-family*   "MonoLisa Nasy"
+     *font-main-family*   "MonoLisa Nasy"  ;; "Monaspace Radon Var"
      *font-symbol-family* "SF Pro"
+     *font-nerd-family*   "Symbols Nerd Font Mono"
      *font-cjk-family*    "STFLGQKJF"
      *font-cjk-2-family*  "FZLiuGongQuanKaiShuJF"
      ;; I.Ngaan' font from `http://founder.acgvlyric.org/iu/doku.php/造字:開源字型_i.顏體'.
@@ -2583,7 +2565,7 @@ 
字体
*font-symbol-size* 17 *font-header-line-size* 12 - *font-main-weight* 'medium) + *font-main-weight* 'medium) (:opts* ((*font-cjk-size* *font-cjk-2-size* @@ -2607,287 +2589,316 @@
字体
*font-cjk-weight* *font-cjk-2-weight* *font-cjk-3-weight*) - . 'normal) + . 'normal) ((*font-cjk-4-weight* *font-cjk-5-weight*) - . 'bold))) - (require '芄蘭 nil t)) + . 'bold))) + (require '芄蘭 nil t)) -(cl-eval-when (compile eval load) - (defun nasy/-font-doc (cname ftype) +(cl-eval-when (compile eval load) + (defun nasy/-font-doc (cname ftype) "Generate font custome variable doc with CNAME and FTYPE." (concat "The " cname " font " ftype ". After change it, run `M-x nasy/set-font' to see the effect.")) - (defun nasy/-cus-font () + (defun nasy/-cus-font () "Defcustom some fonts." - (setq nasy--cus-font t) - (dolist (cname '("main" "symbol" "cjk" "mode-line" "tab-line" "header-line")) - (cl-loop for ftype in '("family" "weight" "size" "scale") - for type = (cond ((string= "family" ftype) 'string) - ((string= "weight" ftype) 'symbol) - ((string= "size" ftype) 'float) - ((string= "scale" ftype) 'float) + (setq nasy--cus-font t) + (dolist (cname '("main" "symbol" "cjk" "mode-line" "tab-line" "header-line")) + (cl-loop for ftype in '("family" "weight" "size" "scale") + for type = (cond ((string= "family" ftype) 'string) + ((string= "weight" ftype) 'symbol) + ((string= "size" ftype) 'float) + ((string= "scale" ftype) 'float) (t (error "Wrong Font Type"))) for doc = (nasy/-font-doc cname ftype) for name = (intern (format "*font-%s-%s*" cname ftype)) do - (progn - (custom-declare-variable name nil doc :group 'nasy-font :type type) - (when (string= "cjk" cname) - (cl-loop for sfxn in '(2 3 4 5) + (progn + (custom-declare-variable name nil doc :group 'nasy-font :type type) + (when (string= "cjk" cname) + (cl-loop for sfxn in '(2 3 4 5) for cname_ = (format "%s-%d" cname sfxn) for name_ = (intern (format "*font-%s-%s*" cname_ ftype)) for doc_ = (nasy/-font-doc cname_ ftype) do - (progn + (progn (custom-declare-variable name_ nil doc_ - :group 'nasy-font + :group 'nasy-font :type type))))))))) -(cl-eval-when (compile) +(cl-eval-when (compile) (nasy/-cus-font) (nasy/-set-font)) -(defun nasy/check-font (font) +(defun nasy/check-font (font) "Check if FONT avaliable." - (if (find-font (font-spec :family font)) + (if (find-font (font-spec :family font)) t (message (format "`%s' font not find" font)))) -(defun nasy/set-default-font (charset &optional size frame) +(defun nasy/set-default-font (charset &optional size frame) "Set CHARSET fontset to default *font-main* with SIZE on FRAME." - (when (and (display-graphic-p) + (when (and (display-graphic-p) (nasy/check-font *font-main-family*)) - (let ((size (or size *font-main-size*))) + (let ((size (or size *font-main-size*))) (set-fontset-font t charset (font-spec :family *font-main-family* :weight *font-main-weight* :size size) frame - 'prepend)))) + 'prepend)))) -(defun nasy/set-hanamin (charset &optional size frame) +(defun nasy/set-hanamin (charset &optional size frame) "Set CHARSET fontset to HanaMin with SIZE on FRAME. https://github.com/cjkvi/HanaMinAFDKO/releases Font for char like 𨉚." - (when (display-graphic-p) - (let ((size (or size *font-cjk-size*))) - (when (nasy/check-font "HanaMinB") - (set-fontset-font (frame-parameter nil 'font) + (when (display-graphic-p) + (let ((size (or size *font-cjk-size*))) + (when (nasy/check-font "HanaMinB") + (set-fontset-font (frame-parameter nil 'font) charset (font-spec :family "HanaMinB" - :weight 'normal + :weight 'normal :size size) frame - 'prepend)) - (when (nasy/check-font "HanaMinA") - (set-fontset-font (frame-parameter nil 'font) + 'prepend)) + (when (nasy/check-font "HanaMinA") + (set-fontset-font (frame-parameter nil 'font) charset (font-spec :family "HanaMinA" - :weight 'normal + :weight 'normal :size size) frame - 'prepend)) - (setf (alist-get ".*HanaMinA.*" face-font-rescale-alist *font-cjk-scale* nil 'string=) + 'prepend)) + (setf (alist-get ".*HanaMinA.*" face-font-rescale-alist *font-cjk-scale* nil 'string=) *font-cjk-scale*) - (setf (alist-get ".*HanaMinB.*" face-font-rescale-alist *font-cjk-scale* nil 'string=) + (setf (alist-get ".*HanaMinB.*" face-font-rescale-alist *font-cjk-scale* nil 'string=) *font-cjk-scale*) - (cl-loop for sfx in (reverse '("A" "B" "C" "Ex A1" "Ex A2" "Ex B" "Ex C" "I")) + (cl-loop for sfx in (reverse '("A" "B" "C" "Ex A1" "Ex A2" "Ex B" "Ex C" "I")) for hfont = (concat "Hanazono Mincho " sfx) do - (progn - (when (nasy/check-font hfont) - (set-fontset-font (frame-parameter nil 'font) + (progn + (when (nasy/check-font hfont) + (set-fontset-font (frame-parameter nil 'font) charset (font-spec :family hfont - :weight 'normal + :weight 'normal :size size) frame - 'prepend)) + 'prepend)) - (setf (alist-get (format ".*%s.*" hfont) + (setf (alist-get (format ".*%s.*" hfont) face-font-rescale-alist *font-cjk-scale* nil - 'string=) + 'string=) *font-cjk-scale*)))))) -(defun nasy/set-symbol (charset &optional size weight frame) +(defun nasy/set-symbol (charset &optional size weight frame) "Set CHARSET fontset to Symbol with SIZE with WEIGHT on FRAME. Font for char like ∷." - (when (display-graphic-p) - (let ((size (or size *font-symbol-size*))) - (when (nasy/check-font *font-symbol-family*) - (set-fontset-font (frame-parameter nil 'font) + (when (display-graphic-p) + (let ((size (or size *font-symbol-size*))) + (when (nasy/check-font *font-symbol-family*) + (set-fontset-font (frame-parameter nil 'font) charset (font-spec :family *font-symbol-family* :weight weight :size size) frame - 'prepend))))) + 'prepend))))) -(defun nasy/set-apple-symbol (charset &optional frame) +(defun nasy/set-apple-symbol (charset &optional frame) "Set CHARSET fontset to Apple Color Emoji with SIZE with WEIGHT on FRAME. Font for char like ∷." - (when (display-graphic-p) - (when (nasy/check-font "SF Pro") - (set-fontset-font (frame-parameter nil 'font) + (when (display-graphic-p) + (when (nasy/check-font "SF Pro") + (set-fontset-font (frame-parameter nil 'font) charset (font-spec :family "SF Pro") frame - 'prepend)))) - - -(defun nasy/-set--font (frame) + 'prepend)))) + + +(defun nasy/set-nerd-fonts (&optional font-family frame) + "Modify nerd font charsets to use FONT-FAMILY for FRAME." + (when (nasy/check-font (or font-family *font-nerd-family*)) + (let ((font-f (or font-family *font-nerd-family*)) + (charsets '((#xe5fa . #xe631) ;; Seti-UI + Custom + (#xe700 . #xe7c5) ;; Devicons + (#xf000 . #xf2e0) ;; Font Awesome + (#xe200 . #xe2a9) ;; Font Awesome Extension + (#xf500 . #xfd46) (#xf0001 . #xf1af0) ;; Material Design Icons + (#xe300 . #xe3eb) ;; Weather + (#xf400 . #xf4a9) #x2665 #x26A1 ;; Octicons + (#xe0a0 . #xe0a2) (#xe0b0 . #xe0b3) ;; Powerline Symbols + #xe0a3 (#xe0b4 . #xe0c8) #xe0ca (#xe0cc . #xe0d4) ;; Powerline Extra Symbols + (#x23fb . #x23fe) #x2b58 ;; IEC Power Symbols + (#xf300 . #xf32d) ;; Font Logos + (#xe000 . #xe00a) ;; Pomicons + (#xea60 . #xebeb)))) ;; Codicons + (cl-loop for charset in charsets do + (set-fontset-font + (frame-parameter nil 'font) + charset + (font-spec :family font-f + :weight nil + :size nil) + frame + 'prepend))))) + + +(defun nasy/-set--font (frame) "Nasy set font for `FRAME'." - (unless nasy--cus-font + (unless nasy--cus-font (nasy/-cus-font)) - (unless nasy--set-font + (unless nasy--set-font (nasy/-set-font)) - (when (display-graphic-p) + (when (display-graphic-p) ;; default - (when (nasy/check-font *font-main-family*) + (when (nasy/check-font *font-main-family*) (set-face-attribute - 'default nil + 'default nil :font (font-spec :family *font-main-family* :weight *font-main-weight* :size *font-main-size*))) ;; 中文 - (dolist (charset '(kana han cjk-misc bopomofo)) - (progn + (dolist (charset '(kana han cjk-misc bopomofo)) + (progn (nasy/set-hanamin charset) - (cl-loop for fn in (reverse '("" "-2" "-3" "-4" "-5")) + (cl-loop for fn in (reverse '("" "-2" "-3" "-4" "-5")) for fpf = (format "*font-cjk%s" fn) for ff = (eval (intern (concat fpf "-family*"))) for fw = (eval (intern (concat fpf "-weight*"))) for fs = (eval (intern (concat fpf "-size*"))) for fss = (eval (intern (concat fpf "-scale*"))) do - (progn - (when (nasy/check-font ff) - (set-fontset-font (frame-parameter nil 'font) + (progn + (when (nasy/check-font ff) + (set-fontset-font (frame-parameter nil 'font) charset (font-spec :family ff :weight fw) ;; :size fs) frame - 'prepend)) - (let ((ffn (concat ".*" ff ".*"))) - (setf (alist-get ffn face-font-rescale-alist fss nil 'string=) fss)))))) - - (when (and *is-a-mac* - (nasy/check-font "SF Pro")) - ;; For NS/Cocoa - (set-fontset-font (frame-parameter nil 'font) - 'symbol - (font-spec :family "SF Pro") - frame - 'prepend)) - - (when (nasy/check-font *font-symbol-family*) - (set-fontset-font (frame-parameter nil 'font) - 'symbol - (font-spec :family *font-symbol-family* - :weight *font-symbol-weight* - :size *font-symbol-size*) - frame - 'append) - (set-fontset-font (frame-parameter nil 'font) - 'unicode - (font-spec :family *font-symbol-family* - :weight *font-symbol-weight* - :size *font-symbol-size*) - frame - 'append)) - - (when (nasy/check-font "Apple Color Emoji") - (set-fontset-font (frame-parameter nil 'font) - 'symbol - (font-spec :family "Apple Color Emoji") - frame - 'append) - (set-fontset-font (frame-parameter nil 'font) - 'unicode - (font-spec :family "Apple Color Emoji") - frame - 'append)) - - (when (nasy/check-font *font-math-family*) - (set-fontset-font (frame-parameter nil 'font) - (cons #x1D400 #x1D7FF) - (font-spec :family *font-math-family*) - frame - 'prepend) - (set-fontset-font (frame-parameter nil 'font) - (cons #x2100 #x214f) - (font-spec :family *font-math-family*) - frame - 'prepend)) - - (when (nasy/check-font *font-mode-line-family*) - (set-face-attribute 'mode-line nil - :font (font-spec :family *font-mode-line-family* - :weight *font-mode-line-weight* - :size *font-mode-line-size*)) - - (set-face-attribute 'mode-line-inactive nil - :font (font-spec :family *font-mode-line-family* - :weight *font-mode-line-weight* - :size *font-mode-line-size*))) - (when (nasy/check-font *font-tab-line-family*) - (set-face-attribute 'tab-line nil - :font (font-spec :family *font-tab-line-family* - :weight *font-tab-line-weight* - :size *font-tab-line-size*))) - (when (nasy/check-font *font-header-line-family*) - (set-face-attribute 'header-line nil - :font (font-spec :family *font-header-line-family* - :weight *font-header-line-weight* - :size *font-header-line-size*)))) + 'prepend)) + (let ((ffn (concat ".*" ff ".*"))) + (setf (alist-get ffn face-font-rescale-alist fss nil 'string=) fss)))))) + + ;; nerd font + (nasy/set-nerd-fonts nil frame) + (when (and *is-a-mac* + (nasy/check-font "SF Pro")) + ;; For NS/Cocoa + (set-fontset-font (frame-parameter nil 'font) + 'symbol + (font-spec :family "SF Pro") + frame + 'prepend)) + + (when (nasy/check-font *font-symbol-family*) + (set-fontset-font (frame-parameter nil 'font) + 'symbol + (font-spec :family *font-symbol-family* + :weight *font-symbol-weight* + :size *font-symbol-size*) + frame + 'append) + (set-fontset-font (frame-parameter nil 'font) + 'unicode + (font-spec :family *font-symbol-family* + :weight *font-symbol-weight* + :size *font-symbol-size*) + frame + 'append)) + + (when (nasy/check-font "Apple Color Emoji") + (set-fontset-font (frame-parameter nil 'font) + 'symbol + (font-spec :family "Apple Color Emoji") + frame + 'append) + (set-fontset-font (frame-parameter nil 'font) + 'unicode + (font-spec :family "Apple Color Emoji") + frame + 'append)) + + (when (nasy/check-font *font-math-family*) + (set-fontset-font (frame-parameter nil 'font) + (cons #x1D400 #x1D7FF) + (font-spec :family *font-math-family*) + frame + 'prepend) + (set-fontset-font (frame-parameter nil 'font) + (cons #x2100 #x214f) + (font-spec :family *font-math-family*) + frame + 'prepend)) + + (when (nasy/check-font *font-mode-line-family*) + (set-face-attribute 'mode-line nil + :font (font-spec :family *font-mode-line-family* + :weight *font-mode-line-weight* + :size *font-mode-line-size*)) + + (set-face-attribute 'mode-line-inactive nil + :font (font-spec :family *font-mode-line-family* + :weight *font-mode-line-weight* + :size *font-mode-line-size*))) + (when (nasy/check-font *font-tab-line-family*) + (set-face-attribute 'tab-line nil + :font (font-spec :family *font-tab-line-family* + :weight *font-tab-line-weight* + :size *font-tab-line-size*))) + (when (nasy/check-font *font-header-line-family*) + (set-face-attribute 'header-line nil + :font (font-spec :family *font-header-line-family* + :weight *font-header-line-weight* + :size *font-header-line-size*)))) ;; (after-x 'doom-modeline - ;; (doom-modeline--set-char-widths doom-modeline-rhs-icons-alist)) + ;; (doom-modeline--set-char-widths doom-modeline-rhs-icons-alist)) - (run-hooks 'nasy/font-change-hook)) + (run-hooks 'nasy/font-change-hook)) -(defun nasy/set-font (&rest _) +(defun nasy/set-font (&rest _) "Nasy set font." - (interactive) + (interactive) (message "setting font...") (nasy/-set--font nil) (message "setting font...done")) -(add-hook 'emacs-startup-hook #'nasy/-set-font 98) -(add-hook 'emacs-startup-hook #'nasy/-cus-font 97) +(add-hook 'emacs-startup-hook #'nasy/-set-font 98) +(add-hook 'emacs-startup-hook #'nasy/-cus-font 97) ;; (add-hook 'after-init-hook #'nasy/set-font) -(add-hook 'emacs-startup-hook #'nasy/set-font 99) +(add-hook 'emacs-startup-hook #'nasy/set-font 99) ;; (add-hook 'nasy-first-key-hook #'nasy/set-font) ;; (add-hook 'after-make-frame-functions #'nasy/set-font) -(when noninteractive +(when noninteractive (nasy/set-font))
-
-
光幖
-
+
6.5.1.5. 光幖
+
-
(defvar nasy-cursor-colors '("#F00056"
+
(defvar nasy-cursor-colors '("#F00056"
                              "#057748"
                              "#30DFF3"
                              "#FF9393"
@@ -2898,97 +2909,96 @@ 
光幖
"#FAFF72") "Blink cursor colors.") -(defvar nasy--blink-cursor-count 0 +(defvar nasy--blink-cursor-count 0 "Blink cursor counter.") -(defun nasy/blink-cursor-timer-function (&rest _) - (when (not (internal-show-cursor-p)) - (when (>= nasy--blink-cursor-count (length nasy-cursor-colors)) - (setq nasy--blink-cursor-count 0)) - (let ((color (nth nasy--blink-cursor-count nasy-cursor-colors)) +(defun nasy/blink-cursor-timer-function (&rest _) + (when (not (internal-show-cursor-p)) + (when (>= nasy--blink-cursor-count (length nasy-cursor-colors)) + (setq nasy--blink-cursor-count 0)) + (let ((color (nth nasy--blink-cursor-count nasy-cursor-colors)) (hl-color (nth nasy--blink-cursor-count (reverse nasy-cursor-colors)))) (set-cursor-color color) - (when (featurep 'beacon) - (setq beacon-color color)) - (setq nasy--blink-cursor-count (1+ nasy--blink-cursor-count))))) + (when (featurep 'beacon) + (setq beacon-color color)) + (setq nasy--blink-cursor-count (1+ nasy--blink-cursor-count))))) -(add-hook 'nasy-first-key-hook - #'(lambda () - (advice-add 'blink-cursor-timer-function :before - #'nasy/blink-cursor-timer-function))) +(add-hook 'nasy-first-key-hook + #'(lambda () + (advice-add 'blink-cursor-timer-function :before + #'nasy/blink-cursor-timer-function)))
-
-
定製
-
+
6.5.1.6. 定製
+
-
-
+
6.5.1.6.1.
+
-
(defgroup nasy nil
+
(defgroup nasy nil
   "Nasy Emacs Custom Configurations."
-  :group 'emacs)
+  :group 'emacs)
 
-(defgroup nasy-font nil
+(defgroup nasy-font nil
   "Nasy Emacs Custom Font Configurations."
-  :group 'nasy)
+  :group 'nasy)
 
-(defcustom lisp-modes-hooks '(common-lisp-mode-hook
+(defcustom lisp-modes-hooks '(common-lisp-mode-hook
                               emacs-lisp-mode-hook
                               lisp-mode-hook
                               lisp-interaction-mode-hook
                               racket-mode-hook
                               scheme-mode-hook)
   "List of lisp-related modes hooks."
-  :type '(repeat symbol)
-  :group 'nasy)
+  :type '(repeat symbol)
+  :group 'nasy)
 
-(defmacro lisp-modes-hooks-add (func)
+(defmacro lisp-modes-hooks-add (func)
   "Add FUNC to all lisp-related modes hooks."
-  (let ((bs))
-    (dolist (hook lisp-modes-hooks)
-      (push `(add-hook ',hook #',func) bs))
+  (let ((bs))
+    (dolist (hook lisp-modes-hooks)
+      (push `(add-hook ',hook #',func) bs))
     (macroexp-progn bs)))
 
-(defcustom *theme* 'nasy-theme
+(defcustom *theme* 'nasy-theme
   "The Theme."
-  :group 'nasy
-  :type 'symbol)
+  :group 'nasy
+  :type 'symbol)
 
-(defun nasy/-cus-emacs ()
+(defun nasy/-cus-emacs ()
   "Nasy customize emacs misc variable."
-  (customize-set-variable 'colon-double-space    nil "Customized by Nasy.")
-  (customize-set-variable 'cursor-type           'box "Customized by Nasy.")
-  (customize-set-variable 'custom-raised-buttons nil "Customized by Nasy.")
-  (customize-set-variable 'help-window-select    t "Customized by Nasy.")
-  (customize-set-variable 'make-backup-files     nil "Customized by Nasy.")
-  (customize-set-variable 'mouse-yank-at-point   t "Customized by Nasy.")
-  (customize-set-variable 'mouse-drag-and-drop-region-cross-program
+  (customize-set-variable 'colon-double-space    nil "Customized by Nasy.")
+  (customize-set-variable 'cursor-type           'box "Customized by Nasy.")
+  (customize-set-variable 'custom-raised-buttons nil "Customized by Nasy.")
+  (customize-set-variable 'help-window-select    t "Customized by Nasy.")
+  (customize-set-variable 'make-backup-files     nil "Customized by Nasy.")
+  (customize-set-variable 'mouse-yank-at-point   t "Customized by Nasy.")
+  (customize-set-variable 'mouse-drag-and-drop-region-cross-program
                           t "Customized by Nasy.")
-  (customize-set-variable 'resize-mini-windows   t "Customized by Nasy.")
-  (customize-set-variable 'scroll-conservatively 5 "Customized by Nasy.")
-  (customize-set-variable 'scroll-margin         5 "Customized by Nasy.")
-  (customize-set-variable 'tab-always-indent     'complete "Customized by Nasy.")
-  (customize-set-variable 'use-dialog-box        nil "Customized by Nasy.")
-  (customize-set-variable 'use-file-dialog       nil "Customized by Nasy.")
-  (customize-set-variable 'word-wrap-by-category t   "Customized by Nasy.")
+  (customize-set-variable 'resize-mini-windows   t "Customized by Nasy.")
+  (customize-set-variable 'scroll-conservatively 5 "Customized by Nasy.")
+  (customize-set-variable 'scroll-margin         5 "Customized by Nasy.")
+  (customize-set-variable 'tab-always-indent     'complete "Customized by Nasy.")
+  (customize-set-variable 'use-dialog-box        nil "Customized by Nasy.")
+  (customize-set-variable 'use-file-dialog       nil "Customized by Nasy.")
+  (customize-set-variable 'word-wrap-by-category t   "Customized by Nasy.")
 
-  (customize-set-variable 'enable-recursive-minibuffers t "Customized by Nasy.")
+  (customize-set-variable 'enable-recursive-minibuffers t "Customized by Nasy.")
 
-  (customize-set-variable 'ediff-split-window-function
-                          'split-window-horizontally "Customized by Nasy.")
-  (customize-set-variable 'ediff-window-setup-function
-                          'ediff-setup-windows-plain "Customized by Nasy.")
+  (customize-set-variable 'ediff-split-window-function
+                          'split-window-horizontally "Customized by Nasy.")
+  (customize-set-variable 'ediff-window-setup-function
+                          'ediff-setup-windows-plain "Customized by Nasy.")
 
-  (setq-default indent-tabs-mode nil)
+  (setq-default indent-tabs-mode nil)
 
-  (fset 'yes-or-no-p 'y-or-n-p)
+  (fset 'yes-or-no-p 'y-or-n-p)
 
   (column-number-mode 1)
   (delete-selection-mode 1)
@@ -2999,35 +3009,34 @@ 
(pixel-scroll-precision-mode 1)) -(add-hook 'nasy-first-key-hook #'nasy/-cus-emacs) +(add-hook 'nasy-first-key-hook #'nasy/-cus-emacs)
-
-
-
+
6.5.1.6.2.
+
-
(defun nasy/-insert-backslash ()
-  (interactive)
+
(defun nasy/-insert-backslash ()
+  (interactive)
   (insert-char ?\\))
 
-(defun n/kill-line-0 ()
-  (interactive)
+(defun n/kill-line-0 ()
+  (interactive)
   (kill-line 0))
 
-(defun nasy/-cus-mac ()
+(defun nasy/-cus-mac ()
   "Customize macOS."
-  (setup mac
+  (setup mac
     (:only-if *is-a-mac*)
     (:opt*
-     mac-function-modifier      'super
-     mac-option-modifier        'meta
-     mac-command-modifier       'hyper
-     mac-right-command-modifier 'super
-     mac-right-option-modifier  'alt
-     default-frame-alist '((ns-transparent-titlebar . t)
+     mac-function-modifier      'super
+     mac-option-modifier        'meta
+     mac-command-modifier       'hyper
+     mac-right-command-modifier 'super
+     mac-right-option-modifier  'alt
+     default-frame-alist '((ns-transparent-titlebar . t)
                            (ns-appearance           . light)
                            (alpha-background        . 75)
                            (vertical-scroll-bars    . nil)
@@ -3062,100 +3071,99 @@ 
(global-unset-key (kbd "<magnify-down>")) (global-unset-key (kbd "<magnify-up>"))))) -(add-hook 'emacs-startup-hook #'nasy/-cus-mac) +(add-hook 'emacs-startup-hook #'nasy/-cus-mac)
-
-

時用之

-
+

6.5.2. 時用之

+

主勭使用。

;;; 風雨時用.el --- Nasy's emacs.d core file.  -*- lexical-binding: t; -*-
-(cl-eval-when (compile)
-  (add-to-list 'load-path (locate-user-emacs-file "桃夭/擊鼓"))
-  (add-to-list 'load-path (locate-user-emacs-file "桃夭/風雨"))
-  (require '擊鼓)
-  (require '風雨)
-
-  (require 'compile)
-  (require 'winner)
-
-  (sup 'avy t)
-  (sup 'expand-region t)
-  (sup 'flycheck t)
-  (sup 'org t)
-  (sup 'projectile t)
-  (sup 'smartparens t)
-  (sup 'treemacs t)
+(cl-eval-when (compile)
+  (add-to-list 'load-path (locate-user-emacs-file "桃夭/擊鼓"))
+  (add-to-list 'load-path (locate-user-emacs-file "桃夭/風雨"))
+  (require '擊鼓)
+  (require '風雨)
+
+  (require 'compile)
+  (require 'winner)
+
+  (sup 'apheleia t)
+  (sup 'avy t)
+  (sup 'expand-region t)
+  (sup 'flycheck t)
+  (sup 'nasy-emacs-ai t)
+  (sup 'org t)
+  (sup 'projectile t)
+  (sup 'smartparens t)
+  (sup 'treemacs t)
   (with-no-warnings
-    (setq vterm-always-compile-module t))
-  (sup 'vterm t)
-  (sup '(vterm-toggle :build (:not native-compile)) t)
-  (sup `(:local-repo ,(concat *nasy-site* "nasy/nasy-theme")
+    (setq vterm-always-compile-module t))
+  (sup 'vterm t)
+  (sup '(vterm-toggle :build (:not native-compile)) t)
+  (sup `(:local-repo ,(concat *nasy-site* "nasy/nasy-theme")
             :files ("彩.el"))
        t))
 
-
-
-
+
6.5.2.1.
+
-
(defvar nasy-file-sym-t '((".config/nasy-emacs" . ".emacs.d")))
+
(defvar nasy-file-sym-t '((".config/nasy-emacs" . ".emacs.d")))
 
-
-
函數
-
+
6.5.2.2. 函數
+
;;;###autoload
-(defun nasy/file-sym-t (file)
+(defun nasy/file-sym-t (file)
   "Trans true file name to symlink file name."
-  (cl-loop for (from . to) in nasy-file-sym-t
+  (cl-loop for (from . to) in nasy-file-sym-t
            do
-           (setq file (string-replace from to file))
+           (setq file (string-replace from to file))
            return file))
 
 
 ;;;###autoload
-(defun nasy/file-truename (file)
+(defun nasy/file-truename (file)
   "Get the true name of FILE."
-  (if (or (file-remote-p file nil t)
+  (if (or (file-remote-p file nil t)
           (not (file-remote-p file)))
       (file-truename file)
     file))
 
 
 ;;;###autoload
-(defun nasy/p-ignore-p (truename)
+(defun nasy/p-ignore-p (truename)
   "Determine whether ignore the `TRUENAME' file or not."
-  (or (string-match-p "nix/store" truename)
+  (or (string-match-p "nix/store" truename)
       nil))
 
 
 ;;;###autoload
-(defun nasy/unquote (exp)
+(defun nasy/unquote (exp)
   "Return EXP unquoted."
-  (declare (pure t) (side-effect-free t))
-  (while (memq (car-safe exp) '(quote function))
-    (setq exp (cadr exp)))
+  (declare (pure t) (side-effect-free t))
+  (while (memq (car-safe exp) '(quote function))
+    (setq exp (cadr exp)))
   exp)
 
 
 ;;;###autoload
-(defun posframe-poshandler-frame-top-center (info)
+(defun posframe-poshandler-frame-top-center (info)
   "Make posframe INFO top center."
   (cons (/ (- (plist-get info :parent-frame-width)
               (plist-get info :posframe-width))
@@ -3164,62 +3172,62 @@ 
函數
;;;###autoload -(defun nasy/wfw1 (&rest _) +(defun nasy/wfw1 (&rest _) "Widget forward 1." - (interactive) + (interactive) (widget-forward 1)) ;;;###autoload -(defun nasy/fw2 (&rest _) +(defun nasy/fw2 (&rest _) "Forward 2 chars." - (interactive "p") + (interactive "p") (forward-char 2)) ;;;###autoload -(defun nasy/閒置 () +(defun nasy/閒置 () "閒置 Emacs." - (interactive) + (interactive) (dashboard-refresh-buffer) (delete-other-windows)) ;;;###autoload -(defun nasy/-open-custom () +(defun nasy/-open-custom () "Open custom 芄蘭.el." - (interactive) + (interactive) (find-file (concat *nasy-custom* "芄蘭.el"))) ;;;###autoload -(defun nasy/-open-source-page () +(defun nasy/-open-source-page () "Open source page." - (interactive) + (interactive) (browse-url "https://github.com/nasyxx/emacs.d/")) ;;;###autoload -(defun nasy/-open-document () +(defun nasy/-open-document () "Open document." - (interactive) + (interactive) (browse-url "https://emacs.nasy.moe/")) ;;;###autoload -(defun nasy/clear-text-overlay () +(defun nasy/clear-text-overlay () "Clear text overlay." - (interactive) - (let ((inhibit-read-only t)) + (interactive) + (let ((inhibit-read-only t)) (set-text-properties (point-min) (point-max) nil))) ;;;###autoload -(defun nasy/up-directory (arg) +(defun nasy/up-directory (arg) "Move up a directory ARGth times." - (interactive "p") - (if minibuffer-completing-file-name - (if (string-match-p "/." (minibuffer-contents)) + (interactive "p") + (if minibuffer-completing-file-name + (if (string-match-p "/." (minibuffer-contents)) (zap-up-to-char (- arg) ?/) (delete-minibuffer-contents)) (backward-kill-word arg))) @@ -3227,46 +3235,45 @@
函數
-
-
重新加載 user-init-file 文件
-
+
6.5.2.3. 重新加載 user-init-file 文件
+
;;;###autoload
-(defun nasy/reload-init ()
+(defun nasy/reload-init ()
   "Reload init.el."
-  (interactive)
+  (interactive)
   (message "Reloading init.el...")
-  (load user-init-file nil 'nomessage)
+  (load user-init-file nil 'nomessage)
   (message "Reloading init.el... done."))
 
 
 ;;;###autoload
-(defun nasy/eval-buffer-or-region (&optional start end)
+(defun nasy/eval-buffer-or-region (&optional start end)
   "Evaluate the current region, or the whole buffer if no region is active.
 In Lisp code, START and END denote the region to be evaluated;
 they default to `point-min' and `point-max' respectively.
 If evaluating a buffer visiting this file, then delegate instead
 to `nasy/reload-init'."
-  (interactive)
-  (if (and buffer-file-name
+  (interactive)
+  (if (and buffer-file-name
            (member (file-truename buffer-file-name)
                    (list
-                    (when (bound-and-true-p early-init-file)
+                    (when (bound-and-true-p early-init-file)
                       (file-truename early-init-file))
                     (file-truename user-init-file)))
            (not (region-active-p)))
       (nasy/reload-init)
-    (let ((name nil))
-      (if (region-active-p)
-          (progn
-            (setq start (region-beginning))
-            (setq end (region-end))
-            (setq name "region"))
-        (setq start (point-min))
-        (setq end (point-max))
-        (setq name (buffer-name)))
-      (let ((load-file-name (buffer-file-name)))
+    (let ((name nil))
+      (if (region-active-p)
+          (progn
+            (setq start (region-beginning))
+            (setq end (region-end))
+            (setq name "region"))
+        (setq start (point-min))
+        (setq end (point-max))
+        (setq name (buffer-name)))
+      (let ((load-file-name (buffer-file-name)))
         (message "Evaluating %s..." name)
         (eval-region start end)
         (message "Evaluating %s...done" name)))))
@@ -3274,34 +3281,32 @@ 
重新加載 user-init-file<
-
-
臿入時間
-
+
6.5.2.4. 臿入時間
+
;;;###autoload
-(defun nasy/insert-current-date ()
+(defun nasy/insert-current-date ()
   "Insert current date."
-  (interactive)
+  (interactive)
   (insert (shell-command-to-string "echo -n $(date +'%b %d, %Y')")))
 
 ;;;###autoload
-(defun nasy/insert-current-filename ()
+(defun nasy/insert-current-filename ()
   "Insert current buffer filename."
-  (interactive)
+  (interactive)
   (insert (file-relative-name buffer-file-name)))
 
-
-
buffer 相關
-
+
6.5.2.5. buffer 相關
+
;;;###autoload
-(defvar nasy/real-buffer-functions
-  '(nasy/dired-buffer-p)
+(defvar nasy/real-buffer-functions
+  '(nasy/dired-buffer-p)
   "A list of predicate functions run to determine if a buffer is real, unlike
 `nasy/unreal-buffer-functions'. They are passed one argument: the buffer to be
 tested.
@@ -3310,8 +3315,8 @@ 
buffer 相關
See `nasy/real-buffer-p' for more information.") ;;;###autoload -(defvar nasy/unreal-buffer-functions - '(minibufferp nasy/special-buffer-p nasy/non-file-visiting-buffer-p) +(defvar nasy/unreal-buffer-functions + '(minibufferp nasy/special-buffer-p nasy/non-file-visiting-buffer-p) "A list of predicate functions run to determine if a buffer is *not* real, unlike `nasy/real-buffer-functions'. They are passed one argument: the buffer to be tested. @@ -3320,12 +3325,12 @@
buffer 相關
See `nasy/real-buffer-p' for more information.") ;;;###autoload -(defvar-local nasy/real-buffer-p nil +(defvar-local nasy/real-buffer-p nil "If non-nil, this buffer should be considered real no matter what. See `nasy/real-buffer-p' for more information.") ;;;###autoload -(defvar nasy/fallback-buffer-name "*scratch*" +(defvar nasy/fallback-buffer-name "*scratch*" "The name of the buffer to fall back to if no other buffers exist (will create it if it doesn't exist).") @@ -3334,95 +3339,95 @@
buffer 相關
;; Functions ;;;###autoload -(defun nasy/buffer-frame-predicate (buf) +(defun nasy/buffer-frame-predicate (buf) "To be used as the default frame buffer-predicate parameter. Returns nil if BUF should be skipped over by functions like `next-buffer' and `other-buffer'." - (or (nasy/real-buffer-p buf) + (or (nasy/real-buffer-p buf) (eq buf (nasy/fallback-buffer)))) ;;;###autoload -(defun nasy/fallback-buffer () +(defun nasy/fallback-buffer () "Returns the fallback buffer, creating it if necessary. By default this is the scratch buffer. See `nasy/fallback-buffer-name' to change this." - (let (buffer-list-update-hook) + (let (buffer-list-update-hook) (get-buffer-create nasy/fallback-buffer-name))) ;;;###autoload -(defalias 'nasy/buffer-list #'buffer-list) +(defalias 'nasy/buffer-list #'buffer-list) ;;;###autoload -(defun nasy/project-root (&optional dir) +(defun nasy/project-root (&optional dir) "Return the project root of DIR (defaults to `default-directory'). Returns nil if not in a project." - (let ((projectile-project-root - (unless dir (bound-and-true-p projectile-project-root))) + (let ((projectile-project-root + (unless dir (bound-and-true-p projectile-project-root))) projectile-require-project-root) (projectile-project-root dir))) ;;;###autoload -(defun nasy/project-buffer-list (&optional project) +(defun nasy/project-buffer-list (&optional project) "Return a list of buffers belonging to the specified PROJECT. If PROJECT is nil, default to the current project. If no project is active, return all buffers." - (let ((buffers (nasy/buffer-list))) - (if-let* ((project-root - (if project (expand-file-name project) + (let ((buffers (nasy/buffer-list))) + (if-let* ((project-root + (if project (expand-file-name project) (nasy/project-root)))) - (cl-loop for buf in buffers + (cl-loop for buf in buffers if (projectile-project-buffer-p buf project-root) collect buf) buffers))) ;;;###autoload -(defun nasy/open-projects () +(defun nasy/open-projects () "Return a list of projects with open buffers." - (cl-loop with projects = (make-hash-table :test 'equal :size 8) + (cl-loop with projects = (make-hash-table :test 'equal :size 8) for buffer in (nasy/buffer-list) if (buffer-live-p buffer) if (nasy/real-buffer-p buffer) - if (with-current-buffer buffer (nasy/project-root)) + if (with-current-buffer buffer (nasy/project-root)) do (puthash (abbreviate-file-name it) t projects) finally return (hash-table-keys projects))) ;;;###autoload -(defun nasy/dired-buffer-p (buf) +(defun nasy/dired-buffer-p (buf) "Returns non-nil if BUF is a dired buffer." - (with-current-buffer buf (derived-mode-p 'dired-mode))) + (with-current-buffer buf (derived-mode-p 'dired-mode))) ;;;###autoload -(defun nasy/special-buffer-p (buf) +(defun nasy/special-buffer-p (buf) "Returns non-nil if BUF's name starts and ends with an *." (equal (substring (buffer-name buf) 0 1) "*")) ;;;###autoload -(defun nasy/temp-buffer-p (buf) +(defun nasy/temp-buffer-p (buf) "Returns non-nil if BUF is temporary." (equal (substring (buffer-name buf) 0 1) " ")) ;;;###autoload -(defun nasy/visible-buffer-p (buf) +(defun nasy/visible-buffer-p (buf) "Return non-nil if BUF is visible." (get-buffer-window buf)) ;;;###autoload -(defun nasy/buried-buffer-p (buf) +(defun nasy/buried-buffer-p (buf) "Return non-nil if BUF is not visible." (not (nasy/visible-buffer-p buf))) ;;;###autoload -(defun nasy/non-file-visiting-buffer-p (buf) +(defun nasy/non-file-visiting-buffer-p (buf) "Returns non-nil if BUF does not have a value for `buffer-file-name'." (not (buffer-file-name buf))) ;;;###autoload -(defun nasy/real-buffer-list (&optional buffer-list) +(defun nasy/real-buffer-list (&optional buffer-list) "Return a list of buffers that satify `nasy/real-buffer-p'." - (cl-remove-if-not #'nasy/real-buffer-p (or buffer-list (nasy/buffer-list)))) + (cl-remove-if-not #'nasy/real-buffer-p (or buffer-list (nasy/buffer-list)))) ;;;###autoload -(defun nasy/real-buffer-p (buffer-or-name) +(defun nasy/real-buffer-p (buffer-or-name) "Returns t if BUFFER-OR-NAME is a =real= buffer. A real buffer is a useful buffer; a first class citizen in Doom. Real ones should get special treatment, because we will be spending most of our time in @@ -3435,112 +3440,112 @@
buffer 相關
3. None of the functions in `nasy/unreal-buffer-functions' must return non-nil. If BUFFER-OR-NAME is omitted or nil, the current buffer is tested." - (or (bufferp buffer-or-name) + (or (bufferp buffer-or-name) (stringp buffer-or-name) - (signal 'wrong-type-argument (list '(bufferp stringp) buffer-or-name))) - (when-let (buf (get-buffer buffer-or-name)) - (and (buffer-live-p buf) + (signal 'wrong-type-argument (list '(bufferp stringp) buffer-or-name))) + (when-let (buf (get-buffer buffer-or-name)) + (and (buffer-live-p buf) (not (nasy/temp-buffer-p buf)) - (or (buffer-local-value 'nasy/real-buffer-p buf) - (run-hook-with-args-until-success 'nasy/real-buffer-functions buf) - (not (run-hook-with-args-until-success 'nasy/unreal-buffer-functions buf)))))) + (or (buffer-local-value 'nasy/real-buffer-p buf) + (run-hook-with-args-until-success 'nasy/real-buffer-functions buf) + (not (run-hook-with-args-until-success 'nasy/unreal-buffer-functions buf)))))) ;;;###autoload -(defun nasy/unreal-buffer-p (buffer-or-name) +(defun nasy/unreal-buffer-p (buffer-or-name) "Return t if BUFFER-OR-NAME is an =unreal= buffer. See `nasy/real-buffer-p' for details on what that means." (not (nasy/real-buffer-p buffer-or-name))) ;;;###autoload -(defun nasy/buffers-in-mode (modes &optional buffer-list derived-p) +(defun nasy/buffers-in-mode (modes &optional buffer-list derived-p) "Return a list of buffers whose `major-mode' is `eq' to MODE(S). If DERIVED-P, test with `derived-mode-p', otherwise use `eq'." - (let ((modes (nasy/enlist modes))) - (cl-remove-if-not (if derived-p - (lambda (buf) - (with-current-buffer buf - (apply #'derived-mode-p modes))) - (lambda (buf) - (memq (buffer-local-value 'major-mode buf) modes))) - (or buffer-list (nasy/buffer-list))))) + (let ((modes (nasy/enlist modes))) + (cl-remove-if-not (if derived-p + (lambda (buf) + (with-current-buffer buf + (apply #'derived-mode-p modes))) + (lambda (buf) + (memq (buffer-local-value 'major-mode buf) modes))) + (or buffer-list (nasy/buffer-list))))) ;;;###autoload -(defun nasy/visible-windows (&optional window-list) +(defun nasy/visible-windows (&optional window-list) "Return a list of the visible, non-popup (dedicated) windows." - (cl-loop for window in (or window-list (window-list)) - when (or (window-parameter window 'visible) + (cl-loop for window in (or window-list (window-list)) + when (or (window-parameter window 'visible) (not (window-dedicated-p window))) collect window)) ;;;###autoload -(defun nasy/visible-buffers (&optional buffer-list) +(defun nasy/visible-buffers (&optional buffer-list) "Return a list of visible buffers (i.e. not buried)." - (if buffer-list - (cl-remove-if-not #'get-buffer-window buffer-list) - (delete-dups (mapcar #'window-buffer (window-list))))) + (if buffer-list + (cl-remove-if-not #'get-buffer-window buffer-list) + (delete-dups (mapcar #'window-buffer (window-list))))) ;;;###autoload -(defun nasy/buried-buffers (&optional buffer-list) +(defun nasy/buried-buffers (&optional buffer-list) "Get a list of buffers that are buried." - (cl-remove-if #'get-buffer-window (or buffer-list (nasy/buffer-list)))) + (cl-remove-if #'get-buffer-window (or buffer-list (nasy/buffer-list)))) ;;;###autoload -(defun nasy/matching-buffers (pattern &optional buffer-list) +(defun nasy/matching-buffers (pattern &optional buffer-list) "Get a list of all buffers that match the regex PATTERN." - (cl-loop for buf in (or buffer-list (nasy/buffer-list)) + (cl-loop for buf in (or buffer-list (nasy/buffer-list)) when (string-match-p pattern (buffer-name buf)) collect buf)) ;;;###autoload -(defun nasy/set-buffer-real (buffer flag) +(defun nasy/set-buffer-real (buffer flag) "Forcibly mark BUFFER as FLAG (non-nil = real)." - (with-current-buffer buffer - (setq nasy/real-buffer-p flag))) + (with-current-buffer buffer + (setq nasy/real-buffer-p flag))) ;;;###autoload -(defun nasy/kill-buffer-and-windows (buffer) +(defun nasy/kill-buffer-and-windows (buffer) "Kill the buffer and delete all the windows it's displayed in." - (dolist (window (get-buffer-window-list buffer)) - (unless (one-window-p t) + (dolist (window (get-buffer-window-list buffer)) + (unless (one-window-p t) (delete-window window))) (kill-buffer buffer)) ;;;###autoload -(defun nasy/fixup-windows (windows) +(defun nasy/fixup-windows (windows) "Ensure that each of WINDOWS is showing a real buffer or the fallback buffer." - (dolist (window windows) - (with-selected-window window - (when (nasy/unreal-buffer-p (window-buffer)) + (dolist (window windows) + (with-selected-window window + (when (nasy/unreal-buffer-p (window-buffer)) (previous-buffer) - (when (nasy/unreal-buffer-p (window-buffer)) + (when (nasy/unreal-buffer-p (window-buffer)) (switch-to-buffer (nasy/fallback-buffer))))))) ;;;###autoload -(defun nasy/kill-buffer-fixup-windows (buffer) +(defun nasy/kill-buffer-fixup-windows (buffer) "Kill the BUFFER and ensure all the windows it was displayed in have switched to a real buffer or the fallback buffer." - (let ((windows (get-buffer-window-list buffer))) + (let ((windows (get-buffer-window-list buffer))) (kill-buffer buffer) - (nasy/fixup-windows (cl-remove-if-not #'window-live-p windows)))) + (nasy/fixup-windows (cl-remove-if-not #'window-live-p windows)))) ;;;###autoload -(defun nasy/kill-buffers-fixup-windows (buffers) +(defun nasy/kill-buffers-fixup-windows (buffers) "Kill the BUFFERS and ensure all the windows they were displayed in have switched to a real buffer or the fallback buffer." - (let ((seen-windows (make-hash-table :test 'eq :size 8))) - (dolist (buffer buffers) - (let ((windows (get-buffer-window-list buffer))) + (let ((seen-windows (make-hash-table :test 'eq :size 8))) + (dolist (buffer buffers) + (let ((windows (get-buffer-window-list buffer))) (kill-buffer buffer) - (dolist (window (cl-remove-if-not #'window-live-p windows)) + (dolist (window (cl-remove-if-not #'window-live-p windows)) (puthash window t seen-windows)))) (nasy/fixup-windows (hash-table-keys seen-windows)))) ;;;###autoload -(defun nasy/-kill-matching-buffers (pattern &optional buffer-list) +(defun nasy/-kill-matching-buffers (pattern &optional buffer-list) "Kill all buffers (in current workspace OR in BUFFER-LIST) that match the regex PATTERN. Returns the number of killed buffers." - (let ((buffers (nasy/matching-buffers pattern buffer-list))) - (dolist (buf buffers (length buffers)) + (let ((buffers (nasy/matching-buffers pattern buffer-list))) + (dolist (buf buffers (length buffers)) (kill-buffer buf)))) @@ -3548,7 +3553,7 @@
buffer 相關
;; Hooks ;;;###autoload -(defun nasy/mark-buffer-as-real-h () +(defun nasy/mark-buffer-as-real-h () "Hook function that marks the current buffer as real." (nasy/set-buffer-real (current-buffer) t)) @@ -3557,245 +3562,243 @@
buffer 相關
;; Interactive commands ;;;###autoload -(defun nasy/kill-this-buffer-in-all-windows (buffer &optional dont-save) +(defun nasy/kill-this-buffer-in-all-windows (buffer &optional dont-save) "Kill BUFFER globally and ensure all windows previously showing this buffer have switched to a real buffer or the fallback buffer. If DONT-SAVE, don't prompt to save modified buffers (discarding their changes)." - (interactive + (interactive (list (current-buffer) current-prefix-arg)) (cl-assert (bufferp buffer) t) - (when (and (buffer-modified-p buffer) dont-save) - (with-current-buffer buffer + (when (and (buffer-modified-p buffer) dont-save) + (with-current-buffer buffer (set-buffer-modified-p nil))) (nasy/kill-buffer-fixup-windows buffer)) -(defun nasy/message-or-count (interactive message count) - (if interactive +(defun nasy/message-or-count (interactive message count) + (if interactive (message message count) count)) ;;;###autoload -(defun nasy/kill-all-buffers (&optional buffer-list interactive) +(defun nasy/kill-all-buffers (&optional buffer-list interactive) "Kill all buffers and closes their windows. If the prefix arg is passed, doesn't close windows and only kill buffers that belong to the current project." - (interactive - (list (if current-prefix-arg + (interactive + (list (if current-prefix-arg (nasy/project-buffer-list) (nasy/buffer-list)) t)) - (if (null buffer-list) + (if (null buffer-list) (message "No buffers to kill") (save-some-buffers) (delete-other-windows) - (when (memq (current-buffer) buffer-list) + (when (memq (current-buffer) buffer-list) (switch-to-buffer (nasy/fallback-buffer))) - (mapc #'kill-buffer buffer-list) + (mapc #'kill-buffer buffer-list) (nasy/message-or-count interactive "Killed %d buffers" (- (length buffer-list) - (length (cl-remove-if-not #'buffer-live-p buffer-list)))))) + (length (cl-remove-if-not #'buffer-live-p buffer-list)))))) ;;;###autoload -(defun nasy/kill-other-buffers (&optional buffer-list interactive) +(defun nasy/kill-other-buffers (&optional buffer-list interactive) "Kill all other buffers (besides the current one). If the prefix arg is passed, kill only buffers that belong to the current project." - (interactive + (interactive (list (delq (current-buffer) - (if current-prefix-arg + (if current-prefix-arg (nasy/project-buffer-list) (nasy/buffer-list))) t)) - (mapc #'nasy/kill-buffer-and-windows buffer-list) + (mapc #'nasy/kill-buffer-and-windows buffer-list) (nasy/message-or-count interactive "Killed %d other buffers" (- (length buffer-list) - (length (cl-remove-if-not #'buffer-live-p buffer-list))))) + (length (cl-remove-if-not #'buffer-live-p buffer-list))))) ;;;###autoload -(defun nasy/kill-matching-buffers (pattern &optional buffer-list interactive) +(defun nasy/kill-matching-buffers (pattern &optional buffer-list interactive) "Kill buffers that match PATTERN in BUFFER-LIST. If the prefix arg is passed, only kill matching buffers in the current project." - (interactive + (interactive (list (read-regexp "Buffer pattern: ") - (if current-prefix-arg + (if current-prefix-arg (nasy/project-buffer-list) (nasy/buffer-list)) t)) (nasy/-kill-matching-buffers pattern buffer-list) - (when interactive + (when interactive (message "Killed %d buffer(s)" (- (length buffer-list) - (length (cl-remove-if-not #'buffer-live-p buffer-list)))))) + (length (cl-remove-if-not #'buffer-live-p buffer-list)))))) ;;;###autoload -(defun nasy/kill-buried-buffers (&optional buffer-list interactive) +(defun nasy/kill-buried-buffers (&optional buffer-list interactive) "Kill buffers that are buried. If PROJECT-P (universal argument), only kill buried buffers belonging to the current project." - (interactive + (interactive (list (nasy/buried-buffers - (if current-prefix-arg (nasy/project-buffer-list))) + (if current-prefix-arg (nasy/project-buffer-list))) t)) - (mapc #'kill-buffer buffer-list) + (mapc #'kill-buffer buffer-list) (nasy/message-or-count interactive "Killed %d buried buffers" (- (length buffer-list) - (length (cl-remove-if-not #'buffer-live-p buffer-list))))) + (length (cl-remove-if-not #'buffer-live-p buffer-list))))) ;;;###autoload -(defun nasy/kill-project-buffers (project &optional interactive) +(defun nasy/kill-project-buffers (project &optional interactive) "Kill buffers for the specified PROJECT." - (interactive - (list (if-let (open-projects (nasy/open-projects)) + (interactive + (list (if-let (open-projects (nasy/open-projects)) (completing-read "Kill buffers for project: " open-projects nil t nil nil - (if-let* ((project-root (nasy/project-root)) + (if-let* ((project-root (nasy/project-root)) (project-root (abbreviate-file-name project-root)) ((member project-root open-projects))) project-root)) (message "No projects are open!") nil) t)) - (when project - (let ((buffer-list (nasy/project-buffer-list project))) + (when project + (let ((buffer-list (nasy/project-buffer-list project))) (nasy/kill-buffers-fixup-windows buffer-list) (nasy/message-or-count interactive "Killed %d project buffers" (- (length buffer-list) - (length (cl-remove-if-not #'buffer-live-p buffer-list))))))) + (length (cl-remove-if-not #'buffer-live-p buffer-list))))))) ;;;###autoload -(defun nasy/kill-buffers-no-company-box () +(defun nasy/kill-buffers-no-company-box () "Kill all buffers except company box buffers." - (interactive) + (interactive) (nasy/kill-all-buffers - (cl-loop for buffer in (nasy/buffer-list) + (cl-loop for buffer in (nasy/buffer-list) when (not (string-match-p "company-box" (buffer-name buffer))) collect buffer))) ;;;###autoload -(defun nasy/scratch () +(defun nasy/scratch () "Switch buffer to scratch." - (interactive) + (interactive) (switch-to-buffer "*scratch*"))
-
-
布局相關
-
+
6.5.2.6. 布局相關
+
;; When splitting window, show (other-buffer) in the new window
-(defun split-window-func-with-other-buffer (split-function)
+(defun split-window-func-with-other-buffer (split-function)
   "Split window with `SPLIT-FUNCTION'."
-  (lambda (&optional arg)
+  (lambda (&optional arg)
     "Split this window and switch to the new window unless ARG is provided."
-    (interactive "P")
+    (interactive "P")
     (funcall split-function)
-    (let ((target-window (next-window)))
+    (let ((target-window (next-window)))
       (set-window-buffer target-window (other-buffer))
-      (unless arg
+      (unless arg
         (select-window target-window)))))
 
-(defun split-window--v ()
+(defun split-window--v ()
   "Split window vertically."
-  (interactive)
-  (split-window-func-with-other-buffer 'split-window-vertically))
+  (interactive)
+  (split-window-func-with-other-buffer 'split-window-vertically))
 
-(defun split-window--h ()
+(defun split-window--h ()
   "Split window horizontcally."
-  (interactive)
-  (split-window-func-with-other-buffer 'split-window-horizontally))
+  (interactive)
+  (split-window-func-with-other-buffer 'split-window-horizontally))
 
-(defun toggle-delete-other-windows ()
+(defun toggle-delete-other-windows ()
   "Delete other windows in frame if any, or restore previous window config."
-  (interactive)
-  (if (and winner-mode
+  (interactive)
+  (if (and winner-mode
            (equal (selected-window) (next-window)))
       (winner-undo)
     (delete-other-windows)))
 
-(defun split-window-horizontally-instead ()
+(defun split-window-horizontally-instead ()
   "Kill any other windows and re-split such that the current window is on the top half of the frame."
-  (interactive)
-  (let ((other-buffer (and (next-window) (window-buffer (next-window)))))
+  (interactive)
+  (let ((other-buffer (and (next-window) (window-buffer (next-window)))))
     (delete-other-windows)
     (split-window-horizontally)
-    (when other-buffer
+    (when other-buffer
       (set-window-buffer (next-window) other-buffer))))
 
-(defun split-window-vertically-instead ()
+(defun split-window-vertically-instead ()
   "Kill any other windows and re-split such that the current window is on the left half of the frame."
-  (interactive)
-  (let ((other-buffer (and (next-window) (window-buffer (next-window)))))
+  (interactive)
+  (let ((other-buffer (and (next-window) (window-buffer (next-window)))))
     (delete-other-windows)
     (split-window-vertically)
-    (when other-buffer
+    (when other-buffer
       (set-window-buffer (next-window) other-buffer))))
 
   ;; Borrowed from http://postmomentum.ch/blog/201304/blog-on-emacs
-(defun nasy/split-window()
+(defun nasy/split-window()
   "Split the window to see the most recent buffer in the other window.
   Call a second time to restore the original window configuration."
-  (interactive)
-  (if (eq last-command 'nasy-split-window)
-      (progn
+  (interactive)
+  (if (eq last-command 'nasy-split-window)
+      (progn
         (jump-to-register :nasy-split-window)
-        (setq this-command 'nasy-unsplit-window))
+        (setq this-command 'nasy-unsplit-window))
     (window-configuration-to-register :nasy/split-window)
     (switch-to-buffer-other-window nil)))
 
-
-
文字處理
-
+
6.5.2.7. 文字處理
+
;;;###autoload
-(defun nasy/delete-backward-word (arg)
+(defun nasy/delete-backward-word (arg)
   "Like `backward-kill-word', but doesn't affect the kill-ring."
-  (interactive "p")
-  (let (kill-ring)
+  (interactive "p")
+  (let (kill-ring)
     (backward-kill-word arg)))
 
 ;;;###autoload
-(defun nasy/region-active-p ()
+(defun nasy/region-active-p ()
   "Return non-nil if selection is active."
-  (declare (side-effect-free t))
+  (declare (side-effect-free t))
   (use-region-p))
 
 ;;;###autoload
-(defun nasy/region-beginning ()
+(defun nasy/region-beginning ()
   "Return beginning position of selection."
-  (declare (side-effect-free t))
+  (declare (side-effect-free t))
   (region-beginning))
 
 ;;;###autoload
-(defun nasy/region-end ()
+(defun nasy/region-end ()
   "Return end position of selection."
-  (declare (side-effect-free t))
+  (declare (side-effect-free t))
   (region-end))
 
 ;;;###autoload
-(defun nasy/thing-at-point-or-region (&optional thing prompt)
+(defun nasy/thing-at-point-or-region (&optional thing prompt)
   "Grab the current selection, THING at point, or xref identifier at point.
 Returns THING if it is a string. Otherwise, if nothing is found at point and
 PROMPT is non-nil, prompt for a string (if PROMPT is a string it'll be used as
 the prompting string). Returns nil if all else fails.
 NOTE: Don't use THING for grabbing symbol-at-point. The xref fallback is smarter
 in some cases."
-  (declare (side-effect-free t))
-  (cond ((stringp thing)
+  (declare (side-effect-free t))
+  (cond ((stringp thing)
          thing)
         ((nasy/region-active-p)
          (buffer-substring-no-properties
@@ -3803,67 +3806,67 @@ 
文字處理
(nasy/region-end))) (thing (thing-at-point thing t)) - ((require 'xref nil t) + ((require 'xref nil t) ;; A little smarter than using `symbol-at-point', though in most cases, ;; xref ends up using `symbol-at-point' anyway. (xref-backend-identifier-at-point (xref-find-backend))) (prompt - (read-string (if (stringp prompt) prompt ""))))) + (read-string (if (stringp prompt) prompt ""))))) ;;;###autoload -(defalias 'default/newline #'newline) +(defalias 'default/newline #'newline) ;;;###autoload -(defun default/newline-above () +(defun default/newline-above () "Insert an indented new line before the current one." - (interactive) + (interactive) (beginning-of-line) - (save-excursion (newline)) + (save-excursion (newline)) (indent-according-to-mode)) ;;;###autoload -(defun default/newline-below () +(defun default/newline-below () "Insert an indented new line after the current one." - (interactive) + (interactive) (end-of-line) (newline-and-indent)) ;;;###autoload -(defun default/yank-pop () +(defun default/yank-pop () "Interactively select what text to insert from the kill ring." - (interactive) + (interactive) (call-interactively - (cond ((fboundp 'counsel-yank-pop) #'counsel-yank-pop) - ((fboundp 'helm-show-kill-ring) #'helm-show-kill-ring) + (cond ((fboundp 'counsel-yank-pop) #'counsel-yank-pop) + ((fboundp 'helm-show-kill-ring) #'helm-show-kill-ring) ((error "No kill-ring search backend available. Enable ivy or helm!"))))) ;;;###autoload -(defun default/yank-buffer-filename () +(defun default/yank-buffer-filename () "Copy the current buffer's path to the kill ring." - (interactive) - (if-let* ((filename (or buffer-file-name (bound-and-true-p list-buffers-directory)))) + (interactive) + (if-let* ((filename (or buffer-file-name (bound-and-true-p list-buffers-directory)))) (message (kill-new (abbreviate-file-name filename))) (error "Couldn't find filename in current buffer"))) ;;;###autoload -(defun default/insert-file-path (arg) +(defun default/insert-file-path (arg) "Insert the file name (absolute path if prefix ARG). If `buffer-file-name' isn't set, uses `default-directory'." - (interactive "P") - (let ((path (or buffer-file-name default-directory))) + (interactive "P") + (let ((path (or buffer-file-name default-directory))) (insert - (if arg + (if arg (abbreviate-file-name path) (file-name-nondirectory path))))) ;;;###autoload -(defun default/newline-indent-and-continue-comments-a () +(defun default/newline-indent-and-continue-comments-a () "A replacement for `newline-and-indent'. Continues comments if executed from a commented line, with special support for languages with weak native comment continuation support (like C-family languages)." - (interactive) - (if (and (sp-point-in-comment) + (interactive) + (if (and (sp-point-in-comment) comment-line-break-function) (funcall comment-line-break-function nil) (delete-horizontal-space t) @@ -3871,116 +3874,118 @@
文字處理
(indent-according-to-mode))) -(defun nasy/insert-zero-width-space () +(defun nasy/insert-zero-width-space () "Insert a zero width space \u200b." - (interactive) + (interactive) (insert "\u200b"))
-
-
挈壺   benchmark
-
+
6.5.2.8. 挈壺   benchmark
+
-
(defmacro nasy/timer (&rest body)
+
(defmacro nasy/timer (&rest body)
   "Measure and return the time it takes evaluating BODY."
-  `(let ((time (current-time)))
+  `(let ((time (current-time)))
      ,@body
      (float-time (time-since time))))
 
-
-
模式
-
+
6.5.2.9. 模式
+
-
激活區域
-
+
6.5.2.9.1. 激活區域
+
-
(defvar nasy/active-region--on nil)
+
(defvar nasy/active-region--on nil)
 
-(defun nasy/on--active-region ()
+(defun nasy/on--active-region ()
   (nasy/active-region--mode 1))
 
-(defun nasy/off--active-region ()
+(defun nasy/off--active-region ()
   (nasy/active-region--mode -1))
 
-(defvar nasy/active-region-map (make-sparse-keymap))
+(defvar nasy/active-region-map (make-sparse-keymap))
 
 
 ;;;###autoload
-(define-minor-mode nasy/active-region--mode
+(define-minor-mode nasy/active-region--mode
   "Actized region or not."
   :keymap nasy/active-region-map)
 
 
 ;;;###autoload
-(define-minor-mode nasy/active-region-mode
+(define-minor-mode nasy/active-region-mode
   "Actived region or not."
   :lighter "n/ar"
-  (if nasy/active-region-mode
-      (progn
+  (if nasy/active-region-mode
+      (progn
         (nasy/off--active-region)
-        (add-hook 'activate-mark-hook   #'nasy/on--active-region)
-        (add-hook 'deactivate-mark-hook #'nasy/off--active-region))
-    (remove-hook 'activate-mark-hook   #'nasy/on--active-region)
-    (remove-hook 'deactivate-mark-hook #'nasy/off--active-region)
+        (add-hook 'activate-mark-hook   #'nasy/on--active-region)
+        (add-hook 'deactivate-mark-hook #'nasy/off--active-region))
+    (remove-hook 'activate-mark-hook   #'nasy/on--active-region)
+    (remove-hook 'deactivate-mark-hook #'nasy/off--active-region)
     (nasy/off--active-region)))
 
-
-
快捷鍵
-
+
6.5.2.9.2. 快捷鍵
+
-
(defun nasy/-set-key-map ()
+
(defun nasy/-set-key-map ()
   "Nasy Set keymap for config."
-  (define-key global-map (kbd "s-SPC") #'nasy/insert-zero-width-space))
+  (define-key global-map (kbd "s-SPC") #'nasy/insert-zero-width-space))
 
 
-(defun nasy/-unset-key-map ()
+(defun nasy/-unset-key-map ()
   "Nasy Unet keymap for config."
   (define-key global-map (kbd "s-SPC") nil))
 
 
-(defun nasy/-keymap ()
+(defun nasy/-keymap ()
   "Define nasy key map."
   (define-keymap :parent mode-specific-map
-    "c"     (define-keymap :prefix 'nasy-code-map
-              "c" #'compile
-              "C" #'recompile
-              "t" #'vterm-toggle
-              "x" #'flycheck-list-errors)
-    "e"     (define-keymap :prefix 'nasy-edit-map
-              "a"   #'avy-goto-char
-              "c"   #'comment-line
-              "e"   #'er/expand-region
-              "SPC" #'nasy/insert-zero-width-space)
-    "t"     (define-keymap :prefix 'nasy-treemacs-map
-              "t" #'treemacs
-              "1" #'treemacs-delete-other-windows
-              "B" #'treemacs-bookmark
-              "f" #'treemacs-find-file)
-    "o"     (define-keymap :prefix 'nasy-org-map
-              "b" #'org-tree-to-indirect-buffer)
-    "y"     (define-keymap :prefix 'nasy-yas-map
-              "n" #'yas-new-snippet)))
-
-
-(define-minor-mode nasy-keybinding-mode
+    "a"     (define-keymap :prefix 'nasy-ai-map
+              "r" #'org-ai-talk-capture-in-org
+              "Z" #'nasy-ai-tozh-at-point
+              "z" #'nasy-ai-tozh)
+    "c"     (define-keymap :prefix 'nasy-code-map
+              "c" #'compile
+              "C" #'recompile
+              "t" #'vterm-toggle
+              "x" #'flycheck-list-errors
+              "f" #'apheleia-format-buffer)
+    "e"     (define-keymap :prefix 'nasy-edit-map
+              "a"   #'avy-goto-char
+              "c"   #'comment-line
+              "e"   #'er/expand-region
+              "SPC" #'nasy/insert-zero-width-space)
+    "t"     (define-keymap :prefix 'nasy-treemacs-map
+              "t" #'treemacs
+              "1" #'treemacs-delete-other-windows
+              "B" #'treemacs-bookmark
+              "f" #'treemacs-find-file)
+    "o"     (define-keymap :prefix 'nasy-org-map
+              "b" #'org-tree-to-indirect-buffer)
+    "y"     (define-keymap :prefix 'nasy-yas-map
+              "n" #'yas-new-snippet)))
+
+
+(define-minor-mode nasy-keybinding-mode
   "Nasy Keybinding Mode."
   :init-value nil
   :lighter "n/k"
-  (if nasy-keybinding-mode
-      (progn
-        (let ((keymap (nasy/-keymap)))
+  (if nasy-keybinding-mode
+      (progn
+        (let ((keymap (nasy/-keymap)))
           (define-key global-map "\C-c" keymap))
 
         (nasy/-set-key-map))
@@ -3989,7 +3994,7 @@ 
快捷鍵
(nasy/-unset-key-map))) -(setup nasy-keybinding +(setup nasy-keybinding (:hook-into nasy-org-first-key-hook prog-mode-hook text-mode-hook)) @@ -3997,39 +4002,38 @@
快捷鍵
-
-
光影
-
+
6.5.2.9.3. 光影
+
-
(defun beacon--shine-b ()
+
(defun beacon--shine-b ()
   "Shine a beacon at point."
-  (let ((colors (beacon--color-range)))
-    (save-excursion
+  (let ((colors (beacon--color-range)))
+    (save-excursion
       ;; (backward-char 1)
-      (while colors
-        (if (looking-at "^")
-            (setq colors nil)
-          (beacon--colored-overlay (pop colors))
+      (while colors
+        (if (looking-at "^")
+            (setq colors nil)
+          (beacon--colored-overlay (pop colors))
           (backward-char 1))))))
 
 
-(defun nasy/beacon-blink (&rest _)
+(defun nasy/beacon-blink (&rest _)
   "Blink the beacon at the position of the cursor."
-  (interactive)
+  (interactive)
   (beacon--vanish)
-  (run-hooks 'beacon-before-blink-hook)
+  (run-hooks 'beacon-before-blink-hook)
   (beacon--shine-b)
-  (when (timerp beacon--timer)
+  (when (timerp beacon--timer)
     (cancel-timer beacon--timer))
-  (setq beacon--timer
+  (setq beacon--timer
         (run-at-time beacon-blink-delay
                      (/ beacon-blink-duration 1.0 beacon-size)
-                     #'beacon--dec)))
+                     #'beacon--dec)))
 
 
-(defun nasy/blink ()
-  (cond ((member this-command '(left-char
+(defun nasy/blink ()
+  (cond ((member this-command '(left-char
                                 backward-char
                                 backward-word
                                 delete-char
@@ -4042,7 +4046,7 @@ 
光影
org-delete-backward-char org-metaleft)) (beacon-blink)) - ((member this-command '(right-char + ((member this-command '(right-char forward-char forward-word self-insert-command @@ -4053,14 +4057,14 @@
光影
org-metaright)) (nasy/beacon-blink)))) -(define-minor-mode nasy-beacon-cursor-mode +(define-minor-mode nasy-beacon-cursor-mode "Nasy beacon on moving cursor." :lighter "n/bc" :global t - :group 'nasy - (if nasy-beacon-cursor-mode - (add-hook 'pre-command-hook #'nasy/blink) - (remove-hook 'pre-command-hook #'nasy/blink))) + :group 'nasy + (if nasy-beacon-cursor-mode + (add-hook 'pre-command-hook #'nasy/blink) + (remove-hook 'pre-command-hook #'nasy/blink))) (nasy-beacon-cursor-mode 1)
@@ -4068,12 +4072,11 @@
光影
-
-
-
+
6.5.2.10.
+
-
(provide '風雨時用)
+
(provide '風雨時用)
 ;;; 風雨時用.el ends here
 
@@ -4081,14 +4084,13 @@
-
-

緑衣

-
+

6.6. 緑衣

+
-
(add-to-list 'load-path (locate-user-emacs-file  "桃夭/緑衣"))
-(require '緑衣)
-(require ')
+
(add-to-list 'load-path (locate-user-emacs-file  "桃夭/緑衣"))
+(require '緑衣)
+(require ')
 
@@ -4120,14 +4122,13 @@

緑衣

You cannot disable anything here.

-
-

-
+

6.6.1.

+
-
Anzu   search tools
-
+
6.6.1.1. Anzu   search tools
+

anzu.el is an Emacs port of anzu.vim. anzu.el provides a minor mode which displays current match and total matches information in the mode-line in various @@ -4139,7 +4140,7 @@

Anzu   searc

-
(setup anzu
+
(setup anzu
   (:doc "anzu.el is an Emacs port of anzu.vim.")
   (:url "https://github.com/emacsorphanage/anzu")
   (:tag "search" "tools")
@@ -4151,10 +4152,9 @@ 
Anzu   searc
-
-
Avy   point location
-
+
6.6.1.2. Avy   point location
+

Jump to things in Emacs tree-style.

@@ -4164,12 +4164,12 @@
Avy   point
-
(setup avy
+
(setup avy
   (:doc "Jump to things in Emacs tree-style.")
   (:url "https://github.com/abo-abo/avy")
   (:tag "point" "location")
   (:opt
-   avy-keys '(?a ?o ?e ?u ?i ?d ?h ?t ?n ?s)) ;; for dvorak
+   avy-keys '(?a ?o ?e ?u ?i ?d ?h ?t ?n ?s)) ;; for dvorak
   (:global
    "C-;"     avy-goto-char
    "C-:"     avy-goto-char-2
@@ -4183,10 +4183,9 @@ 
Avy   point
-
-
Beginend   editing
-
+
6.6.1.3. Beginend   editing
+

Emacs package to redefine M-< and M-> for some modes

@@ -4196,7 +4195,7 @@
Beginend    -
(setup beginend
+
(setup beginend
   (:doc "Emacs package to redefine M-< and M-> for some modes")
   (:url "https://github.com/DamienCassou/beginend")
   (:tag "editing")
@@ -4205,32 +4204,31 @@ 
Beginend    -
Compile   builtin
-
+
6.6.1.4. Compile   builtin
+
-
(defvar nasy/last-compilation-buffer nil
+
(defvar nasy/last-compilation-buffer nil
   "The last buffer in which compilation took place.")
 
-(defun nasy/save-compilation-buffer (&rest _)
+(defun nasy/save-compilation-buffer (&rest _)
   "Save the compilation buffer to find it later."
-  (setq nasy/last-compilation-buffer next-error-last-buffer))
+  (setq nasy/last-compilation-buffer next-error-last-buffer))
 
-(defun alert-after-compilation-finish (buf result)
+(defun alert-after-compilation-finish (buf result)
   "Use `alert' to report compilation RESULT if BUF is hidden."
-  (when (buffer-live-p buf)
-    (unless (catch 'is-visible
-              (walk-windows (lambda (w)
-                              (when (eq (window-buffer w) buf)
-                                (throw 'is-visible t))))
+  (when (buffer-live-p buf)
+    (unless (catch 'is-visible
+              (walk-windows (lambda (w)
+                              (when (eq (window-buffer w) buf)
+                                (throw 'is-visible t))))
               nil)
       (alert (concat "Compilation " result)
              :buffer buf
-             :category 'compilation
+             :category 'compilation
              :title "Emacs"))))
 
-(setup compile
+(setup compile
   (:tag "builtin")
   (:advice compilation-start :after nasy/save-compilation-buffer)
   (:global [f6] recompile)
@@ -4239,10 +4237,9 @@ 
Compile    -
Consult   extensions
-
+
6.6.1.5. Consult   extensions
+

consult.el - Consulting completing-read.

@@ -4255,17 +4252,16 @@
Consult    -
consult
-
+
6.6.1.5.1. consult
+
-
(defun nasy/consult-line-symbol-at-point ()
+
(defun nasy/consult-line-symbol-at-point ()
   "Consult line with symbol at point."
-  (interactive)
-  (consult-line (thing-at-point 'symbol)))
+  (interactive)
+  (consult-line (thing-at-point 'symbol)))
 
-(setup consult
+(setup consult
   (:doc "consult.el - Consulting completing-read")
   (:url "https://github.com/minad/consult")
   (:tag "extensions")
@@ -4290,28 +4286,27 @@ 
consult
"C-S-s" nasy/consult-line-symbol-at-point) (:when-loaded (:require consult-xref) - (consult-customize + (consult-customize consult-theme - :preview-key '("M-." + :preview-key '("M-." :debounce 3 "<up>" "<down>" :debounce 1 any) consult-ripgrep consult-git-grep consult-grep consult-bookmark consult-recent-file consult-xref consult--source-recent-file consult--source-project-recent-file consult--source-bookmark consult-buffer - :preview-key '("M-." + :preview-key '("M-." :debounce 5 "<up>" "<down>" :debounce 5 any))))
-
-
consult-flycheck
-
+
6.6.1.5.2. consult-flycheck
+
-
(setup consult-flycheck
+
(setup consult-flycheck
   (:doc "consult.el - Consulting completing-read")
   (:url "https://github.com/minad/consult")
   (:tag "extensions")
@@ -4322,10 +4317,9 @@ 
consult-flycheck
-
-
consult-dir   convenience
-
+
6.6.1.5.3. consult-dir   convenience
+

Consult-dir allows you to easily select and switch between “active” directories. @@ -4336,7 +4330,7 @@

consult-dir   
-
(setup consult-dir
+
(setup consult-dir
   (:doc "consult-dir: switch directories easily in Emacs")
   (:url "https://github.com/karthink/consult-dir")
   (:tag "convenience")
@@ -4355,10 +4349,9 @@ 
consult-dir   
-
-
Dired   files
-
+
6.6.1.6. Dired   files
+

DiredMode is the mode of a Dired buffer. It shows a directory (folder) listing that you can use to perform various operations on files and subdirectories in @@ -4372,7 +4365,7 @@

Dired   file

-
(setup dired
+
(setup dired
   (:doc "DiredMode is the mode of a Dired buffer.")
   (:url "https://www.emacswiki.org/emacs/DiredMode")
   (:tag "files")
@@ -4380,17 +4373,16 @@ 
Dired   file [mouse-2] dired-find-file "C-c C-p" wdired-change-to-wdired-mode) (:opt - insert-directory-program (or (executable-find "gls") + insert-directory-program (or (executable-find "gls") (executable-find "ls")) - dired-recursive-deletes 'top)) + dired-recursive-deletes 'top))
-
-
Easy Kill   killing convenience
-
+
6.6.1.7. Easy Kill   killing convenience
+

Provide commands easy-kill and easy-mark to let users kill or mark things easily.

@@ -4400,7 +4392,7 @@
Easy Kill    -
(setup easy-kill
+
(setup easy-kill
   (:doc "Kill & Mark Things Easily in Emacs.")
   (:url "https://github.com/leoliu/easy-kill")
   (:tag "killing" "convenience")
@@ -4411,22 +4403,20 @@ 
Easy Kill    -
Eldoc   builtin docs help
-
+
6.6.1.8. Eldoc   builtin docs help
+
-
(setup eldoc
-  (:opt eldoc-documentation-strategy #'eldoc-documentation-compose
+
(setup eldoc
+  (:opt eldoc-documentation-strategy #'eldoc-documentation-compose
         eldoc-echo-area-use-multiline-p t))
 
-
-
Emacs Spatial Navigate   editing
-
+
6.6.1.9. Emacs Spatial Navigate   editing
+

Spatial navigation in Emacs.

@@ -4436,7 +4426,7 @@
Emacs Spatial Navigate   
-
(setup spatial-navigate
+
(setup spatial-navigate
   (:doc "Spatial navigation in Emacs.")
   (:url "https://gitlab.com/ideasman42/emacs-spatial-navigate")
   (:tag "editing")
@@ -4452,10 +4442,9 @@ 
Emacs Spatial Navigate   
-
-
embark   convenience
-
+
6.6.1.10. embark   convenience
+

Emacs Mini-Buffer Actions Rooted in Keymaps.

@@ -4465,52 +4454,52 @@
embark    -
(defun embark-act-noquit ()
+
(defun embark-act-noquit ()
   "Run action but don't quit the minibuffer afterwards."
-  (interactive)
-  (let ((embark-quit-after-action nil))
+  (interactive)
+  (let ((embark-quit-after-action nil))
     (embark-act)))
 
-(defun embark-which-key-indicator ()
+(defun embark-which-key-indicator ()
   "An embark indicator that displays keymaps using which-key.
  The which-key help message will show the type and value of the
  current target followed by an ellipsis if there are further
  targets."
-  (lambda (&optional keymap targets prefix)
-    (if (null keymap)
+  (lambda (&optional keymap targets prefix)
+    (if (null keymap)
         (which-key--hide-popup-ignore-command)
       (which-key--show-keymap
-       (if (eq (plist-get (car targets) :type) 'embark-become)
+       (if (eq (plist-get (car targets) :type) 'embark-become)
            "Become"
          (format "Act on %s '%s'%s"
                  (plist-get (car targets) :type)
                  (embark--truncate-target (plist-get (car targets) :target))
-                 (if (cdr targets) "…" "")))
-       (if prefix
-           (pcase (lookup-key keymap prefix 'accept-default)
-             ((and (pred keymapp) km) km)
-             (_ (key-binding prefix 'accept-default)))
+                 (if (cdr targets) "…" "")))
+       (if prefix
+           (pcase (lookup-key keymap prefix 'accept-default)
+             ((and (pred keymapp) km) km)
+             (_ (key-binding prefix 'accept-default)))
          keymap)
-       nil nil t (lambda (binding)
+       nil nil t (lambda (binding)
                    (not (string-suffix-p "-argument" (cdr binding))))))))
 
-(defun embark-hide-which-key-indicator (fn &rest args)
+(defun embark-hide-which-key-indicator (fn &rest args)
   "Hide the which-key indicator immediately when using the completing-read prompter."
   (which-key--hide-popup-ignore-command)
-  (let ((embark-indicators
-         (remq #'embark-which-key-indicator embark-indicators)))
+  (let ((embark-indicators
+         (remq #'embark-which-key-indicator embark-indicators)))
     (apply fn args)))
 
-(defun embark-live-vertico ()
+(defun embark-live-vertico ()
   "Shrink Vertico minibuffer when `embark-live' is active."
-  (when-let (win (and (string-prefix-p "*Embark Live" (buffer-name))
+  (when-let (win (and (string-prefix-p "*Embark Live" (buffer-name))
                       (active-minibuffer-window)))
-    (with-selected-window win
-      (when (and (bound-and-true-p vertico--input)
-                 (fboundp 'vertico-multiform-unobtrusive))
+    (with-selected-window win
+      (when (and (bound-and-true-p vertico--input)
+                 (fboundp 'vertico-multiform-unobtrusive))
         (vertico-multiform-unobtrusive)))))
 
-(setup embark
+(setup embark
   (:doc "Emacs Mini-Buffer Actions Rooted in Keymaps.")
   (:url "https://github.com/oantolin/embark")
   (:tag "convenience")
@@ -4523,7 +4512,7 @@ 
embark   (:after vertico (:bind-into vertico-map "M-o" embark-act) - (add-to-list 'embark-indicators #'embark-which-key-indicator)) + (add-to-list 'embark-indicators #'embark-which-key-indicator)) (:after 風雨時用 (:bind-into nasy/active-region-map "M-o" embark-act)) @@ -4531,13 +4520,13 @@
embark   (:hook embark-live-vertico)) (:when-loaded ;; Hide the mode line of the Embark live/completions buffers - (add-to-list 'display-buffer-alist - '("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*" + (add-to-list 'display-buffer-alist + '("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*" nil (window-parameters (mode-line-format . none)))))) -(setup embark-consult +(setup embark-consult (:load-first consult) (:with-mode embark-collect-mode (:hook consult-preview-at-point-mode))) @@ -4545,10 +4534,9 @@
embark    -
Flycheck   convenience languages tools
-
+
6.6.1.11. Flycheck   convenience languages tools
+

Modern on-the-fly syntax checking extension for GNU Emacs.

@@ -4562,14 +4550,14 @@
Flycheck    -
(setup flycheck
+
(setup flycheck
   (:doc "On the fly syntax checking for GNU Emacs.")
   (:url "https://github.com/flycheck/flycheck")
   (:tag "convenience" "languages" "tools")
   (:hook-into prog-mode)
   (:opt
-   flycheck-display-errors-function #'flycheck-display-error-messages-unless-error-list
-   flycheck-check-syntax-automatically '(save idle-change mode-enabled)
+   flycheck-display-errors-function #'flycheck-display-error-messages-unless-error-list
+   flycheck-check-syntax-automatically '(save idle-change mode-enabled)
    flycheck-display-errors-delay       0.25)
   (:bind-into flycheck-error-list-mode-map
     "C-n" flycheck-error-list-next-error
@@ -4577,24 +4565,23 @@ 
Flycheck   "RET" flycheck-error-list-goto-error [return] flycheck-error-list-goto-error) (:when-loaded - (add-to-list 'display-buffer-alist - `(,(rx bos "*Flycheck errors*" eos) + (add-to-list 'display-buffer-alist + `(,(rx bos "*Flycheck errors*" eos) (display-buffer-reuse-window display-buffer-in-side-window) (side . bottom) (reusable-frames . visible) (window-height . 0.33))) - (defalias 'show-error-at-point-soon - 'flycheck-show-error-at-point) - (add-to-list 'flycheck-emacs-lisp-checkdoc-variables 'sentence-end-double-space))) + (defalias 'show-error-at-point-soon + 'flycheck-show-error-at-point) + (add-to-list 'flycheck-emacs-lisp-checkdoc-variables 'sentence-end-double-space)))
-
-
GCMH   internal
-
+
6.6.1.12. GCMH   internal
+

gcmh 管理汙薉

@@ -4608,22 +4595,22 @@
GCMH   int

-
(defun nasy/-start-gcmh (&rest _)
+
(defun nasy/-start-gcmh (&rest _)
   "Start GCMH."
-  (when (and (not noninteractive)
-             (not (and (boundp '*no-gcmh*)
+  (when (and (not noninteractive)
+             (not (and (boundp '*no-gcmh*)
                      *no-gcmh*)))
     (customize-set-variable
-     'gcmh-verbose t
+     'gcmh-verbose t
      "Customized with leaf in `gcmh' block")
     (customize-set-variable
-     'gcmh-low-cons-threshold #x2000000  ;; 32MB
+     'gcmh-low-cons-threshold #x2000000  ;; 32MB
      "Customized with leaf in `gcmh' block")
     (customize-set-variable
-     'gcmh-high-cons-threshold #x8000000 ;; 128MB
+     'gcmh-high-cons-threshold #x8000000 ;; 128MB
      "Customized with leaf in `gcmh' block")
     (customize-set-variable
-     'gcmh-idle-delay 360
+     'gcmh-idle-delay 360
      "Customized with leaf in `gcmh' block")
     (gcmh-mode 1)))
 
@@ -4634,7 +4621,7 @@ 
GCMH   int ;; :commands gcmh-mode ;; :hook (nasy-first-key . nasy/-start-gcmh)) -(setup gcmh +(setup gcmh (:doc "Use GCMH -- the Garbage Collector Magic Hack -- to adjust garbage collection.") (:url "https://gitlab.com/koral/gcmh") (:tag "internal") @@ -4643,12 +4630,11 @@
GCMH   int
-
-
Grep   builtin
-
+
6.6.1.13. Grep   builtin
+
-
(setup grep
+
(setup grep
   (:tag "builtin")
   (:opt
    grep-highlight-matches t
@@ -4657,10 +4643,9 @@ 
Grep   buil
-
-
Helpful   help lisp
-
+
6.6.1.14. Helpful   help lisp
+

A better Emacs help buffer.

@@ -4670,7 +4655,7 @@
Helpful   h

-
(setup helpful
+
(setup helpful
   (:doc "A better Emacs *help* buffer.")
   (:url "https://github.com/Wilfred/helpful")
   (:tag "help" "lisp")
@@ -4682,12 +4667,11 @@ 
Helpful   h
-
-
elisp-demos
-
+
6.6.1.14.1. elisp-demos
+
-
(setup elisp-demos
+
(setup elisp-demos
   (:doc "Demonstrate Emacs Lisp APIs.")
   (:url "https://github.com/xuchunyang/elisp-demos")
   (:tag "lisp" "docs")
@@ -4697,10 +4681,9 @@ 
elisp-demos
-
-
Keyfreq   extensions utilities
-
+
6.6.1.15. Keyfreq   extensions utilities
+

Track Emacs commands frequency

@@ -4710,14 +4693,14 @@
Keyfreq    -
(setup keyfreq
+
(setup keyfreq
   (:doc "Track Emacs commands frequency")
   (:url "https://github.com/dacap/keyfreq")
   (:tag "extensions" "utilities")
   (:opt
    keyfreq-file (concat *nasy-var* "keyfreq")
    keyfreq-excluded-commands
-   '(backward-char
+   '(backward-char
      dap-tooltip-mouse-motion
      delete-backward-char
      execute-extended-command
@@ -4751,10 +4734,9 @@ 
Keyfreq    -
marginalia   extensions
-
+
6.6.1.16. marginalia   extensions
+

marginalia.el - Marginalia in the minibuffer

@@ -4764,7 +4746,7 @@
marginalia    -
(setup marginalia
+
(setup marginalia
   (:doc "marginalia.el - Marginalia in the minibuffer.")
   (:url "https://github.com/minad/marginalia")
   (:tag "extensions")
@@ -4776,17 +4758,16 @@ 
marginalia    -
(setup all-the-icons-completion
-  (:with-mode marginalia-mode
-    (:hook all-the-icons-completion-marginalia-setup)))
+
;; (setup all-the-icons-completion
+;;   (:with-mode marginalia-mode
+;;     (:hook all-the-icons-completion-marginalia-setup)))
 
-
-
Orderless   extensions
-
+
6.6.1.17. Orderless   extensions
+

This package provides an orderless completion style that divides the pattern into space-separated components, and matches candidates that @@ -4801,7 +4782,7 @@

Orderless    -
(defun nasy/-orderless-dispatch (pattern _index _total)
+
(defun nasy/-orderless-dispatch (pattern _index _total)
   "Orderless (PATTERN) dispatch.
 
  Recognizes the following patterns:
@@ -4811,49 +4792,48 @@ 
Orderless    * !without-literal without-literal! * .ext (file extension) * regexp$ (regexp matching at end)" - (cond + (cond ;; Ensure that $ works with Consult commands, which add disambiguation suffixes - ((string-suffix-p "$" pattern) `(orderless-regexp . ,(concat (substring pattern 0 -1) "[\x100000-\x10FFFD]*$"))) + ((string-suffix-p "$" pattern) `(orderless-regexp . ,(concat (substring pattern 0 -1) "[\x100000-\x10FFFD]*$"))) ;; File extensions - ((string-match-p "\\`\\.." pattern) `(orderless-regexp . ,(concat "\\." (substring pattern 1) "[\x100000-\x10FFFD]*$"))) + ((string-match-p "\\`\\.." pattern) `(orderless-regexp . ,(concat "\\." (substring pattern 1) "[\x100000-\x10FFFD]*$"))) ;; Ignore single ! - ((string= "!" pattern) `(orderless-literal . "")) + ((string= "!" pattern) `(orderless-literal . "")) ;; Without literal - ((string-prefix-p "!" pattern) `(orderless-without-literal . ,(substring pattern 1))) - ((string-suffix-p "!" pattern) `(orderless-without-literal . ,(substring pattern 0 -1))) + ((string-prefix-p "!" pattern) `(orderless-without-literal . ,(substring pattern 1))) + ((string-suffix-p "!" pattern) `(orderless-without-literal . ,(substring pattern 0 -1))) ;; Initialism matching - ((string-prefix-p "`" pattern) `(orderless-initialism . ,(substring pattern 1))) - ((string-suffix-p "`" pattern) `(orderless-initialism . ,(substring pattern 0 -1))) + ((string-prefix-p "`" pattern) `(orderless-initialism . ,(substring pattern 1))) + ((string-suffix-p "`" pattern) `(orderless-initialism . ,(substring pattern 0 -1))) ;; Literal matching - ((string-prefix-p "=" pattern) `(orderless-literal . ,(substring pattern 1))) - ((string-suffix-p "=" pattern) `(orderless-literal . ,(substring pattern 0 -1))) + ((string-prefix-p "=" pattern) `(orderless-literal . ,(substring pattern 1))) + ((string-suffix-p "=" pattern) `(orderless-literal . ,(substring pattern 0 -1))) ;; Flex matching - ((string-prefix-p "~" pattern) `(orderless-flex . ,(substring pattern 1))) - ((string-suffix-p "~" pattern) `(orderless-flex . ,(substring pattern 0 -1))))) + ((string-prefix-p "~" pattern) `(orderless-flex . ,(substring pattern 1))) + ((string-suffix-p "~" pattern) `(orderless-flex . ,(substring pattern 0 -1))))) -(setup orderless +(setup orderless (:doc "Emacs completion style that matches multiple regexps in any order.") (:url "https://github.com/oantolin/orderless") (:tag "extensions") - (:first-key* (require 'orderless)) + (:first-key* (require 'orderless)) (:opt - completion-styles '(orderless initials basic) - orderless-matching-styles '(orderless-regexp + completion-styles '(orderless initials basic) + orderless-matching-styles '(orderless-regexp orderless-initialism orderless-literal) - orderless-style-dispatchers '(nasy/-orderless-dispatch) + orderless-style-dispatchers '(nasy/-orderless-dispatch) orderless-component-separator "[ &·]" completion-category-defaults nil - completion-category-overrides '((file (styles partial-completion))))) + completion-category-overrides '((file (styles partial-completion)))))
-
-
Page Break Lines   convenience faces
-
+
6.6.1.18. Page Break Lines   convenience faces
+

This Emacs library provides a global mode which displays ugly form feed characters as tidy horizontal rules. @@ -4864,14 +4844,14 @@

Page Break Lines   
-
(setup page-break-lines
+
(setup page-break-lines
   (:doc "Emacs: display ugly ^L page breaks as tidy horizontal lines")
   (:url "https://github.com/purcell/page-break-lines")
   (:tag "convenience" "faces")
   (:with-hook nasy/font-change-hook
-    (:hook (lambda ()
-             (progn
-               (after-x 'page-break-lines
+    (:hook (lambda ()
+             (progn
+               (after-x 'page-break-lines
                  (nasy/change-char-width page-break-lines-char 2)
                  (nasy/set-symbol ?⊸ 18 nil))))))
   (:opt page-break-lines-char ?⊸))
@@ -4879,12 +4859,11 @@ 
Page Break Lines   
-
-
Parens   faces languages parens builtin
-
+
6.6.1.19. Parens   faces languages parens builtin
+
-
(setup paren
+
(setup paren
   (:tag "builtin")
   (:opt show-paren-context-when-offscreen t)
   (:first-key show-paren-mode))
@@ -4892,10 +4871,9 @@ 
Parens   fa
-
-
Projectile   convenience project
-
+
6.6.1.20. Projectile   convenience project
+

Projectile is a project interaction library for Emacs. Its goal is to provide a nice set of features operating on a project level without introducing external @@ -4910,29 +4888,28 @@

Projectile    -
(setup projectile
+
(setup projectile
   (:doc "Projectile is a project interaction library for Emacs.")
   (:url "https://github.com/bbatsov/projectile")
   (:tag "project" "convenience")
   (:global [remap find-tag] projectile-find-tag)
   (:opt
    projectile-known-projects-file (concat *nasy-var* "projectile/known-projects.el")
-   projectile-indexing-method          'hybrid
-   projectile-require-project-root     'prompt
-   projectile-ignored-project-function #'nasy/p-ignore-p)
+   projectile-indexing-method          'hybrid
+   projectile-require-project-root     'prompt
+   projectile-ignored-project-function #'nasy/p-ignore-p)
   (:when-loaded
-    (setq projectile-project-root-files-top-down-recurring
-           (append '("compile_commands.json"
+    (setq projectile-project-root-files-top-down-recurring
+           (append '("compile_commands.json"
                      ".cquery")
                    projectile-project-root-files-top-down-recurring))))
 
-
-
Recentf   files
-
+
6.6.1.21. Recentf   files
+

Recentf is a minor mode that builds a list of recently opened files.

@@ -4942,9 +4919,9 @@
Recentf   

-
(defvar nasy--recentf-cleaned nil)
+
(defvar nasy--recentf-cleaned nil)
 
-(setup recentf
+(setup recentf
   (:doc "Recentf is a minor mode that builds a list of recently opened files.")
   (:url "https://www.emacswiki.org/emacs/RecentFiles")
   (:tag "files")
@@ -4952,15 +4929,15 @@ 
Recentf    (:first-key* (recentf-mode)) (:mode-hook - (after-x '風雨時用 - (unless nasy--recentf-cleaned - (setq nasy--recentf-cleaned t) + (after-x '風雨時用 + (unless nasy--recentf-cleaned + (setq nasy--recentf-cleaned t) (recentf-cleanup)))) (:opt* recentf-save-file (concat *nasy-var* "recentf-save.el") recentf-filename-handlers - '(;; Text properties inflate the size of recentf's files, and there is + '(;; Text properties inflate the size of recentf's files, and there is ;; no purpose in persisting them, so we strip them out. substring-no-properties ;; Resolve symlinks of local files. Otherwise we get duplicate @@ -4972,11 +4949,11 @@
Recentf    ;; horizontal space the recentf listing uses to list recent files. abbreviate-file-name) - recentf-auto-cleanup 'never + recentf-auto-cleanup 'never recentf-max-saved-items 1000 recentf-exclude - `(,(abbreviate-file-name + `(,(abbreviate-file-name (locate-user-emacs-file *nasy-var*)) "/tmp/" "/ssh:" "/nix/store" "~/.nix/store" "/private/var/folders" ,(locate-user-emacs-file "straight")))) @@ -4984,12 +4961,11 @@
Recentf   
-
-
Savehist   history
-
+
6.6.1.22. Savehist   history
+
-
(setup savehist
+
(setup savehist
   (:hook-into nasy-first-key-hook)
   (:opt
    kill-ring-max              300
@@ -4997,7 +4973,7 @@ 
Savehist   (concat *nasy-var* "savehist.el") - savehist-additional-variables '(mark-ring + savehist-additional-variables '(mark-ring global-mark-ring search-ring regexp-search-ring @@ -5006,12 +4982,11 @@
Savehist    -
Sessions   history
-
+
6.6.1.23. Sessions   history
+
-
(setup session
+
(setup session
   (:autoload session-initialize session-save-session)
   (:with-hook aftre-init-hook
     (:hook session-initialize))
@@ -5020,9 +4995,9 @@ 
Sessions   (:opt* session-save-file (concat *nasy-var* "session")) (:opt session-name-disable-regexp "\\(?:\\`'/tmp\\|\\.git/[A-Z_]+\\'\\)" - session-save-file-coding-system 'utf-8 + session-save-file-coding-system 'utf-8 desktop-globals-to-save - '((comint-input-ring . 50) + '((comint-input-ring . 50) (compile-history . 30) desktop-missing-file-warning (dired-regexp-history . 20) @@ -5051,22 +5026,20 @@
Sessions    -
Subword   builtin
-
+
6.6.1.24. Subword   builtin
+
-
(setup subword
+
(setup subword
   (:tag "builtin")
   (:hook-into prog-mode-hook))
 
-
-
Sudo Edit   convenience
-
+
6.6.1.25. Sudo Edit   convenience
+

Utilities for opening files with sudo

@@ -5076,7 +5049,7 @@
Sudo Edit    -
(setup sudo-edit
+
(setup sudo-edit
   (:doc "Utilities for opening files with sudo.")
   (:url "https://github.com/nflath/sudo-edit")
   (:tag "convenience"))
@@ -5084,10 +5057,9 @@ 
Sudo Edit    -
switch-window   convenience
-
+
6.6.1.26. switch-window   convenience
+

Offer a visual way to choose a window to switch to.

@@ -5097,7 +5069,7 @@
switch-window   
-
(setup switch-window
+
(setup switch-window
   (:doc "Offer a *visual* way to choose a window to switch to.")
   (:url "https://github.com/dimitri/switch-window")
   (:tag "convenience")
@@ -5113,30 +5085,28 @@ 
switch-window    (:opt ;; for dvorak layout switch-window-qwerty-shortcuts - '("a" "o" "e" "u" "h" "t" "n" "s" "i" "d" + '("a" "o" "e" "u" "h" "t" "n" "s" "i" "d" ";" "," "." "p" "y" "f" "g" "c" "l" "'" "q" "j" "k" "x" "b" "m") - switch-window-shortcut-style 'qwerty)) + switch-window-shortcut-style 'qwerty))
-
-
Tempo   builtin
-
+
6.6.1.27. Tempo   builtin
+
-
(setup tempo
+
(setup tempo
   (:tag "builtin")
   (:autoload tempo-define-template))
 
-
-
transient   bindings
-
+
6.6.1.28. transient   bindings
+

Taking inspiration from prefix keys and prefix arguments, Transient implements a similar abstraction involving a prefix command, infix @@ -5155,7 +5125,7 @@

transient    -
(setup transient
+
(setup transient
   (:doc "Transient commands.")
   (:url "https://github.com/magit/transient")
   (:tag "bindings")
@@ -5163,17 +5133,16 @@ 
transient   (concat *nasy-var* "transient/history.el") transient-levels-file (concat *nasy-etc* "transient/levels.el") transient-values-file (concat *nasy-etc* "transient/values.el")) - (:init (add-to-list 'nasy--defer-loads 'transient))) + (:init (add-to-list 'nasy--defer-loads 'transient)))
-
-
Treesit
-
+
6.6.1.29. Treesit   languages
+
-
(defun na/treesit-install-language-grammar (lang)
+
(defun na/treesit-install-language-grammar (lang)
   "Build and install the tree-sitter language grammar library for LANG.
 
  Interactively, if `treesit-language-source-alist' doesn't already
@@ -5186,60 +5155,68 @@ 
Treesit
See `exec-path' for the current path where Emacs looks for executable programs, such as the C/C++ compiler and linker." - (interactive (list (intern + (interactive (list (intern (completing-read "Language: " - (mapcar #'car treesit-language-source-alist))))) - (when-let ((recipe - (or (assoc lang treesit-language-source-alist) + (mapcar #'car treesit-language-source-alist))))) + (when-let ((recipe + (or (assoc lang treesit-language-source-alist) (treesit--install-language-grammar-build-recipe lang)))) - (condition-case err - (apply #'treesit--install-language-grammar-1 + (condition-case err + (apply #'treesit--install-language-grammar-1 ;; The nil is OUT-DIR. (cons (car treesit-extra-load-path) recipe)) (error (display-warning - 'treesit + 'treesit (format "Error encountered when installing language grammar: %s" err))))) ;; Check that the installed language grammar is loadable. - (pcase-let ((`(,available . ,err) + (pcase-let ((`(,available . ,err) (treesit-language-available-p lang t))) - (when (not available) + (when (not available) (display-warning - 'treesit + 'treesit (format "The installed language grammar for %s cannot be located or has problems (%s): %s" lang (nth 0 err) (string-join - (mapcar (lambda (x) (format "%s" x)) + (mapcar (lambda (x) (format "%s" x)) (cdr err)) " ")))))) -(setup treesit +(setup treesit (:opt treesit-font-lock-level 4) (:when-loaded - (add-to-list 'treesit-extra-load-path + (add-to-list 'treesit-extra-load-path (concat *nasy-var* "treesit"))) (:advice treesit-install-language-grammar :override na/treesit-install-language-grammar)) -(setup treesit-auto - (:opt treesit-auto-install 'prompt) +(setup treesit-auto + (:opt treesit-auto-install 'prompt) (:first-key* - (require 'treesit-auto) - (add-to-list 'treesit-auto-fallback-alist '(bash-ts-mode . sh-mode)) - (add-to-list 'treesit-auto-fallback-alist '(toml-ts-mode . conf-toml-mode)) + (require 'treesit-auto) + (add-to-list 'treesit-auto-fallback-alist '(bash-ts-mode . sh-mode)) + (add-to-list 'treesit-auto-fallback-alist '(toml-ts-mode . conf-toml-mode)) + (add-to-list 'treesit-auto-recipe-list + (make-treesit-auto-recipe + :lang 'typst + :ts-mode 'typst-ts-mode + :remap '(typst-mode) + :url "https://github.com/uben0/tree-sitter-typst" + :revision "master" + :source-dir "src" + :ext ".typ")) (global-treesit-auto-mode)))
-
-
Unfill   convenience
-
+
6.6.1.30. Unfill   convenience
+

Functions providing the inverse of Emacs' fill-paragraph and fill-region

@@ -5249,7 +5226,7 @@
Unfill    -
(setup unfill
+
(setup unfill
   (:doc "Functions providing the inverse of Emacs' fill-paragraph and fill-region")
   (:url "https://github.com/purcell/unfill")
   (:tag "convenience")
@@ -5258,15 +5235,14 @@ 
Unfill    -
Uniquify   builtin files
-
+
6.6.1.31. Uniquify   builtin files
+
-
(setup uniquify
+
(setup uniquify
   (:tag "builtin" "files")
   (:opt
-   uniquify-buffer-name-style   'reverse
+   uniquify-buffer-name-style   'reverse
    uniquify-separator           " • "
    uniquify-after-kill-buffer-p t
    uniquify-ignore-buffers-re   "^\\*"))
@@ -5274,10 +5250,9 @@ 
Uniquify    -
valign   convenience table text
-
+
6.6.1.32. valign   convenience table text
+

这个包能对齐 Org Mode、Markdown和table.el 的表格。它能对齐包含不等宽字体、中日韩字符、图片的表格。valign 不会影响 Org Mode(或 Markdown mode)基于等宽字符的对齐。 (注:目歬不在 org-mode 中启用)

@@ -5295,7 +5270,7 @@
valign    -
(setup valign
+
(setup valign
   (:doc "Pixel-perfect visual alignment for Org and Markdown tables.")
   (:url "https://github.com/casouri/valign")
   (:tag "convenience" "table" "text")
@@ -5304,21 +5279,19 @@ 
valign    -
vc-mode   vc
-
+
6.6.1.33. vc-mode   vc
+
-
(setup vc
+
(setup vc
   (:first-key vc-mode))
 
-
-
Vertico   completion extensions
-
+
6.6.1.34. Vertico   completion extensions
+

Vertico provides a performant and minimalistic vertical completion UI based on the default completion system. The main focus of Vertico is @@ -5339,7 +5312,7 @@

Vertico   
;; Add prompt indicator to `completing-read-multiple'.
 ;; We display [CRM<separator>], e.g., [CRM,] if the separator is a comma.
-(defun crm-indicator (args)
+(defun crm-indicator (args)
   (cons (format "[CRM%s] %s"
                 (replace-regexp-in-string
                  "\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" ""
@@ -5347,7 +5320,7 @@ 
Vertico   (car args)) (cdr args))) -(setup vertico +(setup vertico (:doc "Vertico provides a performant and minimalistic vertical completion UI based on the default completion system.") (:url "https://github.com/minad/vertico") (:tag "completion") @@ -5359,16 +5332,15 @@
Vertico   (:hook vertico-repeat-save)) (:mode-hook (vertico-mouse-mode 1) - (after-x '風雨時用 + (after-x '風雨時用 (nasy/active-region-mode 1))))
-
-
View Large File   files largefiles utilities
-
+
6.6.1.35. View Large File   files largefiles utilities
+

Emacs minor mode that allows viewing, editing, searching and comparing large files in batches, trading memory for processor time. @@ -5379,15 +5351,15 @@

View Large File   
-
(defun ffap-vlf ()
+
(defun ffap-vlf ()
   "Find file at point with VLF."
-  (interactive)
-  (let ((file (ffap-file-at-point)))
-    (unless (file-exists-p file)
+  (interactive)
+  (let ((file (ffap-file-at-point)))
+    (unless (file-exists-p file)
       (error "File does not exist: %s" file))
     (vlf file)))
 
-(setup vlf
+(setup vlf
   (:doc "View Large Files in Emacs")
   (:url "https://github.com/m00natic/vlfi")
   (:tag "files" "large files" "utilities")
@@ -5396,10 +5368,9 @@ 
View Large File   
-
-
wgrep   editing extensions grep
-
+
6.6.1.36. wgrep   editing extensions grep
+

wgrep allows you to edit a grep buffer and apply those changes to the file buffer like sed interactively. No need to learn sed script, just @@ -5411,7 +5382,7 @@

wgrep   ed

-
(setup wgrep
+
(setup wgrep
   (:doc "Writable grep buffer and apply the changes to files.")
   (:url "https://github.com/mhayashi1120/Emacs-wgrep")
   (:tag "editing" "extensions" "grep"))
@@ -5419,22 +5390,20 @@ 
wgrep   ed
-
-
Which Function   builtin
-
+
6.6.1.37. Which Function   builtin
+
-
(setup which-func
+
(setup which-func
   (:tag "builtin")
   (:first-key which-function-mode))
 
-
-
Whitespace   convenience data wp
-
+
6.6.1.38. Whitespace   convenience data wp
+

Visualize blanks (TAB, (HARD) SPACE and NEWLINE).

@@ -5452,11 +5421,11 @@
Whitespace    -
(defun no-trailing-whitespace ()
+
(defun no-trailing-whitespace ()
   "Turn off display of trailing whitespace in this buffer."
-  (setq show-trailing-whitespace nil))
+  (setq show-trailing-whitespace nil))
 
-(setup whitespace
+(setup whitespace
   (:tag "data" "wp")
   (:with-function no-trailing-whitespace
     (:hook-into
@@ -5474,14 +5443,14 @@ 
Whitespace   ))) -(setup whitespace-cleanup-mode +(setup whitespace-cleanup-mode (:doc "In Emacs, intelligently call whitespace-cleanup on save.") (:url "https://github.com/purcell/whitespace-cleanup-mode") (:tag "convonience") (:opt whitespace-cleanup-mode-only-if-initially-clean nil whitespace-style - '(face trailing tabs spaces newline + '(face trailing tabs spaces newline missing-newline-at-eof empty indentation space-after-tab space-before-tab space-mark tab-mark newline-mark)) @@ -5491,29 +5460,27 @@
Whitespace    -
xref   builtin
-
+
6.6.1.39. xref   builtin
+
-
(setup xref
+
(setup xref
   (:opts
    ((xref-show-xrefs-function
      xref-show-definitions-function)
-    . #'xref-show-definitions-completing-read)))
+    . #'xref-show-definitions-completing-read)))
 
-
-

-
+

6.6.2.

+
;;;###autoload
-(defvar nasy/company-backend-alist
-  '((text-mode company-dabbrev company-yasnippet company-ispell company-files)
+(defvar nasy/company-backend-alist
+  '((text-mode company-dabbrev company-yasnippet company-ispell company-files)
     (prog-mode company-capf company-yasnippet company-files)
     (conf-mode company-capf company-dabbrev-code company-yasnippet company-files))
   "An alist matching modes to company backends.
@@ -5522,20 +5489,19 @@ 

;;;###autoload -(defvar nasy-cape/company +(defvar nasy-cape/company ;; '(company-tabnine company-yasnippet) - '(company-yasnippet)) + '(company-yasnippet))
-
-

-
+

6.6.3.

+
;;;###autoload
-(defun nasy/add-company-backend (modes &rest backends)
+(defun nasy/add-company-backend (modes &rest backends)
   "Prepend BACKENDS (in order) to `company-backends' in MODES.
 
  MODES should be one symbol or a list of them, representing major or minor modes.
@@ -5550,100 +5516,100 @@ 

(nasy/add-company-backend '(c-mode c++-mode) '(:separate company-irony-c-headers company-irony)) (nasy/add-company-backend 'sh-mode nil) ; unsets backends for `sh-mode'" - (declare (indent defun)) - (dolist (mode (nasy/enlist modes)) - (if (null (car backends)) - (setq nasy/company-backend-alist + (declare (indent defun)) + (dolist (mode (nasy/enlist modes)) + (if (null (car backends)) + (setq nasy/company-backend-alist (delq (assq mode nasy/company-backend-alist) nasy/company-backend-alist)) - (setf (alist-get mode nasy/company-backend-alist) + (setf (alist-get mode nasy/company-backend-alist) backends)))) ;;;###autoload -(defun nasy/company-backends () +(defun nasy/company-backends () "Get company backends." - (let (backends) - (let ((mode major-mode) + (let (backends) + (let ((mode major-mode) (modes (list major-mode))) - (while (setq mode (get mode 'derived-mode-parent)) - (push mode modes)) - (dolist (mode modes) - (dolist (backend (append (cdr (assq mode nasy/company-backend-alist)) - (default-value 'company-backends))) - (push backend backends))) + (while (setq mode (get mode 'derived-mode-parent)) + (push mode modes)) + (dolist (mode modes) + (dolist (backend (append (cdr (assq mode nasy/company-backend-alist)) + (default-value 'company-backends))) + (push backend backends))) (delete-dups - (append (cl-loop for (mode . backends) in nasy/company-backend-alist - if (or (eq major-mode mode) ; major modes - (and (boundp mode) + (append (cl-loop for (mode . backends) in nasy/company-backend-alist + if (or (eq major-mode mode) ; major modes + (and (boundp mode) (symbol-value mode))) ; minor modes append backends) (nreverse backends)))))) ;;;###autoload -(defun nasy/company-init-backends-h () +(defun nasy/company-init-backends-h () "Set `company-backends' for the current buffer." - (or (memq major-mode '(fundamental-mode special-mode)) + (or (memq major-mode '(fundamental-mode special-mode)) buffer-read-only - (nasy/temp-buffer-p (or (buffer-base-buffer) (current-buffer))) - (setq-local company-backends (nasy/company-backends)))) + (nasy/temp-buffer-p (or (buffer-base-buffer) (current-buffer))) + (setq-local company-backends (nasy/company-backends)))) ;; (put 'nasy/company-init-backends-h 'permanent-local-hook t) ;;;###autoload -(defun nasy/company-complete () +(defun nasy/company-complete () "Bring up the completion popup. If only one result, complete it." - (interactive) - (require 'company) - (when (ignore-errors + (interactive) + (require 'company) + (when (ignore-errors (/= (point) - (cdr (bounds-of-thing-at-point 'symbol)))) - (save-excursion (insert " "))) - (when (and (company-manual-begin) + (cdr (bounds-of-thing-at-point 'symbol)))) + (save-excursion (insert " "))) + (when (and (company-manual-begin) (= company-candidates-length 1)) (company-complete-common))) ;;;###autoload -(defun nasy/company-has-completion-p () +(defun nasy/company-has-completion-p () "Return non-nil if a completion candidate exists at point." - (and (company-manual-begin) + (and (company-manual-begin) (= company-candidates-length 1))) ;;;###autoload -(defun nasy/company-toggle-auto-completion () +(defun nasy/company-toggle-auto-completion () "Toggle as-you-type code completion." - (interactive) - (require 'company) - (setq company-idle-delay (unless company-idle-delay 0.2)) + (interactive) + (require 'company) + (setq company-idle-delay (unless company-idle-delay 0.2)) (message "Auto completion %s" - (if company-idle-delay "enabled" "disabled"))) + (if company-idle-delay "enabled" "disabled"))) ;;;###autoload -(defun nasy/company-dabbrev () +(defun nasy/company-dabbrev () "Invokes `company-dabbrev-code' in `prog-mode' buffers and `company-dabbrev' everywhere else." - (interactive) + (interactive) (call-interactively - (if (derived-mode-p 'prog-mode) - #'company-dabbrev-code - #'company-dabbrev))) + (if (derived-mode-p 'prog-mode) + #'company-dabbrev-code + #'company-dabbrev))) ;;;###autoload -(defun nasy/company-whole-lines (command &optional arg &rest ignored) +(defun nasy/company-whole-lines (command &optional arg &rest ignored) "`company-mode' completion backend that completes whole-lines, akin to vim's C-x C-l." - (interactive (list 'interactive)) - (require 'company) - (pcase command - (`interactive (company-begin-backend 'nasy/company-whole-lines)) - (`prefix (company-grab-line "^[\t\s]*\\(.+\\)" 1)) - (`candidates + (interactive (list 'interactive)) + (require 'company) + (pcase command + (`interactive (company-begin-backend 'nasy/company-whole-lines)) + (`prefix (company-grab-line "^[\t\s]*\\(.+\\)" 1)) + (`candidates (all-completions arg (delete-dups @@ -5656,129 +5622,128 @@

;;;###autoload -(defun nasy/company-dict-or-keywords () +(defun nasy/company-dict-or-keywords () "`company-mode' completion combining `company-dict' and `company-keywords'." - (interactive) - (require 'company-dict) - (require 'company-keywords) - (let ((company-backends '((company-keywords company-dict)))) - (call-interactively #'company-complete))) + (interactive) + (require 'company-dict) + (require 'company-keywords) + (let ((company-backends '((company-keywords company-dict)))) + (call-interactively #'company-complete))) ;;;###autoload -(defun nasy/company-dabbrev-code-previous () +(defun nasy/company-dabbrev-code-previous () "TODO." - (interactive) - (require 'company-dabbrev) - (let ((company-selection-wrap-around t)) - (call-interactively #'nasy/company-dabbrev) + (interactive) + (require 'company-dabbrev) + (let ((company-selection-wrap-around t)) + (call-interactively #'nasy/company-dabbrev) (company-select-previous-or-abort))) ;;;###autoload -(defvar nasy/prev-whitespace-mode nil) -(make-variable-buffer-local 'nasy/prev-whitespace-mode) +(defvar nasy/prev-whitespace-mode nil) +(make-variable-buffer-local 'nasy/prev-whitespace-mode) ;;;###autoload -(defvar nasy/show-trailing-whitespace nil) -(make-variable-buffer-local 'nasy/show-trailing-whitespace) +(defvar nasy/show-trailing-whitespace nil) +(make-variable-buffer-local 'nasy/show-trailing-whitespace) -(defvar my-prev-whitespace-mode nil) +(defvar my-prev-whitespace-mode nil) ;;;###autoload -(defun nasy/-pre-popup-draw () +(defun nasy/-pre-popup-draw () "Turn off whitespace mode before showing company complete tooltip." - (if whitespace-mode - (progn - (setq my-prev-whitespace-mode t) + (if whitespace-mode + (progn + (setq my-prev-whitespace-mode t) (whitespace-mode -1))) - (setq nasy/show-trailing-whitespace show-trailing-whitespace) - (setq show-trailing-whitespace nil)) + (setq nasy/show-trailing-whitespace show-trailing-whitespace) + (setq show-trailing-whitespace nil)) ;;;###autoload -(defun nasy/-post-popup-draw () +(defun nasy/-post-popup-draw () "Restore previous whitespace mode after showing company tooltip." - (if nasy/prev-whitespace-mode - (progn + (if nasy/prev-whitespace-mode + (progn (whitespace-mode 1) - (setq nasy/prev-whitespace-mode nil))) - (setq show-trailing-whitespace nasy/show-trailing-whitespace)) + (setq nasy/prev-whitespace-mode nil))) + (setq show-trailing-whitespace nasy/show-trailing-whitespace)) ;;;###autoload -(defun nasy/company-filter-c () +(defun nasy/company-filter-c () (company-search-abort) (company-filter-candidates)) ;;;###autoload -(defun nasy/company-box-icons--elisp-fn (candidate) - (when (derived-mode-p 'emacs-lisp-mode) - (let ((sym (intern candidate))) - (cond ((fboundp sym) 'ElispFunction) - ((boundp sym) 'ElispVariable) - ((featurep sym) 'ElispFeature) - ((facep sym) 'ElispFace))))) +(defun nasy/company-box-icons--elisp-fn (candidate) + (when (derived-mode-p 'emacs-lisp-mode) + (let ((sym (intern candidate))) + (cond ((fboundp sym) 'ElispFunction) + ((boundp sym) 'ElispVariable) + ((featurep sym) 'ElispFeature) + ((facep sym) 'ElispFace))))) ;;;###autoload -(defun nasy/company-remove-scrollbar-a (orig-fn &rest args) +(defun nasy/company-remove-scrollbar-a (orig-fn &rest args) "This disables the company-box scrollbar, because: https://github.com/sebastiencs/company-box/issues/44" - (cl-letf (((symbol-function #'display-buffer-in-side-window) - (symbol-function #'ignore))) + (cl-letf (((symbol-function #'display-buffer-in-side-window) + (symbol-function #'ignore))) (apply orig-fn args))) ;;;###autoload -(defun nasy/merge-capf (c) +(defun nasy/merge-capf (c) "Merge c into completion-at-point-functions." - (remove-hook 'completion-at-point-functions t t) - (add-hook 'completion-at-point-functions c 1 'local)) + (remove-hook 'completion-at-point-functions t t) + (add-hook 'completion-at-point-functions c 1 'local)) ;; (setq completion-at-point-functions ;; (cape-capf-buster (apply #'cape-super-capf completion-at-point-functions)))) ;;;###autoload -(defun nasy/-merge-capf () +(defun nasy/-merge-capf () "Merge nasy capy." - (require 'cape) - (let ((nasy-capfs (cape-capf-buster (cape-company-to-capf + (require 'cape) + (let ((nasy-capfs (cape-capf-buster (cape-company-to-capf (apply-partially - #'company--multi-backend-adapter + #'company--multi-backend-adapter nasy-cape/company))))) (nasy/merge-capf nasy-capfs))) ;;;###autoload -(defun nasy/orderless-dispatch-flex-first (_pattern index _total) +(defun nasy/orderless-dispatch-flex-first (_pattern index _total) "orderless-flex for corfu." - (and (eq index 0) 'orderless-flex)) + (and (eq index 0) 'orderless-flex)) ;;;###autoload -(defun nasy/setup-corfu () +(defun nasy/setup-corfu () "Setup corfu." (corfu-mode 1) - (setq-local orderless-matching-styles '(orderless-flex) + (setq-local orderless-matching-styles '(orderless-flex) orderless-style-dispatchers nil) - (add-hook 'orderless-style-dispatchers (function nasy/orderless-dispatch-flex-first) nil - 'local)) + (add-hook 'orderless-style-dispatchers (function nasy/orderless-dispatch-flex-first) nil + 'local))
-
-

-
+

6.6.4.

+
-
cape   editing extensions
-
+
6.6.4.1. cape   editing extensions
+

Cape provides a bunch of Completion At Point Extensions which can be used in combination with my Corfu completion UI or the default @@ -5792,7 +5757,7 @@

cape   edit

-
(setup cape
+
(setup cape
   (:doc "Completion At Point Extensions.")
   (:url "https://github.com/minad/cape")
   (:tag "editing" "extensions")
@@ -5804,9 +5769,8 @@ 
cape   edit "p d" cape-dabbrev ;; or dabbrev-completion "p f" cape-file "p k" cape-keyword - "p s" cape-symbol + "p s" cape-elisp-symbol "p a" cape-abbrev - "p i" cape-ispell "p l" cape-line "p w" cape-dict "p \\" cape-tex @@ -5816,25 +5780,24 @@
cape   edit (:with-hook corfu-mode-hook (:hook nasy/-merge-capf)) (:when-loaded - (setq completion-at-point-functions + (setq completion-at-point-functions (cape-capf-buster (cape-company-to-capf (apply-partially - #'company--multi-backend-adapter + #'company--multi-backend-adapter nasy-cape/company))))))
-
-
company
-
+
6.6.4.2. company
+
-
company
-
+
6.6.4.2.1. company
+
-
(setup company
+
(setup company
   (:autoload company--multi-backend-adapter))
   ;; ;; (:global
   ;; ;;  "C-;"      nasy/company-complete
@@ -5890,10 +5853,9 @@ 
company
-
-
Company Quickhelp
-
+
6.6.4.2.2. Company Quickhelp
+
;; (leaf company-quickhelp
 ;;   :after company
@@ -5907,10 +5869,9 @@ 
Company Quickhelp
-
-
Company Tabnine
-
+
6.6.4.2.3. Company Tabnine
+
;; (leaf company-tabnine
 ;;   :disabled t
@@ -5923,10 +5884,9 @@ 
Company Tabnine
-
-
Company Flx
-
+
6.6.4.2.4. Company Flx
+
;; (leaf company-flx
 ;;   :after company
@@ -5936,10 +5896,9 @@ 
Company Flx
-
-
Company Box
-
+
6.6.4.2.5. Company Box
+
;; (leaf company-box
 ;;   :after company
@@ -5999,10 +5958,9 @@ 
Company Box
-
-
copilot.el   editing extensions
-
+
6.6.4.3. copilot.el   editing extensions
+

Copilot.el is an Emacs plugin for GitHub Copilot.

@@ -6012,18 +5970,18 @@
copilot.el    -
(defun nasy/copilot-complete ()
+
(defun nasy/copilot-complete ()
   "Copilot complete."
-  (interactive)
+  (interactive)
   (copilot-clear-overlay)
   (copilot-complete))
 
-(defun nasy/copilot-disable-p ()
+(defun nasy/copilot-disable-p ()
   "Disable copilot when at the end of the file and not changed."
-  (and (= (point-max) (point))
+  (and (= (point-max) (point))
        (not (buffer-modified-p))))
 
-(setup copilot
+(setup copilot
   (:doc "An unofficial Copilot plugin for Emacs.")
   (:url "https://github.com/zerolfx/copilot.el")
   (:tag "editing" "extensions")
@@ -6031,21 +5989,18 @@ 
copilot.el   (:bind-into copilot-mode-map "C-<tab>" copilot-accept-completion "H-SPC" nasy/copilot-complete) - (:opt copilto-idle-delay 0.8) + (:opt copilot-idle-delay 0.8 + copilot-indent-warning-suppress t) (:when-loaded - (add-to-list 'copilot-disable-predicates #'nasy/copilot-disable-p)) - (:hook-into prog-mode-hook text-mode org-mode-hook emacs-lisp-mode-hook) - (:mode-hook - (add-to-list 'copilot--indentation-alist '(python-ts-mode python-indent py-indent-offset python-indent-offset)) - (setq copilot-idle-delay 0.8))) + (add-to-list 'copilot-disable-predicates #'nasy/copilot-disable-p)) + (:hook-into prog-mode-hook text-mode org-mode-hook emacs-lisp-mode-hook))
-
-
corfu   editing extensions
-
+
6.6.4.4. corfu   editing extensions
+

Corfu enhances the default completion in region function with a completion overlay.

@@ -6055,19 +6010,19 @@
corfu   ed

-
(defun nasy/corfu-commit-predicate ()
+
(defun nasy/corfu-commit-predicate ()
   "Auto-commit candidates if:
   1. A '.' is typed, except after a SPACE or text/org mode.
   2. A selection was made, aside from entering SPACE.
   3. Just one candidate exists, and we continue to non-symbol info.
   4. The 1st match is exact."
-  (cond
+  (cond
    ((seq-contains-p (this-command-keys-vector) ?.)
-    (or (string-empty-p (car corfu--input))
+    (or (string-empty-p (car corfu--input))
         (not
-         (or (string= (substring (car corfu--input) -1) " ")
-             (eq major-mode 'org-mode)
-             (eq major-mode 'text-mode)))))
+         (or (string= (substring (car corfu--input) -1) " ")
+             (eq major-mode 'org-mode)
+             (eq major-mode 'text-mode)))))
 
    ((/= corfu--index corfu--preselect) ; a selection was made
     (not (seq-contains-p (this-command-keys-vector) ?\s)))
@@ -6075,12 +6030,12 @@ 
corfu   ed ((eq corfu--total 1) ;just one candidate (seq-intersection (this-command-keys-vector) [?: ?, ?\) ?\] ?\( ?\s])) - ((and corfu--input ; exact 1st match + ((and corfu--input ; exact 1st match (string-equal (substring (car corfu--input) corfu--base) (car corfu--candidates))) - (seq-intersection (this-command-keys-vector) [?: ?\. ?, ?\) ?\] ?\" ?' ?\s])))) + (seq-intersection (this-command-keys-vector) [?: ?\. ?, ?\) ?\] ?\" ?' ?\s])))) -(setup corfu +(setup corfu (:doc "Completion Overlay Region FUnction.") (:url "https://github.com/minad/corfu") (:tag "editing" "extensions") @@ -6095,12 +6050,12 @@
corfu   ed corfu-preview-current) . nil)) (:opt - corfu-quit-no-match 'separator + corfu-quit-no-match 'separator corfu-separator #x00b7 corfu-auto-delay 0.4 corfu-auto-prefix 2 corfu-echo-documentation 1 - corfu-commit-predicate #'nasy/corfu-commit-predicate) + corfu-commit-predicate #'nasy/corfu-commit-predicate) (:with-function nasy/setup-corfu (:hook-into prog-mode-hook @@ -6113,15 +6068,14 @@
corfu   ed (corfu-history-mode) (corfu-indexed-mode) (:after savehist - (add-to-list 'savehist-additional-variables 'corfu-history)))) + (add-to-list 'savehist-additional-variables 'corfu-history))))
-
-
corfu-popupinfo   convenience corfu documentation popup
-
+
6.6.4.5. corfu-popupinfo   convenience corfu documentation popup
+

Display a documentation popup for completion candidate when using Corfu. It can be re regarded as company-quickhelp for Corfu. @@ -6132,7 +6086,7 @@

corfu-popupinfo   
-
(setup corfu-popupinfo
+
(setup corfu-popupinfo
   (:doc "Documentation popup for Corfu.")
   (:url "https://github.com/minad/corfu/blob/main/extensions/corfu-popupinfo.el")
   (:tag "convenience" "corfu" "documentation" "popup")
@@ -6141,10 +6095,9 @@ 
corfu-popupinfo   
-
-
citre
-
+
6.6.4.6. citre
+

Citre

@@ -6152,13 +6105,12 @@
citre
-
-

月出

-
+

6.7. 月出

+
-
(add-to-list 'load-path (locate-user-emacs-file  "桃夭/月出"))
-(require '月出)
+
(add-to-list 'load-path (locate-user-emacs-file  "桃夭/月出"))
+(require '月出)
 
@@ -6181,14 +6133,13 @@

月出

Selective packages. Disabled the package by setting no-package in the custom file.

-
-

-
+

6.7.1.

+
-
abridge-diff   diffs tools magit
-
+
6.7.1.1. abridge-diff   diffs tools magit
+

A simple Emacs package for abridging refined diff hunks (for example in magit). Why abridge a diff hunk? Most diffs are line based. If you are working @@ -6203,7 +6154,7 @@

abridge-diff   
-
(setup abridge-diff
+
(setup abridge-diff
   (:doc "Emacs package for refining diff hunks with very long lines (as in LaTeX files).")
   (:url "https://github.com/jdtsmith/abridge-diff")
   (:tag "diffs" "magit" "tools")
@@ -6214,10 +6165,9 @@ 
abridge-diff   
-
-
Ansi-Color   comm processes terminals services
-
+
6.7.1.2. Ansi-Color   comm processes terminals services
+

ansi-color.el translates ANSI SGR (Select Graphic Rendition) escape sequences like "Esc[30m" into EmacsOverlays, TextProperties, or XEmacsExtents with face @@ -6229,12 +6179,12 @@

Ansi-Color    -
(defun colourise-compilation-buffer ()
-  (when (eq major-mode 'compilation-mode)
+
(defun colourise-compilation-buffer ()
+  (when (eq major-mode 'compilation-mode)
     (ansi-color-apply-on-region compilation-filter-start
                                 (point-max))))
 
-(setup ansi-color
+(setup ansi-color
   (:doc "ansi-color.el translates ANSI SGR (Select Graphic Rendition) escape sequences with face colours, bold, etc.")
   (:url "https://www.emacswiki.org/emacs/AnsiColor")
   (:tag "comm" "processes" "terminals" "services")
@@ -6246,10 +6196,9 @@ 
Ansi-Color    -
beacon   convenience
-
+
6.7.1.3. beacon   convenience
+

A light that follows your cursor around so you don't lose it!

@@ -6259,7 +6208,7 @@
beacon    -
(setup beacon
+
(setup beacon
   (:doc "Never lose your cursor again.")
   (:url "https://github.com/Malabarba/beacon")
   (:tag "convenience")
@@ -6273,15 +6222,14 @@ 
beacon   ) . 1)) (:with-hook nasy-first-key-hook - (:hook (lambda () (require 'beacon))))) + (:hook (lambda () (require 'beacon)))))
-
-
Color Identifiers Mode   faces languages
-
+
6.7.1.4. Color Identifiers Mode   faces languages
+

Emacs minor mode to highlight each source code identifier uniquely based on its name. @@ -6292,7 +6240,7 @@

Color Identifiers Mode   
-
(setup color-identifiers-mode
+
(setup color-identifiers-mode
   (:doc "Emacs minor mode to highlight each source code identifier uniquely based on its name.")
   (:url "https://github.com/ankurdave/color-identifiers-mode")
   (:tag "faces" "languages")
@@ -6304,22 +6252,20 @@ 
Color Identifiers Mode   
-
-
Default Text Scale   text
-
+
6.7.1.5. Default Text Scale   text
+
-
(setup default-text-scale
+
(setup default-text-scale
   (:autoload default-text-scale-mode)
   (:hook-into nasy-first-key-hook))
 
-
-
Diff-hl (only for dired)   vc diffs
-
+
6.7.1.6. Diff-hl (only for dired)   vc diffs
+

Emacs package for highlighting uncommitted changes

@@ -6329,7 +6275,7 @@
Diff-hl (only for dired)   
-
(setup diff-hl
+
(setup diff-hl
   (:doc "Emacs package for highlighting uncommitted changes")
   (:url "https://github.com/dgutov/diff-hl")
   (:tag "vc" "diffs")
@@ -6344,10 +6290,9 @@ 
Diff-hl (only for dired)   
-
-
dired-async   dired async network
-
+
6.7.1.7. dired-async   dired async network
+

Simple library for asynchronous processing in Emacs.

@@ -6357,7 +6302,7 @@
dired-async   
-
(setup dired-async
+
(setup dired-async
   (:doc "Simple library for asynchronous processing in Emacs.")
   (:url "https://github.com/jwiegley/emacs-async")
   (:tag "dired" "async" "network")
@@ -6367,10 +6312,9 @@ 
dired-async   
-
-
Dired Hack   files
-
+
6.7.1.8. Dired Hack   files
+

Collection of useful dired additions

@@ -6380,28 +6324,27 @@
Dired Hack    -
(setup dired-hacks
+
(setup dired-hacks
   (:doc "Collection of useful dired additions")
   (:url "https://github.com/Fuco1/dired-hacks")
   (:tag "files"))
 
-
-
Dired Filter
-
+
6.7.1.8.1. Dired Filter
+
-
(setup dired-filter
+
(setup dired-filter
   (:autoload dired-filter-group-mode)
   (:bind-into dired-filter-map
      "p" dired-filter-pop-all)
   (:with-hook dired-mode-hook
     (:hook dired-filter-mode dired-filter-group-mode))
   (:opt
-   dired-filter-revert 'never
+   dired-filter-revert 'never
    dired-filter-group-saved-groups
-   '(("default"
+   '(("default"
       ("Git"
        (directory . ".git")
        (file . ".gitignore"))
@@ -6427,80 +6370,79 @@ 
Dired Filter
-
-
Dired Rainbow
-
+
6.7.1.8.2. Dired Rainbow
+
-
(defun nasy/-init-dired-rainbow ()
+
(defun nasy/-init-dired-rainbow ()
   "Nasy init dired-rainbow."
-  (require 'dired-rainbow)
+  (require 'dired-rainbow)
   (with-no-warnings
-    (dired-rainbow-define
+    (dired-rainbow-define
      html "#eb5286"
      ("css" "less" "sass" "scss" "htm" "html" "jhtm" "mht" "eml" "mustache" "xhtml"))
-    (dired-rainbow-define
+    (dired-rainbow-define
       xml "#f2d024"
       ("xml" "xsd" "xsl" "xslt" "wsdl" "bib" "json" "msg" "pgn" "rss" "yaml" "yml" "rdata"))
-    (dired-rainbow-define
+    (dired-rainbow-define
       document "#9561e2"
       ("docm" "doc" "docx" "odb" "odt" "pdb" "pdf" "ps" "rtf" "djvu" "epub" "odp" "ppt" "pptx"))
-    (dired-rainbow-define
+    (dired-rainbow-define
       markdown "#705438"
       ("org" "etx" "info" "markdown" "md" "mkd" "nfo" "pod" "rst" "tex" "textfile" "txt"))
-    (dired-rainbow-define
+    (dired-rainbow-define
       database "#6574cd"
       ("xlsx" "xls" "csv" "accdb" "db" "mdb" "sqlite" "nc"))
-    (dired-rainbow-define
+    (dired-rainbow-define
       media "#de751f"
       ("mp3" "mp4" "MP3" "MP4" "avi" "mpeg" "mpg" "flv" "ogg" "mov" "mid" "midi" "wav" "aiff" "flac"))
-    (dired-rainbow-define
+    (dired-rainbow-define
       image "#f66d9b"
       ("tiff" "tif" "cdr" "gif" "ico" "jpeg" "jpg" "png" "psd" "eps" "svg"))
-    (dired-rainbow-define
+    (dired-rainbow-define
       log "#c17d11"
       ("log"))
-    (dired-rainbow-define
+    (dired-rainbow-define
       shell "#f6993f"
       ("awk" "bash" "bat" "sed" "sh" "zsh" "vim"))
-    (dired-rainbow-define
+    (dired-rainbow-define
       interpreted "#38c172"
       ("py" "ipynb" "rb" "pl" "t" "msql" "mysql" "pgsql" "sql" "r" "clj" "cljs" "scala" "js"))
-    (dired-rainbow-define
+    (dired-rainbow-define
       compiled "#4dc0b5"
       ("asm" "cl" "lisp" "el" "c" "h" "c++" "h++" "hpp" "hxx" "m" "cc" "cs" "cp" "cpp" "go" "f" "for" "ftn" "f90" "f95" "f03" "f08" "s" "rs" "hi" "h
         s" "pyc" ".java"))
-    (dired-rainbow-define
+    (dired-rainbow-define
       executable "#8cc4ff"
       ("exe" "msi"))
-    (dired-rainbow-define
+    (dired-rainbow-define
       compressed "#51d88a"
       ("7z" "zip" "bz2" "tgz" "txz" "gz" "xz" "z" "Z" "jar" "war" "ear" "rar" "sar" "xpi" "apk" "xz" "tar"))
-    (dired-rainbow-define
+    (dired-rainbow-define
       packaged "#faad63"
       ("deb" "rpm" "apk" "jad" "jar" "cab" "pak" "pk3" "vdf" "vpk" "bsp"))
-    (dired-rainbow-define
+    (dired-rainbow-define
       encrypted "#ffed4a"
       ("gpg" "pgp" "asc" "bfe" "enc" "signature" "sig" "p12" "pem"))
-    (dired-rainbow-define
+    (dired-rainbow-define
      fonts "#6cb2eb"
      ("afm" "fon" "fnt" "pfb" "pfm" "ttf" "otf"))
-    (dired-rainbow-define
+    (dired-rainbow-define
      partition "#e3342f"
      ("dmg" "iso" "bin" "nrg" "qcow" "toast" "vcd" "vmdk" "bak"))
-    (dired-rainbow-define
+    (dired-rainbow-define
      vc "#0074d9"
      ("git" "gitignore" "gitattributes" "gitmodules"))
-    (dired-rainbow-define-chmod
+    (dired-rainbow-define-chmod
      directory "#6cb2eb"
      "d.*")
-    (dired-rainbow-define-chmod
+    (dired-rainbow-define-chmod
      executable-unix
      "#38c172" "-.*x.*"))
   (font-lock-flush)
   (font-lock-ensure))
 
-(setup dired-rainbow
+(setup dired-rainbow
   (:autoload nasy/-init-dired-rainbow dired-rainbow-define dired-rainbow-define-chmod)
   (:load-first dired)
   (:with-hook dired-mode-hook
@@ -6509,23 +6451,21 @@ 
Dired Rainbow
-
-
Dired Narrow
-
+
6.7.1.8.3. Dired Narrow
+
-
(setup dired-narrow
+
(setup dired-narrow
   (:load-first dired))
 
-
-
Dired Collapse
-
+
6.7.1.8.4. Dired Collapse
+
-
(setup dired-collapse
+
(setup dired-collapse
   (:load-first dired)
   (:hook-into dired-mode-hook))
 
@@ -6533,10 +6473,9 @@
Dired Collapse
-
-
Dirvish   convenience files
-
+
6.7.1.9. Dirvish   convenience files
+

Dirvish is an improved version of the Emacs inbuilt package Dired. It not only gives Dired an appealing and highly customizable user @@ -6549,17 +6488,17 @@

Dirvish    -
(setup dirvish
+
(setup dirvish
   (:doc "A polished Dired with batteries included.")
   (:url "https://github.com/alexluigit/dirvish")
   (:tag "files" "convenience")
   (:first-key*
    (dirvish-override-dired-mode))
   (:opt delete-by-moving-to-trash t
-        dirvish-default-layout    '(0 0.3 0.7)
+        dirvish-default-layout    '(0 0.3 0.7)
         dirvish-reuse-session     nil
         dirvish-attributes
-        '(vc-state subtree-state all-the-icons collapse file-time file-size)
+        '(vc-state subtree-state collapse file-time file-size)
         dirvish-preview-dispatchers nil)  ;; never preview
   (:global "C-c f" dirvish-fd)
   (:bind-into dirvish-mode-map ; Dirvish inherits `dired-mode-map'
@@ -6584,10 +6523,9 @@ 
Dirvish    -
eldoc box   docs extensions help
-
+
6.7.1.10. eldoc box   docs extensions help
+

This package displays ElDoc documentations in a childframe.

@@ -6597,7 +6535,7 @@
eldoc box    -
(setup eldoc-box
+
(setup eldoc-box
   (:doc "This package displays ElDoc documentations in a childframe.")
   (:url "https://github.com/casouri/eldoc-box")
   (:tag "docs" "extensions" "help")
@@ -6608,10 +6546,9 @@ 
eldoc box    -
eldoc-overlay   extensions
-
+
6.7.1.11. eldoc-overlay   extensions
+

Display eldoc doc with contextual documentation overlay for easy to look.

@@ -6621,7 +6558,7 @@
eldoc-overlay   
-
(setup eldoc-overlay
+
(setup eldoc-overlay
   (:doc "Display eldoc doc with contextual documentation overlay for easy to look.")
   (:url "https://github.com/stardiviner/eldoc-overlay")
   (:tag "extensions")
@@ -6630,10 +6567,9 @@ 
eldoc-overlay   
-
-
Expand Region   marking region
-
+
6.7.1.12. Expand Region   marking region
+

Emacs extension to increase selected region by semantic units.

@@ -6643,7 +6579,7 @@
Expand Region   
-
(setup expand-region
+
(setup expand-region
   (:doc "Emacs extension to increase selected region by semantic units.")
   (:url "https://github.com/magnars/expand-region.el")
   (:tag "marking" "region")
@@ -6652,10 +6588,9 @@ 
Expand Region   
-
-
Find File in Project   project convenience
-
+
6.7.1.13. Find File in Project   project convenience
+

Find file/directory and review Diff/Patch/Commit quickly everywhere.

@@ -6665,7 +6600,7 @@
Find File in Project   
-
(setup find-file-in-project
+
(setup find-file-in-project
   (:doc "Find file/directory and review Diff/Patch/Commit quickly everywhere.")
   (:url "https://github.com/technomancy/find-file-in-project")
   (:tag "project" "convenience")
@@ -6674,10 +6609,9 @@ 
Find File in Project   
-
-
ftables   convenience table text
-
+
6.7.1.14. ftables   convenience table text
+

This package provides some convenient commands for filling a table, i.e., adjusting the layout of the table so it can fit in n columns. @@ -6688,7 +6622,7 @@

ftables    -
(setup ftable
+
(setup ftable
   (:doc "Fill (auto-layout) tables.")
   (:url "https://github.com/casouri/ftable")
   (:tag "convenience" "table" "text"))
@@ -6696,10 +6630,9 @@ 
ftables    -
Git Gutter   vc git
-
+
6.7.1.15. Git Gutter   vc git
+

Disabled. Now use diff-hl

@@ -6713,7 +6646,7 @@
Git Gutter    -
(setup git-gutter
+
(setup git-gutter
   (:doc "Emacs port of GitGutter which is Sublime Text Plugin.")
   (:url "https://github.com/emacsorphanage/git-gutter")
   (:tag "vc" "git"))
@@ -6721,10 +6654,9 @@ 
Git Gutter    -
Highlight Indent Guides   faces
-
+
6.7.1.16. Highlight Indent Guides   faces
+

Disabled.

@@ -6738,7 +6670,7 @@
Highlight Indent Guides   
-
(setup highlight-indent-guides
+
(setup highlight-indent-guides
   (:doc "Emacs minor mode to highlight indentation.")
   (:url "https://github.com/DarthFennec/highlight-indent-guides")
   (:tag "faces")
@@ -6747,10 +6679,9 @@ 
Highlight Indent Guides   
-
-
Highlight Tail   color effect highlight visual
-
+
6.7.1.17. Highlight Tail   color effect highlight visual
+

This minor-mode draws a tail in real time, when you write.

@@ -6760,7 +6691,7 @@
Highlight Tail   
-
(setup highlight-tail
+
(setup highlight-tail
   (:doc "This minor-mode draws a tail in real time, when you write.")
   (:url "https://www.emacswiki.org/emacs/highlight-tail.el")
   (:tag "color" "effect" "highlight" "visual"))
@@ -6768,10 +6699,9 @@ 
Highlight Tail   
-
-
hl-line   faces frame emulations
-
+
6.7.1.18. hl-line   faces frame emulations
+

Highlight the current line of characters.

@@ -6781,7 +6711,7 @@
hl-line   

-
(setup hl-line
+
(setup hl-line
   (:doc "Highlight the current line of characters.")
   (:url "https://www.emacswiki.org/emacs/HighlightCurrentLine")
   (:tag "faces" "frames" "emulations")
@@ -6790,10 +6720,9 @@ 
hl-line   
-
-
imenu list   tools convenience
-
+
6.7.1.19. imenu list   tools convenience
+

Emacs plugin to show the current buffer's imenu entries in a seperate buffer.

@@ -6803,7 +6732,7 @@
imenu list    -
(setup imenu-list
+
(setup imenu-list
   (:doc "Emacs plugin to show the current buffer's imenu entries in a seperate buffer")
   (:url "https://github.com/bmag/imenu-list")
   (:tag "tools" "convenience")
@@ -6813,10 +6742,9 @@ 
imenu list    -
kind-icon   completion
-
+
6.7.1.20. kind-icon   completion
+

kind-icon — colorful icons for completion in Emacs

@@ -6832,21 +6760,20 @@
kind-icon    -
(setup kind-icon
+
(setup kind-icon
   (:doc "Completion kind text/icon prefix labelling for emacs in-region completion.")
   (:url "https://github.com/jdtsmith/kind-icon")
   (:tag "completion")
   (:load-first corfu)
-  (:custom kind-icon-default-face 'corfu-default)
-  (:when-loaded (add-to-list 'corfu-margin-formatters #'kind-icon-margin-formatter)))
+  ;; (:custom kind-icon-default-face 'corfu-default)
+  (:when-loaded (add-to-list 'corfu-margin-formatters #'kind-icon-margin-formatter)))
 
-
-
mixed-pitch   faces
-
+
6.7.1.21. mixed-pitch   faces
+

Mixed pitch is a minor mode that enables mixing fixed-pitch (also known as fixed-width or monospace) and variable-pitch (AKA “proportional”) fonts. It @@ -6860,29 +6787,29 @@

mixed-pitch   
-
(eval-and-compile
-  (defvar nasy--hl-line-bold nil))
+
(eval-and-compile
+  (defvar nasy--hl-line-bold nil))
 
-(setup mixed-pitch
+(setup mixed-pitch
   (:doc "Mix fixed-pitch and variable-pitch fonts in Emacs.")
   (:url "https://gitlab.com/jabranham/mixed-pitch")
   (:tag "faces")
-  (:custom mixed-pitch-variable-pitch-cursor '(hbar . 3))
+  (:custom mixed-pitch-variable-pitch-cursor '(hbar . 3))
   (:hook-into org-mode-hook)
   (:mode-hook
-   (after-x 'hl-line
-     (unless (boundp 'nasy--hl-line-bold)
-       (setq nasy--hl-line-bold (face-attribute 'hl-line :weight)))
-     (if mixed-pitch-mode
-         (set-face-attribute 'hl-line nil :weight 'unspecified)
-       (set-face-attribute 'hl-line nil :weight nasy--hl-line-bold))))
+   (after-x 'hl-line
+     (unless (boundp 'nasy--hl-line-bold)
+       (setq nasy--hl-line-bold (face-attribute 'hl-line :weight)))
+     (if mixed-pitch-mode
+         (set-face-attribute 'hl-line nil :weight 'unspecified)
+       (set-face-attribute 'hl-line nil :weight nasy--hl-line-bold))))
   (:after org
-    (setq mixed-pitch-fixed-pitch-faces
+    (setq mixed-pitch-fixed-pitch-faces
           (append mixed-pitch-fixed-pitch-faces
                   org-level-faces
-                  '(whitespace-hspace whitespace-space)
-                  '(fixed-pitch fixed-pitch-serif)
-                  '(org-date
+                  '(whitespace-hspace whitespace-space)
+                  '(fixed-pitch fixed-pitch-serif)
+                  '(org-date
                     org-footnote
                     org-special-keyword
                     org-property-value
@@ -6901,10 +6828,9 @@ 
mixed-pitch   
-
-
mmm-mode   convenience faces languages tools
-
+
6.7.1.22. mmm-mode   convenience faces languages tools
+

MMM Mode is a minor mode for Emacs that allows Multiple Major Modes to coexist in one buffer. @@ -6915,22 +6841,21 @@

mmm-mode    -
(setup mmm-auto
+
(setup mmm-auto
   (:doc "MMM Mode is a minor mode for Emacs that allows Multiple Major Modes to coexist in one buffer.")
   (:url "https://github.com/purcell/mmm-mode")
   (:tag "convenience" "faces" "languages" "tools")
   (:custom
-   mmm-global-mode              'maybe
+   mmm-global-mode              'maybe
    mmm-submode-decoration-level 2)
-  (:first-key (lambda () (require 'mmm-mode))))
+  (:first-key (lambda () (require 'mmm-mode))))
 
-
-
Multiple Cursors   cursors editing
-
+
6.7.1.23. Multiple Cursors   cursors editing
+

Multiple cursors for Emacs.

@@ -6940,7 +6865,7 @@
Multiple Cursors   
-
(setup multiple-cursors
+
(setup multiple-cursors
   (:doc "Multiple cursors for Emacs.")
   (:url "https://github.com/magnars/multiple-cursors.el")
   (:tag "editing" "cursors")
@@ -6959,10 +6884,9 @@ 
Multiple Cursors   
-
-
Persistent Scratch   convenience history
-
+
6.7.1.24. Persistent Scratch   convenience history
+

persistent-scratch is an Emacs package that preserves the state of scratch buffers accross Emacs sessions by saving the state to and @@ -6974,7 +6898,7 @@

Persistent Scratch    -
(setup persistent-scratch
+
(setup persistent-scratch
   (:doc "Preserve the scratch buffer across Emacs sessions.")
   (:url "https://github.com/Fanael/persistent-scratch")
   (:tag "convenience" "history")
@@ -6986,10 +6910,9 @@ 
Persistent Scratch    -
Point History   editing history
-
+
6.7.1.25. Point History   editing history
+

Show the history of points you visited before.

@@ -6999,7 +6922,7 @@
Point History   
-
(setup point-history
+
(setup point-history
   (:doc "Show the history of points you visited before.")
   (:url "https://github.com/blue0513/point-history")
   (:tag "editing")
@@ -7012,10 +6935,9 @@ 
Point History   
-
-
Rainbow-Mode   faces
-
+
6.7.1.26. Rainbow-Mode   faces
+

This minor mode sets background color to strings that match color names, e.g. #0000ff is displayed in white with a blue background. @@ -7026,19 +6948,19 @@

Rainbow-Mode   
-
(defun nasy/rainbow-colorize-match (color &optional match)
+
(defun nasy/rainbow-colorize-match (color &optional match)
   "Return a matched string propertized with a face whose background is COLOR.
 
 The foreground is computed using `rainbow-color-luminance', and is either white or black."
-  (let ((match (or match 0)))
+  (let ((match (or match 0)))
    (put-text-property
     (match-beginning match) (match-end match)
-    'face `((:foreground ,(if (> 0.5 (rainbow-x-color-luminance color))
+    'face `((:foreground ,(if (> 0.5 (rainbow-x-color-luminance color))
                               "white" "black"))
             (:background ,color)
             (:family ,*font-main-family*)))))
 
-(setup rainbow-mode
+(setup rainbow-mode
   (:doc "Colorize color names in buffers.")
   (:url "https://elpa.gnu.org/packages/rainbow-mode.html")
   (:tag "faces")
@@ -7052,18 +6974,17 @@ 
Rainbow-Mode    html-mode-hook prog-mode-hook) (:when-loaded - (eval-when-compile - (defvar *font-main-family*)) - (when (fboundp 'diminish) - (diminish 'rainbow-mode)))) + (eval-when-compile + (defvar *font-main-family*)) + (when (fboundp 'diminish) + (diminish 'rainbow-mode))))
-
-
Rainbow Delimiters   convenience faces lisp tools parens
-
+
6.7.1.27. Rainbow Delimiters   convenience faces lisp tools parens
+

rainbow-delimiters is a "rainbow parentheses"-like mode which highlights delimiters such as parentheses, brackets or braces according to their @@ -7077,7 +6998,7 @@

Rainbow Delimiters    -
(setup rainbow-delimiters
+
(setup rainbow-delimiters
   (:doc "Emacs rainbow delimiters mode")
   (:url "https://github.com/Fanael/rainbow-delimiters")
   (:tag "convenience" "faces" "lisp" "tools")
@@ -7086,10 +7007,9 @@ 
Rainbow Delimiters    -
Shellcop   tools unix
-
+
6.7.1.28. Shellcop   tools unix
+

Analyze errors reported in Emacs builtin shell

@@ -7099,7 +7019,7 @@
Shellcop    -
(setup shellcop
+
(setup shellcop
   (:quit)
   (:doc "Analyze errors reported in Emacs builtin shell.")
   (:url "https://github.com/redguardtoo/shellcop")
@@ -7110,10 +7030,9 @@ 
Shellcop    -
Smartparens   abbrev convenience editing parens
-
+
6.7.1.29. Smartparens   abbrev convenience editing parens
+

Minor mode for Emacs that deals with parens pairs and tries to be smart about it. @@ -7124,7 +7043,7 @@

Smartparens   
-
(setup smartparens
+
(setup smartparens
   (:doc "Minor mode for Emacs that deals with parens pairs and tries to be smart about it.")
   (:url "https://github.com/Fuco1/smartparens")
   (:tag "abbrev" "convenience" "editing")
@@ -7134,10 +7053,9 @@ 
Smartparens   
-
-
Symbol Overlay   faces matching
-
+
6.7.1.30. Symbol Overlay   faces matching
+

Highlight symbols with overlays while providing a keymap for various operations about highlighted symbols. It was originally inspired by the package @@ -7151,7 +7069,7 @@

Symbol Overlay   
-
(setup symbol-overlay
+
(setup symbol-overlay
   (:doc "Highlight symbols with keymap-enabled overlays.")
   (:url "https://github.com/wolray/symbol-overlay")
   (:tag "faces" "matching")
@@ -7165,10 +7083,9 @@ 
Symbol Overlay   
-
-
Treemacs   convenience files
-
+
6.7.1.31. Treemacs   convenience files
+

Treemacs is a file and project explorer similar to NeoTree or vim’s NerdTree, but largely inspired by the Project Explorer in Eclipse. It shows the file system outlines of your projects in a simple tree layout allowing quick navigation and exploration, while also possessing basic file management utilities. @@ -7179,52 +7096,52 @@

Treemacs    -
(setup treemacs
+
(setup treemacs
   (:doc "A tree layout file explorer for Emacs")
   (:url "https://github.com/Alexander-Miller/treemacs")
   (:tag "convenience" "files")
   (:after winum
-    (define-key winum-keymap (kbd "M-0") #'treemacs-select-window))
+    (define-key winum-keymap (kbd "M-0") #'treemacs-select-window))
   (:when-loaded
-    (progn
-      (setq treemacs-collapse-dirs                   (if treemacs-python-executable 3 0)                treemacs-deferred-git-apply-delay      0.5
-            treemacs-directory-name-transformer      #'identity
+    (progn
+      (setq treemacs-collapse-dirs                   (if treemacs-python-executable 3 0)                treemacs-deferred-git-apply-delay      0.5
+            treemacs-directory-name-transformer      #'identity
             treemacs-display-in-side-window          t
-            treemacs-eldoc-display                   'detailed
+            treemacs-eldoc-display                   'detailed
             treemacs-file-event-delay                5000
             treemacs-file-extension-regex            treemacs-last-period-regex-value
             treemacs-file-follow-delay               0.2
-            treemacs-file-name-transformer           #'identity
+            treemacs-file-name-transformer           #'identity
             treemacs-follow-after-init               t
             treemacs-expand-after-init               t
-            treemacs-find-workspace-method           'find-for-file-or-pick-first
+            treemacs-find-workspace-method           'find-for-file-or-pick-first
             treemacs-git-command-pipe                ""
-            treemacs-goto-tag-strategy               'refetch-index
-            treemacs-header-scroll-indicators        '(nil . "^^^^^^")
+            treemacs-goto-tag-strategy               'refetch-index
+            treemacs-header-scroll-indicators        '(nil . "^^^^^^")
             treemacs-hide-dot-git-directory          t
             treemacs-indentation                     2
             treemacs-indentation-string              " "
             treemacs-is-never-other-window           nil
             treemacs-max-git-entries                 5000
-            treemacs-missing-project-action          'ask
+            treemacs-missing-project-action          'ask
             treemacs-move-forward-on-expand          t
             treemacs-no-png-images                   nil
             treemacs-no-delete-other-windows         t
             treemacs-project-follow-cleanup          nil
             treemacs-persist-file                    (concat *nasy-var* "treemacs-persist")
-            treemacs-position                        'left
+            treemacs-position                        'left
             treemacs-recenter-distance               0.1
             treemacs-recenter-after-file-follow      nil
             treemacs-recenter-after-tag-follow       nil
-            treemacs-recenter-after-project-jump     'always
-            treemacs-recenter-after-project-expand   'on-distance
-            treemacs-litter-directories              '("/node_modules" "/.venv" "/.cask")
+            treemacs-recenter-after-project-jump     'always
+            treemacs-recenter-after-project-expand   'on-distance
+            treemacs-litter-directories              '("/node_modules" "/.venv" "/.cask")
             treemacs-show-cursor                     nil
             treemacs-show-hidden-files               t
             treemacs-silent-filewatch                nil
             treemacs-silent-refresh                  nil
-            treemacs-sorting                         'alphabetic-asc
-            treemacs-select-when-already-in-treemacs 'move-back
+            treemacs-sorting                         'alphabetic-asc
+            treemacs-select-when-already-in-treemacs 'move-back
             treemacs-space-between-root-nodes        t
             treemacs-tag-follow-cleanup              t
             treemacs-tag-follow-delay                1.5
@@ -7241,35 +7158,34 @@ 
Treemacs   ;; (treemacs-resize-icons 44) (treemacs-follow-mode 1) (treemacs-filewatch-mode 1) - (treemacs-fringe-indicator-mode 'always) - (when treemacs-python-executable + (treemacs-fringe-indicator-mode 'always) + (when treemacs-python-executable (treemacs-git-commit-diff-mode t)) - (pcase (cons (not (null (executable-find "git"))) + (pcase (cons (not (null (executable-find "git"))) (not (null treemacs-python-executable))) - (`(t . t) - (treemacs-git-mode 'deferred)) - (`(t . _) - (treemacs-git-mode 'simple)))))) + (`(t . t) + (treemacs-git-mode 'deferred)) + (`(t . _) + (treemacs-git-mode 'simple)))))) ;; (setup treemacs-icons-dired ;; (:load-first treemacs dired) ;; (:when-loaded (treemacs-icons-dired-mode))) -(setup treemacs-magit +(setup treemacs-magit (:load-first treemacs magit)) -(setup treemacs-projectile +(setup treemacs-projectile (:load-first treemacs projectile))
-
-
Tree Sitter   languages parsers tools
-
+
6.7.1.32. Tree Sitter   languages parsers tools
+

emacs-tree-sitter is an Emacs binding for tree-sitter, an incremental parsing system. @@ -7311,10 +7227,9 @@

Tree Sitter   
-
-
Tree Sitter Indent   convenience internal
-
+
6.7.1.33. Tree Sitter Indent   convenience internal
+

https://codeberg.org/FelipeLema/tree-sitter-indent.el.git

@@ -7333,10 +7248,9 @@
Tree Sitter Indent    -
Tree Sitter Fold (ts-fold)   convenience folding
-
+
6.7.1.34. Tree Sitter Fold (ts-fold)   convenience folding
+

ts-fold builds on top of elisp-tree-sitter to provide code folding base on the tree-sitter syntax tree. @@ -7356,10 +7270,9 @@

Tree Sitter Fold (ts-fold)   
-
-
Undo Propose   convenience files undo redo history
-
+
6.7.1.35. Undo Propose   convenience files undo redo history
+

Navigate the emacs undo history by staging undo's in a temporary buffer.

@@ -7369,7 +7282,7 @@
Undo Propose   
-
(setup undo-propose
+
(setup undo-propose
   (:doc "Navigate the emacs undo history by staging undo's in a temporary buffer.")
   (:url "https://github.com/jackkamm/undo-propose-el")
   (:tag "convenience" "files" "undo" "redo" "history")
@@ -7378,10 +7291,9 @@ 
Undo Propose   
-
-
Visual-fill-column   convenience
-
+
6.7.1.36. Visual-fill-column   convenience
+

Emacs mode for wrapping visual-line-mode buffers at fill-column.

@@ -7391,7 +7303,7 @@
Visual-fill-column    -
(setup visual-fill-column
+
(setup visual-fill-column
   (:doc "Emacs mode for wrapping visual-line-mode buffers at fill-column.")
   (:url "https://github.com/joostkremers/visual-fill-column")
   (:tag "convenience")
@@ -7404,17 +7316,16 @@ 
Visual-fill-column   ) (:mode-hook - (if visual-fill-column-mode - (setq split-window-preferred-function #'visual-fill-column-split-window-sensibly) - (setq split-window-preferred-function #'split-window-sensibly)))) + (if visual-fill-column-mode + (setq split-window-preferred-function #'visual-fill-column-split-window-sensibly) + (setq split-window-preferred-function #'split-window-sensibly))))
-
-
vundo   undo redo
-
+
6.7.1.37. vundo   undo redo
+

Visual undo tree.

@@ -7428,23 +7339,23 @@
vundo   undo<

-
(setup vundo
+
(setup vundo
   (:doc "Visual undo tree.")
   (:url "https://github.com/casouri/vundo")
   (:tag "undo" "redo")
-  (:custom
-   vundo-window-side        'top
-   vundo--window-max-height 5)
+  (:opt
+   vundo-window-side        'bottom
+   vundo-window-max-height  5
+   vundo-glyph-alist        vundo-unicode-symbols)
   (:global
    "s-/" vundo))
 
-
-
Which Key   help
-
+
6.7.1.38. Which Key   help
+

Emacs package that displays available keybindings in popup.

@@ -7454,7 +7365,7 @@
Which Key    -
(setup which-key
+
(setup which-key
   (:doc "Emacs package that displays available keybindings in popup.")
   (:url "https://github.com/justbur/emacs-which-key")
   (:tag "help")
@@ -7464,10 +7375,9 @@ 
Which Key    -
Writeroom   text
-
+
6.7.1.39. Writeroom   text
+

writeroom-mode is a minor mode for Emacs that implements a distraction-free writing mode similar to the famous Writeroom editor for macOS. @@ -7478,54 +7388,52 @@

Writeroom    -
(setup writeroom-mode
+
(setup writeroom-mode
   (:doc "Writeroom-mode: distraction-free writing for Emacs.")
   (:url "https://github.com/joostkremers/writeroom-mode")
   (:tag "text")
   (:custom
    writeroom-global-effects
-   '(;; writeroom effects
+   '(;; writeroom effects
      ;; writeroom-set-fullscreen
      writeroom-set-alpha
      writeroom-set-menu-bar-lines
      ;; writeroom-set-tool-bar-lines
      writeroom-set-vertical-scroll-bars
      writeroom-set-bottom-divider-width)
-   writeroom-fullscreen-effect 'maximized
+   writeroom-fullscreen-effect 'maximized
    writeroom-maximize-window   nil
    writeroom-width             1.0))
 
-
-
yank-pulse   text
-
+
6.7.1.40. yank-pulse   text
+
;; From https://christiantietze.de/posts/2020/12/emacs-pulse-highlight-yanked-text/
-(defun nasy/-yank-pulse-advice (orig-fn &rest args)
+(defun nasy/-yank-pulse-advice (orig-fn &rest args)
   ;; Define the variables first
-  (let (begin end)
+  (let (begin end)
     ;; Initialize `begin` to the current point before pasting
-    (setq begin (point))
+    (setq begin (point))
     ;; Forward to the decorated function (i.e. `yank`)
     (apply orig-fn args)
     ;; Initialize `end` to the current point after pasting
-    (setq end (point))
+    (setq end (point))
     ;; Pulse to highlight!
     (pulse-momentary-highlight-region begin end)))
 
-(setup pulse
+(setup pulse
   (:advice yank :around nasy/-yank-pulse-advice))
 
-
-
Yasnipeet   convenience emulation
-
+
6.7.1.41. Yasnipeet   convenience emulation
+

YASnippet is a template system for Emacs. It allows you to type an abbreviation and automatically expand it into function templates. Bundled language templates @@ -7547,19 +7455,19 @@

Yasnipeet    -
(defvar nasy-yas-new-snippet (concat *nasy-etc* "yas-new")
+
(defvar nasy-yas-new-snippet (concat *nasy-etc* "yas-new")
   "Yasnippet prompt.")
 
 
-(defun nasy/yas-new-snippet-with-example ()
+(defun nasy/yas-new-snippet-with-example ()
   "https://mjdiloreto.github.io/posts/yasnippet-helpful-buffer/"
-  (interactive)
-  (funcall-interactively 'yas-new-snippet)
+  (interactive)
+  (funcall-interactively 'yas-new-snippet)
   (erase-buffer)
   (insert-file-contents nasy-yas-new-snippet))
 
 
-(setup yasnippet
+(setup yasnippet
   (:doc "A template system for Emacs")
   (:url "https://github.com/joaotavora/yasnippet")
   (:tag "convenience" "enmulation")
@@ -7567,7 +7475,7 @@ 
Yasnipeet   (:autoload yas-minor-mode yas-reload-all) (:custom - yas-snippet-dirs `(,(concat *nasy-etc* "yasnippet/snippets/"))) + yas-snippet-dirs `(,(concat *nasy-etc* "yasnippet/snippets/"))) (:with-mode yas-minor-mode (:hook-into prog-mode-hook text-mode-hook) (:bind @@ -7581,13 +7489,12 @@
Yasnipeet    -

庭燎

-
+

6.8. 庭燎

+
-
(add-to-list 'load-path (locate-user-emacs-file  "桃夭/庭燎"))
-(require '庭燎)
+
(add-to-list 'load-path (locate-user-emacs-file  "桃夭/庭燎"))
+(require '庭燎)
 
@@ -7612,14 +7519,13 @@

庭燎

UI

-
-

-
+

6.8.1.

+
-
Calendar
-
+
6.8.1.1. Calendar
+

Also cal-china-x

@@ -7642,9 +7548,9 @@
Calendar

-
(defun nasy/chinese-date-string (date)
+
(defun nasy/chinese-date-string (date)
   "Nasy version calendar string of DATE."
-  (let* ((cn-date (calendar-chinese-from-absolute
+  (let* ((cn-date (calendar-chinese-from-absolute
                    (calendar-absolute-from-gregorian date)))
          (cn-year  (cadr   cn-date))
          (cn-month (cl-caddr  cn-date))
@@ -7654,46 +7560,46 @@ 
Calendar
(calendar-chinese-sexagesimal-name cn-year) ;; (aref cal-china-x-zodiac-name (% (1- cn-year) 12)) (aref cal-china-x-month-name (1- (floor cn-month))) - (if (integerp cn-month) "" "(闰月)") + (if (integerp cn-month) "" "(闰月)") (aref cal-china-x-day-name (1- cn-day)) (cal-china-x-get-solar-term date) (cal-china-x-get-horoscope (car date) (cadr date))))) -(defun nasy/init-chinese-calendar () +(defun nasy/init-chinese-calendar () "Initial Chinese calendar." - (setq calendar-date-display-form - '((cal-china-x-calendar-display-form - (mapcar (lambda (el) (string-to-number el)) + (setq calendar-date-display-form + '((cal-china-x-calendar-display-form + (mapcar (lambda (el) (string-to-number el)) (list month day year))))) - (setq diary-date-forms chinese-date-diary-pattern) + (setq diary-date-forms chinese-date-diary-pattern) - (setq calendar-chinese-celestial-stem cal-china-x-celestial-stem + (setq calendar-chinese-celestial-stem cal-china-x-celestial-stem calendar-chinese-terrestrial-branch cal-china-x-terrestrial-branch) ;; (setq calendar-month-header '(propertize (format "%d年%2d月" year month) ;; 'font-lock-face ;; 'calendar-month-header)) - (when cal-china-x-force-chinese-week-day - (setq calendar-day-header-array cal-china-x-days)) + (when cal-china-x-force-chinese-week-day + (setq calendar-day-header-array cal-china-x-days)) - (setq calendar-mode-line-format + (setq calendar-mode-line-format (list - (calendar-mode-line-entry 'calendar-scroll-right "previous month" "<") + (calendar-mode-line-entry 'calendar-scroll-right "previous month" "<") ;; "日曆" - '(cal-china-x-get-holiday date) + '(cal-china-x-get-holiday date) - '(concat " " (calendar-date-string date t) + '(concat " " (calendar-date-string date t) (format " 第%d周" - (funcall (if cal-china-x-custom-week-start-date - 'cal-china-x-custom-week-of-date - 'cal-china-x-week-of-date) + (funcall (if cal-china-x-custom-week-start-date + 'cal-china-x-custom-week-of-date + 'cal-china-x-week-of-date) date))) - '(nasy/chinese-date-string date) + '(nasy/chinese-date-string date) ;; " " @@ -7707,23 +7613,23 @@
Calendar
;; (calendar-mode-line-entry 'calendar-goto-today "go to today's date" ;; nil "today")) - (calendar-mode-line-entry 'calendar-scroll-left "next month" ">"))) + (calendar-mode-line-entry 'calendar-scroll-left "next month" ">"))) - (add-hook 'calendar-move-hook 'calendar-update-mode-line) - (add-hook 'calendar-initial-window-hook 'calendar-update-mode-line) + (add-hook 'calendar-move-hook 'calendar-update-mode-line) + (add-hook 'calendar-initial-window-hook 'calendar-update-mode-line) - (add-hook 'calendar-mode-hook - (lambda () - (set (make-local-variable 'font-lock-defaults) + (add-hook 'calendar-mode-hook + (lambda () + (set (make-local-variable 'font-lock-defaults) ;; chinese month and year - '((("[0-9]+年\\ *[0-9]+月" . font-lock-function-name-face)) t)))) + '((("[0-9]+年\\ *[0-9]+月" . font-lock-function-name-face)) t)))) - (advice-add 'calendar-mark-holidays :around 'cal-china-x-mark-holidays) - (advice-add 'mouse-set-point :after 'cal-china-x-mouse-set-point)) + (advice-add 'calendar-mark-holidays :around 'cal-china-x-mark-holidays) + (advice-add 'mouse-set-point :after 'cal-china-x-mouse-set-point)) -(setup calendar +(setup calendar (:customs ;; 爾雅 月名 ((calendar-chinese-month-name-array cal-china-x-month-name) @@ -7731,7 +7637,7 @@
Calendar
"相月" "壯月" "玄月" "陽月" "辜月" "涂月"]))) -(setup cal-china-x +(setup cal-china-x (:doc "chinese localization, prioritized holiday highlight, lunar, horoscope, zodiac, etc.") (:url "https://github.com/xwl/cal-china-x") (:tag "calendar" "date") @@ -7739,20 +7645,19 @@
Calendar
cal-china-x-force-chinese-week-day t cal-china-x-always-show-jieqi t) (:first-key - (lambda () - (progn - (require 'calendar) - (require 'cal-china-x) + (lambda () + (progn + (require 'calendar) + (require 'cal-china-x) (nasy/init-chinese-calendar)))))
-
-
Centaur Tab
-
+
6.8.1.2. Centaur Tab
+

This projects aims to become an aesthetic, functional and efficient tabs plugin for Emacs with a lot of customization options. @@ -7763,45 +7668,45 @@

Centaur Tab

-
(setup centaur-tabs
+
(setup centaur-tabs
   (:advice centaur-tabs-buffer-groups :override nasy/-centaur-tabs-buffer-groups)
   (:opt
    centaur-tabs-style "wave")
   (:with-hook nasy/font-change-hook
-    (:hook (lambda () (nasy/set-symbol ?⏺ 14)))))
+    (:hook (lambda () (nasy/set-symbol ?⏺ 14)))))
 
 
-(defun nasy/-enable-centaur-tabs-local-mode ()
-  (unless centaur-tabs-mode
+(defun nasy/-enable-centaur-tabs-local-mode ()
+  (unless centaur-tabs-mode
     (centaur-tabs-mode 1))
   (centaur-tabs-local-mode 1))
 
-(defun nasy/-disable-centaur-tabs-local-mode ()
-  (unless centaur-tabs-mode
+(defun nasy/-disable-centaur-tabs-local-mode ()
+  (unless centaur-tabs-mode
     (centaur-tabs-mode 1))
   (centaur-tabs-local-mode -1))
 
 
-(defvar nasy--centaur-text-modes
-  '(org-mode org-agenda-mode org-agenda-clockreport-mode
+(defvar nasy--centaur-text-modes
+  '(org-mode org-agenda-mode org-agenda-clockreport-mode
              org-agenda-log-mode org-beamer-mode
              org-bullets-mode org-cdlatex-mode
              org-indent-mode org-src-mode diary-mode
              text-mode markdown-mode))
 
-(defvar nasy--centaur-vc-modes
-  '(magit-blame-mode magit-blob-mode magit-diff-mode
+(defvar nasy--centaur-vc-modes
+  '(magit-blame-mode magit-blob-mode magit-diff-mode
                      magit-file-mode magit-log-mode
                      magit-process-mode magit-status-mode))
 
 
-(defun nasy/-centaur-tabs-buffer-groups ()
+(defun nasy/-centaur-tabs-buffer-groups ()
   "Nasy's centaur tabs groups."
-  (let ((bn (buffer-name)))
+  (let ((bn (buffer-name)))
     (list
-     (cond
+     (cond
       ;; org, markdown & text
-      ((or (memq major-mode nasy--centaur-text-modes)
+      ((or (memq major-mode nasy--centaur-text-modes)
            (string-prefix-p "*Org Src" bn)
            (string-prefix-p "*Org Export" bn))
        "書寫")
@@ -7811,19 +7716,19 @@ 
Centaur Tab
"Magit") ;; Shell - ((memq major-mode '(eshell-mode shell-mode vterm-mode)) + ((memq major-mode '(eshell-mode shell-mode vterm-mode)) "Shell") ;; Info & Help - ((memq major-mode '(help-mode info-mode helpful-mode)) + ((memq major-mode '(help-mode info-mode helpful-mode)) "注") ;; programming - ((derived-mode-p 'prog-mode) + ((derived-mode-p 'prog-mode) "編程") ;; Web Page - ((or (memq major-mode '(eww-mode xwidget-webkit-mode)) + ((or (memq major-mode '(eww-mode xwidget-webkit-mode)) (string-prefix-p "*xwidget webkit" bn)) "網頁") @@ -7835,7 +7740,7 @@
Centaur Tab
(t (centaur-tabs-get-group-name (current-buffer))))))) -(setup centaur-tabs +(setup centaur-tabs (:quit) (:opt centaur-tabs-set-modified-marker t @@ -7847,12 +7752,12 @@
Centaur Tab
(:mode-hook ;; (centaur-tabs-headline-match) - (customize-set-variable 'centaur-tabs-set-icons t + (customize-set-variable 'centaur-tabs-set-icons t "Customized by Nasy in `centaur-tabs' block") - (customize-set-variable 'centaur-tabs-show-navigation-buttons t + (customize-set-variable 'centaur-tabs-show-navigation-buttons t "Customized by Nasy in `centaur-tabs' block") - (setq centaur-tabs-active-bar - (centaur-tabs--make-xpm 'centaur-tabs-active-bar-face + (setq centaur-tabs-active-bar + (centaur-tabs--make-xpm 'centaur-tabs-active-bar-face 4 centaur-tabs-bar-height)))) @@ -7860,112 +7765,111 @@
Centaur Tab
-
-
Dashboard
-
+
6.8.1.3. Dashboard
+
-
(setup dashboard
+
(setup dashboard
   (:autoload dashboard-refresh-buffer
              dashboard-setup-startup-hook))
 
 
-(defun nasy/-set-dashboard-init-info (&rest _)
-  (setq dashboard-init-info
-        (let ((package-count 0) (time (emacs-init-time)))
-          (setq package-count (+ (hash-table-size straight--profile-cache) package-count))
-          (if (zerop package-count)
+(defun nasy/-set-dashboard-init-info (&rest _)
+  (setq dashboard-init-info
+        (let ((package-count 0) (time (emacs-init-time)))
+          (setq package-count (+ (hash-table-size straight--profile-cache) package-count))
+          (if (zerop package-count)
               (format "Emacs started in %s" time)
             (format "%d packages loaded in %s" package-count time)))))
 
 
-(defun nasy/-dashboard-items (_)
+(defun nasy/-dashboard-items (_)
   (insert "\n       ")
-  (widget-create 'item
+  (widget-create 'item
                  :tag "近期 (r)"
-                 :action #'consult-recent-file
-                 :mouse-face 'highlight
-                 :button-face 'dashboard-heading
+                 :action #'consult-recent-file
+                 :mouse-face 'highlight
+                 :button-face 'dashboard-heading
                  :button-prefix "􀯛 "
                  :button-suffix ""
                  :format "%[%t%]"
                  :help-echo "open recent files")
   (insert "\t")
-  (widget-create 'item
+  (widget-create 'item
                  :tag "書籤 (b)"
-                 :action #'consult-bookmark
-                 :mouse-face 'highlight
-                 :button-face 'dashboard-heading
+                 :action #'consult-bookmark
+                 :mouse-face 'highlight
+                 :button-face 'dashboard-heading
                  :button-prefix "􀉚 "
                  :button-suffix ""
                  :format "%[%t%]"
                  :help-echo "open bookmarks")
   (insert "\t")
-  (widget-create 'item
+  (widget-create 'item
                  :tag "項目 (p)"
-                 :action #'projectile-switch-project
-                 :mouse-face 'highlight
-                 :button-face 'dashboard-heading
+                 :action #'projectile-switch-project
+                 :mouse-face 'highlight
+                 :button-face 'dashboard-heading
                  :button-prefix "􀉹  "
                  :button-suffix ""
                  :format "%[%t%]"
                  :help-echo "open projects")
   (insert "\n\n       ")
-  (widget-create 'item
+  (widget-create 'item
                  :tag "草稿 (c)"
-                 :action #'persistent-scratch-restore
-                 :mouse-face 'highlight
-                 :button-face 'dashboard-heading
+                 :action #'persistent-scratch-restore
+                 :mouse-face 'highlight
+                 :button-face 'dashboard-heading
                  :button-prefix "􀤑 "
                  :button-suffix ""
                  :format "%[%t%]"
                  :help-echo "restore scratch buffer")
   (insert "\t")
-  (widget-create 'item
+  (widget-create 'item
                  :tag "議程 (a)"
-                 :action #'org-agenda
-                 :mouse-face 'highlight
-                 :button-face 'dashboard-heading
+                 :action #'org-agenda
+                 :mouse-face 'highlight
+                 :button-face 'dashboard-heading
                  :button-prefix "􀮝 "
                  :button-suffix ""
                  :format "%[%t%]"
                  :help-echo "Org Agenda")
   (insert "\t")
-  (widget-create 'item
+  (widget-create 'item
                  :tag "日曆 (d)"
-                 :action #'calendar
-                 :mouse-face 'highlight
-                 :button-face 'dashboard-heading
+                 :action #'calendar
+                 :mouse-face 'highlight
+                 :button-face 'dashboard-heading
                  :button-prefix "􀉉 "
                  :button-suffix ""
                  :format "%[%t%]"
                  :help-echo "open calendar")
   (insert "\n\n       ")
-  (widget-create 'item
+  (widget-create 'item
                  :tag "芄蘭 (C)"
-                 :action #'nasy/-open-custom
-                 :mouse-face 'highlight
-                 :button-face 'dashboard-heading
+                 :action #'nasy/-open-custom
+                 :mouse-face 'highlight
+                 :button-face 'dashboard-heading
                  :button-prefix "􀍟 "
                  :button-suffix ""
                  :format "%[%t%]"
                  :help-echo "open custom file")
   (insert "\t")
-  (widget-create 'item
+  (widget-create 'item
                  :tag "源碼 (s)"
-                 :action #'nasy/-open-source-page
-                 :mouse-face 'highlight
-                 :button-face 'dashboard-heading
+                 :action #'nasy/-open-source-page
+                 :mouse-face 'highlight
+                 :button-face 'dashboard-heading
                  :button-prefix "􀧎 "
                  :button-suffix ""
                  :format "%[%t%]"
                  :help-echo "open https://github.com/nasyxx/emacs.d/")
   (insert "\t")
-  (widget-create 'item
+  (widget-create 'item
                  :tag "文檔 (D)"
-                 :action #'nasy/-open-document
-                 :mouse-face 'highlight
-                 :button-face 'dashboard-heading
+                 :action #'nasy/-open-document
+                 :mouse-face 'highlight
+                 :button-face 'dashboard-heading
                  :button-prefix "􀉅  "
                  :button-suffix ""
                  :format "%[%t%]"
@@ -7973,18 +7877,18 @@ 
Dashboard
(insert "\n\n")) -(defun nasy/dashboard-refresh () +(defun nasy/dashboard-refresh () "Refresh dashboard buffer." - (interactive) - (unless (get-buffer dashboard-buffer-name) + (interactive) + (unless (get-buffer dashboard-buffer-name) (generate-new-buffer "*dashboard*")) (dashboard-refresh-buffer)) -(declare-function persistent-scratch-restore "persistent-scratch") +(declare-function persistent-scratch-restore "persistent-scratch") -(setup dashboard +(setup dashboard (:global "<f5>" dashboard-refresh-buffer) (:bind-into dashboard-mode-map @@ -8010,7 +7914,7 @@
Dashboard
[remap previous-line] widget-backward [remap next-line] nasy/wfw1) (:hooks - dashboard-mode-hook (lambda () (setq-local tab-width 1)) + dashboard-mode-hook (lambda () (setq-local tab-width 1)) after-init-hook dashboard-setup-startup-hook after-init-hook dashboard-refresh-buffer) ;; nasy/font-change-hook (lambda () @@ -8025,12 +7929,12 @@
Dashboard
;; (nasy/set-apple-symbol ?🍭) ;; (nasy/set-apple-symbol ?📖)))) (:opt* - dashboard-items '((n-items . t)) + dashboard-items '((n-items . t)) ;; (bookmarks . t) ;; (registers . 5) ;; (agenda . 5) ;; (projects . 7)))) - dashboard-item-generators '((n-items . nasy/-dashboard-items)) + dashboard-item-generators '((n-items . nasy/-dashboard-items)) dashboard-startup-banner (concat *nasy-etc* "n_icon.png")) (:opts* ((dashboard-center-content @@ -8042,442 +7946,162 @@
Dashboard
-
-
doom Theme
-
+
6.8.1.4. doom Theme
+
-
(setup doom-themes
-  (:after all-the-icons)
-  (:first-key* (require 'doom-themes))
+
(setup doom-themes
+  (:first-key* (require 'doom-themes))
   (:opt
    doom-dracula-brighter-comments t
    doom-dracula-colorful-headers  t
    doom-dracula-comment-bg        t
-   doom-themes-treemacs-theme "doom-colors"
+   ;; doom-themes-treemacs-theme "doom-colors"
    doom-themes-org-fontify-special-tags nil)
   (:when-loaded
-   (after-x 'treemacs
-     (doom-themes-treemacs-config))
+   ;; (after-x 'treemacs
+   ;;   (doom-themes-treemacs-config))
    ;; (doom-themes-visual-bell-config)
-   (after-x 'org
+   (after-x 'org
      (doom-themes-org-config))))
 
+
+
6.8.1.5. Icons   icons
+
+

+以 nerd font 显眎圖幖 +

-
-
Pretty Mode   pretty
-
-
-
;; https://github.com/tonsky/FiraCode/wiki/Emacs-instructions
-(defun nasy/adjust-fira-code-symbol (charset &optional size)
-  (let ((size (or size 14)))
-    (set-fontset-font (frame-parameter nil 'font)
-                      charset
-                      (font-spec :family "Fira Code Symbol"
-                                 :weight 'normal
-                                 :size   size))))
-;; I haven't found one statement that makes both of the above situations work, so I use both for now
-(defun pretty-fonts-set-fontsets (CODE-FONT-ALIST)
-  "Utility to associate many unicode points with specified `CODE-FONT-ALIST'."
-  (--each CODE-FONT-ALIST
-    (-let (((font . codes) it))
-      (--each codes
-        (set-fontset-font nil `(,it . ,it) font)
-        (set-fontset-font t `(,it . ,it) font)))))
-
-(defun pretty-fonts--add-kwds (FONT-LOCK-ALIST)
-  "Exploits `font-lock-add-keywords'(`FONT-LOCK-ALIST') to apply regex-unicode replacements."
-  (font-lock-add-keywords
-   nil (--map (-let (((rgx uni-point) it))
-               `(,rgx (0 (progn
-                           (compose-region
-                            (match-beginning 1) (match-end 1)
-                            ,(concat "\t" (list uni-point)))
-                           nil))))
-             FONT-LOCK-ALIST)))
-
-(defmacro pretty-fonts-set-kwds (FONT-LOCK-HOOKS-ALIST)
-  "Set regex-unicode replacements to many modes(`FONT-LOCK-HOOKS-ALIST')."
-  `(--each ,FONT-LOCK-HOOKS-ALIST
-     (-let (((font-locks . mode-hooks) it))
-       (--each mode-hooks
-         (add-hook it (-partial 'pretty-fonts--add-kwds
-                                (symbol-value font-locks)))))))
-
-(defconst pretty-fonts-fira-font
-  '(;; OPERATORS
-    ;; Pipes
-    ("\\(<|\\)" #Xe14d) ("\\(<>\\)" #Xe15b) ("\\(<|>\\)" #Xe14e) ("\\(|>\\)" #Xe135)
-
-    ;; Brackets
-    ("\\(<\\*\\)" #Xe14b) ("\\(<\\*>\\)" #Xe14c) ("\\(\\*>\\)" #Xe104)
-    ("\\(<\\$\\)" #Xe14f) ("\\(<\\$>\\)" #Xe150) ("\\(\\$>\\)" #Xe137)
-    ("\\(<\\+\\)" #Xe155) ("\\(<\\+>\\)" #Xe156) ("\\(\\+>\\)" #Xe13a)
-
-    ;; Equality
-    ("\\(!=\\)" #Xe10e) ("\\(!==\\)"         #Xe10f) ("\\(=/=\\)" #Xe143)
-    ("\\(/=\\)" #Xe12c) ("\\(/==\\)"         #Xe12d)
-    ("\\(===\\)" #Xe13d) ("[^!/]\\(==\\)[^>]" #Xe13c)
-
-    ;; Equality Special
-    ("\\(||=\\)"  #Xe133) ("[^|]\\(|=\\)" #Xe134)
-    ("\\(~=\\)"   #Xe166)
-    ("\\(\\^=\\)" #Xe136)
-    ("\\(=:=\\)"  #Xe13b)
-
-    ;; Comparisons
-    ("\\(<=\\)" #Xe141) ("\\(>=\\)" #Xe145)
-    ("\\(</\\)" #Xe162) ("\\(</>\\)" #Xe163)
-
-    ;; Shifts
-    ("[^-=]\\(>>\\)" #Xe147) ("\\(>>>\\)" #Xe14a)
-    ("[^-=]\\(<<\\)" #Xe15c) ("\\(<<<\\)" #Xe15f)
-
-    ;; Dots
-    ("\\(\\.-\\)"    #Xe122) ("\\(\\.=\\)" #Xe123)
-    ("\\(\\.\\.<\\)" #Xe125)
-
-    ;; Hashes
-    ("\\(#{\\)"  #Xe119) ("\\(#(\\)"   #Xe11e) ("\\(#_\\)"   #Xe120)
-    ("\\(#_(\\)" #Xe121) ("\\(#\\?\\)" #Xe11f) ("\\(#\\[\\)" #Xe11a)
-
-    ;; REPEATED CHARACTERS
-    ;; 2-Repeats
-    ("\\(||\\)" #Xe132)
-    ("\\(!!\\)" #Xe10d)
-    ("\\(%%\\)" #Xe16a)
-    ("\\(&&\\)" #Xe131)
-
-    ;; 2+3-Repeats
-    ("\\(##\\)"       #Xe11b) ("\\(###\\)"          #Xe11c) ("\\(####\\)" #Xe11d)
-    ("\\(--\\)"       #Xe111) ("\\(---\\)"          #Xe112)
-    ("\\({-\\)"       #Xe108) ("\\(-}\\)"           #Xe110)
-    ("\\(\\\\\\\\\\)" #Xe106) ("\\(\\\\\\\\\\\\\\)" #Xe107)
-    ("\\(\\.\\.\\)"   #Xe124) ("\\(\\.\\.\\.\\)"    #Xe126)
-    ("\\(\\+\\+\\)"   #Xe138) ("\\(\\+\\+\\+\\)"    #Xe139)
-    ("\\(//\\)"       #Xe12f) ("\\(///\\)"          #Xe130)
-    ("\\(::\\)"       #Xe10a) ("\\(:::\\)"          #Xe10b)
-
-    ;; ARROWS
-    ;; Direct
-    ("[^-]\\(->\\)" #Xe114) ("[^=]\\(=>\\)" #Xe13f)
-    ("\\(<-\\)"     #Xe152)
-    ("\\(-->\\)"    #Xe113) ("\\(->>\\)"    #Xe115)
-    ("\\(==>\\)"    #Xe13e) ("\\(=>>\\)"    #Xe140)
-    ("\\(<--\\)"    #Xe153) ("\\(<<-\\)"    #Xe15d)
-    ("\\(<==\\)"    #Xe158) ("\\(<<=\\)"    #Xe15e)
-    ("\\(<->\\)"    #Xe154) ("\\(<=>\\)"    #Xe159)
-
-    ;; Branches
-    ("\\(-<\\)"  #Xe116) ("\\(-<<\\)" #Xe117)
-    ("\\(>-\\)"  #Xe144) ("\\(>>-\\)" #Xe148)
-    ("\\(=<<\\)" #Xe142) ("\\(>>=\\)" #Xe149)
-    ("\\(>=>\\)" #Xe146) ("\\(<=<\\)" #Xe15a)
-
-    ;; Squiggly
-    ("\\(<~\\)" #Xe160) ("\\(<~~\\)" #Xe161)
-    ("\\(~>\\)" #Xe167) ("\\(~~>\\)" #Xe169)
-    ("\\(-~\\)" #Xe118) ("\\(~-\\)"  #Xe165)
-
-    ;; MISC
-    ("\\(www\\)"                   #Xe100)
-    ("\\(<!--\\)"                  #Xe151)
-    ("\\(~@\\)"                    #Xe164)
-    ("[^<]\\(~~\\)"                #Xe168)
-    ("\\(\\?=\\)"                  #Xe127)
-    ("[^=]\\(:=\\)"                #Xe10c)
-    ("\\(/>\\)"                    #Xe12e)
-    ("[^\\+<>]\\(\\+\\)[^\\+<>]"   #Xe16d)
-    ("[^:=]\\(:\\)[^:=]"           #Xe16c)
-    ("\\(<=\\)"                    #Xe157))
-  "Fira font ligatures and their regexes.")
-
-
- -
-
(setup pretty-mode
-  (:with-hook nasy/font-change-hook
-    (:hook
-     (lambda ()
-       (progn
-         (when (display-graphic-p)
-           (set-fontset-font (frame-parameter nil 'font)
-                             '(#Xe100 . #Xe16f)
-                             "Fira Code Symbol")
-           (nasy/adjust-fira-code-symbol #Xe126 15))))))
-  (:when-loaded
-    (when (fboundp 'mac-auto-operator-composition-mode)
-      (mac-auto-operator-composition-mode))
-    (after-x 'dash
-      (pretty-fonts-set-kwds
-       '((pretty-fonts-fira-font prog-mode-hook org-mode-hook))))))
+
+
(setup nerd-icons
+  (:after kind-icon
+    (:opt
+     kind-icon-use-icons nil
+     kind-icon-mapping
+     `((array          ,(nerd-icons-codicon "nf-cod-symbol_array")       :face font-lock-type-face)
+       (boolean        ,(nerd-icons-codicon "nf-cod-symbol_boolean")     :face font-lock-builtin-face)
+       (class          ,(nerd-icons-codicon "nf-cod-symbol_class")       :face font-lock-type-face)
+       (color          ,(nerd-icons-codicon "nf-cod-symbol_color")       :face success)
+       (command        ,(nerd-icons-codicon "nf-cod-terminal")           :face default)
+       (constant       ,(nerd-icons-codicon "nf-cod-symbol_constant")    :face font-lock-constant-face)
+       (constructor    ,(nerd-icons-codicon "nf-cod-triangle_right")     :face font-lock-function-name-face)
+       (enummember     ,(nerd-icons-codicon "nf-cod-symbol_enum_member") :face font-lock-builtin-face)
+       (enum-member    ,(nerd-icons-codicon "nf-cod-symbol_enum_member") :face font-lock-builtin-face)
+       (enum           ,(nerd-icons-codicon "nf-cod-symbol_enum")        :face font-lock-builtin-face)
+       (event          ,(nerd-icons-codicon "nf-cod-symbol_event")       :face font-lock-warning-face)
+       (field          ,(nerd-icons-codicon "nf-cod-symbol_field")       :face font-lock-variable-name-face)
+       (file           ,(nerd-icons-codicon "nf-cod-symbol_file")        :face font-lock-string-face)
+       (folder         ,(nerd-icons-codicon "nf-cod-folder")             :face font-lock-doc-face)
+       (interface      ,(nerd-icons-codicon "nf-cod-symbol_interface")   :face font-lock-type-face)
+       (keyword        ,(nerd-icons-codicon "nf-cod-symbol_keyword")     :face font-lock-keyword-face)
+       (macro          ,(nerd-icons-codicon "nf-cod-symbol_misc")        :face font-lock-keyword-face)
+       (magic          ,(nerd-icons-codicon "nf-cod-wand")               :face font-lock-builtin-face)
+       (method         ,(nerd-icons-codicon "nf-cod-symbol_method")      :face font-lock-function-name-face)
+       (function       ,(nerd-icons-codicon "nf-cod-symbol_method")      :face font-lock-function-name-face)
+       (module         ,(nerd-icons-codicon "nf-cod-file_submodule")     :face font-lock-preprocessor-face)
+       (numeric        ,(nerd-icons-codicon "nf-cod-symbol_numeric")     :face font-lock-builtin-face)
+       (operator       ,(nerd-icons-codicon "nf-cod-symbol_operator")    :face font-lock-comment-delimiter-face)
+       (param          ,(nerd-icons-codicon "nf-cod-symbol_parameter")   :face default)
+       (property       ,(nerd-icons-codicon "nf-cod-symbol_property")    :face font-lock-variable-name-face)
+       (reference      ,(nerd-icons-codicon "nf-cod-references")         :face font-lock-variable-name-face)
+       (snippet        ,(nerd-icons-codicon "nf-cod-symbol_snippet")     :face font-lock-string-face)
+       (string         ,(nerd-icons-codicon "nf-cod-symbol_string")      :face font-lock-string-face)
+       (struct         ,(nerd-icons-codicon "nf-cod-symbol_structure")   :face font-lock-variable-name-face)
+       (text           ,(nerd-icons-codicon "nf-cod-text_size")          :face font-lock-doc-face)
+       (typeparameter  ,(nerd-icons-codicon "nf-cod-list_unordered")     :face font-lock-type-face)
+       (type-parameter ,(nerd-icons-codicon "nf-cod-list_unordered")     :face font-lock-type-face)
+       (unit           ,(nerd-icons-codicon "nf-cod-symbol_ruler")       :face font-lock-constant-face)
+       (value          ,(nerd-icons-codicon "nf-cod-symbol_field")       :face font-lock-builtin-face)
+       (variable       ,(nerd-icons-codicon "nf-cod-symbol_variable")    :face font-lock-variable-name-face)
+       (t              ,(nerd-icons-codicon "nf-cod-code")               :face font-lock-warning-face)))))
+
+(setup nerd-icons-ibuffer
+  (:hook-into ibuffer-mode-hook))
+
+(setup nerd-icons-completion
+  (:first-key nerd-icons-completion-mode))
+
+(setup treemacs-nerd-icons
+  (:after* treemacs
+    (:require treemacs-nerd-icons)
+    (treemacs-load-theme "nerd-icons")))
 
+
+
+
+
6.8.1.6. Ligature
+
+

+This package maps ordinary graphemes (characters) to fancy ligatures, if both your version of Emacs and the font supports it. +

+ +

+With this package you can control where Emacs must display ligatures. That is useful if you only want a subset of the ligatures in certain major modes, for instance, or if you want to ensure that some modes have no ligatures at all. +

+ +

+https://github.com/mickeynp/ligature.el +

-
;; (setup pretty-mode
-;;   (:with-hook nasy/font-change-hook
-;;     (:hook
-;;      (lambda ()
-;;        (progn
-;;          (nasy/set-symbol ?ℂ 13 'bold)
-;;          (nasy/set-symbol ?𝕔 16)
-;;          (nasy/set-symbol ?𝔻 13 'bold)
-;;          (nasy/set-symbol ?𝕕 14)
-;;          (nasy/set-symbol ?𝕃 13 'bold)
-;;          (nasy/set-symbol ?𝕝 14) ;; with   (1/4 space)
-;;          (nasy/set-symbol ?ℝ 12 'bold)
-;;          (nasy/set-symbol ?𝕣 18)
-;;          (nasy/set-symbol ?𝕋 14 'bold)
-;;          (nasy/set-symbol ?𝕥 19)
-;;          (nasy/set-symbol ?ℤ 13 'bold)
-;;          (nasy/set-symbol ?𝕫 16)
-;;          (nasy/set-symbol ?∑ 11 'bold)
-;;          (nasy/set-symbol ?∏ 11 'bold)
-;;          (nasy/set-symbol ?∅ 11 'bold)
-;;          (nasy/set-symbol ?⋃ 11 'bold))))))
-(setup pretty-mode
-  (:with-hook prog-mode-hook
-    (:hook
-     (lambda () (mapc (lambda (pair) (push pair prettify-symbols-alist))
-                 '(;; Data Type             P N
-                   ("Float"  . #x211d)  ;; ℝxxxx
-                   ("float"  . #x211d)  ;; ℝxxx
-                   ("Int"    . #x2124)  ;; ℤxxx
-                   ("int"    . #x2124)  ;; ℤxxx
-                   ;; ("String" . #x1d57e)  ;; 𝕊 𝕾
-                   ;; ("string" . #x1d598)  ;; 𝕤 𝖘
-                   ;; ("str"    . #x1d598)  ;; 𝕤 𝖘
-                   ("String" . (#x1d54a (Br . Bl) #x2006))  ;; 𝕊 xxxxxx
-                   ("string" . (#x1d54a (Br . Bl) #x2006))  ;; 𝕤 xxxxxx x1d564
-                   ("str"    . (#x1d54a (Br . Bl) #x2006))  ;; 𝕤 xxxx
-                   ("Char"   . #x2102)   ;; ℂx
-                   ("char"   . #x1d554)  ;; 𝕔x
-
-                   ("False"  . #x1d53d)  ;; 𝔽 𝕱
-                   ("True"   . #x1d54b)  ;; 𝕋 𝕿
-
-                   ("Any"    . #x2203)  ;; 
-                   ("any"    . #x2203)  ;; 
-                   ("any_"   . #x2203)  ;; 
-                   ("And"    . (#x2000 (Br . Bl) #x22c0 (Br . Bl) #x2005))  ;; 
-                   ("and"    . (#x2004 (Br . Bl) #x22cf (Br . Bl) #x2004 (Br . Bl) #x2009))  ;; 
-                   ("Or"     . #x22c1)  ;; 
-                   ("or"     . (#x2006 (Br . Bl) #x22cE (Br . Bl) #x2009))  ;; 
-                   ("not"    . #x00ac)  ;; ¬
-                   ("not_"   . #x00ac)  ;; ¬
-
-                   ("All"    . #x2200)  ;; 
-                   ("all"    . #x2200)  ;; 
-                   ("all_"   . #x2200)  ;; 
-                   ("for"    . #x2200)  ;; 
-                   ("forall" . #x2200)  ;; 
-                   ("forM"   . #x2200)  ;; 
-
-                   ("pi"     . #x03c0)  ;; π
-
-                   ("sum"    . #x2211)  ;; 
-                   ("Sum"    . #x2211)  ;; 
-                   ("Product" . #x220F) ;; 
-                   ("product" . #x220F) ;; 
-
-                   ("None"   . #x2205)  ;; 
-                   ("none"   . #x2205)  ;; 
-
-                   ("in"     . (#x2006 (Br . Bl) #x2208 (Br . Bl) #x2009 (Br . Bl) #x2009))  ;;  ∈  
-                   ("`elem`" . (#x2006 (Br . Bl) #x2208 (Br . Bl) #x2009 (Br . Bl) #x2009))  ;;  ∈  
-                   ("not in"    . (#x2006 (Br . Bl) #x2209 (Br . Bl) #x2009 (Br . Bl) #x2009))  ;;  ∉  
-                   ("`notElem`" . (#x2006 (Br . Bl) #x2209 (Br . Bl) #x2009 (Br . Bl) #x2009))  ;;  ∉  
-                   ("return" . (#x21d2 (Br . Bl) #x2005 ))  ;; ⇒  x (Br . Bl) #x2006
-                   ("yield"  . (#x21d4 (Br . Bl) #x2004))  ;; ⇔ x xxxxxxxxxxxxxxxxx
-                   ("pure"   . (#x21f0 (Br . Bl)))))))))          ;; ⇰ x
-(setup pretty-mode
-  (:with-hook (prog-mode-hook
-               emacs-lisp-mode-hook
-               org-mode-hook)
-    (:hook
-     (lambda () (mapc (lambda (pair) (push pair prettify-symbols-alist))
-                 '(;; Global
-                   ;; Pipes
-                   ("<|"  . (?\s (Br . Bl) #Xe14d))
-                   ("<>"  . (?\s (Br . Bl) #Xe15b))
-                   ("<|>" . (?\s (Br . Bl) ?\s (Br . Bl) #Xe14e))
-                   ("|>"  . (?\s (Br . Bl) #Xe135))
-
-                   ;; Brackets
-                   ("<*"  . (?\s (Br . Bl) #Xe14b))
-                   ("<*>" . (?\s (Br . Bl) ?\s (Br . Bl) #Xe14c))
-                   ("*>"  . (?\s (Br . Bl) #Xe104))
-                   ("<$"  . (?\s (Br . Bl) #Xe14f))
-                   ("<$>" . (?\s (Br . Bl) ?\s (Br . Bl) #Xe150))
-                   ("$>"  . (?\s (Br . Bl) #Xe137))
-                   ("<+"  . (?\s (Br . Bl) #Xe155))
-                   ("<+>" . (?\s (Br . Bl) ?\s (Br . Bl) #Xe156))
-                   ("+>"  . (?\s (Br . Bl) #Xe13a))
-                   ("[]"  . (#x2005 (Br . Bl) #x1d731 (Br . Bl) #x2005))
-
-                   ;; Equality
-                   ("=/="  . (?\s (Br . Bl) ?\s (Br . Bl) #Xe143))
-                   ("/="   . (?\s (Br . Bl) #Xe12c))
-                   ("/=="  . (?\s (Br . Bl) ?\s (Br . Bl) #Xe12d))
-                   ("/==>" . (?\s (Br . Bl) ?\s (Br . Bl) ?\s (Br . Bl) #Xe13c))
-                   ("!==>" . (?\s (Br . Bl) ?\s (Br . Bl) ?\s (Br . Bl) #Xe13c))
-                   ;; Special
-                   ("||="  . (?\s (Br . Bl) ?\s (Br . Bl) #Xe133))
-                   ("|="   . (?\s (Br . Bl) #Xe134))
-                   ("~="   . (?\s (Br . Bl) #Xe166))
-                   ("^="   . (?\s (Br . Bl) #Xe136))
-                   ("=:="  . (?\s (Br . Bl) ?\s (Br . Bl) #Xe13b))
-
-                   ;; Comparisons
-                   ("</"   . (?\s (Br . Bl) #Xe162))
-                   ("</>"  . (?\s (Br . Bl) ?\s (Br . Bl) #Xe163))
-
-                   ;; Shifts
-                   ("=>>"  . (?\s (Br . Bl) ?\s (Br . Bl) #Xe147))
-                   ("->>"  . (?\s (Br . Bl) ?\s (Br . Bl) #Xe147))
-                   (">>>"  . (?\s (Br . Bl) ?\s (Br . Bl) #Xe14a))
-                   (">>>"  . (?\s (Br . Bl) ?\s (Br . Bl) #Xe14a))
-                   ("=<<"  . (?\s (Br . Bl) ?\s (Br . Bl) #Xe15c))
-                   ("-<<"  . (?\s (Br . Bl) ?\s (Br . Bl) #Xe15c))
-                   ("<<<"  . (?\s (Br . Bl) ?\s (Br . Bl) #Xe15f))
-
-                   ;; Dots
-                   (".-"   . (?\s (Br . Bl) #Xe122))
-                   (".="   . (?\s (Br . Bl) #Xe123))
-                   ("..<"  . (?\s (Br . Bl) ?\s (Br . Bl) #Xe125))
-
-                   ;; Hashes
-                   ("#{"   . (?\s (Br . Bl) #Xe119))
-                   ("#("   . (?\s (Br . Bl) #Xe11e))
-                   ("#_"   . (?\s (Br . Bl) #Xe120))
-                   ("#_("  . (?\s (Br . Bl) #Xe121))
-                   ("#?"   . (?\s (Br . Bl) #Xe11f))
-                   ("#["   . (?\s (Br . Bl) #Xe11a))
-
-                   ;; REPEATED CHARACTERS
-                   ;; 2-Repeats
-                   ("!!"   . (?\s (Br . Bl) #Xe10d))
-                   ("%%"   . (?\s (Br . Bl) #Xe16a))
-
-                   ;; 2+3-Repeats
-                   ("##"   . (?\s (Br . Bl) #Xe11b))
-                   ("###"  . (?\s (Br . Bl) ?\s (Br . Bl) #Xe11c))
-                   ("####" . (?\s (Br . Bl) ?\s (Br . Bl) #Xe11d))
-                   ("---"  . (?\s (Br . Bl) ?\s (Br . Bl) #Xe112))
-                   ("{-"   . (?\s (Br . Bl) #Xe108))
-                   ("-}"   . (?\s (Br . Bl) #Xe110))
-                   ("\\\\" . (?\s (Br . Bl) #Xe106))
-                   ("\\\\\\" . (?\s (Br . Bl) ?\s (Br . Bl) #Xe107))
-                   (".."   . (?\s (Br . Bl) #Xe124))
-                   ("..."  . (?\s (Br . Bl) ?\s (Br . Bl) #Xe126 (Br . Bl) #x200b))
-                   ("+++"  . (?\s (Br . Bl) ?\s (Br . Bl) #Xe139))
-                   ("//"   . (?\s (Br . Bl) #Xe12f))
-                   ("///"  . (?\s (Br . Bl) ?\s (Br . Bl) #Xe130))
-                   ("::"   . (?\s (Br . Bl) #Xe10a))  ;; 
-                   (":::"  . (?\s (Br . Bl) ?\s (Br . Bl) #Xe10b))
-
-                   ;; Arrows
-                   ;; Direct
-                   ("->"  . (?\s (Br . Bl) #Xe114))  ;; 
-                   ("=>"  . (?\s (Br . Bl) #Xe13f))
-                   ("->>" . (?\s (Br . Bl) ?\s (Br . Bl) #Xe115))
-                   ("=>>" . (?\s (Br . Bl) ?\s (Br . Bl) #Xe140))
-                   ("<<-" . (?\s (Br . Bl) ?\s (Br . Bl) #Xe15d))
-                   ("<<=" . (?\s (Br . Bl) ?\s (Br . Bl) #Xe15e))
-                   ("<->" . (?\s (Br . Bl) ?\s (Br . Bl) #Xe154))
-                   ("<=>" . (?\s (Br . Bl) ?\s (Br . Bl) #Xe159))
-                   ;; Branches
-                   ("-<"  . (?\s (Br . Bl) #Xe116))
-                   ("-<<" . (?\s (Br . Bl) ?\s (Br . Bl) #Xe117))
-                   (">-"  . (?\s (Br . Bl) #Xe144))
-                   (">>-" . (?\s (Br . Bl) ?\s (Br . Bl) #Xe148))
-                   ("=<<" . (?\s (Br . Bl) ?\s (Br . Bl) #Xe142))
-                   (">=>" . (?\s (Br . Bl) ?\s (Br . Bl) #Xe146))
-                   (">>=" . (?\s (Br . Bl) ?\s (Br . Bl) #Xe149))
-                   ("<=<" . (?\s (Br . Bl) ?\s (Br . Bl) #Xe15a))
-                   ;; Squiggly
-                   ("<~"  . (?\s (Br . Bl) #Xe160))
-                   ("<~~" . (?\s (Br . Bl) ?\s (Br . Bl) #Xe161))
-                   ("~>"  . (?\s (Br . Bl) #Xe167))
-                   ("~~>" . (?\s (Br . Bl) ?\s (Br . Bl) #Xe169))
-                   ("-~"  . (?\s (Br . Bl) #Xe118))
-                   ("~-"  . (?\s (Br . Bl) #Xe165))
-
-                   ;; MISC
-                   ("www" . (?\s (Br . Bl) ?\s (Br . Bl) #Xe100))
-                   ("~@"  . (?\s (Br . Bl) #Xe164))
-                   ("~~"  . (?\s (Br . Bl) #Xe168))
-                   ("?="  . (?\s (Br . Bl) #Xe127))
-                   (":="  . (?\s (Br . Bl) #Xe10c))
-                   ("/>"  . (?\s (Br . Bl) #Xe12e))))))))
-(setup pretty-mode
-  (:with-hook python-base-mode-hook
-    (:hook
-     (lambda ()
-       (mapc (lambda (pair) (push pair prettify-symbols-alist))
-             '(;; Syntax
-               ;;("def"    . (#x1d521 (Br . Bl) #x1d522 (Br . Bl) #x1d523))
-               ("def"    . (#x1d487 (Br . Bl) #x2006))  ;; 𝒇 1 111
-               ("List"   . #x1d543)  ;; 𝕃 𝕷
-               ("list"   . (?𝕝 (Br . Bl) #x2006))  ;; 𝕝   𝖑
-               ("Dict"   . #x1d53B)  ;; 𝔻 𝕯
-               ("dict"   . #x1d555)  ;; 𝕕 𝖉
-               ("Set"    . #x1d61a)  ;; 𝔖 𝘚
-               ("set"    . #x1d634)  ;; 𝔰 𝘴
-               ("Tuple"  . #x1d61b)  ;; 𝕋 𝕿 𝘛
-               ("tuple"  . #x1d635)  ;; 𝕥 𝖙 𝘵
-
-               ("Union"  . #x22c3)  ;; 
-               ("union"  . #x22c3))))))  ;; 
-  (:with-hook haskell-mode-hook
-    (:hook
-     (lambda ()
-       (mapc (lambda (pair) (push pair prettify-symbols-alist))
-             '(;; Syntax
-               ("pure" . (#x21f0 (Br . Bl) #x2006)))))) ;; ⇰  x
-    ;; (" . "  . (?\s (Br . Bl) #x2218 (Br . Bl) ?\s (Br . Bl) #x2006)) ;; ∘
-    ))
+
(setup ligature
+  (:after ligature
+   (ligature-set-ligatures
+    't
+    '("|||>" "<|||" "<==>" "<!--" "####" "~~>" "***" "||=" "||>"
+      ":::" "::=" "=:=" "===" "==>" "=!=" "=>>" "=<<" "=/=" "!=="
+      "!!." ">=>" ">>=" ">>>" ">>-" ">->" "->>" "-->" "---" "-<<"
+      "<~~" "<~>" "<*>" "<||" "<|>" "<$>" "<==" "<=>" "<=<" "<->"
+      "<--" "<-<" "<<=" "<<-" "<<<" "<+>" "</>" "###" "#_(" "..<"
+      "..." "+++" "/==" "///" "_|_" "www" "&&" "^=" "~~" "~@" "~="
+      "~>" "~-" "**" "*>" "*/" "||" "|}" "|]" "|=" "|>" "|-" "{|"
+      "[|" "]#" "::" ":=" ":>" ":<" "$>" "==" "=>" "!=" "!!" ">:"
+      ">=" ">>" ">-" "-~" "-|" "->" "--" "-<" "<~" "<*" "<|" "<:"
+      "<$" "<=" "<>" "<-" "<<" "<+" "</" "#{" "#[" "#:" "#=" "#!"
+      "##" "#(" "#?" "#_" "%%" ".=" ".-" ".." ".?" "+>" "++" "?:"
+      "?=" "?." "??" ";;" "/*" "/=" "/>" "//" "__" "~~" "(*" "*)"
+      "\\\\" "://" "ff" "fi" "ffi")))
+  (:first-key global-ligature-mode))
 
-
(defvar nasy-prog-mode-first-key-hook nil)
-(defvar nasy--prog-mode-first-key-hook nil)
+
(defvar nasy-prog-mode-first-key-hook nil)
+(defvar nasy--prog-mode-first-key-hook nil)
 
-(defun nasy/-load-prog-mode ()
-  (setq nasy--prog-mode-first-key-hook nasy-prog-mode-first-key-hook)
-  (nasy/run-hook-once-on 'nasy--prog-mode-first-key-hook 'pre-command-hook))
+(defun nasy/-load-prog-mode ()
+  (setq nasy--prog-mode-first-key-hook nasy-prog-mode-first-key-hook)
+  (nasy/run-hook-once-on 'nasy--prog-mode-first-key-hook 'pre-command-hook))
 
-(add-hook 'prog-mode-hook #'nasy/-load-prog-mode)
+(add-hook 'prog-mode-hook #'nasy/-load-prog-mode)
 
-(add-hook 'nasy-prog-mode-first-key-hook #'(lambda () (prettify-symbols-mode 1)))
+(add-hook 'nasy-prog-mode-first-key-hook #'(lambda () (global-ligature-mode 1)))
 
-
-
Mode Line
-
+
6.8.1.7. Mode Line
+
-
(defun nasy/-start-display-time ()
+
(defun nasy/-start-display-time ()
   "Nasy start display time mode."
-  (customize-set-variable 'display-time-24hr-format          t "Customized by Nasy.")
-  (customize-set-variable 'display-time-day-and-date         t "Customized by Nasy.")
-  (customize-set-variable 'display-time-load-average         nil "Customized by Nasy.")
-  (customize-set-variable 'display-time-default-load-average nil "Customized by Nasy.")
+  (customize-set-variable 'display-time-24hr-format          t "Customized by Nasy.")
+  (customize-set-variable 'display-time-day-and-date         t "Customized by Nasy.")
+  (customize-set-variable 'display-time-load-average         nil "Customized by Nasy.")
+  (customize-set-variable 'display-time-default-load-average nil "Customized by Nasy.")
   (display-time-mode 1))
 
-(add-hook 'nasy-first-key-hook #'nasy/-start-display-time)
+(add-hook 'nasy-first-key-hook #'nasy/-start-display-time)
 
-
(setup nyan-mode
+
(setup nyan-mode
   (:opt
    nyan-animate-nyancat t
    nyan-bar-length      16
@@ -8487,7 +8111,7 @@ 
Mode Line
-
(setup minions
+
(setup minions
   (:opt
    minions-mode-line-lighter "✬")
   (:hook-into nasy-first-key-hook))
@@ -8495,17 +8119,17 @@ 
Mode Line
-
(setup doom-modeline
+
(setup doom-modeline
   (:hook-into emacs-startup-hook))
 
-(setup doom-modeline
+(setup doom-modeline
   (:opt
    inhibit-compacting-font-caches   t
    doom-modeline-bar-width          5
    doom-modeline-window-width-limit fill-column
-   doom-modeline-project-detection  'ffip  ;; changed
+   doom-modeline-project-detection  'ffip  ;; changed
    doom-modeline-continuous-word-count-modes
-   '(markdown-mode gfm-mode org-mode text-mode))
+   '(markdown-mode gfm-mode org-mode text-mode))
   (:opts
    ((doom-modeline-icon             ;; changed
      doom-modeline-unicode-fallback ;; changed
@@ -8520,38 +8144,35 @@ 
Mode Line
-
-
Nasy Theme
-
+
6.8.1.8. Nasy Theme
+
-
(setup nasy-theme)
+
(setup nasy-theme)
 
-
-
Main Theme
-
+
6.8.1.9. Main Theme
+
-
(defun nasy/load-theme ()
+
(defun nasy/load-theme ()
   "Nasy load theme function"
-  (when *theme*
-    (require 'nasy-theme)
+  (when *theme*
+    (require 'nasy-theme)
     (load-theme *theme* t)))
 
-(add-hook 'after-init-hook #'nasy/load-theme)
+(add-hook 'after-init-hook #'nasy/load-theme)
 
-
-
Tool Bar
-
+
6.8.1.10. Tool Bar
+
-
(setup tool-bar
+
(setup tool-bar
   (:tag "builtin")
   (:bind-into tool-bar-map
     [copy]            nil
@@ -8569,10 +8190,9 @@ 
Tool Bar
-
-
Tab Line
-
+
6.8.1.11. Tab Line
+
;; (add-hook 'after-init-hook #'global-tab-line-mode)
 ;; (setq tab-line-close-tab-function #'kill-buffer)
@@ -8582,13 +8202,12 @@ 
Tab Line
-
-

日月

-
+

6.9. 日月

+
-
(add-to-list 'load-path (locate-user-emacs-file  "桃夭/日月"))
-(require '日月)
+
(add-to-list 'load-path (locate-user-emacs-file  "桃夭/日月"))
+(require '日月)
 
@@ -8620,14 +8239,13 @@

日月

Applications.

-
-

-
+

6.9.1.

+
-
alert   emacs message notification
-
+
6.9.1.1. alert   emacs message notification
+

A Growl-like alerts notifier for Emacs

@@ -8637,20 +8255,19 @@
alert   emac

-
(setup alert
+
(setup alert
   (:doc "A Growl-like alerts notifier for Emacs.")
   (:url "https://github.com/jwiegley/alert")
   (:tag "notification" "emacs" "message")
   (:custom
-   alert-default-style 'osx-notifier))
+   alert-default-style 'osx-notifier))
 
-
-
Carbon Now sh   convenience
-
+
6.9.1.2. Carbon Now sh   convenience
+

Emacs to carbon.now.sh integration.

@@ -8664,7 +8281,7 @@
Carbon Now sh   
-
(setup carbon-now-sh
+
(setup carbon-now-sh
   (:doc "Emacs to carbon.now.sh integration.")
   (:url "https://github.com/veelenga/carbon-now-sh.el")
   (:tag "convenience"))
@@ -8672,10 +8289,9 @@ 
Carbon Now sh   
-
-
Cheat Sh   docs help
-
+
6.9.1.3. Cheat Sh   docs help
+

Simple Emacs interface for cheat.sh.

@@ -8685,7 +8301,7 @@
Cheat Sh   
-
(setup cheat-sh
+
(setup cheat-sh
   (:doc "Simple Emacs interface for cheat.sh")
   (:url "https://github.com/davep/cheat-sh.el")
   (:tag "docs" "help"))
@@ -8693,10 +8309,9 @@ 
Cheat Sh   
-
-
Emacs Rime   convenience inputmethod
-
+
6.9.1.4. Emacs Rime   convenience inputmethod
+

RIME ㄓ in Emacs

@@ -8706,16 +8321,17 @@
Emacs Rime    -
(setup rime
+
(setup rime
   (:doc "RIME ㄓ in Emacs")
   (:url "https://github.com/DogLooksGood/emacs-rime")
   (:tag "convenience" "input-method")
   (:custom default-input-method "rime")
-  (:first-key (lambda () (require 'rime))))
+  (:first-key (lambda () (require 'rime))))
 
-(setup rime
+(setup rime
   (:global
-   "C-M-¥" toggle-input-method)
+   "C-M-¥" toggle-input-method
+   "C-$"   toggle-input-method)
   (:bind-into rime-mode-map
    "C-`"   rime-send-keybinding
    "C-S-`" rime-send-keybinding
@@ -8727,15 +8343,15 @@ 
Emacs Rime   (expand-file-name "~/.macports") rime-user-data-dir (expand-file-name "~/.config/rime") rime-cursor "˰" - rime-show-candidate 'posframe - rime-posframe-style 'vertical - rime-show-preedit 't + rime-show-candidate 'posframe + rime-posframe-style 'vertical + rime-show-preedit 't ;; rime-show-candidate 'sidewindow ;; rime-sidewindow-keep-window t ;; rime-sidewindow-style 'horizontal ;; rime-sidewindow-side 'top rime-translate-keybindings - '("C-f" + '("C-f" "C-b" "C-n" "C-p" @@ -8754,10 +8370,9 @@
Emacs Rime    -
ESUP – Emacs Start Up Profiler   benchmark convenience processes
-
+
6.9.1.5. ESUP – Emacs Start Up Profiler   benchmark convenience processes
+

Benchmark Emacs Startup time without ever leaving your Emacs.

@@ -8767,7 +8382,7 @@
ESUP – Emacs Start Up Profiler&#

-
(setup esup
+
(setup esup
   (:doc "Benchmark Emacs Startup time without ever leaving your Emacs.")
   (:url "https://github.com/jschaf/esup")
   (:tag "benchmark" "convenience" "processes")
@@ -8776,10 +8391,9 @@ 
ESUP – Emacs Start Up Profiler&#
-
-
explain-pause-mode   performance config speed
-
+
6.9.1.6. explain-pause-mode   performance config speed
+

top, but for Emacs.

@@ -8789,7 +8403,7 @@
explain-pause-mode    -
(setup explain-pause-mode
+
(setup explain-pause-mode
   (:doc "top, but for Emacs.")
   (:url "https://github.com/lastquestion/explain-pause-mode")
   (:tag "performance" "speed" "config"))
@@ -8797,10 +8411,9 @@ 
explain-pause-mode    -
GPTEL
-
+
6.9.1.7. GPTEL
+

Openai GPT.

@@ -8810,20 +8423,19 @@
GPTEL

-
(setup gptel
+
(setup gptel
   (:doc "A no-frills ChatGPT client for Emacs.")
   (:url "https://github.com/karthink/gptel")
   (:tag "convenience")
-  (:opt gptel-default-mode 'org-mode
+  (:opt gptel-default-mode 'org-mode
         gptel-prompt-string "[Nasy]: "))
 
-