Function: ad-make-single-advice-docstring

ad-make-single-advice-docstring is a byte-compiled function defined in advice.el.gz.

Signature

(ad-make-single-advice-docstring ADVICE CLASS &optional STYLE)

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/advice.el.gz
;; @@@ Making an advised documentation string:
;; ===========================================
;; New policy: The documentation string for an advised function will be built
;; at the time the advised `documentation' function is called.  This has the
;; following advantages:
;;   1) command-key substitutions will automatically be correct
;;   2) No wasted string space due to big advised docstrings in caches or
;;      compiled files that contain preactivations
;; The overall overhead for this should be negligible because people normally
;; don't lookup documentation for the same function over and over again.

(defun ad-make-single-advice-docstring (advice class &optional style)
  (let ((advice-docstring (ad-docstring (ad-advice-definition advice))))
    (cond ((eq style 'plain)
	   advice-docstring)
	  (t (if advice-docstring
		 (format "%s-advice `%s':\n%s"
			 (capitalize (symbol-name class))
			 (ad-advice-name advice)
			 advice-docstring)
	       (format "%s-advice `%s'."
		       (capitalize (symbol-name class))
		       (ad-advice-name advice)))))))