Config: fix fix-theme-colors.el
This commit is contained in:
@@ -157,6 +157,14 @@
|
|||||||
content))
|
content))
|
||||||
(setq changes (1+ changes)))))
|
(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
|
(with-temp-file filepath
|
||||||
(insert content))
|
(insert content))
|
||||||
(message " Fixed %d issue(s)" changes)
|
(message " Fixed %d issue(s)" changes)
|
||||||
@@ -179,16 +187,32 @@
|
|||||||
(setq count (1+ count)))
|
(setq count (1+ count)))
|
||||||
(message "Removed %d compiled theme files (.elc)" count)))
|
(message "Removed %d compiled theme files (.elc)" count)))
|
||||||
|
|
||||||
;; Main execution
|
;;;###autoload
|
||||||
(let* ((themes-dir (expand-file-name "~/.emacs.d/straight/repos/replace-colorthemes/"))
|
(defun fix-theme-colors ()
|
||||||
(build-dir (expand-file-name "~/.emacs.d/straight/build/color-theme-modern/")))
|
"Fix invalid color names and properties in Emacs themes.
|
||||||
|
This function can be called interactively or from Lisp."
|
||||||
(if (file-directory-p themes-dir)
|
(interactive)
|
||||||
(progn
|
(let* ((themes-dir (expand-file-name "~/.emacs.d/straight/repos/replace-colorthemes/"))
|
||||||
(fix-all-themes themes-dir)
|
(build-dir (expand-file-name "~/.emacs.d/straight/build/color-theme-modern/")))
|
||||||
(when (file-directory-p build-dir)
|
|
||||||
(remove-compiled-themes build-dir))
|
(if (file-directory-p themes-dir)
|
||||||
(message "\nDone! Restart Emacs to load fixed themes."))
|
(progn
|
||||||
(error "Themes directory not found: %s" themes-dir)))
|
(fix-all-themes themes-dir)
|
||||||
|
(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))))
|
||||||
|
|
||||||
|
;; 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
|
;;; 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 "<prior>") 'emms-previous)
|
||||||
(local-set-key (kbd "<next>") 'emms-next)))
|
(local-set-key (kbd "<next>") 'emms-next)))
|
||||||
|
|
||||||
|
|
||||||
(defun switch-to-emms-playlist()
|
(defun switch-to-emms-playlist()
|
||||||
"Switch to emms playlist."
|
"Switch to emms playlist."
|
||||||
(interactive)
|
(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)
|
(global-set-key (kbd "C-c m d") 'my-emms-play-directory)
|
||||||
|
|
||||||
|
|
||||||
(provide 'init-kbd)
|
(provide 'init-kbd)
|
||||||
|
|
||||||
;;; init-kbd.el ends here
|
;;; init-kbd.el ends here
|
||||||
|
|||||||
Reference in New Issue
Block a user