Subject: bug#54964: 28.1; mistatement in NEWS about read-extended-command-predicate

From: Eli Zaretskii <[email-masked]>
Date: Sat, 16 Apr 2022 14:09:37 +0300

> From: Lars Ingebrigtsen <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Sat, 16 Apr 2022 12:59:52 +0200
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> > That NEWS entry describes two 'declare' forms:
> >
> >    '(declare (completion PREDICATE))'
> >    '(declare (modes MODE...))'
> >
> > Are you saying that M-S-x uses one of these two?  Then I must be
> > missing something.
> 
> Doc string:
> 
> This is like ‘execute-extended-command’, but it limits the
> completions to commands that are particularly relevant to the
> current buffer.  This includes commands that have been marked as
> being specially designed for the current major mode (and enabled
> minor modes), as well as commands bound in the active local key
> maps.

Yes, but again: how is this relevant to that particular NEWS entry?

execute-extended-command-for-buffer is covered by a separate NEWS
entry, which says:

  ** New command 'execute-extended-command-for-buffer'.
  This new command, bound to 'M-S-x', works like
  'execute-extended-command', but limits the set of commands to the
  commands that have been determined to be particularly useful with the
  current mode.

By contrast, the NEWS entry with which this bug report deals doesn't
mention execute-extended-command-for-buffer at all.  Its says this:

  ** New 'declare' forms to control completion of commands in 'M-x'.
  '(declare (completion PREDICATE))' can be used as a general predicate
  to say whether the command should be considered a completion candidate
  when completing with 'M-x TAB'.

  '(declare (modes MODE...))' can be used as a short-hand way of saying
  that the command should be considered a completion candidate when
  completing on commands from buffers in major modes derived from
  MODE..., or, if it's a minor mode, when that minor mode is enabled in
  the current buffer.

  Note that these forms will only have their effect if the
  'read-extended-command-predicate' user option is customized to call
  'command-completion-default-include-p' or a similar function.  The
  default value of 'read-extended-command-predicate' is nil, which means
  no commands that match what you have typed are excluded from being
  completion candidates.

Is something wrong/inaccurate with the text of the above NEWS entry?
An honest question, because I really don't see anything wrong here.