Function: abbrev--check-chars

abbrev--check-chars is a byte-compiled function defined in abbrev.el.gz.

Signature

(abbrev--check-chars ABBREV GLOBAL)

Documentation

Check if the characters in ABBREV have word syntax in either the current (if global is nil) or standard syntax table.

Source Code

;; Defined in /usr/src/emacs/lisp/abbrev.el.gz
(defun abbrev--check-chars (abbrev global)
  "Check if the characters in ABBREV have word syntax in either the
current (if global is nil) or standard syntax table."
  (with-syntax-table
      (cond ((null global) (syntax-table))
            ;; ((syntax-table-p global) global)
            (t (standard-syntax-table)))
    (when (string-match "\\W" abbrev)
      (let ((badchars ())
            (pos 0))
        (while (string-match "\\W" abbrev pos)
          (cl-pushnew (aref abbrev (match-beginning 0)) badchars)
          (setq pos (1+ pos)))
        (error "Some abbrev characters (%s) are not word constituents %s"
               (apply 'string (nreverse badchars))
               (if global "in the standard syntax" "in this mode"))))))