diff options
author | Case Duckworth | 2021-10-05 20:20:42 -0500 |
---|---|---|
committer | Case Duckworth | 2021-10-05 20:20:42 -0500 |
commit | 352f18559ca2f583ecbf161fb3f938952d7e26c4 (patch) | |
tree | 87396b090282d15405699c70e6a0f7613f236b83 /lisp/acdw.el | |
parent | Correct bug (diff) | |
parent | Replace ytel with ytdious (diff) | |
download | emacs-352f18559ca2f583ecbf161fb3f938952d7e26c4.tar.gz emacs-352f18559ca2f583ecbf161fb3f938952d7e26c4.zip |
Merge branch 'main' of github.com:duckwork/.emacs.d
Diffstat (limited to 'lisp/acdw.el')
-rw-r--r-- | lisp/acdw.el | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/lisp/acdw.el b/lisp/acdw.el index 792b9ef..969b6c8 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el | |||
@@ -352,7 +352,7 @@ In short, DO NOT USE THIS FUNCTION!!!" | |||
352 | (cond | 352 | (cond |
353 | ;; Straight forms require some weirdness | 353 | ;; Straight forms require some weirdness |
354 | ((and s1-straight s2-straight) | 354 | ((and s1-straight s2-straight) |
355 | (let* ((r (rx ":straight" (? "-if") (* space) (? "("))) | 355 | (let* ((r (rx ":straight" (? "-when") (* space) (? "("))) |
356 | (s1 (replace-regexp-in-string r "" s1)) | 356 | (s1 (replace-regexp-in-string r "" s1)) |
357 | (s2 (replace-regexp-in-string r "" s2))) | 357 | (s2 (replace-regexp-in-string r "" s2))) |
358 | (string< s1 s2))) | 358 | (string< s1 s2))) |
@@ -793,6 +793,32 @@ This function is internal. Use `acdw/make-password-fetcher' instead." | |||
793 | (insert "💩") | 793 | (insert "💩") |
794 | (setq n (1- n))))) | 794 | (setq n (1- n))))) |
795 | 795 | ||
796 | (defun spongebob-case-region (beg end) | ||
797 | "Make region, defined by BEG and END, lOoK lIkE tHiS." | ||
798 | (interactive "*r") | ||
799 | (save-excursion | ||
800 | (let (case) | ||
801 | (goto-char beg) | ||
802 | (while (< (point) end) | ||
803 | (if (looking-at "[[:alpha:]]") | ||
804 | (if (setq case (not case)) | ||
805 | (upcase-region (point) (progn (forward-char 1) (point))) | ||
806 | (downcase-region (point) (progn (forward-char 1) (point)))) | ||
807 | (forward-char 1)))))) | ||
808 | |||
809 | (defun spongebob-case-word (n) | ||
810 | "Spongebob-case N words forward, beginning at point, moving over." | ||
811 | (interactive "*p") | ||
812 | (spongebob-case-region (point) (progn (forward-word n) (point)))) | ||
813 | |||
814 | (defun spongebob-case-dwim (arg) | ||
815 | "Spongebob-case words in the region if active, else word at point. | ||
816 | If ARG exists, it's passed to `spongebob-case-word'." | ||
817 | (interactive "*p") | ||
818 | (if (use-region-p) | ||
819 | (spongebob-case-region (region-beginning) (region-end)) | ||
820 | (spongebob-case-word arg))) | ||
821 | |||
796 | 822 | ||
797 | ;;; Fat finger solutions | 823 | ;;; Fat finger solutions |
798 | (defun acdw/fat-finger-exit (&optional prefix) | 824 | (defun acdw/fat-finger-exit (&optional prefix) |