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 @@
- +early-init
early-init
此處留些許文字以方便諸君使用
克隆到 .emacs.d
make generate -j
make config -j
@@ -495,28 +502,25 @@ 簡而言之兩步
make update
同時更新 elc 與 eln
@@ -528,10 +532,9 @@自定義文件全位于~芄蘭~有~芄蘭.el~與~custom.el~
@@ -541,57 +544,55 @@;;; 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
外皃
@@ -600,10 +601,9 @@;;; 彩.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
(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
(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)
;;;###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))))))
國風・鄭風・蔓艸
@@ -1348,10 +1345,9 @@
吾學埶不精所述設定必有遺屚朢恕
@@ -1365,10 +1361,9 @@譯 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
early-init
(unless (boundp '*nasy*)
+(unless (boundp '*nasy*)
(load (locate-user-emacs-file"early-init.el") nil t))
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
(add-to-list 'load-path (locate-user-emacs-file "桃夭/擊鼓"))
-(require '擊鼓)
+(add-to-list 'load-path (locate-user-emacs-file "桃夭/擊鼓"))
+(require '擊鼓)
以 raxod502 之 straight.el 載入包以 setup.el.
(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."))
(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))))
https://github.com/progfolio/elpaca
@@ -1757,16 +1746,15 @@(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 @@餘
;; (eval-and-compile
;; (setq leaf-defaults '(:leaf-autoload nil :leaf-defun nil :leaf-defer t))
@@ -1788,10 +1775,9 @@Leaf
;; (eval-when-compile
;; (require 'use-package)
@@ -1817,10 +1803,9 @@use-package
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.
(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
load-path
以 straight
載入本墬包即可。
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
(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"))
;; (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)
例子~芄蘭之例~、个人配置~芄蘭~與自定義~custom-file~
@@ -2101,17 +2082,16 @@(add-to-list 'load-path *nasy-custom*)
+(add-to-list 'load-path *nasy-custom*)
-
(require '芄蘭)
+(require '芄蘭)
;; (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 '芄蘭之例)
(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))
(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 '風雨時用)))
(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.")
(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)))
(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)))))
(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))
(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)))
(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)
(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)
主勭使用。
;;; 風雨時用.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))
(defvar nasy-file-sym-t '((".config/nasy-emacs" . ".emacs.d")))
+(defvar nasy-file-sym-t '((".config/nasy-emacs" . ".emacs.d")))
;;;###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
文件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<
;;;###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)))
;;;###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*"))
;; 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)))
;;;###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"))
(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))))
(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)))
(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 @@快捷鍵
(defun beacon--shine-b ()
+@@ -4068,12 +4072,11 @@(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)
光影
(provide '風雨時用)
+(provide '風雨時用)
;;; 風雨時用.el ends here
(add-to-list 'load-path (locate-user-emacs-file "桃夭/緑衣"))
-(require '緑衣)
-(require '補)
+(add-to-list 'load-path (locate-user-emacs-file "桃夭/緑衣"))
+(require '緑衣)
+(require '補)
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 @@
(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
Jump to things in Emacs tree-style.
@@ -4164,12 +4164,12 @@(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
Emacs package to redefine M-< and M-> for some modes
@@ -4196,7 +4195,7 @@(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))