summary refs log tree commit diff
path: root/emacs
diff options
context:
space:
mode:
authornoa2025-02-23 12:21:35 +0800
committernoa2025-02-23 12:21:35 +0800
commit04aa4f97bd1cbcafd44dbad01f6c8a530c00d74e (patch)
tree05692abb6459d62832da1a8b54939b0140baf48f /emacs
parent11ff7e76bcb5ca1ef26d57918483b30764212780 (diff)
Add function for star ratings
Diffstat (limited to 'emacs')
-rw-r--r--emacs/init.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/emacs/init.el b/emacs/init.el
index 6cdbe97..ff1e7a6 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -610,6 +610,13 @@ With prefix argument TIME, also add the current time."
 
 (global-set-key (kbd "<f5>") 'noa/insert-date-time)
 
+;; Insert a star rating into the buffer.  Currently doesn't check bounds.
+(defun noa/star-rating (rating)
+  "Insert a star rating (★★★☆☆) into the buffer at point as RATING out of five stars."
+  (interactive "nRating: ")
+  (insert-char ?★ rating)
+  (insert-char ?☆ (- 5 rating)))
+
 (defun snarf-song (url)
   (interactive "sYoutube url:")
   (async-shell-command