mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
refactor!: remove pcre2el package
BREAKING CHANGE: This removes the pcre2el package, which Doom was using solely for one function to escape PCREs. In the interest of thinning out Doom's core, I've hoisted a simpler version of the function into Doom's stdlib so I can remove the dependency.
This commit is contained in:
15
lisp/lib/strings.el
Normal file
15
lisp/lib/strings.el
Normal file
@ -0,0 +1,15 @@
|
||||
;;; lisp/lib/strings.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;;###autoload
|
||||
(defun doom-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))))
|
||||
|
||||
;;; end of strings.el
|
Reference in New Issue
Block a user