unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: master 1b0a922 1/2: Make M-x show obsolete commands (Bug#43300)
       [not found] ` <20200913130616.6B79C20B2C@vcs0.savannah.gnu.org>
@ 2020-09-13 19:35   ` Stefan Monnier
  2020-09-18 10:33     ` Stefan Kangas
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Monnier @ 2020-09-13 19:35 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: emacs-devel

>     Make M-x show obsolete commands (Bug#43300)
>     * lisp/simple.el (read-extended-command): Don't hide obsolete
>     commands.
>     (read-extended-command--annotation): Show an annotation for obsolete
>     commands that says what their new name is.

I think this doesn't push users away from obsolete commands
strongly enough.  If removing them from the list of completions is not
an option any more, then maybe we could/should force a kind of
"confirmation".  e.g. `M-x <obsolete-command> RET` would emit a short
"Really call obsolete `obsolete-command`?" and wait for an extra RET
before going ahead.


        Stefan


>  lisp/simple.el | 21 ++++++++-------------
>  1 file changed, 8 insertions(+), 13 deletions(-)
>
> diff --git a/lisp/simple.el b/lisp/simple.el
> index b5002dd..16ff863 100644
> --- a/lisp/simple.el
> +++ b/lisp/simple.el
> @@ -1881,22 +1881,17 @@ to get different commands to edit and resubmit."
>  	   '(metadata
>  	     (annotation-function . read-extended-command--annotation)
>  	     (category . command))
> -         (let ((pred
> -                (if (memq action '(nil t))
> -                    ;; Exclude obsolete commands from completions.
> -                    (lambda (sym)
> -                      (and (funcall pred sym)
> -                           (or (equal string (symbol-name sym))
> -                               (not (get sym 'byte-obsolete-info)))))
> -                  pred)))
> -           (complete-with-action action obarray string pred))))
> +         (complete-with-action action obarray string pred)))
>       #'commandp t nil 'extended-command-history)))
>  
>  (defun read-extended-command--annotation (command-name)
> -  (let* ((function (and (stringp command-name) (intern-soft command-name)))
> -         (binding (where-is-internal function overriding-local-map t)))
> -    (when (and binding (not (stringp binding)))
> -      (format " (%s)" (key-description binding)))))
> +  (let* ((fun (and (stringp command-name) (intern-soft command-name)))
> +         (binding (where-is-internal fun overriding-local-map t))
> +         (obsolete (get fun 'byte-obsolete-info)))
> +    (cond (obsolete
> +           (format " (%s)" (car obsolete)))
> +          ((and binding (not (stringp binding)))
> +           (format " (%s)" (key-description binding))))))
>  
>  (defcustom suggest-key-bindings t
>    "Non-nil means show the equivalent key-binding when M-x command has one.




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: master 1b0a922 1/2: Make M-x show obsolete commands (Bug#43300)
  2020-09-13 19:35   ` master 1b0a922 1/2: Make M-x show obsolete commands (Bug#43300) Stefan Monnier
@ 2020-09-18 10:33     ` Stefan Kangas
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Kangas @ 2020-09-18 10:33 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> I think this doesn't push users away from obsolete commands
> strongly enough.  If removing them from the list of completions is not
> an option any more, then maybe we could/should force a kind of
> "confirmation".  e.g. `M-x <obsolete-command> RET` would emit a short
> "Really call obsolete `obsolete-command`?" and wait for an extra RET
> before going ahead.

I think your proposal sounds good, and I have no objection.

But do we really need to be that forceful about pushing users away from
obsolete commands?  I had hoped that a gentle nudge in the right
direction would be enough, especially given the long time that will pass
before a command is finally removed.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-18 10:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20200913130614.15564.25449@vcs0.savannah.gnu.org>
     [not found] ` <20200913130616.6B79C20B2C@vcs0.savannah.gnu.org>
2020-09-13 19:35   ` master 1b0a922 1/2: Make M-x show obsolete commands (Bug#43300) Stefan Monnier
2020-09-18 10:33     ` Stefan Kangas

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).