Function: srecode-macro-help

srecode-macro-help is an interactive and byte-compiled function defined in srt-mode.el.gz.

Signature

(srecode-macro-help)

Documentation

Provide help for working with macros in a template.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/srecode/srt-mode.el.gz
(defun srecode-macro-help ()
  "Provide help for working with macros in a template."
  (interactive)
  (require 'srecode/insert)
  (let* ((root 'srecode-template-inserter)
	 (chl (eieio-class-children root))
	 (ess (srecode-template-get-escape-start))
	 (ees (srecode-template-get-escape-end))
	 )
    (with-output-to-temp-buffer "*SRecode Macros*"
      (princ "Description of known SRecode Template Macros.")
      (terpri)
      (terpri)
      (while chl
	(let* ((C (car chl))
	       (name (symbol-name C))
	       (key (when (slot-exists-p C 'key)
		      (oref C key)))
	       (showexample t))
	  (setq chl (cdr chl))
	  (setq chl (append (eieio-class-children C) chl))

	  (catch 'skip
	    (when (eq C 'srecode-template-inserter-section-end)
	      (throw 'skip nil))

	    (when (class-abstract-p C)
	      (throw 'skip nil))

            (princ (substitute-quotes "`"))
	    (princ name)
            (princ (substitute-quotes "'"))
	    (when (slot-exists-p C 'key)
	      (when key
		(princ " - Character Key: ")
		(if (stringp key)
		    (progn
		      (setq showexample nil)
		      (cond ((string= key "\n")
			     (princ "\"\\n\"")
			     )
			    (t
			     (prin1 key)
			     )))
		  (prin1 (format "%c" key))
		  )))
	    (terpri)
	    (princ (cl--class-docstring (cl--find-class C)))
	    (terpri)
	    (when showexample
	      (princ "Example:")
	      (terpri)
	      (srecode-inserter-prin-example C ess ees)
	      )

	    (terpri)

	    ) ;; catch
	  );; let*
	))))