chiark / gitweb /
el/dot-emacs.el (mdw-fill-paragraph): Pass on arguments faithfully.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 17 Jul 2024 01:37:10 +0000 (02:37 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 17 Jul 2024 01:37:10 +0000 (02:37 +0100)
The JUSTIFY option doesn't work very well when the fill prefix has
trailing whitespace, but that's a reason not to use it as a user, not
for suppressing it.  The REGION behaviour seems potentially useful, so
suppressing it was undoubtedly a mistake.  (Compatibility isn't an issue
here: both arguments have been around since at least Emacs 23.)

el/dot-emacs.el

index 0030abde0e9afa7ab78d0fd8fc1d2557f8feb698..df3397dc3ff433248916aa08e4f846ee4a6f3419 100644 (file)
@@ -1635,11 +1635,11 @@ (defadvice do-auto-fill (around mdw-dynamic-fill-prefix () activate compile)
   (let ((fill-prefix (mdw-choose-dynamic-fill-prefix)))
     ad-do-it))
 
-(defun mdw-fill-paragraph ()
+(defun mdw-fill-paragraph (&optional justify region)
   "Fill paragraph, getting a dynamic fill prefix."
-  (interactive)
+  (interactive (list (if current-prefix-arg 'full) t))
   (let ((fill-prefix (mdw-choose-dynamic-fill-prefix)))
-    (fill-paragraph nil)))
+    (fill-paragraph justify region)))
 
 (defun mdw-point-within-string-p ()
   "Return non-nil if point is within a string."