refactor: Reorganize package configurations and fix bindings

This commit is contained in:
User
2026-06-30 22:10:17 +08:00
parent 8328d2a8ff
commit 97d0a4a3e4
4 changed files with 24 additions and 20 deletions

View File

@@ -238,11 +238,6 @@
:config :config
(setq eww-auto-rename-buffer t)) (setq eww-auto-rename-buffer t))
;; shr
(use-package shr
:config
(setq shr-inhibit-images nil))
(provide 'init-base) (provide 'init-base)
;;; init-base.el ends here ;;; init-base.el ends here

View File

@@ -35,7 +35,7 @@
:stream t :stream t
:models '(kimi-for-coding) :models '(kimi-for-coding)
:header (lambda (_) :header (lambda (_)
(when-let ((key (gptel--get-api-key))) (when-let* ((key (gptel--get-api-key)))
`(("User-Agent" . "RooCode/3.30.3") `(("User-Agent" . "RooCode/3.30.3")
("HTTP-Referer" . "https://github.com/RooVetGit/Roo-Cline") ("HTTP-Referer" . "https://github.com/RooVetGit/Roo-Cline")
("X-Title" . "Roo Code") ("X-Title" . "Roo Code")
@@ -53,7 +53,8 @@
(string-trim clean))) (string-trim clean)))
(defun my-gptel-save-session () (defun my-gptel-save-session ()
"Save current gptel session to ~/gptel/sessions/ with AI-generated filename. "Save current gptel session to ~/gptel/sessions/ with AI-generated
filename.
The filename is prefixed with a YYYYMMDD-HHmmss timestamp and generated The filename is prefixed with a YYYYMMDD-HHmmss timestamp and generated
from the last 1500 characters of the buffer." from the last 1500 characters of the buffer."
(interactive) (interactive)
@@ -63,11 +64,15 @@ from the last 1500 characters of the buffer."
(content (with-current-buffer buf (content (with-current-buffer buf
(buffer-substring-no-properties (point-min) (point-max)))) (buffer-substring-no-properties (point-min) (point-max))))
(tail (substring content (max 0 (- (length content) 1500)))) (tail (substring content (max 0 (- (length content) 1500))))
(prompt-text (format "Based on the following conversation, generate a short kebab-case filename (3 to 5 lowercase English words, hyphen-separated, no file extension). Output ONLY the filename, nothing else.\n\n%s" (prompt-text (format "Based on the following conversation, generate a short kebab-case
filename (3 to 5 lowercase English words, hyphen-separated, no file
extension). Output ONLY the filename, nothing else.\n\n%s"
tail))) tail)))
(message "Generating filename with AI...") (message "Generating filename with AI...")
(let ((fsm (gptel-request prompt-text (let ((fsm (gptel-request prompt-text
:system "You are a filename generator. Output ONLY a short kebab-case filename (3-5 lowercase English words separated by hyphens). No explanations, no quotes, no punctuation, no file extension." :system "You are a filename generator. Output ONLY a short kebab-case
filename (3-5 lowercase English words separated by hyphens). No
explanations, no quotes, no punctuation, no file extension."
:stream nil :stream nil
:callback :callback
(lambda (response info) (lambda (response info)
@@ -132,7 +137,7 @@ from the last 1500 characters of the buffer."
:models '((kimi-for-coding)) :models '((kimi-for-coding))
:request-params '(:temperature 0.6 :thinking (:type "disabled")) :request-params '(:temperature 0.6 :thinking (:type "disabled"))
:header (lambda (_) :header (lambda (_)
(when-let ((key (gptel--get-api-key))) (when-let* ((key (gptel--get-api-key)))
`(("User-Agent" . "RooCode/3.30.3") `(("User-Agent" . "RooCode/3.30.3")
("HTTP-Referer" . "https://github.com/RooVetGit/Roo-Cline") ("HTTP-Referer" . "https://github.com/RooVetGit/Roo-Cline")
("X-Title" . "Roo Code") ("X-Title" . "Roo Code")

View File

@@ -75,7 +75,7 @@
:hook :hook
(after-init . denote-rename-buffer-mode) (after-init . denote-rename-buffer-mode)
(dired-mode . denote-dired-mode) (dired-mode . denote-dired-mode)
:config :init
(cond (cond
(*is-android* (*is-android*
(setq denote-directory "~/storage/shared/my-org-note/")) (setq denote-directory "~/storage/shared/my-org-note/"))
@@ -83,14 +83,14 @@
(setq denote-directory "H:/emacs/my-org-note/")) (setq denote-directory "H:/emacs/my-org-note/"))
(t (t
(setq denote-directory "~/org/my-org-note/"))) (setq denote-directory "~/org/my-org-note/")))
:init (setq denote-org-store-link-to-heading 'context
(setq denote-prompts '(title signature keywords)) denote-prompts '(title signature keywords))
(setq denote-title-history nil) (setq denote-title-history nil
(setq denote-signature-history denote-signature-history
'("note" "project" "fun" "wisdom" "article" "data" "metanote" "agenda" "journal" "archive")) '("note" "project" "fun" "wisdom" "article" "data" "metanote" "agenda" "journal" "archive")
(setq denote-known-keywords denote-known-keywords
'("emacs")) '("emacs")
(setq denote-title-history nil)) denote-title-history nil))
;; denote-org ;; denote-org
(use-package denote-org) (use-package denote-org)

View File

@@ -59,7 +59,7 @@
(:map markdown-mode-map (:map markdown-mode-map
("C-c C-e" . markdown-do)) ("C-c C-e" . markdown-do))
:hook :hook
(markdown-mode . toggle-truncate-lines) (markdown-mode . visual-line-mode)
:init :init
(setq markdown-command "multimarkdown" (setq markdown-command "multimarkdown"
markdown-fontify-code-blocks-natively t)) markdown-fontify-code-blocks-natively t))
@@ -67,6 +67,10 @@
(use-package edit-indirect) (use-package edit-indirect)
;; html ;; html
(use-package shr
:config
(setq shr-inhibit-images nil))
(use-package htmlize) (use-package htmlize)
(provide 'init-prog) (provide 'init-prog)