aboutsummaryrefslogtreecommitdiff
path: root/sx.el
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2015-02-26 16:07:56 -0300
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-02-26 16:07:56 -0300
commitcb93e1d242e866f9bd862880ecbcfceaec16ecd9 (patch)
treee6527e0f8dace4f6320e2ace329abfbe85ddc8ea /sx.el
parent7ef768bce7a943a55774f225022d8883c95a523f (diff)
parentd9a6666b13fb15361580354d8d865b2555d843bb (diff)
Merge pull request #259 from vermiculus/bind-answer-sorting-to-a-key
Bind answer sorting to a key
Diffstat (limited to 'sx.el')
-rw-r--r--sx.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/sx.el b/sx.el
index ccad1b0..501f1e0 100644
--- a/sx.el
+++ b/sx.el
@@ -340,6 +340,12 @@ GET-FUNC and performs the actual comparison."
"Return STRING with consecutive whitespace squashed together."
(replace-regexp-in-string "[ \r\n]+" " " string))
+(defun sx--invert-predicate (predicate)
+ "Return PREDICATE function with arguments inverted.
+For instance (sx--invert-predicate #'<) is the same as #'>.
+Note this is not the same as negating PREDICATE."
+ (lambda (&rest args) (apply predicate (reverse args))))
+
;;; Printing request data
(defvar sx--overlays nil