Function: expand-add-abbrev

expand-add-abbrev is a byte-compiled function defined in expand.el.gz.

Signature

(expand-add-abbrev TABLE ABBREV EXPANSION ARG)

Documentation

Add one abbreviation and provide the hook to move to the specified positions.

Source Code

;; Defined in /usr/src/emacs/lisp/expand.el.gz
(defun expand-add-abbrev (table abbrev expansion arg)
  "Add one abbreviation and provide the hook to move to the specified positions."
  (let* ((string-exp (if (and (symbolp expansion) (fboundp expansion))
			 nil
		       expansion))
         (position   (if (and arg string-exp)
			 (if (listp arg)
			     (- (length expansion) (1- (car arg)))
			   (- (length expansion) (1- arg)))
		       0)))
    (define-abbrev
      table
      abbrev
      (vector string-exp
	      position
	      (if (and (listp arg)
		       (not (null arg)))
		  (cons (length string-exp) arg)
		nil)
	      (if (and (symbolp expansion) (fboundp expansion))
		  expansion
                nil))
      'expand-abbrev-hook)))