Compare commits

...

5 Commits

Author SHA1 Message Date
Jason Tian 075c923417 format README.org 2023-10-19 09:38:51 +08:00
Jason TIAN 123f9ad8d3 update README.org 2023-10-19 08:40:20 +08:00
Jason TIAN 2eae453c82 update README.org 2023-10-19 08:37:21 +08:00
Jason Tian fad8ba9193 delete trailing wihtespace 2023-10-18 21:39:15 +08:00
Jason TIAN 7225adcae7 add my/highlight-selected-text 2023-10-18 21:06:22 +08:00
2 changed files with 27 additions and 4 deletions

View File

@ -2,8 +2,10 @@
[[https://github.com/jsntn/emacs.d/actions/workflows/myelpa.yml][https://github.com/jsntn/emacs.d/actions/workflows/myelpa.yml/badge.svg]]
This is my personal Emacs configuration, continually used and tweaked since
2020, and I am always trying to make it same behaviour on my Windows and macOS.
Behold, dear visitor, my cherished Emacs configuration, meticulously crafted and
refined since the year of 2020. With unwavering dedication, I tirelessly
endeavor to harmonize its functioning across both the Windows and macOS
operating systems. 🙂
* Table of Content :noexport:TOC_4:
- [[#a-personal-emacs-configuration][A Personal Emacs Configuration]]
@ -30,6 +32,7 @@ This is my personal Emacs configuration, continually used and tweaked since
- [[#plantuml-1][PlantUML]]
- [[#winpython][WinPython]]
- [[#known-issue][Known Issue]]
- [[#read-more][Read more]]
* Usage
TODO
@ -161,3 +164,6 @@ I use [[https://github.com/jwiegley/use-package][use-package]] to manage package
However, it seems the hl-todo and org-bullets settings don't work if they are
configured in the init-packages.el, i.e., [[https://github.com/jsntn/emacs.d/commit/1e409e075024d72f2dc7520ada092b04b3012f48#diff-aeac2722d1b94adc236ce40df31d9cb7eb107e43b95c13c6c795e71044ec2c29L119-L138][link 1]] and [[https://github.com/jsntn/emacs.d/commit/1e409e075024d72f2dc7520ada092b04b3012f48#diff-aeac2722d1b94adc236ce40df31d9cb7eb107e43b95c13c6c795e71044ec2c29L150-L152][link 2]], but both of them
are effective if I move them to [[https://github.com/jsntn/emacs.d/commit/19e71501432f5b5ba36375ad711eb62a3fbe91d4#diff-54e03c0bf9c47228b3868e00ea21baade79013af33501ff53bbadbd26060a227R32-R35][init-display.el]] and my [[https://github.com/jsntn/emacs.d/blob/1e409e075024d72f2dc7520ada092b04b3012f48/init.el#L98][local-config.el]].
* Read more
- https://github.com/jsntn/emacs-vagrantfile

View File

@ -5,6 +5,23 @@
;; the my/xxx utils config - yet to be placed in dedicated init-xxx.el files
(defun my/highlight-selected-text (start end &optional color)
"Highlight the selected region temporarily with the specified color.
If color is not provided, the default color is #5F87FF.
Version 2023-10-18"
(interactive "r\nsEnter color (e.g., 'red', press ENTER for default #5F87FF): ")
(let* ((overlay (make-overlay start end))
(color (if (string= color "") "#5F87FF" color))
(text-color (if (or (string= color "black") (string= color "#5F87FF"))
"white"
"black")))
(overlay-put overlay 'face `((:background ,color :foreground ,text-color)))
(add-hook 'before-revert-hook (lambda () (delete-overlay overlay)))))
(defun my/random-org-item ()
"Go to a random org heading from all org files in `org-directory`."
(interactive)
@ -510,9 +527,9 @@ Version: 2023-08-31"
(with-current-buffer existing-buffer
(goto-char (point-max)) ; move to the end of the existing buffer
(insert-buffer-substring source-buffer)
(pop-to-buffer existing-buffer))))
(pop-to-buffer existing-buffer))))
(defun my/kill-buffers-by-pattern (pattern)
"Kill buffers whose names match the specified pattern.