about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2021-10-07 17:28:51 -0500
committerCase Duckworth2021-10-07 17:29:13 -0500
commit5e3f88cde60426a0497370a11d77fad8e3b5dd01 (patch)
treeab8ffbae67cfad4d15dc0c7e2fa6391c05cc3ff0
parentBegin on acdw-auto-insert.el (diff)
downloademacs-5e3f88cde60426a0497370a11d77fad8e3b5dd01.tar.gz
emacs-5e3f88cde60426a0497370a11d77fad8e3b5dd01.zip
Break spongebob-case to its own package
-rw-r--r--init.el8
-rw-r--r--lisp/acdw.el26
2 files changed, 6 insertions, 28 deletions
diff --git a/init.el b/init.el index ac88cde..efcf846 100644 --- a/init.el +++ b/init.el
@@ -431,8 +431,7 @@
431 (:bind "c" #'capitalize-dwim 431 (:bind "c" #'capitalize-dwim
432 "t" #'titlecase-dwim 432 "t" #'titlecase-dwim
433 "u" #'upcase-dwim 433 "u" #'upcase-dwim
434 "l" #'downcase-dwim 434 "l" #'downcase-dwim))
435 "s" #'spongebob-case-dwim))
436 435
437 (column-number-mode +1)) 436 (column-number-mode +1))
438 437
@@ -2388,6 +2387,11 @@ the default is \"/\"."
2388 (:unbind "M-j" ; sp-join-sexp 2387 (:unbind "M-j" ; sp-join-sexp
2389 )) 2388 ))
2390 2389
2390(setup (:straight (spongebob-case
2391 :host github
2392 :repo "duckwork/spongebob-case.el"))
2393 (:global "C-c c s" #'spongebob-case-dwim))
2394
2391(setup (:straight ssh-config-mode) 2395(setup (:straight ssh-config-mode)
2392 (:file-match (rx "/.ssh/config" eos) 2396 (:file-match (rx "/.ssh/config" eos)
2393 (rx "/ssh" (? "d") "_config" eos)) 2397 (rx "/ssh" (? "d") "_config" eos))
diff --git a/lisp/acdw.el b/lisp/acdw.el index 50ca00c..489b808 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el
@@ -793,32 +793,6 @@ 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.
816If 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
822 796
823;;; Fat finger solutions 797;;; Fat finger solutions
824(defun acdw/fat-finger-exit (&optional prefix) 798(defun acdw/fat-finger-exit (&optional prefix)