diff options
author | Yuchen Pei <id@ypei.org> | 2025-01-14 09:42:04 +1100 |
---|---|---|
committer | Yuchen Pei <id@ypei.org> | 2025-01-14 09:42:04 +1100 |
commit | cb90a203a7967b99032cd806f685419d4d0e2cd9 (patch) | |
tree | 1ee1e6c32800c191b717aa3f8d93f66d004374cd /emacs/.emacs.d/lisp/my | |
parent | 087556dfaaa23ab5604fba6b95e7c29515a07767 (diff) |
[emacs] Add timer to save score in emms
Also add isearch to common packages, so that search-whitespace-regexp
takes effect in the emms profile
Diffstat (limited to 'emacs/.emacs.d/lisp/my')
-rw-r--r-- | emacs/.emacs.d/lisp/my/my-package.el | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/emacs/.emacs.d/lisp/my/my-package.el b/emacs/.emacs.d/lisp/my/my-package.el index b591d0f..9eefa2e 100644 --- a/emacs/.emacs.d/lisp/my/my-package.el +++ b/emacs/.emacs.d/lisp/my/my-package.el @@ -216,6 +216,17 @@ same name, cancel that one first." (cancel-timer ,var-name)) (setq ,var-name (run-with-timer ,secs ,repeat ,function)))) +(defmacro my-timer (var-name secs repeat function) + "Create a timer. + +The timer has name VAR-NAME. If there is an existing time with the +same name, cancel that one first." + + `(progn + (when (and (boundp ',var-name) (timerp ,var-name)) + (cancel-timer ,var-name)) + (setq ,var-name (run-with-timer ,secs ,repeat ,function)))) + (defun my-describe-package-from-url (url) (interactive "sUrl: ") (when (string-match @@ -263,7 +274,7 @@ same name, cancel that one first." (add-hook hook function))) (defvar my-common-packages - '(package windmove consult icomplete + '(package windmove consult icomplete isearch my-utils my-buffer my-editing my-complete) "Common packages to include with any profile") |