Subject: Re: bug#50935: minibuffer-electric-default-mode interface

From: Stefan Kangas <[email-masked]>
Date: Tue, 5 Oct 2021 12:55:52 -0400

tags 50935 + patch
thanks

Juri Linkov <[email-masked]> writes:

>> A third option is to add 'minibuffer-default-prompt-format' on emacs-28,
>> but make the suggested deletion on master -- which give us more time to
>> get `minibuffer-default-prompt-format' up to scrap.
>
> I guess the answer depends on the question how many prompts
> are already converted to 'minibuffer-default-prompt-format',
> and how many remain.  I checked a few commands, and noticed
> only one command that doesn't use the new format.  It's 'M-.'
> ('xref-find-definitions').  But maybe it can't use the new option
> 'minibuffer-default-prompt-format' because xref.el should be
> available in old versions?  Still it could use
>
>   (if (boundp 'minibuffer-default-prompt-format) ...

I've now updated any prompt I could find to use `format-prompt' (by
grepping for " (default ").  Maybe I've missed one or two, but that
should mean that that the overwhelming majority of our prompts now
respect `minibuffer-default-prompt-format'.  See commit 6640942221.

With that, I think the option `minibuffer-eldef-shorten-default' should
be declared obsolete, as in the attached patch, and consequently removed
from the manual.  This change should go to master, of course.

The command `minibuffer-electric-default-mode' shouldn't be declared
obsolete as it does something different.
From 2aa7838e263f8645b1142554a8df164210b35989 Mon Sep 17 00:00:00 2001
From: Stefan Kangas <[email-masked]>
Date: Tue, 5 Oct 2021 18:37:30 +0200
Subject: [PATCH] Make minibuffer-eldef-shorten-default obsolete

* lisp/minibuf-eldef.el (minibuffer-eldef-shorten-default): Make
variable obsolete in favor of 'minibuffer-default-prompt-format'.
* doc/emacs/mini.texi (Basic Minibuffer): Delete above obsolete
variable.
---
 doc/emacs/mini.texi   | 8 ++------
 etc/NEWS              | 6 ++++++
 lisp/minibuf-eldef.el | 2 ++
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/doc/emacs/mini.texi b/doc/emacs/mini.texi
index b0f6e424a7..d764352998 100644
--- a/doc/emacs/mini.texi
+++ b/doc/emacs/mini.texi
@@ -58,12 +58,8 @@ Basic Minibuffer
 Emacs hides the default argument as soon as you modify the contents of
 the minibuffer (since typing @key{RET} would no longer submit that
 default).  If you ever bring back the original minibuffer text, the
-prompt again shows the default.  Furthermore, if you change the
-variable @code{minibuffer-eldef-shorten-default} to a non-@code{nil}
-value, the default argument is displayed as @samp{[@var{default-arg}]}
-instead of @samp{(default @var{default-arg})}, saving some screen
-space.  To enable this minor mode, type @kbd{M-x
-minibuffer-electric-default-mode}.
+prompt again shows the default.  To enable this minor mode, type
+@kbd{M-x minibuffer-electric-default-mode}.
 
   Since the minibuffer appears in the echo area, it can conflict with
 other uses of the echo area.  If an error message or an informative
diff --git a/etc/NEWS b/etc/NEWS
index e9fcfba425..79cca4b4ef 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -98,6 +98,12 @@ also handle ANSI codes for faint, italic and blinking text, displaying
 it with new 'ansi-term-faint/italic/slow-blinking/fast-blinking'
 faces.
 
+** Miscellaneous
+
++++
+*** User option 'minibuffer-eldef-shorten-default' is now obsolete.
+Customize the user option 'minibuffer-default-prompt-format' instead.
+
 
 * New Modes and Packages in Emacs 29.1
 
diff --git a/lisp/minibuf-eldef.el b/lisp/minibuf-eldef.el
index f67ec353c8..c1a4443057 100644
--- a/lisp/minibuf-eldef.el
+++ b/lisp/minibuf-eldef.el
@@ -64,6 +64,8 @@ minibuffer-eldef-shorten-default
   :type 'boolean
   :group 'minibuffer
   :version "24.3")
+(make-obsolete-variable 'minibuffer-eldef-shorten-default
+                        'minibuffer-default-prompt-format "29.1")
 
 (defvar minibuffer-default-in-prompt-regexps
   (minibuffer-default--in-prompt-regexps)
-- 
2.30.2