From be57e47c974015bb4623b1d32f41fed5b126d229 Mon Sep 17 00:00:00 2001 From: Chen Bin Date: Mon, 4 Mar 2024 00:48:52 +1100 Subject: [PATCH] emms buffer search supports pinyin --- lisp/init-utils.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lisp/init-utils.el b/lisp/init-utils.el index 317483c93..36602afe0 100644 --- a/lisp/init-utils.el +++ b/lisp/init-utils.el @@ -550,7 +550,8 @@ Copied from 3rd party package evil-textobj." (defun my-extended-regexp (str) "Build regex compatible with pinyin from STR." - (let* ((len (length str))) + (let* ((len (length str)) + bn) (cond ;; do nothing ((<= (length str) 1)) @@ -559,8 +560,9 @@ Copied from 3rd party package evil-textobj." ;; remaining input is converted into Chinese pinyin regex. ((or (and (string-match "[:\|;]" (substring str 0 1)) (setq str (substring str 1 len))) - (and (buffer-name) (or (string= "*Org Agenda*" (buffer-name)) - (string-match "\\.org$" (buffer-name))))) + (and (setq bn (buffer-name)) + (or (member bn '("*Org Agenda*")) + (string-match ".*EMMS Playlist\\|\\.org$" bn)))) (my-ensure 'pinyinlib) (setq str (pinyinlib-build-regexp-string str)))