[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/tablist c78eccd 24/60: Turn macro into a function
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/tablist c78eccd 24/60: Turn macro into a function |
Date: |
Sun, 1 Aug 2021 18:19:28 -0400 (EDT) |
branch: elpa/tablist
commit c78eccdc68dc858b0d33987735622a7c1c1b63a4
Author: Andreas Politz <politza@hochschule-trier.de>
Commit: Andreas Politz <politza@hochschule-trier.de>
Turn macro into a function
* lisp/tablist.el (tablist-generate-sorter): This should be a function.
---
tablist.el | 20 +++++++-------------
1 file changed, 7 insertions(+), 13 deletions(-)
diff --git a/tablist.el b/tablist.el
index 5e56926..567d69e 100644
--- a/tablist.el
+++ b/tablist.el
@@ -1926,7 +1926,7 @@ AWINDOW is deleted."
(tablist-window-attach newwin window)
newwin))
-(defmacro tablist-generate-sorter (column compare-fn &optional read-fn)
+(defun tablist-generate-sorter (column compare-fn &optional read-fn)
"Generate a sort function for `tabulated-list' entries.
Example:
@@ -1936,18 +1936,12 @@ Example:
would create a sort function sorting `tabulated-list-entries' on
the 0-th column as numbers by the less-than relation."
- (let ((column-sym (make-symbol "column"))
- (compare-fn-sym (make-symbol "compare-fn"))
- (read-fn-sym (make-symbol "read-fn")))
- `(let ((,column-sym ,column)
- (,compare-fn-sym ,compare-fn)
- (,read-fn-sym (or ,read-fn 'identity)))
- (lambda (e1 e2)
- (funcall ,compare-fn-sym
- (funcall ,read-fn-sym
- (aref (cadr e1) ,column-sym))
- (funcall ,read-fn-sym
- (aref (cadr e2) ,column-sym)))))))
+ (lambda (e1 e2)
+ (funcall compare-fn
+ (funcall (or read-fn 'identity)
+ (aref (cadr e1) column))
+ (funcall read-fn
+ (aref (cadr e2) column)))))
(provide 'tablist)
;;; tablist.el ends here
- [nongnu] elpa/tablist 0f1e499 21/60: Add .dir-locals.el, (continued)
- [nongnu] elpa/tablist 0f1e499 21/60: Add .dir-locals.el, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/tablist 3ade133 15/60: Handle recent changes in eldoc., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/tablist 6c03338 12/60: *** empty log message ***, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/tablist 6d03439 20/60: Added dir-locals.el, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/tablist d65235d 14/60: Fixed a bug regarding tablist columns., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/tablist 9c0c56d 22/60: * lisp/pdf-occur.el: New and improved asynchronous, multiple file occur., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/tablist a0c8192 23/60: Bumped version added NEWS., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/tablist bf2e139 04/60: Fixed some bindings., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/tablist f980411 08/60: Clean up help text., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/tablist 82bf4b9 10/60: Updated copyright., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/tablist c78eccd 24/60: Turn macro into a function,
Philip Kaludercic <=
- [nongnu] elpa/tablist c5da8e6 32/60: Ignore .cask directory, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/tablist 117c37f 33/60: Added Cask, Makefile and README files, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/tablist 2262a80 35/60: Clear .dir-locals.el, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/tablist f13b8f0 41/60: Improve README, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/tablist c834a84 42/60: Cosmetic changes to tablist, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/tablist af87031 45/60: Add compatibility with Emacs 27, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/tablist 389730e 46/60: Add byte-compile target, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/tablist 8079801 48/60: Fix invalid argument error, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/tablist 61f653f 52/60: Quote commands as functions, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/tablist 7cd9360 27/60: Merge branch 'master' into options, Philip Kaludercic, 2021/08/01