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
(setq eww-auto-rename-buffer t))
;; shr
(use-package shr
:config
(setq shr-inhibit-images nil))
(provide 'init-base)
;;; init-base.el ends here

View File

@@ -35,7 +35,7 @@
:stream t
:models '(kimi-for-coding)
:header (lambda (_)
(when-let ((key (gptel--get-api-key)))
(when-let* ((key (gptel--get-api-key)))
`(("User-Agent" . "RooCode/3.30.3")
("HTTP-Referer" . "https://github.com/RooVetGit/Roo-Cline")
("X-Title" . "Roo Code")
@@ -53,7 +53,8 @@
(string-trim clean)))
(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
from the last 1500 characters of the buffer."
(interactive)
@@ -63,11 +64,15 @@ from the last 1500 characters of the buffer."
(content (with-current-buffer buf
(buffer-substring-no-properties (point-min) (point-max))))
(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)))
(message "Generating filename with AI...")
(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
:callback
(lambda (response info)
@@ -132,7 +137,7 @@ from the last 1500 characters of the buffer."
:models '((kimi-for-coding))
:request-params '(:temperature 0.6 :thinking (:type "disabled"))
:header (lambda (_)
(when-let ((key (gptel--get-api-key)))
(when-let* ((key (gptel--get-api-key)))
`(("User-Agent" . "RooCode/3.30.3")
("HTTP-Referer" . "https://github.com/RooVetGit/Roo-Cline")
("X-Title" . "Roo Code")

View File

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

View File

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