Function: ad-read-advice-name

ad-read-advice-name is a byte-compiled function defined in advice.el.gz.

Signature

(ad-read-advice-name FUNCTION CLASS &optional PROMPT)

Documentation

Read name of existing advice of CLASS for FUNCTION with completion.

An optional PROMPT is used to prompt for the name.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/advice.el.gz
(defun ad-read-advice-name (function class &optional prompt)
  "Read name of existing advice of CLASS for FUNCTION with completion.
An optional PROMPT is used to prompt for the name."
  (let* ((name-completion-table
          (mapcar (lambda (advice)
                    (list (symbol-name (ad-advice-name advice))))
		  (ad-get-advice-info-field function class)))
	 (default
	   (if (null name-completion-table)
	       (error "ad-read-advice-name: `%s' has no %s advice"
		      function class)
	     (car (car name-completion-table))))
	 (name (completing-read (format-prompt (or prompt "Name") default)
                                name-completion-table nil t)))
    (if (equal name "")
	(intern default)
      (intern name))))