summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2021-10-06 11:16:18 -0500
committerCase Duckworth2021-10-06 11:16:18 -0500
commitd134922c7c5ff3ff9f86cb0c04100bdd5436c754 (patch)
treefdb5e9313677c63ebb83db1981dd7be967b87237
parentFix eshell... I think (diff)
downloademacs-d134922c7c5ff3ff9f86cb0c04100bdd5436c754.tar.gz
emacs-d134922c7c5ff3ff9f86cb0c04100bdd5436c754.zip
Add open-paragraph
-rw-r--r--init.el2
-rw-r--r--lisp/acdw.el17
2 files changed, 18 insertions, 1 deletions
diff --git a/init.el b/init.el index a1536c5..2361107 100644 --- a/init.el +++ b/init.el
@@ -1222,7 +1222,7 @@ specific to most general, they are these:
1222 1222
1223(setup (:straight crux) 1223(setup (:straight crux)
1224 (:global "C-o" #'crux-smart-open-line 1224 (:global "C-o" #'crux-smart-open-line
1225 "M-o" #'crux-smart-open-line-above 1225 "M-o" #'open-paragraph
1226 "C-M-\\" #'crux-cleanup-buffer-or-region 1226 "C-M-\\" #'crux-cleanup-buffer-or-region
1227 "C-x 4 t" #'crux-transpose-windows) 1227 "C-x 4 t" #'crux-transpose-windows)
1228 1228
diff --git a/lisp/acdw.el b/lisp/acdw.el index 969b6c8..cc73071 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el
@@ -862,6 +862,23 @@ When called with PREFIX, just kill Emacs without confirmation."
862 (let ((b (get-buffer (if (consp b) (car b) b)))) 862 (let ((b (get-buffer (if (consp b) (car b) b))))
863 (member (buffer-local-value 'major-mode b) modes))))) 863 (member (buffer-local-value 'major-mode b) modes)))))
864 (pop-to-buffer (read-buffer "Buffer: " nil t pred)))) 864 (pop-to-buffer (read-buffer "Buffer: " nil t pred))))
865
866;;; BLAH
867
868(defun open-paragraph ()
869 "Open a paragraph after point.
870A paragraph is defined as continguous non-empty lines of text
871surrounded by empty lines, so opening a paragraph means to make
872three blank lines, then place the point on the second one."
873 (interactive)
874 ;; Go to next blank line. This /isn't/ `end-of-paragraph-text' because
875 ;; that's weird with org, and I'm guessing other modes too.
876 (while (not (looking-at "^$"))
877 (forward-line 1))
878 (newline)
879 (delete-blank-lines)
880 (newline 2)
881 (previous-line))
865 882
866(provide 'acdw) 883(provide 'acdw)
867;;; acdw.el ends here 884;;; acdw.el ends here