Function: ad-read-advice-class
ad-read-advice-class is a byte-compiled function defined in
advice.el.gz.
Signature
(ad-read-advice-class FUNCTION &optional PROMPT DEFAULT)
Documentation
Read a valid advice class with completion from the minibuffer.
An optional PROMPT will be used to prompt for the class. DEFAULT will be returned on empty input (defaults to the first non-empty advice class of FUNCTION).
Source Code
;; Defined in /usr/src/emacs/lisp/emacs-lisp/advice.el.gz
(defun ad-read-advice-class (function &optional prompt default)
"Read a valid advice class with completion from the minibuffer.
An optional PROMPT will be used to prompt for the class. DEFAULT will
be returned on empty input (defaults to the first non-empty advice
class of FUNCTION)."
(setq default
(or default
(cl-dolist (class ad-advice-classes)
(if (ad-get-advice-info-field function class)
(cl-return class)))
(error "ad-read-advice-class: `%s' has no advices" function)))
(let ((class (completing-read
(format-prompt (or prompt "Class") default)
ad-advice-class-completion-table nil t)))
(if (equal class "")
default
(intern class))))