diff --git a/lisp/acdw.el b/lisp/acdw.el index a673e4a..10a51c1 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el @@ -139,6 +139,10 @@ active, or else the entire buffer." (= (line-beginning-position) (line-end-position))) (insert "\n"))))) +(defcustom +open-paragraph-ignore-modes '(special-mode lui-mode comint-mode) + "Modes in which `+open-paragraph' makes no sense." + :type '(repeat function)) + (defun +open-paragraph (&optional arg) "Open a paragraph after paragraph at point. A paragraph is defined as continguous non-empty lines of text @@ -149,7 +153,7 @@ Called with prefix ARG, open a paragraph before point." ;; TODO: Take an integer as ARG, allowing for skipping paragraphs up and down. (interactive "*P") ;; TODO: add `+open-paragraph-ignore-modes' - (unless (derived-mode-p 'special-mode 'lui-mode 'comint-mode) + (unless (apply #'derived-mode-p +open-paragraph-ignore-modes) ;; Go to next blank line. This /isn't/ `end-of-paragraph-text' because ;; that's weird with org, and I'm guessing other modes too. (unless (looking-at "^$") (forward-line (if arg -1 +1)))