aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias EngdegÄrd2021-12-11 21:59:13 +0100
committerMattias EngdegÄrd2021-12-11 21:59:13 +0100
commit36cd4f5d81c3c19e5719e25daa1a8e08c88cc1a7 (patch)
tree4347f23e0126c9c3a5ea33049d28c7f405c7dbe1
parentd56b0b4e6b5be1c27d7f3667bc3caaa63269d465 (diff)
downloademacs-36cd4f5d81c3c19e5719e25daa1a8e08c88cc1a7.tar.gz
emacs-36cd4f5d81c3c19e5719e25daa1a8e08c88cc1a7.zip
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.
-rw-r--r--lisp/gnus/gnus-sum.el24
1 files changed, 7 insertions, 17 deletions
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."
5001 gnus-article-sort-functions))) 5001 gnus-article-sort-functions)))
5002 (gnus-message 7 "Sorting articles...done")))) 5002 (gnus-message 7 "Sorting articles...done"))))
5003 5003
5004;; Written by Hallvard B Furuseth <h.b.furuseth@usit.uio.no>. 5004(defsubst gnus-thread-header (thread)
5005(defmacro gnus-thread-header (thread) 5005 "Return header of first article in THREAD."
5006 "Return header of first article in THREAD. 5006 (if (consp thread)
5007Note that THREAD must never, ever be anything else than a variable - 5007 (car (if (stringp (car thread))
5008using some other form will lead to serious barfage." 5008 (cadr thread)
5009 (or (symbolp thread) (signal 'wrong-type-argument '(symbolp thread))) 5009 thread))
5010 ;; (8% speedup to gnus-summary-prepare, just for fun :-) 5010 thread))
5011 (cond
5012 ((and (boundp 'lexical-binding) lexical-binding)
5013 ;; FIXME: This version could be a "defsubst" rather than a macro.
5014 `(#[257 "\211:\203\16\0\211@;\203\15\0A@@\207"
5015 [] 2]
5016 ,thread))
5017 (t
5018 ;; Not sure how XEmacs handles these things, so let's keep the old code.
5019 (list 'byte-code "\10\211:\203\17\0\211@;\203\16\0A@@\207"
5020 (vector thread) 2))))
5021 5011
5022(defsubst gnus-article-sort-by-number (h1 h2) 5012(defsubst gnus-article-sort-by-number (h1 h2)
5023 "Sort articles by article number." 5013 "Sort articles by article number."