APPROVE COMMIT
NOTE: This patch has been committed
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1555271198 -3600
# Sun Apr 14 20:46:38 2019 +0100
# Node ID 0a871e6424f98ebba6b22ceea1531da1f85358a8
# Parent 900e287bde1f0288186a4db74f7c4138be468deb
Remove #'weak-box-ref-1 from the dumped Lisp, ensure a reasonable docstring
2019-04-14 Aidan Kehoe <kehoea(a)parhasard.net>
* misc.el:
* misc.el (make-weak-box):
* misc.el (weak-box-ref):
* misc.el (:load-toplevel):
Remove #'weak-box-ref-1 from the dumped Lisp binary, using
(eval-when (:load-toplevel) ...) to ensure a reasonable docstring.
diff -r 900e287bde1f -r 0a871e6424f9 lisp/ChangeLog
--- a/lisp/ChangeLog Sun Apr 14 15:00:53 2019 +0100
+++ b/lisp/ChangeLog Sun Apr 14 20:46:38 2019 +0100
@@ -1,3 +1,12 @@
+2019-04-14 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * misc.el:
+ * misc.el (make-weak-box):
+ * misc.el (weak-box-ref):
+ * misc.el (:load-toplevel):
+ Remove #'weak-box-ref-1 from the dumped Lisp binary, using
+ (eval-when (:load-toplevel) ...) to ensure a reasonable docstring.
+
2019-03-28 Aidan Kehoe <kehoea(a)parhasard.net>
* x-init.el (pseudo-canonicalize-keysym):
diff -r 900e287bde1f -r 0a871e6424f9 lisp/misc.el
--- a/lisp/misc.el Sun Apr 14 15:00:53 2019 +0100
+++ b/lisp/misc.el Sun Apr 14 20:46:38 2019 +0100
@@ -94,6 +94,7 @@
(progn
(defalias 'weak-box-ref-1
#'(lambda (weak-box)
+ (check-type weak-box weak-box)
(cdr (assq weak-box
(weak-list-list all-weak-boxes)))))
;; Use defvar so calls to #'make-weak-box when it is
@@ -110,7 +111,17 @@
(defun weak-box-ref (weak-box)
"Return the contents of weak box WEAK-BOX.
If the contents have been GCed, return NIL."
- (check-argument-type 'weak-box-p weak-box)
(weak-box-ref-1 weak-box))
+(eval-when (:load-toplevel)
+ (defalias 'weak-box-ref
+ (make-byte-code
+ (compiled-function-arglist (symbol-function 'weak-box-ref-1))
+ (compiled-function-instructions (symbol-function 'weak-box-ref-1))
+ (compiled-function-constants (symbol-function 'weak-box-ref-1))
+ (compiled-function-stack-depth (symbol-function 'weak-box-ref-1))
+ ;; Use the docstring info of #'weak-box-ref itself.
+ (compiled-function-doc-string (symbol-function 'weak-box-ref))))
+ (unintern 'weak-box-ref-1))
+
;;; misc.el ends here
--
‘As I sat looking up at the Guinness ad, I could never figure out /
How your man stayed up on the surfboard after forty pints of stout’
(C. Moore)