branch: externals/xr
commit 1a818608cd9c6ee592731489759019e689facc1f
Author: Mattias EngdegĂ„rd <[email protected]>
Commit: Mattias EngdegĂ„rd <[email protected]>

    Use intern-soft instead of intern for less obarray fluff
---
 xr.el | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/xr.el b/xr.el
index 98228c0920..91f7f2e4d2 100644
--- a/xr.el
+++ b/xr.el
@@ -130,12 +130,11 @@ END is nil if unknown."
              (eq (aref string (1+ idx)) ?:)
              (let ((i (xr--string-search ":]" string (+ 2 idx))))
                (if i
-                   ;; FIXME: don't pollute the standard obarray
-                   (let ((sym (intern (substring string (+ idx 2) i))))
+                   (let* ((name (substring string (+ idx 2) i))
+                          (sym (intern-soft name)))
                      (unless (memq sym (eval-when-compile xr--char-classes))
                        (xr--error idx (1+ i)
-                                  "No character class `[:%s:]'"
-                                  (symbol-name sym)))
+                                  "No character class `[:%s:]'" name))
                      (let ((prev (assq sym classes)))
                        (if prev
                            (let* ((prev-beg (cdr prev))
@@ -1834,11 +1833,11 @@ A-SETS and B-SETS are arguments to `any'."
            (eq (aref string (1+ idx)) ?:)
            (let ((i (xr--string-search ":]" string (+ 2 idx))))
              (if i
-                  (let ((sym (intern (substring string (+ idx 2) i))))
+                 (let* ((name (substring string (+ idx 2) i))
+                        (sym (intern-soft name)))
                     (unless (memq sym (eval-when-compile xr--char-classes))
                       (xr--error idx (1+ i)
-                                 "No character class `[:%s:]'"
-                                 (symbol-name sym)))
+                                 "No character class `[:%s:]'" name))
                     ;; Another useful ad-hoc check.
                     (when (and (> idx 0)
                                (eq (aref string (1- idx)) ?\[)

Reply via email to