Config: fix fix-theme-colors.el
This commit is contained in:
@@ -157,6 +157,14 @@
|
||||
content))
|
||||
(setq changes (1+ changes)))))
|
||||
|
||||
;; Fix :family inside :box (invalid property)
|
||||
(when (string-match ":box (\\([^)]+\\):family \"[^\"]+\"\\([^)]*\\))" content)
|
||||
(setq content (replace-regexp-in-string
|
||||
":box (\\([^)]+\\):family \"[^\"]+\"\\([^)]*\\))"
|
||||
":box (\\1\\2)"
|
||||
content))
|
||||
(setq changes (1+ changes)))
|
||||
|
||||
(with-temp-file filepath
|
||||
(insert content))
|
||||
(message " Fixed %d issue(s)" changes)
|
||||
@@ -179,7 +187,11 @@
|
||||
(setq count (1+ count)))
|
||||
(message "Removed %d compiled theme files (.elc)" count)))
|
||||
|
||||
;; Main execution
|
||||
;;;###autoload
|
||||
(defun fix-theme-colors ()
|
||||
"Fix invalid color names and properties in Emacs themes.
|
||||
This function can be called interactively or from Lisp."
|
||||
(interactive)
|
||||
(let* ((themes-dir (expand-file-name "~/.emacs.d/straight/repos/replace-colorthemes/"))
|
||||
(build-dir (expand-file-name "~/.emacs.d/straight/build/color-theme-modern/")))
|
||||
|
||||
@@ -189,6 +201,18 @@
|
||||
(when (file-directory-p build-dir)
|
||||
(remove-compiled-themes build-dir))
|
||||
(message "\nDone! Restart Emacs to load fixed themes."))
|
||||
(error "Themes directory not found: %s" themes-dir)))
|
||||
(error "Themes directory not found: %s" themes-dir))))
|
||||
|
||||
;; When run as a script (--script), execute the function
|
||||
(when noninteractive
|
||||
(fix-theme-colors))
|
||||
|
||||
;;;###autoload
|
||||
(defun fix-theme-colors-add-to-load-path ()
|
||||
"Add the directory containing this file to load-path."
|
||||
(interactive)
|
||||
(add-to-list 'load-path (file-name-directory load-file-name))
|
||||
(message "Added %s to load-path" (file-name-directory load-file-name)))
|
||||
|
||||
(provide 'fix-theme-colors)
|
||||
;;; fix-theme-colors.el ends here
|
||||
|
||||
@@ -342,7 +342,6 @@ Disable jinx-mode if it's enable and global-jinx-mode is disable , otherwise tog
|
||||
(local-set-key (kbd "<prior>") 'emms-previous)
|
||||
(local-set-key (kbd "<next>") 'emms-next)))
|
||||
|
||||
|
||||
(defun switch-to-emms-playlist()
|
||||
"Switch to emms playlist."
|
||||
(interactive)
|
||||
@@ -351,7 +350,6 @@ Disable jinx-mode if it's enable and global-jinx-mode is disable , otherwise tog
|
||||
|
||||
(global-set-key (kbd "C-c m d") 'my-emms-play-directory)
|
||||
|
||||
|
||||
(provide 'init-kbd)
|
||||
|
||||
;;; init-kbd.el ends here
|
||||
|
||||
Reference in New Issue
Block a user