feat(emacs): Fill some search-related stubs

This commit is contained in:
Madeleine Sydney
2025-02-20 15:45:20 -07:00
parent 98a71dc13b
commit e2193dbd53
13 changed files with 227 additions and 26 deletions

View File

@@ -120,4 +120,16 @@ in some cases."
(interactive "P<x><y>")
(syd-evil-paste t arg register yank-handler))
;;;###autoload
(defun syd-pcre-quote (str)
"Like `reqexp-quote', but for PCREs."
(let ((special '(?. ?^ ?$ ?* ?+ ?? ?{ ?\\ ?\[ ?\| ?\())
(quoted nil))
(mapc (lambda (c)
(when (memq c special)
(push ?\\ quoted))
(push c quoted))
str)
(concat (nreverse quoted))))
(provide 'syd-text)