summary refs log tree commit diff stats
path: root/lisp/acdw.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/acdw.el')
-rw-r--r--lisp/acdw.el25
1 files changed, 11 insertions, 14 deletions
diff --git a/lisp/acdw.el b/lisp/acdw.el index 86443a1..792b9ef 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el
@@ -93,7 +93,7 @@ features."
93 (let* ((this (car features)) 93 (let* ((this (car features))
94 (rest (cdr features))) 94 (rest (cdr features)))
95 `(with-eval-after-load ',this 95 `(with-eval-after-load ',this
96 (with-eval-after-all ,rest ,@body))))) 96 (with-eval-after-loads ,rest ,@body)))))
97 97
98(defmacro with-message (message &rest body) 98(defmacro with-message (message &rest body)
99 "Execute BODY, messaging 'MESSAGE...' before and 'MESSAGE... Done.' after." 99 "Execute BODY, messaging 'MESSAGE...' before and 'MESSAGE... Done.' after."
@@ -338,26 +338,23 @@ In short, DO NOT USE THIS FUNCTION!!!"
338 (save-excursion 338 (save-excursion
339 (sort-sexps 339 (sort-sexps
340 (point-min) (point-max) 340 (point-min) (point-max)
341 (lambda (sexp) 341 ;; Key function
342 (format "%S" (cadr sexp))) 342 nil
343 ;; Sort function
343 (lambda (s1 s2) ; oh god, this is worse. 344 (lambda (s1 s2) ; oh god, this is worse.
344 (let* ((s1 (cdr s1)) (s2 (cdr s2)) ; for the strings themselves 345 (let* ((s1 (cdr s1)) (s2 (cdr s2)) ; for the strings themselves
345 (s1-require (string-match ":require" s1)) 346 (require-regexp (rx bos (* nonl) ":require"))
346 (s2-require (string-match ":require" s2)) 347 (straight-regexp (rx bos (* nonl) ":straight"))
347 (s1-straight (string-match ":straight" s1)) 348 (s1-require (string-match require-regexp s1))
348 (s2-straight (string-match ":straight" s2)) 349 (s2-require (string-match require-regexp s2))
349 (s1-bare (not (or s1-require s1-straight))) 350 (s1-straight (string-match straight-regexp s1))
350 (s2-bare (not (or s2-require s2-straight)))) 351 (s2-straight (string-match straight-regexp s2)))
351 (cond 352 (cond
352 ;; if both are the same, sort regular style 353 ;; Straight forms require some weirdness
353 ((or (and s1-require s2-require)
354 (and s1-bare s2-bare))
355 (string< s1 s2))
356 ((and s1-straight s2-straight) 354 ((and s1-straight s2-straight)
357 (let* ((r (rx ":straight" (? "-if") (* space) (? "("))) 355 (let* ((r (rx ":straight" (? "-if") (* space) (? "(")))
358 (s1 (replace-regexp-in-string r "" s1)) 356 (s1 (replace-regexp-in-string r "" s1))
359 (s2 (replace-regexp-in-string r "" s2))) 357 (s2 (replace-regexp-in-string r "" s2)))
360 (message "'%S' '%S'" s1 s2)
361 (string< s1 s2))) 358 (string< s1 s2)))
362 ;; requires should go first 359 ;; requires should go first
363 ((and s1-require (not s2-require)) t) 360 ((and s1-require (not s2-require)) t)