Function: vhdl-aput

vhdl-aput is a byte-compiled function defined in vhdl-mode.el.gz.

Signature

(vhdl-aput ALIST-SYMBOL KEY &optional VALUE)

Documentation

Insert a key-value pair into an alist.

The alist is referenced by ALIST-SYMBOL. The key-value pair is made from KEY and VALUE. If the key-value pair referenced by KEY can be found in the alist, the value of KEY will be set to VALUE. If the key-value pair cannot be found in the alist, it will be inserted into the head of the alist.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/vhdl-mode.el.gz
    (require 'speedbar)))		; for speedbar-with-writable

(defun vhdl-aput (alist-symbol key &optional value)
  "Insert a key-value pair into an alist.
The alist is referenced by ALIST-SYMBOL.  The key-value pair is made
from KEY and VALUE.  If the key-value pair referenced by KEY can be
found in the alist, the value of KEY will be set to VALUE.  If the
key-value pair cannot be found in the alist, it will be inserted into
the head of the alist."
  (let* ((alist (symbol-value alist-symbol))
	 (elem (assoc key alist)))
    (if elem
	(setcdr elem value)
      (set alist-symbol (cons (cons key value) alist)))))