Subject: bug#55289: 29.0.50; minibuffer-next-completion errors on wrap when completion-show-help and completions-header-format are set to nil

From: Eshel Yaron <[email-masked]>
Date: Fri, 06 May 2022 17:57:25 +0300

1. Run emacs -Q
2. Evaluate the following form:
   (setq completions-format 'one-column
         completion-auto-select nil
         completion-show-help nil
         completions-header-format nil
         completion-auto-help 'visual
         completion-wrap-movement t)
3. Type 'M-x gnus M-<up> M-<down>'
4. Emacs reports error: "Wrong type argument: integer-or-marker-p, nil"

In GNU Emacs 29.0.50 (build 4, x86_64-apple-darwin21.3.0, NS appkit-2113.30 Version 12.2.1 (Build 21D62))
 of 2022-05-06 built on Eshels-MBP
Repository revision: 8fce81897dabe9c06f7b3f59cfb0bb9348422531
Repository branch: master
Windowing system distributor 'Apple', version 10.3.2113
System Description:  macOS 12.2.1

Configured using:
 'configure --enable-link-time-optimization --with-json
 --with-native-compilation --with-xwidgets'

Configured features:
ACL DBUS GIF GLIB GMP GNUTLS JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP
NOTIFY KQUEUE NS PDUMPER PNG RSVG SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS WEBP XIM XWIDGETS ZLIB

Important settings:
  value of $LC_CTYPE: UTF-8
  locale-coding-system: utf-8-unix

Major mode: ELisp/d

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr ispell emacsbug message mailcap yank-media rmc
puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived
epg rfc6068 epg-config gnus-util text-property-search time-date
mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils
mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr
mail-utils comp comp-cstr warnings rx cl-seq cl-macs cl-extra help-mode
seq gv subr-x byte-opt cl-loaddefs cl-lib bytecomp byte-compile cconv
iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks
lisp-float-type elisp-mode mwheel term/ns-win ns-win ucs-normalize
mule-util term/common-win tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice simple cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese composite emoji-zwj charscript charprop case-table
epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button
loaddefs faces cus-face macroexp files window text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads xwidget-internal dbusbind
kqueue cocoa ns lcms2 multi-tty make-network-process native-compile
emacs)

Memory information:
((conses 16 160297 10698)
 (symbols 48 7321 1)
 (strings 32 33792 2323)
 (string-bytes 1 1105301)
 (vectors 16 23667)
 (vector-slots 8 366128 22095)
 (floats 8 46 28)
 (intervals 56 15100 0)
 (buffers 992 13))