about summary refs log tree commit diff stats
path: root/lisp/acdw.el
diff options
context:
space:
mode:
authorCase Duckworth2022-02-08 20:59:33 -0600
committerCase Duckworth2022-02-08 20:59:33 -0600
commitfe8985ae47234937fce348734dc1ec34a528acd7 (patch)
tree18039317ffa4129941c6682415d70b42c8def677 /lisp/acdw.el
parentDon't display slack team name (diff)
downloademacs-fe8985ae47234937fce348734dc1ec34a528acd7.tar.gz
emacs-fe8985ae47234937fce348734dc1ec34a528acd7.zip
Write +{forward,backward}-paragraph
Diffstat (limited to 'lisp/acdw.el')
-rw-r--r--lisp/acdw.el20
1 files changed, 20 insertions, 0 deletions
diff --git a/lisp/acdw.el b/lisp/acdw.el index 2b3cafc..99e5c1e 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el
@@ -291,5 +291,25 @@ With optional ARG, kill all chat-related buffers first."
291 )) 291 ))
292 (mapc #'call-interactively chat-functions)) 292 (mapc #'call-interactively chat-functions))
293 293
294(defun +forward-paragraph (arg)
295 "Move forward ARG (simple) paragraphs.
296A paragraph here is simply defined: it's a block of buffer that's
297separated from others by two newlines."
298 (interactive "p")
299 (let ((direction (/ arg (abs arg))))
300 (forward-line direction)
301 (while (not (or (bobp)
302 (eobp)
303 (= arg 0)))
304 (if (looking-at "^[ \f\t]*$")
305 (setq arg (- arg direction))
306 (forward-line direction)))))
307
308(defun +backward-paragraph (arg)
309 "Move backward ARG (simple) paragraphs.
310See `+forward-paragraph' for the behavior."
311 (interactive "p")
312 (+forward-paragraph (- arg)))
313
294(provide 'acdw) 314(provide 'acdw)
295;;; acdw.el ends here 315;;; acdw.el ends here