|
Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
;; This file:
;; http://anggtwu.net/elisp/2025-modern-reset.el.html
;; http://anggtwu.net/elisp/2025-modern-reset.el
;; (find-angg "elisp/2025-modern-reset.el")
;; Author: Eduardo Ochs <eduardoochs@gmail.com>
;;
;; See: (find-angg "ORG/2025-modern.org")
;; (find-angg "elisp/2025-modern-advice.el")
;; (find-angg "elisp/2025-modern-prints.el")
;; (find-angg "elisp/emacsconf2024.el")
;;
;; «.interpreted-function-orig» (to "interpreted-function-orig")
;; «.advice-orig» (to "advice-orig")
;; «interpreted-function-orig» (to ".interpreted-function-orig")
;; The original `cl-print-object' for `interpreted-function' objects.
;; Copied from:
;; (find-efile "emacs-lisp/cl-print.el" "(object interpreted-function)")
;;
(cl-defmethod cl-print-object ((object interpreted-function) stream)
(unless stream (setq stream standard-output))
(princ "#f(lambda " stream)
(let ((args (help-function-arglist object 'preserve-names)))
;; It's tempting to print the arglist from the "usage" info in the
;; doc (e.g. for `&key` args), but that only makes sense if we
;; *don't* print the body, since otherwise the body will tend to
;; refer to args that don't appear in the arglist.
(if args
(prin1 args stream)
(princ "()" stream)))
(let ((env (aref object 2)))
(if (null env)
(princ " :dynbind" stream)
(princ " " stream)
(cl-print-object
(vconcat (mapcar (lambda (x) (if (consp x) (list (car x) (cdr x)) x))
env))
stream)))
(let* ((doc (documentation object 'raw)))
(when doc
(princ " " stream)
(prin1 doc stream)))
(let ((inter (interactive-form object)))
(when inter
(princ " " stream)
(cl-print-object inter stream)))
(dolist (exp (aref object 1))
(princ " " stream)
(cl-print-object exp stream))
(princ ")" stream))
;; «advice-orig» (to ".advice-orig")
;; The original `cl-print-object' for `advice' objects. Copied from:
;; (find-efile "emacs-lisp/nadvice.el" "(cl-defmethod cl-print-object")
;;
(cl-defmethod cl-print-object ((object advice) stream)
(cl-assert (advice--p object))
(princ "#f(advice " stream)
(cl-print-object (advice--car object) stream)
(princ " " stream)
(princ (advice--how object) stream)
(princ " " stream)
(cl-print-object (advice--cdr object) stream)
(let ((props (advice--props object)))
(when props
(princ " " stream)
(cl-print-object props stream)))
(princ ")" stream))