Config: add lexical-binding: t to all files.

This commit is contained in:
User
2026-03-30 12:35:53 +08:00
parent 8e0d0a7551
commit 9499ebd704
13 changed files with 91 additions and 25 deletions

View File

@@ -1,5 +1,8 @@
;;; init-completion.el
;;; -*- lexical-binding: t -*-
;;; init-completion.el --- completion config -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:
;; eglot
(use-package eglot
@@ -68,3 +71,5 @@
(setq treesit-font-lock-level 4))
(provide 'init-completion)
;;; init-completion.el ends here

View File

@@ -1,5 +1,8 @@
;;; init-const.el
;;; -*- lexical-binding: t -*-
;;; init-const.el --- constant and system stuff -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:
;; 识别操作系统
(defconst *is-mac* (eq system-type 'darwin))
@@ -33,3 +36,5 @@
(setq w32-system-coding-system 'utf-8))
(provide 'init-const)
;;; init-const.el ends here

View File

@@ -1,5 +1,8 @@
;;; init-elpa.el
;;; -*- lexical-binding: t -*-
;;; init-elpa.el --- elpa config -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:
;; Clash 代理配置
(setq url-proxy-services
@@ -47,3 +50,5 @@
:hook (after-init . benchmark-init/deactivate))
(provide 'init-elpa)
;;; init-elpa.el ends here

View File

@@ -77,4 +77,5 @@
:state (consult--jump-state)))
(provide 'init-jinx)
;;; init-jinx.el ends here

View File

@@ -1,5 +1,8 @@
;;; init-kbd.el
;;; -*- lexical-binding: t -*-
;;; init-kbd.el --- keybindings -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:
;; 修改mac键位
(when *is-mac*
@@ -337,3 +340,5 @@ Disable jinx-mode if it's enable and global-jinx-mode is disable , otherwise tog
(provide 'init-kbd)
;;; init-kbd.el ends here

View File

@@ -1,5 +1,8 @@
;;; init-org.el
;;; -*- lexical-binding: t -*-
;;; init-org.el --- org-mode config -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:
(use-package org)
@@ -263,7 +266,7 @@ See `org-capture-templates' for more information."
;; 快速部署
(defun my-blog-publish ()
"publish blog , git add/commit/push , generate commit message"
"Publish blog , git add/commit/push , generate commit message."
(interactive)
(let* ((blog-dir "d:/emacs/hugo/this-is-my-blog/")
(timestamp (format-time-string "%Y-%m-%d %H:%M:%S"))
@@ -291,11 +294,12 @@ See `org-capture-templates' for more information."
;; 预览博客
(defun my-blog-preview ()
"Save and preview blog."
(interactive)
(save-buffer)
(let ((default-directory "d:/emacs/hugo/this-is-my-blog/"))
;; 启动 Hugo server
(start-process "hugo-server" "*hugo-server*"
(start-process "hugo-server" "*hugo-server*"
"hugo" "server" "-D" "--bind" "0.0.0.0" "--port" "1313")
;; 等待服务器启动
(sleep-for 2)
@@ -305,3 +309,5 @@ See `org-capture-templates' for more information."
(global-set-key (kbd "C-c o v") 'my-blog-preview)
(provide 'init-org)
;;; init-org.el ends here

View File

@@ -1,5 +1,8 @@
;;; init-package.el
;;; -*- lexical-binding: t -*-
;;; init-package.el --- major packages -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:
(setopt use-package-enable-imenu-support t)
@@ -207,7 +210,7 @@
;; 模式行设置
(require 'emms-mode-line)
(emms-mode-line-mode 1)
(emms-mode-line-blank) ; 初始为空
(emms-mode-line-blank) ; 初始为空
;; 自定义模式行格式
(setq emms-mode-line-format " [%s] ")
@@ -307,3 +310,5 @@
(use-package vterm))
(provide 'init-package)
;;; init-package.el ends here

View File

@@ -1,5 +1,8 @@
;;; init-segmentation.el
;;; -*- lexical-binding: t -*-
;;; init-segmentation.el --- Chinese segmentation config -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:
;; emacs-chinese-word-segmentation 配置
(when *is-windows*
@@ -40,3 +43,5 @@
(define-key cns-mode-map (kbd "C-<backspace>") nil))
(provide 'init-segmentation)
;;; init-segmentation.el ends here

View File

@@ -1,5 +1,8 @@
;;; init-startup.el
;;; -*- lexical-binding: t -*-
;;; init-startup.el --- startup settings -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:
;; mac自动全屏
(when *is-mac*
@@ -66,3 +69,5 @@
(add-hook 'org-mode-hook 'electric-pair-mode)
(provide 'init-startup)
;;; init-startup.el ends here

View File

@@ -1,5 +1,8 @@
;;; init-ui.el
;;; -*- lexical-binding: t -*-
;;; init-ui.el --- ui and other style customization cofig -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:
;; 设置系统编码
(when (fboundp 'set-charset-priority)
@@ -120,3 +123,5 @@
(cnfonts--select-profile "profile1"))
(provide 'init-ui)
;;; init-ui.el ends here

View File

@@ -1,5 +1,8 @@
;;; init-window.el
;;; -*- lexical-binding: t -*-
;;; init-window.el --- windows manage packages -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:
(use-package popper
:defines popper-echo-dispatch-actions
@@ -102,3 +105,5 @@
(use-package es-windows)
(provide 'init-window)
;;; init-window.el ends here