Function: verilog-symbol-detick-text

verilog-symbol-detick-text is a byte-compiled function defined in verilog-mode.el.gz.

Signature

(verilog-symbol-detick-text TEXT)

Documentation

Return TEXT without any known defines.

If the variable vh-{symbol} is defined, substitute that value. This function is intended for use in AUTO_TEMPLATE Lisp expressions.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/verilog-mode.el.gz
(defun verilog-symbol-detick-text (text)
  "Return TEXT without any known defines.
If the variable vh-{symbol} is defined, substitute that value.
This function is intended for use in AUTO_TEMPLATE Lisp expressions."
  (let ((ok t) symbol val)
    (while (and ok (string-match "`\\([a-zA-Z0-9_]+\\)" text))
      (setq symbol (match-string 1 text))
      ;;(message symbol)
      (cond ((and
	      ;; Namespace intentionally short for AUTOs and compatibility
	      (boundp (intern (concat "vh-" symbol)))
	      ;; Emacs has a bug where boundp on a buffer-local
	      ;; variable in only one buffer returns t in another.
	      ;; This can confuse, so check for nil.
	      ;; Namespace intentionally short for AUTOs and compatibility
             (setq val (symbol-value (intern (concat "vh-" symbol)))))
	     (setq text (replace-match val nil nil text)))
	    (t (setq ok nil)))))
  text)