Subject: Patch: make set-fill-column show the current fill-column

From: Antoine Levitt <[email-masked]>
Date: Tue, 08 Feb 2022 13:04:33 +0100

[I posted this on emacs-devel but apparently patches should go to
bug-gnu-emacs so here goes]

I recently used set-fill-column again after years of neglect, and I
remember being mystified by what it did before; I think this is because
I misunderstood the word "default" (I understood it as "the default
setting of fill-column" whereas emacs meant "the thing that will be if
you just press RET"). I think changing the prompt would go a long way
towards making it more accessible to new users, and be more informative
for long-time emacsers as well. Removing the "default" part is tricky
because it's customizable (via minibuffer-default-prompt-format) and
used in several functions, but something like "Set fill-column to
(default 60, currently 80)" looks like a good compromise. Here is a
simple patch doing this.

diff --git a/lisp/simple.el b/lisp/simple.el
index c878fda..b7986ed 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -7903,7 +7903,14 @@ set-fill-column
              ;; We used to use current-column silently, but C-x f is too easily
              ;; typed as a typo for C-x C-f, so we turned it into an error and
              ;; now an interactive prompt.
-             (read-number "Set fill-column to: " (current-column)))))
+             (let ((prompt (concat "Set fill-column to"
+                                   (format minibuffer-default-prompt-format
+                                           (concat (number-to-string (current-column))
+                                                   ", currently "
+                                                   (number-to-string fill-column)))
+                                   ": "))
+                   (minibuffer-default-prompt-format ""))
+               (read-number prompt (current-column))))))
   (if (consp arg)
       (setq arg (current-column)))
   (if (not (integerp arg))