Function: clear-abbrev-table

clear-abbrev-table is a byte-compiled function defined in abbrev.el.gz.

Signature

(clear-abbrev-table TABLE)

Documentation

Undefine all abbrevs in abbrev table TABLE, leaving TABLE empty.

Source Code

;; Defined in /usr/src/emacs/lisp/abbrev.el.gz
;; (defvar-local local-abbrev-table fundamental-mode-abbrev-table
;;   "Local (mode-specific) abbrev table of current buffer.")

(defun clear-abbrev-table (table)
  "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))
    ;; Preserve the table's properties.
    (cl-assert sym)
    (let ((newsym (obarray-put table "")))
      (set newsym nil)	     ; Make sure it won't be confused for an abbrev.
      (setplist newsym (symbol-plist sym)))
    (abbrev-table-put table :abbrev-table-modiff
                      (1+ (abbrev-table-get table :abbrev-table-modiff))))
  ;; For backward compatibility, always return nil.
  nil)