Function: verilog-comp-defun

verilog-comp-defun is a byte-compiled function defined in verilog-mode.el.gz.

Signature

(verilog-comp-defun STR PRED FLAG)

Documentation

Completion table for function names.

Function passed to completing-read, try-completion or all-completions. Returns a completion on any function name based on STR prefix. If FLAG is t, the function returns a list of all possible completions. If it is nil it returns a string, the longest possible completion, or t if STR is an exact match. If FLAG is lambda, the function returns t if STR is an exact match, nil otherwise.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/verilog-mode.el.gz
(defun verilog-comp-defun (str pred flag)
  "Completion table for function names.
Function passed to `completing-read', `try-completion' or `all-completions'.
Returns a completion on any function name based on STR prefix.
If FLAG is t, the function returns a list of all possible completions.
If it is nil it returns a string, the longest possible completion,
or t if STR is an exact match.
If FLAG is `lambda', the function returns t if STR is an exact match,
nil otherwise."
  (let ((verilog-all nil)
       (verilog-str str)
       match)

    ;; Set buffer to use for searching labels. This should be set
    ;; within functions which use verilog-completions
    (with-current-buffer verilog-buffer-to-use

      (let ((verilog-str verilog-str))
	;; Build regular expression for functions
       (setq verilog-str
             (verilog-build-defun-re (if (string= verilog-str "")
                                         "[a-zA-Z_]"
                                       verilog-str)))
	(goto-char (point-min))

	;; Build a list of all possible completions
	(while (verilog-re-search-forward verilog-str nil t)
	  (setq match (buffer-substring (match-beginning 2) (match-end 2)))
         (setq verilog-all (cons match verilog-all))))

      ;; Now we have built a list of all matches. Give response to caller
      (verilog--complete-with-action flag verilog-all verilog-str pred))))