[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
scratch/obarray 05e8b01d8c4 6/9: add obarray-clear and use it
From: |
Mattias Engdegård |
Subject: |
scratch/obarray 05e8b01d8c4 6/9: add obarray-clear and use it |
Date: |
Mon, 12 Feb 2024 09:10:54 -0500 (EST) |
branch: scratch/obarray
commit 05e8b01d8c45f81d654e0624aba0d0cbb22295f2
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>
add obarray-clear and use it
---
lisp/abbrev.el | 3 +--
lisp/obarray.el | 5 +++++
lisp/vc/vc.el | 2 +-
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/lisp/abbrev.el b/lisp/abbrev.el
index b523977fed5..188eeb720c0 100644
--- a/lisp/abbrev.el
+++ b/lisp/abbrev.el
@@ -602,8 +602,7 @@ It is nil if the abbrev has already been unexpanded.")
"Undefine all abbrevs in abbrev table TABLE, leaving TABLE empty."
(setq abbrevs-changed t)
(let* ((sym (obarray-get table "")))
- (dotimes (i (length table))
- (aset table i 0))
+ (obarray-clear table)
;; Preserve the table's properties.
(cl-assert sym)
(let ((newsym (obarray-put table "")))
diff --git a/lisp/obarray.el b/lisp/obarray.el
index a26992df8e2..e1ebb2ade51 100644
--- a/lisp/obarray.el
+++ b/lisp/obarray.el
@@ -66,5 +66,10 @@ Return t on success, nil otherwise."
"Call function FN on every symbol in obarray OB and return nil."
(mapatoms fn ob))
+(defun obarray-clear (ob)
+ "Remove all symbols from obarray OB."
+ ;; FIXME: This doesn't change the symbols to uninterned status.
+ (fillarray ob 0))
+
(provide 'obarray)
;;; obarray.el ends here
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index f612daaa569..cfb285404ff 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -935,7 +935,7 @@ is sensitive to blank lines."
(defun vc-clear-context ()
"Clear all cached file properties."
(interactive)
- (fillarray vc-file-prop-obarray 0))
+ (obarray-clear vc-file-prop-obarray))
(defmacro with-vc-properties (files form settings)
"Execute FORM, then maybe set per-file properties for FILES.
- branch scratch/obarray created (now d6af4455d72), Mattias Engdegård, 2024/02/12
- scratch/obarray 82cf3ab0edf 2/9: Make minibuf-tests independent of obarray hash order, Mattias Engdegård, 2024/02/12
- scratch/obarray aa6f6434342 3/9: lread.c: Use bare symbol operations, Mattias Engdegård, 2024/02/12
- scratch/obarray 05e8b01d8c4 6/9: add obarray-clear and use it,
Mattias Engdegård <=
- scratch/obarray 0a1c9810065 1/9: Internal function for obarray performance analysis (bug#68244), Mattias Engdegård, 2024/02/12
- scratch/obarray 0e821664f89 4/9: use obarray-make instead of make-vector, Mattias Engdegård, 2024/02/12
- scratch/obarray 3997133bf13 5/9: use obarrayp, not vectorp, to detect obarrays, Mattias Engdegård, 2024/02/12
- scratch/obarray d6af4455d72 9/9: Use obarray object for initial obarray, Mattias Engdegård, 2024/02/12
- scratch/obarray 2fd9f17a063 7/9: remove check of obarray-default-size in tests, Mattias Engdegård, 2024/02/12
- scratch/obarray 37fdb9d87f3 8/9: add PVEC_OBARRAY and use it for obarray functions, Mattias Engdegård, 2024/02/12