\f
* Lisp Changes in Emacs 30.1
-** New function 're--describe-compiled' to see the innards of a regexp.
+** New function 're-disassemble' to see the innards of a regexp.
If you compiled with '--enable-checking', you can use this to help debug
either your regexp performance problems or the regexp engine.
(insert "\n")))))
nil)
+(defun re-disassemble (regexp &optional case-table)
+ "Describe the compiled form of REGEXP in a separate window.
+If CASE-TABLE is non-nil, use it as translation table for case-folding.
+
+This function is mainly intended for maintenance of Emacs itself
+and may change at any time. It requires Emacs to be built with
+`--enable-checking'."
+ (interactive "XRegexp (Lisp expression): ")
+ (let ((desc (with-temp-buffer
+ (when case-table
+ (set-case-table case-table))
+ (let ((case-fold-search (and case-table t)))
+ (re--describe-compiled regexp)))))
+ (with-output-to-temp-buffer "*Regexp-disassemble*"
+ (with-current-buffer standard-output
+ (insert desc)))))
+
(provide 'disass)
;;; disass.el ends here