GNU bug report logs - #61479
28.2; icomplete-in-buffer --- Error in post-command-hook: args-out-of-range

Previous Next

Package: emacs;

Reported by: Fernando de Morais <fernandodemorais.jf <at> gmail.com>

Date: Mon, 13 Feb 2023 14:59:02 UTC

Severity: normal

Found in version 28.2

Fixed in version 29.0.60

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 61479 in the body.
You can then email your comments to 61479 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#61479; Package emacs. (Mon, 13 Feb 2023 14:59:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Fernando de Morais <fernandodemorais.jf <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 13 Feb 2023 14:59:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Fernando de Morais <fernandodemorais.jf <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.2; icomplete-in-buffer --- Error in post-command-hook:
 args-out-of-range
Date: Mon, 13 Feb 2023 11:56:41 -0300
To reproduce, which is possible with 'emacs -Q', please:

1. Evaluate the following snippet:

  (progn
    (with-eval-after-load 'icomplete
      (setq icomplete-in-buffer t))
    (icomplete-mode))

2. Type the following:

  (with-)

3. Then, with the cursor positioned after the dash, C-M-i (to try
   `completion-at-point').

Results in:

  - A window with the *Completions* buffer is shown, but an error[1] is
    raised and `icomplete' does not appear in the current buffer;
  - Deleting the close parenthesis and trying `completion-at-point' once
    again brings `icomplete' to the buffer, as expected.

[1]  "Error in post-command-hook (icomplete-post-command-hook): (args-out-of-range #("with-" 0 5 (fontified t)) 0 6)"


In GNU Emacs 28.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.36, cairo version 1.17.6)
 of 2023-01-02 built on 2
Windowing system distributor 'The X.Org Foundation', version 11.0.12101007
System Description: Arch Linux

Configured using:
 'configure --with-x-toolkit=gtk3 --with-native-compilation
 --sysconfdir=/etc --prefix=/usr --libexecdir=/usr/lib
 --localstatedir=/var --with-cairo --with-harfbuzz --with-libsystemd
 --with-modules 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt
 -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security
 -fstack-clash-protection -fcf-protection -g
 -ffile-prefix-map=/build/emacs/src=/usr/src/debug/emacs -flto=auto'
 'LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -flto=auto''

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS
X11 XDBE XIM XPM GTK3 ZLIB

Important settings:
  value of $LC_CTYPE: pt_BR.UTF-8
  value of $LANG: pt_BR.UTF-8
  value of $XMODIFIERS: @im=fcitx
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  shell-dirtrack-mode: t
  flymake-mode: t
  flyspell-mode: t
  hl-line-mode: t
  corfu-mode: t
  rainbow-delimiters-mode: t
  recentf-mode: t
  savehist-mode: t
  goto-address-prog-mode: t
  minions-mode: t
  movemail-auto-fetch-mode: t
  marginalia-mode: t
  icomplete-vertical-mode: t
  icomplete-mode: t
  minibuffer-electric-default-mode: t
  minibuffer-depth-indicate-mode: t
  display-time-mode: t
  global-so-long-mode: t
  electric-pair-mode: t
  delete-selection-mode: t
  display-battery-mode: t
  gcmh-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  temp-buffer-resize-mode: t
  size-indication-mode: t
  column-number-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  hs-minor-mode: t

Load-path shadows:
None found.

Features:
(shadow bbdb-message footnote emacsbug sendmail gnus-uu yenc tramp-cache
tramp-sh tramp tramp-loaddefs trampver tramp-integration files-x
tramp-compat ls-lisp consult-dir re-builder rng-xsd xsd-regexp rng-cmpct
rng-nxml rng-valid nxml-mode nxml-outln nxml-rap sgml-mode facemenu
yasnippet eglot external-completion array filenotify jsonrpc ert ewoc
sh-script smie executable view sxhkdrc-mode em-tramp em-rebind em-smart
em-unix em-term term ehelp em-script em-prompt em-ls em-hist em-pred
em-glob em-cmpl em-dirs esh-var em-basic em-banner em-alias esh-mode
eshell esh-cmd esh-ext esh-opt esh-proc esh-io esh-arg esh-module
esh-groups esh-util markdown-mode edit-indirect color consult-imenu
imenu misearch multi-isearch shell gnus-cite smiley mm-archive mail-extr
gnus-bcklg sort gnus-ml disp-table qp nnmaildir nnagent nnml bbdb-gnus
bbdb-mua nnnil nnrss gnus-topic mairix gnus-dup gnus-draft nndraft nnmh
gnus-demon gnus-async gnus-agent gnus-srvr gnus-score score-mode
nnvirtual gnus-msg nntp gnus-cache denote xref whitespace shortdoc
consult-org modus-operandi-theme embark-org embark-consult embark
help-fns radix-tree cl-print debug backtrace cape-keyword cape socks
elpher gemini-mode comp comp-cstr time-stamp ox-taskjuggler ox-md
ox-gemini ox-odt rng-loc rng-uri rng-parse rng-match rng-dt rng-util
rng-pttrn nxml-parse nxml-ns nxml-enc xmltok nxml-util ox-latex
ox-icalendar org-agenda org-refile ox-html table ox-ascii ox-publish ox
tab-line face-remap olivetti bbdb-csv-import bbdb-com crm dash pcsv bbdb
bbdb-site timezone diary-lib diary-loaddefs cal-move conf-mode org-eldoc
org-indent image-file image-converter gnutls network-stream url-http
url-gw nsm url-cache url-auth ol-eww eww-lnum eww xdg url-queue mm-url
ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect gnus-search eieio-opt
speedbar ezimage dframe gnus-art mm-uu mml2015 mm-view mml-smime smime
dig gnus-sum shr-tag-pre-highlight language-detection shr kinsoku svg
dom gnus-group gnus-undo gnus-start gnus-dbus gnus-cloud nnimap nnmail
mail-source utf7 netrc nnoo parse-time gnus-spec gnus-int gnus-range
message rmc puny rfc822 mml mml-sec mm-decode mm-bodies mm-encode
mailabbrev gmm-utils mailheader gnus-win gnus nnheader gnus-util rmail
rmail-loaddefs mail-utils ol-docview doc-view jka-compr image-mode exif
ol-bibtex ol-bbdb ol-w3m ol-doi org-link-doi ob-octave org-superstar
org-element avl-tree generator org-contrib org ob ob-tangle ob-ref
ob-lob ob-table ob-exp org-macro org-footnote org-src ob-comint
org-pcomplete pcmpl-args pcmpl-gnu pcmpl-linux pcmpl-unix pcomplete
org-list org-faces org-entities noutline outline org-version
ob-emacs-lisp ob-core ob-eval org-table oc-basic bibtex iso8601 ol
org-keys oc org-compat advice org-macs org-loaddefs find-func holidays
hol-loaddefs cal-menu calendar cal-loaddefs consult-icomplete consult
bookmark vc-mtn vc-hg vc-git diff-mode vc-bzr vc-src vc-sccs vc-svn
vc-cvs vc-rcs diff vc vc-dispatcher ibuffer-vc ibuf-ext ibuffer
ibuffer-loaddefs mule-util time-date checkdoc lisp-mnt mail-parse
rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr dired-x dired-aux
dired dired-loaddefs flymake-proc flymake project compile
text-property-search comint ansi-color ring warnings
display-line-numbers epa-file epa derived epg rfc6068 epg-config
cl-extra help-mode flyspell ispell hl-line hideshow corfu
rainbow-delimiters recentf tree-widget cus-start savehist server
goto-addr minions rx easy-mmode let-alist exec-path-from-shell ibuf-macs
marginalia icomplete minibuf-eldef mb-depth orderless time so-long
edmacro kmacro elec-pair delsel format-spec battery dbus xml
auth-source-pass modus-vivendi-theme modus-themes pcase ffap thingatpt
no-littering compat compat-29 gcmh system-packages tex-site info package
browse-url url url-proxy url-privacy url-expand url-methods url-history
url-cookie url-domsuf url-util mailcap url-handlers url-parse
auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache json subr-x map url-vars seq byte-opt gv bytecomp
byte-compile cconv cus-edit pp cus-load wid-edit cl-loaddefs cl-lib
iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks
lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd
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 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 simple abbrev obarray
cl-preloaded nadvice button loaddefs faces cus-face macroexp files
window text-properties overlay sha1 md5 base64 format env code-pages
mule custom widget hashtable-print-readable backquote threads dbusbind
inotify lcms2 dynamic-setting system-font-setting font-render-setting
cairo move-toolbar gtk x-toolkit x multi-tty make-network-process
native-compile emacs)

Memory information:
((conses 16 1335704 152377)
 (symbols 48 55703 5)
 (strings 32 300173 19716)
 (string-bytes 1 11310923)
 (vectors 16 293272)
 (vector-slots 8 3428060 332065)
 (floats 8 91543 611)
 (intervals 56 30075 2894)
 (buffers 992 51))

-- 
Regards,
Fernando de Morais.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61479; Package emacs. (Mon, 13 Feb 2023 17:58:01 GMT) Full text and rfc822 format available.

Message #8 received at 61479 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Fernando de Morais <fernandodemorais.jf <at> gmail.com>
Cc: 61479 <at> debbugs.gnu.org
Subject: Re: bug#61479: 28.2; icomplete-in-buffer --- Error in
 post-command-hook: args-out-of-range
Date: Mon, 13 Feb 2023 19:56:57 +0200
>   (progn
>     (with-eval-after-load 'icomplete
>       (setq icomplete-in-buffer t))
>     (icomplete-mode))
>
> 2. Type the following:
>
>   (with-)
>
> 3. Then, with the cursor positioned after the dash, C-M-i (to try
>    `completion-at-point').
>
> Results in:
>
>   - A window with the *Completions* buffer is shown, but an error[1] is
>     raised and `icomplete' does not appear in the current buffer;
>   - Deleting the close parenthesis and trying `completion-at-point' once
>     again brings `icomplete' to the buffer, as expected.
>
> [1]  "Error in post-command-hook (icomplete-post-command-hook): (args-out-of-range #("with-" 0 5 (fontified t)) 0 6)"
>
> In GNU Emacs 28.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.36, cairo version 1.17.6)

Please try in Emacs 29 where this was fixed recently.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61479; Package emacs. (Mon, 13 Feb 2023 18:02:02 GMT) Full text and rfc822 format available.

Message #11 received at 61479 <at> debbugs.gnu.org (full text, mbox):

From: Fernando de Morais <fernandodemorais.jf <at> gmail.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: 61479 <at> debbugs.gnu.org
Subject: Re: bug#61479: 28.2; icomplete-in-buffer --- Error in
 post-command-hook: args-out-of-range
Date: Mon, 13 Feb 2023 15:01:19 -0300
Hello Juri,

Juri Linkov <juri <at> linkov.net> writes:

> Please try in Emacs 29 where this was fixed recently.

All right then. Thank you very much!

-- 
Regards,
Fernando de Morais.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61479; Package emacs. (Tue, 14 Feb 2023 04:02:02 GMT) Full text and rfc822 format available.

Message #14 received at 61479 <at> debbugs.gnu.org (full text, mbox):

From: Fernando de Morais <fernandodemorais.jf <at> gmail.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: 61479 <at> debbugs.gnu.org
Subject: Re: bug#61479: 28.2; icomplete-in-buffer --- Error in
 post-command-hook: args-out-of-range
Date: Tue, 14 Feb 2023 01:01:28 -0300
Hello again Juri,

Fernando de Morais <fernandodemorais.jf <at> gmail.com> writes:

> Hello Juri,
>
> Juri Linkov <juri <at> linkov.net> writes:
>
>> Please try in Emacs 29 where this was fixed recently.
>
> All right then. Thank you very much!

I've just tested it on Emacs 29, as requested, and from this build of master
branch.  It worked as expected.  👍

-- 
Regards,
Fernando de Morais.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61479; Package emacs. (Tue, 14 Feb 2023 18:30:02 GMT) Full text and rfc822 format available.

Message #17 received at 61479 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Fernando de Morais <fernandodemorais.jf <at> gmail.com>
Cc: 61479 <at> debbugs.gnu.org
Subject: Re: bug#61479: 28.2; icomplete-in-buffer --- Error in
 post-command-hook: args-out-of-range
Date: Tue, 14 Feb 2023 20:28:46 +0200
>>> Please try in Emacs 29 where this was fixed recently.
>>
>> All right then. Thank you very much!
>
> I've just tested it on Emacs 29, as requested, and from this build of master
> branch.  It worked as expected.  👍

Does it also select a completion candidate?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61479; Package emacs. (Tue, 14 Feb 2023 19:35:02 GMT) Full text and rfc822 format available.

Message #20 received at 61479 <at> debbugs.gnu.org (full text, mbox):

From: Fernando de Morais <fernandodemorais.jf <at> gmail.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: 61479 <at> debbugs.gnu.org
Subject: Re: bug#61479: 28.2; icomplete-in-buffer --- Error in
 post-command-hook: args-out-of-range
Date: Tue, 14 Feb 2023 16:32:38 -0300
Hello Juri,

Juri Linkov <juri <at> linkov.net> writes:

> Does it also select a completion candidate?

Well, when I hit C-j, it selects the candidate, but then:

  - The buffer is modified in a way that only the selected candidate is
    visible;
  - The same is true for multiple C-M-i when in the candidate list;
  - I need to use `undo' to go back to the previous state of the buffer.

-- 
Regards,
Fernando de Morais.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61479; Package emacs. (Wed, 15 Feb 2023 18:37:02 GMT) Full text and rfc822 format available.

Message #23 received at 61479 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Fernando de Morais <fernandodemorais.jf <at> gmail.com>
Cc: 61479 <at> debbugs.gnu.org
Subject: Re: bug#61479: 28.2; icomplete-in-buffer --- Error in
 post-command-hook: args-out-of-range
Date: Wed, 15 Feb 2023 20:20:58 +0200
close 61479 29.0.60
thanks

> Well, when I hit C-j, it selects the candidate, but then:
>
>   - The buffer is modified in a way that only the selected candidate is
>     visible;
>   - The same is true for multiple C-M-i when in the candidate list;
>   - I need to use `undo' to go back to the previous state of the buffer.

Unfortunately, this is not yet implemented.  There are many already
opened requests for this: bug#45763, bug#45764, bug#45767, bug#51575.
So I'm closing this one.




bug marked as fixed in version 29.0.60, send any further explanations to 61479 <at> debbugs.gnu.org and Fernando de Morais <fernandodemorais.jf <at> gmail.com> Request was from Juri Linkov <juri <at> linkov.net> to control <at> debbugs.gnu.org. (Wed, 15 Feb 2023 18:37:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61479; Package emacs. (Thu, 16 Feb 2023 18:31:02 GMT) Full text and rfc822 format available.

Message #28 received at 61479 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Fernando de Morais <fernandodemorais.jf <at> gmail.com>
Cc: 61479 <at> debbugs.gnu.org
Subject: Re: bug#61479: 28.2; icomplete-in-buffer --- Error in
 post-command-hook: args-out-of-range
Date: Thu, 16 Feb 2023 20:29:15 +0200
>> Does it also select a completion candidate?
>
> Well, when I hit C-j, it selects the candidate, but then:
>
>   - The buffer is modified in a way that only the selected candidate is
>     visible;
>   - The same is true for multiple C-M-i when in the candidate list;
>   - I need to use `undo' to go back to the previous state of the buffer.

Here is a short patch that completely fixes this problem.
But probably it's too late for the release branch
since icomplete never worked correctly in the buffer.

diff --git a/lisp/icomplete.el b/lisp/icomplete.el
index f7a91599f3b..aadc2e32787 100644
--- a/lisp/icomplete.el
+++ b/lisp/icomplete.el
@@ -215,7 +215,11 @@ icomplete-force-complete-and-exit
        ;; calculated, This causes the first cached completion to
        ;; be taken (i.e. the one that the user sees highlighted)
        completion-all-sorted-completions)
-      (minibuffer-force-complete-and-exit)
+      (if (window-minibuffer-p)
+          (minibuffer-force-complete-and-exit)
+        (minibuffer-force-complete (icomplete--field-beg)
+                                   (icomplete--field-end)
+                                   'dont-cycle))
     ;; Otherwise take the faster route...
     (minibuffer-complete-and-exit)))
 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61479; Package emacs. (Sat, 18 Feb 2023 13:26:01 GMT) Full text and rfc822 format available.

Message #31 received at 61479 <at> debbugs.gnu.org (full text, mbox):

From: Fernando de Morais <fernandodemorais.jf <at> gmail.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: 61479 <at> debbugs.gnu.org
Subject: Re: bug#61479: 28.2; icomplete-in-buffer --- Error in
 post-command-hook: args-out-of-range
Date: Sat, 18 Feb 2023 10:24:55 -0300
Hi Juri,

Juri Linkov <juri <at> linkov.net> writes:

>>> Does it also select a completion candidate?
>>
>> Well, when I hit C-j, it selects the candidate, but then:
>>
>>   - The buffer is modified in a way that only the selected candidate is
>>     visible;
>>   - The same is true for multiple C-M-i when in the candidate list;
>>   - I need to use `undo' to go back to the previous state of the buffer.
>
> Here is a short patch that completely fixes this problem.
> But probably it's too late for the release branch
> since icomplete never worked correctly in the buffer.
>
> diff --git a/lisp/icomplete.el b/lisp/icomplete.el
> index f7a91599f3b..aadc2e32787 100644
> --- a/lisp/icomplete.el
> +++ b/lisp/icomplete.el
> @@ -215,7 +215,11 @@ icomplete-force-complete-and-exit
>         ;; calculated, This causes the first cached completion to
>         ;; be taken (i.e. the one that the user sees highlighted)
>         completion-all-sorted-completions)
> -      (minibuffer-force-complete-and-exit)
> +      (if (window-minibuffer-p)
> +          (minibuffer-force-complete-and-exit)
> +        (minibuffer-force-complete (icomplete--field-beg)
> +                                   (icomplete--field-end)
> +                                   'dont-cycle))
>      ;; Otherwise take the faster route...
>      (minibuffer-complete-and-exit)))

This patch fixes the problem when we hit C-j to select a candidate, but
the problem persists if we type multiple C-M-i when in the candidate
list, unfortunately.

At least, now, `icomplete' in buffer is very usable.  😀

Thank you!

-- 
Regards,
Fernando de Morais.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61479; Package emacs. (Thu, 23 Feb 2023 09:12:01 GMT) Full text and rfc822 format available.

Message #34 received at 61479 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Fernando de Morais <fernandodemorais.jf <at> gmail.com>
Cc: 61479 <at> debbugs.gnu.org
Subject: Re: bug#61479: 28.2; icomplete-in-buffer --- Error in
 post-command-hook: args-out-of-range
Date: Thu, 23 Feb 2023 10:36:45 +0200
> This patch fixes the problem when we hit C-j to select a candidate, but
> the problem persists if we type multiple C-M-i when in the candidate
> list, unfortunately.

Thanks for finding another way to reproduce the problem.  This shows
that C-M-i bound to icomplete-force-complete needs the same treatment:

diff --git a/lisp/icomplete.el b/lisp/icomplete.el
index f7a91599f3b..b0b55dd1e7e 100644
--- a/lisp/icomplete.el
+++ b/lisp/icomplete.el
@@ -215,7 +215,11 @@ icomplete-force-complete-and-exit
        ;; calculated, This causes the first cached completion to
        ;; be taken (i.e. the one that the user sees highlighted)
        completion-all-sorted-completions)
-      (minibuffer-force-complete-and-exit)
+      (if (window-minibuffer-p)
+          (minibuffer-force-complete-and-exit)
+        (minibuffer-force-complete (icomplete--field-beg)
+                                   (icomplete--field-end)
+                                   'dont-cycle))
     ;; Otherwise take the faster route...
     (minibuffer-complete-and-exit)))
 
@@ -223,7 +227,11 @@ icomplete-force-complete
   "Complete the icomplete minibuffer."
   (interactive)
   ;; We're not at all interested in cycling here (bug#34077).
-  (minibuffer-force-complete nil nil 'dont-cycle))
+  (if (window-minibuffer-p)
+      (minibuffer-force-complete nil nil 'dont-cycle)
+    (minibuffer-force-complete (icomplete--field-beg)
+                               (icomplete--field-end)
+                               'dont-cycle)))
 
 ;; Apropos `icomplete-scroll', we implement "scrolling icomplete"
 ;; within classic icomplete, which is "rotating", by contrast.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61479; Package emacs. (Sat, 25 Feb 2023 12:17:02 GMT) Full text and rfc822 format available.

Message #37 received at 61479 <at> debbugs.gnu.org (full text, mbox):

From: Fernando de Morais <fernandodemorais.jf <at> gmail.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: 61479 <at> debbugs.gnu.org
Subject: Re: bug#61479: 28.2; icomplete-in-buffer --- Error in
 post-command-hook: args-out-of-range
Date: Sat, 25 Feb 2023 09:15:51 -0300
Hello Juri,

Juri Linkov <juri <at> linkov.net> writes:

> This shows that C-M-i bound to icomplete-force-complete needs the same
> treatment:
>
> diff --git a/lisp/icomplete.el b/lisp/icomplete.el
> index f7a91599f3b..b0b55dd1e7e 100644
> --- a/lisp/icomplete.el
> +++ b/lisp/icomplete.el
> @@ -215,7 +215,11 @@ icomplete-force-complete-and-exit
>         ;; calculated, This causes the first cached completion to
>         ;; be taken (i.e. the one that the user sees highlighted)
>         completion-all-sorted-completions)
> -      (minibuffer-force-complete-and-exit)
> +      (if (window-minibuffer-p)
> +          (minibuffer-force-complete-and-exit)
> +        (minibuffer-force-complete (icomplete--field-beg)
> +                                   (icomplete--field-end)
> +                                   'dont-cycle))
>      ;; Otherwise take the faster route...
>      (minibuffer-complete-and-exit)))
>  
> @@ -223,7 +227,11 @@ icomplete-force-complete
>    "Complete the icomplete minibuffer."
>    (interactive)
>    ;; We're not at all interested in cycling here (bug#34077).
> -  (minibuffer-force-complete nil nil 'dont-cycle))
> +  (if (window-minibuffer-p)
> +      (minibuffer-force-complete nil nil 'dont-cycle)
> +    (minibuffer-force-complete (icomplete--field-beg)
> +                               (icomplete--field-end)
> +                               'dont-cycle)))
>  
>  ;; Apropos `icomplete-scroll', we implement "scrolling icomplete"
>  ;; within classic icomplete, which is "rotating", by contrast.

I've tested it and it worked perfectly!  Thank you once more.

> Thanks for finding another way to reproduce the problem.

You're welcome.  🤝

-- 
Regards,
Fernando de Morais.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61479; Package emacs. (Mon, 27 Feb 2023 18:47:02 GMT) Full text and rfc822 format available.

Message #40 received at 61479 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Fernando de Morais <fernandodemorais.jf <at> gmail.com>
Cc: 61479 <at> debbugs.gnu.org
Subject: Re: bug#61479: 28.2; icomplete-in-buffer --- Error in
 post-command-hook: args-out-of-range
Date: Mon, 27 Feb 2023 20:45:38 +0200
>> This shows that C-M-i bound to icomplete-force-complete needs the same
>> treatment:
>
> I've tested it and it worked perfectly!  Thank you once more.

Thanks for confirming.  Now the fix is pushed to Emacs 30.
And these bugs are closed as well: bug#45763, bug#45764, bug#51575.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 28 Mar 2023 11:24:13 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 30 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.