aboutsummaryrefslogtreecommitdiff
path: root/sx.el
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2015-02-12 14:59:46 -0200
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-02-12 15:01:59 -0200
commit85109b7dd2ffb896151ccef2c014c7d9ea33e682 (patch)
tree704e430265af6ea381fe167c39767f511603925f /sx.el
parent78cc17295c255dc188c96ea7a401ee9a915b9269 (diff)
Define possible values for answer sorting
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 33b36b6..381f78e 100644
--- a/sx.el
+++ b/sx.el
@@ -335,6 +335,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