From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Antoine Levitt Newsgroups: gmane.emacs.bugs Subject: bug#53874: Patch: make set-fill-column show the current fill-column Date: Tue, 08 Feb 2022 13:04:33 +0100 Message-ID: <871r0dbm3y.fsf@inria.fr> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2644"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.1.0; emacs 28.0.50 To: 53874@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 08 14:29:11 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nHQYR-0000Wf-GX for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 08 Feb 2022 14:29:11 +0100 Original-Received: from localhost ([::1]:48874 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHQYQ-00023A-7j for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 08 Feb 2022 08:29:10 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:40224) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHPG1-0003WW-1u for bug-gnu-emacs@gnu.org; Tue, 08 Feb 2022 07:06:08 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51808) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nHPFy-0006Qz-R9 for bug-gnu-emacs@gnu.org; Tue, 08 Feb 2022 07:06:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nHPFy-0007Nz-GK for bug-gnu-emacs@gnu.org; Tue, 08 Feb 2022 07:06:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Antoine Levitt Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 08 Feb 2022 12:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 53874 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.164432191728331 (code B ref -1); Tue, 08 Feb 2022 12:06:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 8 Feb 2022 12:05:17 +0000 Original-Received: from localhost ([127.0.0.1]:45703 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHPFE-0007Ms-Lf for submit@debbugs.gnu.org; Tue, 08 Feb 2022 07:05:16 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:49424) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHPFC-0007Mk-PK for submit@debbugs.gnu.org; Tue, 08 Feb 2022 07:05:15 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:40014) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHPFC-0002qD-Es for bug-gnu-emacs@gnu.org; Tue, 08 Feb 2022 07:05:14 -0500 Original-Received: from [2a00:1450:4864:20::434] (port=39605 helo=mail-wr1-x434.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nHPF9-0005uX-Bp for bug-gnu-emacs@gnu.org; Tue, 08 Feb 2022 07:05:14 -0500 Original-Received: by mail-wr1-x434.google.com with SMTP id d27so2021614wrc.6 for ; Tue, 08 Feb 2022 04:03:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=user-agent:from:to:subject:date:message-id:mime-version; bh=XRJtE1bybRS4gXhOknL5G794TAodr6dMfxZveyL4V2w=; b=ZeNf9HJs5lJirxz5zrS15igfH+JVoWnnXLWq5uzLupl7sPP3NlvMAhPXxkrQwYRNdT Aa+uyBuSeDH4//Gmzd1YHx6Hh7EpLoqQSysfI6Ax3H9K+eKP4hV2rCkUY20SFQNWcYbX hclfC/RgUMcmOcqjFR2df2+CA8RUIILbUStIWx38iOmaduEoUYPZA88brvuFhN+HHtPB AFVRtYGfUku+YRF3RVKRBxANf6/I5C29qXnXdnr5dvuH8pRqICwioqV9YPPhjax8+yb5 UCfvWIzpPLT8ioPi6fiRBsyhmX4fRef5H+a6ujfl+NSgTRt3SgzzmSud+qg5MtPuWEfC xq5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:user-agent:from:to:subject:date:message-id :mime-version; bh=XRJtE1bybRS4gXhOknL5G794TAodr6dMfxZveyL4V2w=; b=srW78ojioOzg5s4Vzk+yE3NlDl5DeOAEfawPlDwDcbOArDH9LjZbI5Nv0MpH2Qfgz6 A+qsLnm6+1Wwt2RqWYnCYVjxBV47gebnQrqAuy2NxpD/wawqYueHrZYXiz4QRFxWluLj vUsVg/U5gqiYV2aMP0Uw0k0a1QYjX6xnLXHg38lGsS6wNI8c0DzDVVTig1v0aE2JO93e 95YW2qqjsWDI4cAWwWgzjELNW5pDhc5fBFlooYMTXygwNo8b4bwDIQ+U0IXXwEVk1mnF oVqxGkIu7Sqpwa8xlCEBf92CZnv/Hd4JF2FF/mnIwXR3i6swBDBIAC/w889i6WKJKFty qNxg== X-Gm-Message-State: AOAM531ENzgSXO/rD7ZaIen6KGxBKGCxaxR1t3SYJAwIK5fG/2gGXZYR ndPGmKa64xJ/w3zmTTCWrx1aHJIHZ/M= X-Google-Smtp-Source: ABdhPJxUj9dz5ugnp+YlgRuQhIl3JD6lhWCOogDJLO67jDGsxY3u0GXPWfUrib0sAq5EWAAdxangcA== X-Received: by 2002:adf:fac2:: with SMTP id a2mr3418817wrs.68.1644321806231; Tue, 08 Feb 2022 04:03:26 -0800 (PST) Original-Received: from lambda (fw.enpc.fr. [194.57.247.3]) by smtp.gmail.com with ESMTPSA id b6sm14546240wrd.29.2022.02.08.04.03.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 08 Feb 2022 04:03:25 -0800 (PST) X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::434 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=antoine.levitt@gmail.com; helo=mail-wr1-x434.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:226363 Archived-At: [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))