[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 36cd4f5 1/2: Reimplement gnus-thread-header in Lisp
From: |
Mattias Engdegård |
Subject: |
master 36cd4f5 1/2: Reimplement gnus-thread-header in Lisp |
Date: |
Sat, 11 Dec 2021 16:20:40 -0500 (EST) |
branch: master
commit 36cd4f5d81c3c19e5719e25daa1a8e08c88cc1a7
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>
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.
---
lisp/gnus/gnus-sum.el | 24 +++++++-----------------
1 file changed, 7 insertions(+), 17 deletions(-)
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index ba61658..1bd0e88 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 <h.b.furuseth@usit.uio.no>.
-(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."