diff options
author | Case Duckworth | 2022-05-06 10:21:32 -0500 |
---|---|---|
committer | Case Duckworth | 2022-05-06 10:21:32 -0500 |
commit | 246990fd15c85c26d262ffe4587e739d21a36004 (patch) | |
tree | 9162902d5dba692d15fced85ba32688a007d48ec | |
parent | Pull recipe repos as part of +straight-update-all (diff) | |
download | emacs-246990fd15c85c26d262ffe4587e739d21a36004.tar.gz emacs-246990fd15c85c26d262ffe4587e739d21a36004.zip |
Make modes in which to ignore open-paragraph a customization option
-rw-r--r-- | lisp/acdw.el | 6 |
1 files changed, 5 insertions, 1 deletions
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." | |||
139 | (= (line-beginning-position) (line-end-position))) | 139 | (= (line-beginning-position) (line-end-position))) |
140 | (insert "\n"))))) | 140 | (insert "\n"))))) |
141 | 141 | ||
142 | (defcustom +open-paragraph-ignore-modes '(special-mode lui-mode comint-mode) | ||
143 | "Modes in which `+open-paragraph' makes no sense." | ||
144 | :type '(repeat function)) | ||
145 | |||
142 | (defun +open-paragraph (&optional arg) | 146 | (defun +open-paragraph (&optional arg) |
143 | "Open a paragraph after paragraph at point. | 147 | "Open a paragraph after paragraph at point. |
144 | A paragraph is defined as continguous non-empty lines of text | 148 | A paragraph is defined as continguous non-empty lines of text |
@@ -149,7 +153,7 @@ Called with prefix ARG, open a paragraph before point." | |||
149 | ;; TODO: Take an integer as ARG, allowing for skipping paragraphs up and down. | 153 | ;; TODO: Take an integer as ARG, allowing for skipping paragraphs up and down. |
150 | (interactive "*P") | 154 | (interactive "*P") |
151 | ;; TODO: add `+open-paragraph-ignore-modes' | 155 | ;; TODO: add `+open-paragraph-ignore-modes' |
152 | (unless (derived-mode-p 'special-mode 'lui-mode 'comint-mode) | 156 | (unless (apply #'derived-mode-p +open-paragraph-ignore-modes) |
153 | ;; Go to next blank line. This /isn't/ `end-of-paragraph-text' because | 157 | ;; Go to next blank line. This /isn't/ `end-of-paragraph-text' because |
154 | ;; that's weird with org, and I'm guessing other modes too. | 158 | ;; that's weird with org, and I'm guessing other modes too. |
155 | (unless (looking-at "^$") (forward-line (if arg -1 +1))) | 159 | (unless (looking-at "^$") (forward-line (if arg -1 +1))) |