From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Fernando de Morais Newsgroups: gmane.emacs.bugs Subject: 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 Message-ID: <875ybz2jiw.fsf@gmail.com> References: <87y1p1wr4m.fsf@gmail.com> <86cz6dfnyu.fsf@mail.linkov.net> <87wn4ltpg0.fsf@gmail.com> <87lel0ao9z.fsf@gmail.com> <86wn4k14pt.fsf@mail.linkov.net> <87y1p0dovd.fsf@gmail.com> <868rgxea6c.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26624"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 61479@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 18 14:26:12 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pTNEB-0006i7-Mo for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 18 Feb 2023 14:26:11 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pTNE3-00032C-S4; Sat, 18 Feb 2023 08:26:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pTNE2-000321-EH for bug-gnu-emacs@gnu.org; Sat, 18 Feb 2023 08:26:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pTNE2-0005u1-59 for bug-gnu-emacs@gnu.org; Sat, 18 Feb 2023 08:26:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pTNE1-0006OS-VE for bug-gnu-emacs@gnu.org; Sat, 18 Feb 2023 08:26:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Fernando de Morais Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 Feb 2023 13:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61479 X-GNU-PR-Package: emacs Original-Received: via spool by 61479-submit@debbugs.gnu.org id=B61479.167672672524504 (code B ref 61479); Sat, 18 Feb 2023 13:26:01 +0000 Original-Received: (at 61479) by debbugs.gnu.org; 18 Feb 2023 13:25:25 +0000 Original-Received: from localhost ([127.0.0.1]:42760 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pTNDQ-0006N8-ER for submit@debbugs.gnu.org; Sat, 18 Feb 2023 08:25:24 -0500 Original-Received: from mail-oa1-f43.google.com ([209.85.160.43]:47006) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pTNDO-0006Ml-BQ for 61479@debbugs.gnu.org; Sat, 18 Feb 2023 08:25:22 -0500 Original-Received: by mail-oa1-f43.google.com with SMTP id 586e51a60fabf-171b204f641so553533fac.13 for <61479@debbugs.gnu.org>; Sat, 18 Feb 2023 05:25:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :message-id:date:in-reply-to:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=7RtyHoG/fFOWQrvbMGdV8erX+OdPzwqGSGxnXSnJ5Yw=; b=Wb4NHwdThrcaySqqFHNZDfd+S/WGdxWsqIRlugGXHcXkn8PcjaDyGVSfTSrFMb4/r0 v7JHcAQLoD9PDQSz4r8nwhsvAmXe127niQGJ5bAQE16R9TjVW97DPCQTf8z9r192BKKV D7jsCTbeIrZ4XhPeHtIVa2Iy55RiqNDwLSqjxp+kHA0cXD+g/OKF+ih/GIjNG71rjq5Z uSPhyLbpCTAJ4MsR2l6pkHwdpJE9FjwPQGU8QZxdd+zTFU/G9xOPyIyhKCylLQh/AfVo 8/vd1anxCOCibqrSrAAx0qIzbCKpD6BTbuL9B+jaobIOJHH4MhhCMOUk6mp+2tmasxax mKcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :message-id:date:in-reply-to:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=7RtyHoG/fFOWQrvbMGdV8erX+OdPzwqGSGxnXSnJ5Yw=; b=3VeKRRsrz1lz2kztdf4iUOkbm43AtEI2UApRPa17mXeYYiyZS8XvJMKCwb73OZUE7T SjIcxMt2JnSrgUumbSIQSLLwTU/emOO9Sw+vyPRyoRj80+/7jkqZQ96AHh3fAfEvUZmW f4fJQSnYtjkbnwKqBYGfPjU+V4CMGkoZ0nrJu8IoevuaWYh2hnv1Ji45DJbioEpu3Ic+ t/XuOdqWfNN5Y/M+3dnT+nWBa0sZg3mYUppJQze+W4iLQ00R6SA4vfZiMt6kCYLs4KW0 HyAbyQucHGPu0fkBzQHOJHkVFPwquZkLGIWo+E86OrPJ2MpLnBpAxKjBN5P17Weo/ldw Jxfg== X-Gm-Message-State: AO0yUKU68zW6/9ylLJHiwMYeDK6zb/ncJyhRKBhtlVzAcrdEy1bb2Abr DER/2wPzhIoLe5MKNIhG4QqGjJSnOhA= X-Google-Smtp-Source: AK7set8yF6Pp3hk3Tta4JbTXV6IfYpLguR/YgGbED8MSb7eQ3oYCiY7reo9Mt99F0VwpWj6Ikl9VhA== X-Received: by 2002:a05:6870:d253:b0:150:b2d9:ebdf with SMTP id h19-20020a056870d25300b00150b2d9ebdfmr1091204oac.14.1676726716507; Sat, 18 Feb 2023 05:25:16 -0800 (PST) Original-Received: from sekai ([2804:14c:da80:82e2::925f]) by smtp.gmail.com with ESMTPSA id ef5-20020a0568701a8500b00152c52608dbsm1791169oab.34.2023.02.18.05.25.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Feb 2023 05:25:16 -0800 (PST) In-Reply-To: <868rgxea6c.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 16 Feb 2023 20:29:15 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:255965 Archived-At: Hi Juri, Juri Linkov 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. =F0=9F=98=80 Thank you! --=20 Regards, Fernando de Morais.