From 2dc88e2a50c2f9603110ab1970e15e156844ba6f Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Mon, 11 Dec 2017 14:43:22 +0100 Subject: [PATCH] add fill-or-unfill paragraph Signed-off-by: Andreas Gerler --- bba.org | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/bba.org b/bba.org index bb5d080e..72448eec 100644 --- a/bba.org +++ b/bba.org @@ -2846,6 +2846,24 @@ safe files with #! in first line as user executable. #+END_SRC +* fill-or-unfill paragraph +[2017-06-09 Fri 12:25] + +#+BEGIN_SRC emacs-lisp :tangle yes + (defun bba-fill-or-unfill () + "Like `fill-paragraph', but unfill if used twice." + (interactive) + (let ((fill-column + (if (eq last-command 'bba-fill-or-unfill) + (progn (setq this-command nil) + (point-max)) + fill-column))) + (call-interactively 'fill-paragraph))) + + (global-set-key [remap fill-paragraph] + 'bba-fill-or-unfill) +#+END_SRC + * Move Cursor to Beginning of Line/Paragraph [2017-03-02 Thu 13:46] -- 2.47.3