about summary refs log tree commit diff stats
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/acdw.el6
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.
144A paragraph is defined as continguous non-empty lines of text 148A 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)))