aboutsummaryrefslogtreecommitdiff
path: root/sx.el
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2015-02-26 22:24:58 -0300
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-02-26 22:24:58 -0300
commitee4e74f25fdb97faf4cb92952072a42b7b507e2a (patch)
treeea083b78a425cde9ed8184ba269894c15f10f938 /sx.el
parentcd629005cc68f0eeefc42a92ea1e75658791439f (diff)
parentf4ba0e2a11581477e412c276080a049d19351361 (diff)
Merge branch 'master' into generate-header-line-from-keymap
Diffstat (limited to 'sx.el')
-rw-r--r--sx.el8
1 files changed, 7 insertions, 1 deletions
diff --git a/sx.el b/sx.el
index e94c5de..e7b62a5 100644
--- a/sx.el
+++ b/sx.el
@@ -209,7 +209,7 @@ is intentionally skipped."
(while (and ;; We're not at the end.
(cdr-safe tail)
;; We're not at the right place.
- (,(or predicate #'<) x (cadr tail)))
+ (funcall (or ,predicate #'<) x (cadr tail)))
(setq tail (cdr tail)))
(setcdr tail (cons x (cdr tail)))))
@@ -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