From: Mattias EngdegÄrd Date: Sat, 11 Dec 2021 20:59:13 +0000 (+0100) Subject: Reimplement gnus-thread-header in Lisp X-Git-Tag: emacs-29.0.90~3600^2~3 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=36cd4f5d81c3c19e5719e25daa1a8e08c88cc1a7;p=emacs.git Reimplement gnus-thread-header in Lisp * lisp/gnus/gnus-sum.el (gnus-thread-header): Replace lovingly hand-crafted assembler code with plain Lisp. With lexical binding the difference is unlikely to be detectable. --- diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index ba616586002..1bd0e8847e2 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -5001,23 +5001,13 @@ If LINE, insert the rebuilt thread starting on line LINE." gnus-article-sort-functions))) (gnus-message 7 "Sorting articles...done")))) -;; Written by Hallvard B Furuseth . -(defmacro gnus-thread-header (thread) - "Return header of first article in THREAD. -Note that THREAD must never, ever be anything else than a variable - -using some other form will lead to serious barfage." - (or (symbolp thread) (signal 'wrong-type-argument '(symbolp thread))) - ;; (8% speedup to gnus-summary-prepare, just for fun :-) - (cond - ((and (boundp 'lexical-binding) lexical-binding) - ;; FIXME: This version could be a "defsubst" rather than a macro. - `(#[257 "\211:\203\16\0\211@;\203\15\0A@@\207" - [] 2] - ,thread)) - (t - ;; Not sure how XEmacs handles these things, so let's keep the old code. - (list 'byte-code "\10\211:\203\17\0\211@;\203\16\0A@@\207" - (vector thread) 2)))) +(defsubst gnus-thread-header (thread) + "Return header of first article in THREAD." + (if (consp thread) + (car (if (stringp (car thread)) + (cadr thread) + thread)) + thread)) (defsubst gnus-article-sort-by-number (h1 h2) "Sort articles by article number."