GNU bug report logs - #53874
Patch: make set-fill-column show the current fill-column

Previous Next

Package: emacs;

Reported by: Antoine Levitt <antoine.levitt <at> gmail.com>

Date: Tue, 8 Feb 2022 12:06:02 UTC

Severity: wishlist

Tags: patch

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Antoine Levitt <antoine.levitt <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Patch: make set-fill-column show the current fill-column
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))




This bug report was last modified 3 years and 104 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.