From unknown Fri Jun 20 20:06:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#68514: 30.0.50; minibuffer-choose-completion + elisp-c-a-p delete next sexp when completing after open paren Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 16 Jan 2024 17:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 68514 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 68514@debbugs.gnu.org Cc: dmitry@gutov.dev, juri@linkov.net X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.170542479526007 (code B ref -1); Tue, 16 Jan 2024 17:07:01 +0000 Received: (at submit) by debbugs.gnu.org; 16 Jan 2024 17:06:35 +0000 Received: from localhost ([127.0.0.1]:49611 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rPmtX-0006lP-2Y for submit@debbugs.gnu.org; Tue, 16 Jan 2024 12:06:35 -0500 Received: from lists.gnu.org ([2001:470:142::17]:58320) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rPmtU-0006lB-IN for submit@debbugs.gnu.org; Tue, 16 Jan 2024 12:06:33 -0500 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 1rPmtN-00024p-Pi for bug-gnu-emacs@gnu.org; Tue, 16 Jan 2024 12:06:26 -0500 Received: from mxout5.mail.janestreet.com ([64.215.233.18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rPmtL-0001Za-8r for bug-gnu-emacs@gnu.org; Tue, 16 Jan 2024 12:06:25 -0500 From: Spencer Baugh Date: Tue, 16 Jan 2024 12:06:20 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1705424780; bh=mfBmhIKHfK13M4tjJjTe/gQzwkPEJ620jn0ZgxSxQrc=; h=From:To:Cc:Subject:Date; b=G/4nnczLFOoEiE7jiELAl4kkqo0YDrDKD2hFjL0CYQqFpTmORB65Fe9dppJxguHYb AwC1DfVIZYG6K0PdX6zfYGZzm8caN462dbWZ6QKJM4K6ytiEtngANq947a4kVF5k7K 6eylQ3Z6GBihlgdJ0Doi7bkrpV8VLiyWTcurkdzMPab78Wh6MUxzYW10pO8/J8QRDV y55izd9g7Qmokj1sRaBpsX+5O/gPps0osGy6yoAGkVBrgk4hn+c5UWrKq2z/rqEChx 1LajpgD/eKFjAB92ePQLIA2T8v/xDyf6Rz4XfS5J5dHl2ghwXuYuOkJ3R/9CMQ6VCX 4hdAnJPDk3VSA== Received-SPF: pass client-ip=64.215.233.18; envelope-from=sbaugh@janestreet.com; helo=mxout5.mail.janestreet.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) In an Elisp buffer, if you trigger completion after an open paren then use minibuffer-choose-completion to choose a completion, minibuffer-choose-completion will delete the next sexp before inserting the completion. Step by step: 1. emacs -Q 2. In an Elisp buffer, type in: ( (progn (some) (big) (expression)) 3. Move point to the end of the initial "(" and hit M-TAB 4. Use M-down and M-RET to select some completion e.g. "current-buffer". 5. When the completion is inserted, "(progn (some) (big) (expression))" is deleted, so the buffer contains just e.g. "(current-buffer" If at step 2, the user types any characters after the "(", the progn won't be deleted; for example, typing instead: (a (progn (some) (big) (expression)) and doing completion and using M-RET to pick a completion doesn't delete the progn sexp. This is because elisp-completion-at-point returns a completion region covering the entire sexp after the start of the region. That sexp is "(progn (some) (big) (expression))" in the first case and "a" in the second case. I'm not sure how to fix this. I don't know all the features of elisp-completion-at-point, but maybe it shouldn't use (forward-sexp 1) when finding the end of the completion region. Maybe it should be doing something like (skip-syntax-forward "w_") to determine the end of the region? BTW, this completion region returned by elisp-completion-at-point also causes a bug in company-mode: since company-capf stops completion when the end of the completion region is after point, it's not possible to do Elisp company completion immediately after an open paren no matter how company is configured. In GNU Emacs 30.0.50 (build 20, x86_64-pc-linux-gnu, X toolkit, cairo version 1.15.12, Xaw scroll bars) of 2023-12-27 built on igm-qws-u22796a Repository revision: b9c0ce0a400f18e1bba4e3491c94994d73ef9405 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12011000 System Description: Rocky Linux 8.9 (Green Obsidian) Configured using: 'configure -C 'CFLAGS=-O0 -g3' --with-gif=ifavailable --with-x-toolkit=lucid' Configured features: CAIRO DBUS FREETYPE GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XINPUT2 XPM LUCID ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction 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 minibuffer-regexp-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 emacsbug message mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search time-date subr-x mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd touch-screen 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 seq simple cl-generic indonesian philippine 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 theme-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 dbusbind inotify dynamic-setting system-font-setting font-render-setting cairo x-toolkit xinput2 x multi-tty move-toolbar make-network-process emacs) Memory information: ((conses 16 243422 25806) (symbols 48 9546 0) (strings 32 31424 2459) (string-bytes 1 846405) (vectors 16 10420) (vector-slots 8 158724 18572) (floats 8 43 21) (intervals 56 49602 0) (buffers 984 12)) From unknown Fri Jun 20 20:06:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#68514: 30.0.50; minibuffer-choose-completion + elisp-c-a-p delete next sexp when completing after open paren Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 16 Jan 2024 17:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68514 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Spencer Baugh , 68514@debbugs.gnu.org Cc: juri@linkov.net Received: via spool by 68514-submit@debbugs.gnu.org id=B68514.17054261335952 (code B ref 68514); Tue, 16 Jan 2024 17:29:02 +0000 Received: (at 68514) by debbugs.gnu.org; 16 Jan 2024 17:28:53 +0000 Received: from localhost ([127.0.0.1]:49666 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rPnF6-0001Xw-Pq for submit@debbugs.gnu.org; Tue, 16 Jan 2024 12:28:53 -0500 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:56169) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rPnF3-0001Xh-FV for 68514@debbugs.gnu.org; Tue, 16 Jan 2024 12:28:50 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 715F15C021D; Tue, 16 Jan 2024 12:28:43 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 16 Jan 2024 12:28:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1705426123; x=1705512523; bh=PYRRXBg9pryibeHD6NsSOn+wqJTymrnK1e2E+fhWOtA=; b= grKZ2uuc1O2ZSyTScpVHWtIgypJOIdYRykZX3ETRfbTqHv3Rm0dGWu3M2Uh3Pob1 FcvHiYc8OPd2FMEc/nm1PQJ6R8YKkDe8dnXAf4vAkMoCFfEL8vLXg+Rb0hzXaXIy wlI9W/l8XTFFTorJtyLRjyQl+qa1e0nDEa5yOLcrA6/jwfjEWQuk961PO8j+z87b a/J7F5C9kGx7xu6t1oiO0gvpu0lo5iNympA6mIISHNaZCZsTFcUpzHJxqHlhEgOs Q67dSXgKWU6WqIV7gJyU6eHA1YW1H9fvg8vYHvXOtjeZ0v0PFbsGij3UGq8k/+Q0 ngGI/2kUuhBrakJS1wbqsA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1705426123; x= 1705512523; bh=PYRRXBg9pryibeHD6NsSOn+wqJTymrnK1e2E+fhWOtA=; b=S ewAmuhOv6tuwChd3dkkkp8Ed3msgDFbB7M/ISJ3hGkS6cakeqnH/oBcUHoWog1Tp T3puY7zFAYfQ5/3oJiMW0wAd/fPPI2BTBFoUVMkXSkx8K+ikfyTuYCbF86o9Kk4d nnyKKGSN+R1+4XXehALnnyRiCZhR1ohi4XUQz0xt9kz2Tg0imLKPW0yR4jJR5JG1 irCYagBtJ7zo8ydXw4cIt41offo8lJvwpjXAvBAAmmxR/wivz4lAYLcxdzmP/Icq sSXwNJ+cumsEZqfU0CEKArRvRhO3qMMuaINuEG1SGjCdWc3MGB+xEIH4HtFic73L wepXKFn583b9aDYRyhuyw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdejfedguddtudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttddvjeenucfhrhhomhepffhm ihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrg htthgvrhhnpeetudeljeegheetgfehgeejkeeuhedvveeikeeufedtvddtveefhfdvveeg udejheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe gumhhithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 16 Jan 2024 12:28:42 -0500 (EST) Message-ID: <3e453670-b669-4b87-835e-a2e199736fab@gutov.dev> Date: Tue, 16 Jan 2024 19:28:39 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US References: From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 16/01/2024 19:06, Spencer Baugh wrote: > I'm not sure how to fix this. I don't know all the features of > elisp-completion-at-point, but maybe it shouldn't use (forward-sexp 1) > when finding the end of the completion region. Maybe it should be doing > something like (skip-syntax-forward "w_") to determine the end of the > region? > > BTW, this completion region returned by elisp-completion-at-point also > causes a bug in company-mode: since company-capf stops completion when > the end of the completion region is after point, it's not possible to do > Elisp company completion immediately after an open paren no matter how > company is configured. I don't have a patch to suggest at the moment, but `elisp-completion-at-point` is indeed peculiar in its bounds detection logic. The idea to use (skip-syntax-forward "w_") sounds good. But one alternative (in case you find it more convenient) is to use (bounds-of-thing-at-point 'symbol). From unknown Fri Jun 20 20:06:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#68514: 30.0.50; minibuffer-choose-completion + elisp-c-a-p delete next sexp when completing after open paren Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 16 Jan 2024 17:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68514 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Spencer Baugh Cc: dmitry@gutov.dev, 68514@debbugs.gnu.org Received: via spool by 68514-submit@debbugs.gnu.org id=B68514.170542733228758 (code B ref 68514); Tue, 16 Jan 2024 17:49:02 +0000 Received: (at 68514) by debbugs.gnu.org; 16 Jan 2024 17:48:52 +0000 Received: from localhost ([127.0.0.1]:49707 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rPnYS-0007Tm-4L for submit@debbugs.gnu.org; Tue, 16 Jan 2024 12:48:52 -0500 Received: from relay3-d.mail.gandi.net ([2001:4b98:dc4:8::223]:49345) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rPnYQ-0007T7-Cz for 68514@debbugs.gnu.org; Tue, 16 Jan 2024 12:48:50 -0500 Received: by mail.gandi.net (Postfix) with ESMTPSA id 8E11760006; Tue, 16 Jan 2024 17:48:41 +0000 (UTC) From: Juri Linkov In-Reply-To: (Spencer Baugh's message of "Tue, 16 Jan 2024 12:06:20 -0500") Organization: LINKOV.NET References: Date: Tue, 16 Jan 2024 19:39:39 +0200 Message-ID: <86ply1npno.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > This is because elisp-completion-at-point returns a completion region > covering the entire sexp after the start of the region. That sexp is > "(progn (some) (big) (expression))" in the first case and "a" in the > second case. This is a known bug without a known fix: https://debbugs.gnu.org/64903#18 From unknown Fri Jun 20 20:06:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#68514: 30.0.50; minibuffer-choose-completion + elisp-c-a-p delete next sexp when completing after open paren Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 16 Jan 2024 19:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68514 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov Cc: dmitry@gutov.dev, 68514@debbugs.gnu.org, monnier@iro.umontreal.ca Received: via spool by 68514-submit@debbugs.gnu.org id=B68514.170543422514372 (code B ref 68514); Tue, 16 Jan 2024 19:44:02 +0000 Received: (at 68514) by debbugs.gnu.org; 16 Jan 2024 19:43:45 +0000 Received: from localhost ([127.0.0.1]:49818 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rPpLc-0003jk-DT for submit@debbugs.gnu.org; Tue, 16 Jan 2024 14:43:44 -0500 Received: from mxout6.mail.janestreet.com ([64.215.233.21]:46807) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rPpLZ-0003jW-Q6 for 68514@debbugs.gnu.org; Tue, 16 Jan 2024 14:43:42 -0500 From: Spencer Baugh In-Reply-To: <86ply1npno.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 16 Jan 2024 19:39:39 +0200") References: <86ply1npno.fsf@mail.linkov.net> Date: Tue, 16 Jan 2024 14:43:35 -0500 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1705434215; bh=k0SNNEA83q/Gj32OV++rkECuHW3TW3uwBCdGFtEqIKI=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=O7wY6QMHqtnLhUM3TaxNrxDbII0L5hMBkEdRzEEmlhvH1PFgbqZXFsueoNykUFRyC 6KzeGo0qoIfvmXyr4Q45J9/T+NZb6/KszMYlJSesZlgr6sgUQipH/CBGcVc1TF4bVf ckMiAIBKp5y9qXYwa/EzG3TWFRrwUX5ObkXCmlS0U9VZe8dJeXMxT6U8zEPHDxuJrB dBotnACC4dWoi5KdTKR9250zz5XhXUMZrZ5ZKlffOALUe+3jrWGQ5GZSYR6+vns8+X 7TGeVho2RpzhhYzHR1goq3QyMa9+bqVv1ss0VSxockHgGQ9HLSpKSOB3vsHRL6GV3Z vtlvcFldiEkXA== X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Juri Linkov writes: >> This is because elisp-completion-at-point returns a completion region >> covering the entire sexp after the start of the region. That sexp is >> "(progn (some) (big) (expression))" in the first case and "a" in the >> second case. > > This is a known bug without a known fix: > https://debbugs.gnu.org/64903#18 Alright, how about this patch? Should fix most of the issue without changing the code too much. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-Make-elisp-cap-region-cover-a-symbol-not-lists-or-st.patch Content-Transfer-Encoding: quoted-printable >From d76353122ec563eb2d3ca23f96ea67a6843974c5 Mon Sep 17 00:00:00 2001 From: Spencer Baugh Date: Tue, 16 Jan 2024 14:32:21 -0500 Subject: [PATCH] Make elisp-cap region cover a symbol, not lists or strings elisp-completion-at-point calculates the completion region by running backward-sexp from (point) and storing that position as the beginning, then running forward-sexp from the beginning and storing that position as the end. elisp-completion-at-point does symbol completion, so the completion region should only cover a symbol. Therefore, elisp-completion-at-point checks whether the beginning of the completion region (the result from backward-sexp) is a quotation mark or open paren, which would indicate that the region covers a string or list, and returns nil in that case. If point is already at the start of a sexp (e.g. immediately after an open paren) then backward-sexp will not move point and the beginning of the completion region would (correctly) be the original point. forward-sexp, in this case, will move over the next sexp after point and include it in the completion region, even if it's a string or list. That has several bad effects: - An unrelated next sexp can be deleted by doing completion at the start of some earlier sexp (bug#64903, bug#68514) - The completion region can be very large, breaking some completion styles; if the next sexp is large enough, completion will fail with:: (invalid-regexp "Regular expression too big") - External completion packages can be broken by this, including corfu: https://github.com/minad/corfu/issues/350 We fix this by mirroring the check on the character at start of the region. We now also check if the character at the end of the completion region is a quotation mark or close paren, and set the end of the region equal to the beginning in that case. This way, we avoid including a string or list in the completion region, but still allow completion to proceed. * lisp/progmodes/elisp-mode.el (elisp-completion-at-point): Avoid returning a completion region which includes a string or list. (bug#64903) --- lisp/progmodes/elisp-mode.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 0ce98ee471c..c9ae92b5680 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -668,6 +668,9 @@ elisp-completion-at-point (goto-char beg) (forward-sexp 1) (skip-chars-backward "'=E2=80=99") + (when (member (char-syntax (char-before (point))) + '(?\" ?\))) + (goto-char beg)) (when (>=3D (point) pos) (point))) (scan-error pos)))) --=20 2.39.3 --=-=-=-- From unknown Fri Jun 20 20:06:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#68514: 30.0.50; minibuffer-choose-completion + elisp-c-a-p delete next sexp when completing after open paren Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 Jan 2024 16:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68514 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Spencer Baugh Cc: dmitry@gutov.dev, 68514@debbugs.gnu.org, Juri Linkov Received: via spool by 68514-submit@debbugs.gnu.org id=B68514.170550950813142 (code B ref 68514); Wed, 17 Jan 2024 16:39:02 +0000 Received: (at 68514) by debbugs.gnu.org; 17 Jan 2024 16:38:28 +0000 Received: from localhost ([127.0.0.1]:53127 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rQ8vr-0003Ps-OP for submit@debbugs.gnu.org; Wed, 17 Jan 2024 11:38:28 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:30979) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rQ8vo-0003Pe-Oe for 68514@debbugs.gnu.org; Wed, 17 Jan 2024 11:38:25 -0500 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id C7B8D10001D; Wed, 17 Jan 2024 11:38:17 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1705509496; bh=2UiWBPqnOlOLzRga3ktNuXKly/q5wAat9+QfTcMPJGU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=K0RLITyB+vsb22/OUrFYaOou5Z7kgNrvFPFpOjIS7aPzuKy0wg4gQA2y1byRD2BZT 9Jgn4oKnA+qDuhD66FExzD8lgKdE2jjbjkmGhpY36fEyiYFnEnJeZ/PG53pYn81nKd tpk5wWgOjzCqL3xx0pNLiWDu/iodk/6h/Du+hoRd2Orwkw98doeLM8WzC0c/TCRkzh KNSIJaPDcC2++5QN+bz/tQ50NakP+Vq6U2Wq+vM8GGveOPxd1ePQzzzOaUZURbgH/8 VnR4jFwdkelItIgNUkKNFO57C+TrwBO9ifJPhWCvgI97J8RJeeyVOWxC4a0VI0OQiB IS1c7KtiwqUBA== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id D2ACA100068; Wed, 17 Jan 2024 11:38:16 -0500 (EST) Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id C2EBC120A97; Wed, 17 Jan 2024 11:38:16 -0500 (EST) From: Stefan Monnier In-Reply-To: (Spencer Baugh's message of "Tue, 16 Jan 2024 14:43:35 -0500") Message-ID: References: <86ply1npno.fsf@mail.linkov.net> Date: Wed, 17 Jan 2024 11:37:15 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.484 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > If point is already at the start of a sexp (e.g. immediately after an > open paren) then backward-sexp will not move point and the beginning > of the completion region would (correctly) be the original point. > > forward-sexp, in this case, will move over the next sexp after point > and include it in the completion region, even if it's a string or > list. The fact that it did not move point is not really the problem. The problem is that point may be just before something like whitespace, so the (member (char-syntax (char-after beg)) '(?\" ?\()) doesn't notice that `forward-sexp` will actually jump over a list or some other such uncompletable sexp. I suggest the patch below instead (which also uses `min` to try to make sure we don't return a BEG..END which doesn't contain point). Stefan diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 00910fb67c7..60d58191175 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -657,12 +657,12 @@ elisp-completion-at-point (save-excursion (backward-sexp 1) (skip-chars-forward "`',=E2=80=98#") - (point)) + (min (point) pos)) (scan-error pos))) (end - (unless (or (eq beg (point-max)) - (member (char-syntax (char-after beg)) - '(?\" ?\())) + (unless (or (>=3D beg (point-max)) + (not (memq (char-syntax (char-after beg)) + '(?w ?\\ ?_)))) (condition-case nil (save-excursion (goto-char beg) From unknown Fri Jun 20 20:06:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#68514: 30.0.50; minibuffer-choose-completion + elisp-c-a-p delete next sexp when completing after open paren Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 Jan 2024 16:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68514 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Spencer Baugh Cc: dmitry@gutov.dev, 68514@debbugs.gnu.org, monnier@iro.umontreal.ca Received: via spool by 68514-submit@debbugs.gnu.org id=B68514.170550993018103 (code B ref 68514); Wed, 17 Jan 2024 16:46:02 +0000 Received: (at 68514) by debbugs.gnu.org; 17 Jan 2024 16:45:30 +0000 Received: from localhost ([127.0.0.1]:53145 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rQ92f-0004gm-9S for submit@debbugs.gnu.org; Wed, 17 Jan 2024 11:45:29 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:51795) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rQ92Y-0004Ez-E2 for 68514@debbugs.gnu.org; Wed, 17 Jan 2024 11:45:22 -0500 Received: by mail.gandi.net (Postfix) with ESMTPSA id 5CD34E000A; Wed, 17 Jan 2024 16:45:13 +0000 (UTC) From: Juri Linkov In-Reply-To: (Spencer Baugh's message of "Tue, 16 Jan 2024 14:43:35 -0500") Organization: LINKOV.NET References: <86ply1npno.fsf@mail.linkov.net> Date: Wed, 17 Jan 2024 18:42:38 +0200 Message-ID: <86zfx329oh.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> This is a known bug without a known fix: >> https://debbugs.gnu.org/64903#18 > > Alright, how about this patch? Should fix most of the issue without > changing the code too much. > > diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el > @@ -668,6 +668,9 @@ elisp-completion-at-point > (goto-char beg) > (forward-sexp 1) > (skip-chars-backward "'’") > + (when (member (char-syntax (char-before (point))) > + '(?\" ?\))) > + (goto-char beg)) > (when (>= (point) pos) > (point))) Thanks. I tried this patch, but it doesn't seem to have any effect. From unknown Fri Jun 20 20:06:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#68514: 30.0.50; minibuffer-choose-completion + elisp-c-a-p delete next sexp when completing after open paren Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 Jan 2024 17:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68514 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: dmitry@gutov.dev, 68514@debbugs.gnu.org, Juri Linkov Received: via spool by 68514-submit@debbugs.gnu.org id=B68514.170551201616496 (code B ref 68514); Wed, 17 Jan 2024 17:21:02 +0000 Received: (at 68514) by debbugs.gnu.org; 17 Jan 2024 17:20:16 +0000 Received: from localhost ([127.0.0.1]:53213 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rQ9aJ-0004Hw-NW for submit@debbugs.gnu.org; Wed, 17 Jan 2024 12:20:16 -0500 Received: from mxout6.mail.janestreet.com ([64.215.233.21]:50291) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rQ9aH-0004HS-Nv for 68514@debbugs.gnu.org; Wed, 17 Jan 2024 12:20:14 -0500 From: Spencer Baugh In-Reply-To: (Stefan Monnier's message of "Wed, 17 Jan 2024 11:37:15 -0500") References: <86ply1npno.fsf@mail.linkov.net> Date: Wed, 17 Jan 2024 12:20:06 -0500 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1705512006; bh=2kNxGkdED7D7SoFwSUVyd3x4cTk3ns8Gg4VFJ58S4Nw=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=p8lvuDfE/KwKj/xCTi2pEvR0+KNzc6WGqGgbshCqZsoAYrlO9KcLfD9OUzDAeOpLv dZRON7dp/KOHKOzQF58zMjlFyHeFBYdWXp4NAethhcE6gB29FCOaHiN4xjaLRCGpjy Yva3TGWNT1a2XeNlohpBhrwT1lAw2Lq5IEwQXAOnIDxSJsQZrkDzztXx+NjqIZZ44m oU2INc72b/C1Oy+9mvNrFZUiZofpVnygh5tkMEU/ZB1VHy2jYXMBRPC4SDp/rMGHoX IfCZCBenoxc39xV8CRh84Fnxj6NnDPJXSbhktBVeNgR/99iz/fV6j61hiH1j6nmPHR uG0rIRSl0NlZg== X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Monnier writes: >> If point is already at the start of a sexp (e.g. immediately after an >> open paren) then backward-sexp will not move point and the beginning >> of the completion region would (correctly) be the original point. >> >> forward-sexp, in this case, will move over the next sexp after point >> and include it in the completion region, even if it's a string or >> list. > > The fact that it did not move point is not really the problem. Yes, I agree that's not a problem - it's not something my patch changes. My patch just causes the completion region to not include unrelated lists/strings. (although it can still include whitespace or comments - but deleting those might actually arguably be correct) > The problem is that point may be just before something like whitespace, > so the > > (member (char-syntax (char-after beg)) > '(?\" ?\()) > > doesn't notice that `forward-sexp` will actually jump over a list or > some other such uncompletable sexp. > > I suggest the patch below instead (which also uses `min` to try to make > sure we don't return a BEG..END which doesn't contain point). > > > Stefan > > > - (unless (or (eq beg (point-max)) > - (member (char-syntax (char-after beg)) > - '(?\" ?\())) > + (unless (or (>= beg (point-max)) > + (not (memq (char-syntax (char-after beg)) > + '(?w ?\\ ?_)))) This prevents completion from happening at all when point is right after an open paren and right before whitespace, which currently works, though it has this bug. That doesn't seem like an improvement, and also it reverts 0db2126d7176b0bd1b13d4b0d1cd958c8cf55714 which explicitly did the opposite. From unknown Fri Jun 20 20:06:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#68514: 30.0.50; minibuffer-choose-completion + elisp-c-a-p delete next sexp when completing after open paren Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 Jan 2024 17:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68514 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov Cc: dmitry@gutov.dev, 68514@debbugs.gnu.org, monnier@iro.umontreal.ca Received: via spool by 68514-submit@debbugs.gnu.org id=B68514.170551217716963 (code B ref 68514); Wed, 17 Jan 2024 17:23:01 +0000 Received: (at 68514) by debbugs.gnu.org; 17 Jan 2024 17:22:57 +0000 Received: from localhost ([127.0.0.1]:53218 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rQ9cv-0004PV-Bg for submit@debbugs.gnu.org; Wed, 17 Jan 2024 12:22:57 -0500 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:38037) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rQ9cs-0004P9-VT for 68514@debbugs.gnu.org; Wed, 17 Jan 2024 12:22:55 -0500 From: Spencer Baugh In-Reply-To: <86zfx329oh.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 17 Jan 2024 18:42:38 +0200") References: <86ply1npno.fsf@mail.linkov.net> <86zfx329oh.fsf@mail.linkov.net> Date: Wed, 17 Jan 2024 12:22:48 -0500 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1705512168; bh=bT+ecOajYGnt50kubu7XUel0RIPR/4vJmtKjoOCIJbQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=LrmBRlJPHvGsEyuvPoEaVNpAEnuIHiPbaZ5Ih9xhIEJWoj/Xok1HphSFdkGlOyrdP dQosPitUtko+HAyUQwRDESOGjQrxWhYfI9hrKnfxWu5V2XSJJj5HuKD1/hGBXw82N+ ZNS9FtnNAkNxE5OOKzUSfZCBzhfXPRZBYWUkJECU2FKxYYPGSCFStZQXKW5PBNq1jb t7kqaaNKMcq7SLJl9+WGGPQnHDrHwyyI8PzS/lXoxdSDZK6QBRQK6us13QrTHHOxZr 1kGCX6xaRdOI+SZoq/3qdeZChrtuhPwh59tPFNqWxezlCodEBk87tNGSb2JxgghogF Si2O7LGKUXJ3A== X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Juri Linkov writes: >>> This is a known bug without a known fix: >>> https://debbugs.gnu.org/64903#18 >> >> Alright, how about this patch? Should fix most of the issue without >> changing the code too much. >> >> diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el >> @@ -668,6 +668,9 @@ elisp-completion-at-point >> (goto-char beg) >> (forward-sexp 1) >> (skip-chars-backward "'=E2=80=99") >> + (when (member (char-syntax (char-before (point))) >> + '(?\" ?\))) >> + (goto-char beg)) >> (when (>=3D (point) pos) >> (point))) > > Thanks. I tried this patch, but it doesn't seem to have any effect. How did you test? If I insert: ( (foo) and move point to: (| (foo) then hit M-TAB and select a completion, for me, after my patch, (foo) is not deleted, whereas before it would be. From unknown Fri Jun 20 20:06:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#68514: 30.0.50; minibuffer-choose-completion + elisp-c-a-p delete next sexp when completing after open paren Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 Jan 2024 17:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68514 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Spencer Baugh Cc: dmitry@gutov.dev, 68514@debbugs.gnu.org, monnier@iro.umontreal.ca Received: via spool by 68514-submit@debbugs.gnu.org id=B68514.17055136207883 (code B ref 68514); Wed, 17 Jan 2024 17:47:02 +0000 Received: (at 68514) by debbugs.gnu.org; 17 Jan 2024 17:47:00 +0000 Received: from localhost ([127.0.0.1]:53286 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rQA0C-000235-8z for submit@debbugs.gnu.org; Wed, 17 Jan 2024 12:47:00 -0500 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:38453) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rQA08-00022h-90 for 68514@debbugs.gnu.org; Wed, 17 Jan 2024 12:46:58 -0500 Received: by mail.gandi.net (Postfix) with ESMTPSA id 57B7A60005; Wed, 17 Jan 2024 17:46:45 +0000 (UTC) From: Juri Linkov In-Reply-To: (Spencer Baugh's message of "Wed, 17 Jan 2024 12:22:48 -0500") Organization: LINKOV.NET References: <86ply1npno.fsf@mail.linkov.net> <86zfx329oh.fsf@mail.linkov.net> Date: Wed, 17 Jan 2024 19:44:26 +0200 Message-ID: <86sf2v26th.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> Thanks. I tried this patch, but it doesn't seem to have any effect. > > How did you test? > > If I insert: > > ( (foo) > > and move point to: > > (| (foo) > > then hit M-TAB and select a completion, for me, after my patch, (foo) is > not deleted, whereas before it would be. I tested with: (| ;; This buffer is for text that is not saved, and for Lisp evaluation. ;; To create a file, visit it with ‘C-x C-f’ and enter text in its buffer. From unknown Fri Jun 20 20:06:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#68514: 30.0.50; minibuffer-choose-completion + elisp-c-a-p delete next sexp when completing after open paren Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 Jan 2024 17:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68514 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Spencer Baugh Cc: dmitry@gutov.dev, 68514@debbugs.gnu.org, Juri Linkov Received: via spool by 68514-submit@debbugs.gnu.org id=B68514.17055140928935 (code B ref 68514); Wed, 17 Jan 2024 17:55:01 +0000 Received: (at 68514) by debbugs.gnu.org; 17 Jan 2024 17:54:52 +0000 Received: from localhost ([127.0.0.1]:53295 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rQA7n-0002K3-Oj for submit@debbugs.gnu.org; Wed, 17 Jan 2024 12:54:52 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:24111) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rQA7l-0002Jp-CJ for 68514@debbugs.gnu.org; Wed, 17 Jan 2024 12:54:50 -0500 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 22D204426C3; Wed, 17 Jan 2024 12:54:42 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1705514080; bh=fF8bdjHyUSCYatO1Noci1/DXzJrWhDfe+6cAi4p7b0g=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=eISOdAvHjhAhI3xn78JVZ0WDTqV4TzKNPSLgV+dN7vnMoze2J3yTtwT8puB/vEKb7 gDurFQx1KDQHLJGIqiqTkGKbBhSb3swAPdjMcyZEam2NsUTIbD7mUE2PT1ZJLslBQh SqBl/jHDR5a6Mscmhelg72zlsDEQxQVBWHjR4+RppVNoog8A3/YMHGdLAd8amh1GTS cPLM5mfm7W3C2bCDSToYqbzXz4qDDfLNO1FIFimutW3l9hLQ+SFmB+4c8vH7QQVL+E UqxZKw6gT0mxoSOOA/rmaplFYmjFgGDFJ9gLoakV46OcmxKogXShW4rRGGhmWPlg+i yjLUdqp89c1bA== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id B2F364426C0; Wed, 17 Jan 2024 12:54:40 -0500 (EST) Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id A24AF1202CB; Wed, 17 Jan 2024 12:54:40 -0500 (EST) From: Stefan Monnier In-Reply-To: (Spencer Baugh's message of "Wed, 17 Jan 2024 12:20:06 -0500") Message-ID: References: <86ply1npno.fsf@mail.linkov.net> Date: Wed, 17 Jan 2024 12:53:39 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.145 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > This prevents completion from happening at all when point is right after > an open paren and right before whitespace, which currently works, though > it has this bug. It "works" only in the sense that it shows completions, but the set of possible completions is arguably too large (or small, depending on your `completion-styles`) to be very useful, and the rest of the behavior is broken because when you choose a completion it deletes the subsequent sexp (because it's actually not completing on "" but on " "). > That doesn't seem like an improvement, and also it > reverts 0db2126d7176b0bd1b13d4b0d1cd958c8cf55714 which explicitly did > the opposite. Then maybe... Stefan diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 00910fb67c7..da0cb96e1cf 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -657,12 +657,13 @@ elisp-completion-at-point (save-excursion (backward-sexp 1) (skip-chars-forward "`',=E2=80=98#") - (point)) + (min (point) pos)) (scan-error pos))) (end - (unless (or (eq beg (point-max)) - (member (char-syntax (char-after beg)) - '(?\" ?\())) + (cond + ((and (< beg (point-max)) + (memq (char-syntax (char-after beg)) + '(?w ?\\ ?_))) (condition-case nil (save-excursion (goto-char beg) @@ -670,7 +671,11 @@ elisp-completion-at-point (skip-chars-backward "'=E2=80=99") (when (>=3D (point) pos) (point))) - (scan-error pos)))) + (scan-error pos))) + ((or (>=3D beg (point-max)) + (memq (char-syntax (char-after beg)) + '(?\) ?\s))) + beg))) ;; t if in function position. (funpos (eq (char-before beg) ?\()) (quoted (elisp--form-quoted-p beg)) From unknown Fri Jun 20 20:06:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#68514: 30.0.50; minibuffer-choose-completion + elisp-c-a-p delete next sexp when completing after open paren Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 Jan 2024 18:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68514 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: dmitry@gutov.dev, 68514@debbugs.gnu.org, Juri Linkov Received: via spool by 68514-submit@debbugs.gnu.org id=B68514.170551504620758 (code B ref 68514); Wed, 17 Jan 2024 18:11:02 +0000 Received: (at 68514) by debbugs.gnu.org; 17 Jan 2024 18:10:46 +0000 Received: from localhost ([127.0.0.1]:53309 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rQANC-0005Ok-Gy for submit@debbugs.gnu.org; Wed, 17 Jan 2024 13:10:46 -0500 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:51587) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rQANA-0005OX-7M for 68514@debbugs.gnu.org; Wed, 17 Jan 2024 13:10:44 -0500 From: Spencer Baugh In-Reply-To: (Stefan Monnier's message of "Wed, 17 Jan 2024 12:53:39 -0500") References: <86ply1npno.fsf@mail.linkov.net> Date: Wed, 17 Jan 2024 13:10:36 -0500 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1705515037; bh=dRvgiLPwgE6MkhSJgoEFxR4KQxDiNAI0aTINcJRQM8Y=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=B+cJ4YzVwZpIjq6x6yy3oNrlONGsiCJ3lOHjgXwVe+Tc1pSpkJfrigswapVcHcuex EEkXjPipvRgISF1lDCEtYqbB1DXMx82sorZm9cYlNmBrSlGE23QGQMgX1RXncKfW62 DpmOb8h1FVm6MDpq6tFabkjlureEvGcSEXX7xzbmjMKmZwCMpj69SwcRTQdXwlV7cZ Zb/8SSzL/lJRrPgSA499A/6mK1D38YfgJcL1ekUV3zalJzvx1sLK51rGLxwMxgP7fC cKEYYbNhcPqF5OZrAlGZDWaRAKdaeaQ5u83cbW/F737fdj7uZkYM4rSDWmBXh0bMUV Zwc3t8uAVpYVA== X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Monnier writes: >> That doesn't seem like an improvement, and also it >> reverts 0db2126d7176b0bd1b13d4b0d1cd958c8cf55714 which explicitly did >> the opposite. > > Then maybe... > > > Stefan > > > diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el > index 00910fb67c7..da0cb96e1cf 100644 > --- a/lisp/progmodes/elisp-mode.el > +++ b/lisp/progmodes/elisp-mode.el > @@ -657,12 +657,13 @@ elisp-completion-at-point > (save-excursion > (backward-sexp 1) > (skip-chars-forward "`',=E2=80=98#") > - (point)) > + (min (point) pos)) > (scan-error pos))) > (end > - (unless (or (eq beg (point-max)) > - (member (char-syntax (char-after beg)) > - '(?\" ?\())) > + (cond > + ((and (< beg (point-max)) > + (memq (char-syntax (char-after beg)) > + '(?w ?\\ ?_))) > (condition-case nil > (save-excursion > (goto-char beg) > @@ -670,7 +671,11 @@ elisp-completion-at-point > (skip-chars-backward "'=E2=80=99") > (when (>=3D (point) pos) > (point))) > - (scan-error pos)))) > + (scan-error pos))) > + ((or (>=3D beg (point-max)) > + (memq (char-syntax (char-after beg)) > + '(?\) ?\s))) > + beg))) > ;; t if in function position. > (funpos (eq (char-before beg) ?\()) > (quoted (elisp--form-quoted-p beg)) Yes, seems great, that seems like what 0db2126d7176b0bd1b13d4b0d1cd958c8cf55714 should have done in the first place. Incidentally, are these (point-max) checks necessary? We're not doing anything that can cause us to leave the narrowed region, I think. From unknown Fri Jun 20 20:06:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#68514: 30.0.50; minibuffer-choose-completion + elisp-c-a-p delete next sexp when completing after open paren Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 Jan 2024 19:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68514 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Spencer Baugh Cc: dmitry@gutov.dev, 68514@debbugs.gnu.org, Juri Linkov Received: via spool by 68514-submit@debbugs.gnu.org id=B68514.17055182943124 (code B ref 68514); Wed, 17 Jan 2024 19:05:02 +0000 Received: (at 68514) by debbugs.gnu.org; 17 Jan 2024 19:04:54 +0000 Received: from localhost ([127.0.0.1]:53501 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rQBDa-0000oH-C2 for submit@debbugs.gnu.org; Wed, 17 Jan 2024 14:04:54 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:47283) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rQBDX-0000o3-Vo for 68514@debbugs.gnu.org; Wed, 17 Jan 2024 14:04:53 -0500 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 5C620442741; Wed, 17 Jan 2024 14:04:44 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1705518282; bh=h9cZ5BSmd5jjITk3KwOz7BlIhGVm7ByKbRe9CHEGIys=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=hXAJf9d2dolEqbeqsYAPZxr+ggilkOd202Z8o3NjYUk2AEChf9kbT13ENrn1mOUlf ++OrSPmYnKgpa1vP4Gc4N3F3kanVKuTcJUHaLKlJu+q2WvXCVr0Kw5DL7PS3ppeR8z CGyR6MyaZ1vmszzN+SjW3Zo70IlzBqZUT/q+srupMBHj4fVpCPTBk2kx0RHJm84qbf WfgZGtdhOlip79kmT1BuPyH1F+FUsGpAFcknI3QX/pM8UJ00MEnsHnzn4vMbH/G6q1 LQRFKk5++sA8m74A0wdfl1Q8O6Dk1ytbRGHxBwtqTzsUNwL4QPSaSxVlaiFj1q6OMP 7xKoioyetpWUQ== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 9E72F442743; Wed, 17 Jan 2024 14:04:42 -0500 (EST) Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 922C5120234; Wed, 17 Jan 2024 14:04:42 -0500 (EST) From: Stefan Monnier In-Reply-To: (Spencer Baugh's message of "Wed, 17 Jan 2024 13:10:36 -0500") Message-ID: References: <86ply1npno.fsf@mail.linkov.net> Date: Wed, 17 Jan 2024 14:03:40 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.145 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Incidentally, are these (point-max) checks necessary? We're not doing > anything that can cause us to leave the narrowed region, I think. `char-after` returns nil at EOB, which would cause an error in `char-syntax`. Stefan From unknown Fri Jun 20 20:06:02 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Spencer Baugh Subject: bug#68514: closed (Re: bug#68514: 30.0.50; minibuffer-choose-completion + elisp-c-a-p delete next sexp when completing after open paren) Message-ID: References: X-Gnu-PR-Message: they-closed 68514 X-Gnu-PR-Package: emacs Reply-To: 68514@debbugs.gnu.org Date: Thu, 18 Jan 2024 19:07:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1705604822-17835-1" This is a multi-part message in MIME format... ------------=_1705604822-17835-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #68514: 30.0.50; minibuffer-choose-completion + elisp-c-a-p delete next sex= p when completing after open paren which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 68514@debbugs.gnu.org. --=20 68514: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D68514 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1705604822-17835-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 68514-done) by debbugs.gnu.org; 18 Jan 2024 19:06:11 +0000 Received: from localhost ([127.0.0.1]:56665 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rQXiN-0004cO-BJ for submit@debbugs.gnu.org; Thu, 18 Jan 2024 14:06:11 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:28623) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rQXiJ-0004bw-Cv for 68514-done@debbugs.gnu.org; Thu, 18 Jan 2024 14:06:09 -0500 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 6209C4442AE; Thu, 18 Jan 2024 14:05:58 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1705604757; bh=cvNgF5PCjdpi6LoB+/CS37jPxIXqMXTfkF/pBePPCrI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=amVTda5pNZqCPTnly7VyEhzSWvI0PaSydumbaewIwcXNO97fh7FYv5iKBrFQRMnh+ m+NhQG9G4MtBkbEkq9GO4NEAqSJI6EVVcpGpQDKjrCm21THh4ZtMMzfZ39U2oEu7Hv JhKZsKUIoCRn9OF7yDctPe4Uma5yoou9cv+A4WXAFJtuklPwp4TNarwN+zLLzGN3Rh ElJ+aai+qpmuE1cG1XmNATlJ5b+auRk2vKDrZAAiF15ZuCevK+l5VGjuFPGR13QrMk XedUb+wLEfTzRqGSDIAH2owLx3U7K807n8TD0z1ADGx8CypzWvdEVV++ok8q8JlnVl jdciKqh4CvYew== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 2A914444264; Thu, 18 Jan 2024 14:05:57 -0500 (EST) Received: from alfajor (modemcable005.21-80-70.mc.videotron.ca [70.80.21.5]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id E6314120429; Thu, 18 Jan 2024 14:05:56 -0500 (EST) From: Stefan Monnier To: Spencer Baugh Subject: Re: bug#68514: 30.0.50; minibuffer-choose-completion + elisp-c-a-p delete next sexp when completing after open paren In-Reply-To: (Stefan Monnier's message of "Wed, 17 Jan 2024 12:53:39 -0500") Message-ID: References: <86ply1npno.fsf@mail.linkov.net> Date: Thu, 18 Jan 2024 14:05:56 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.100 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 68514-done Cc: dmitry@gutov.dev, 68514-done@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Then maybe... Installed in `master`. Closing, Stefan ------------=_1705604822-17835-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 16 Jan 2024 17:06:35 +0000 Received: from localhost ([127.0.0.1]:49611 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rPmtX-0006lP-2Y for submit@debbugs.gnu.org; Tue, 16 Jan 2024 12:06:35 -0500 Received: from lists.gnu.org ([2001:470:142::17]:58320) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rPmtU-0006lB-IN for submit@debbugs.gnu.org; Tue, 16 Jan 2024 12:06:33 -0500 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 1rPmtN-00024p-Pi for bug-gnu-emacs@gnu.org; Tue, 16 Jan 2024 12:06:26 -0500 Received: from mxout5.mail.janestreet.com ([64.215.233.18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rPmtL-0001Za-8r for bug-gnu-emacs@gnu.org; Tue, 16 Jan 2024 12:06:25 -0500 From: Spencer Baugh To: bug-gnu-emacs@gnu.org Subject: 30.0.50; minibuffer-choose-completion + elisp-c-a-p delete next sexp when completing after open paren X-Debbugs-Cc: Date: Tue, 16 Jan 2024 12:06:20 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1705424780; bh=mfBmhIKHfK13M4tjJjTe/gQzwkPEJ620jn0ZgxSxQrc=; h=From:To:Cc:Subject:Date; b=G/4nnczLFOoEiE7jiELAl4kkqo0YDrDKD2hFjL0CYQqFpTmORB65Fe9dppJxguHYb AwC1DfVIZYG6K0PdX6zfYGZzm8caN462dbWZ6QKJM4K6ytiEtngANq947a4kVF5k7K 6eylQ3Z6GBihlgdJ0Doi7bkrpV8VLiyWTcurkdzMPab78Wh6MUxzYW10pO8/J8QRDV y55izd9g7Qmokj1sRaBpsX+5O/gPps0osGy6yoAGkVBrgk4hn+c5UWrKq2z/rqEChx 1LajpgD/eKFjAB92ePQLIA2T8v/xDyf6Rz4XfS5J5dHl2ghwXuYuOkJ3R/9CMQ6VCX 4hdAnJPDk3VSA== Received-SPF: pass client-ip=64.215.233.18; envelope-from=sbaugh@janestreet.com; helo=mxout5.mail.janestreet.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit Cc: dmitry@gutov.dev, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) In an Elisp buffer, if you trigger completion after an open paren then use minibuffer-choose-completion to choose a completion, minibuffer-choose-completion will delete the next sexp before inserting the completion. Step by step: 1. emacs -Q 2. In an Elisp buffer, type in: ( (progn (some) (big) (expression)) 3. Move point to the end of the initial "(" and hit M-TAB 4. Use M-down and M-RET to select some completion e.g. "current-buffer". 5. When the completion is inserted, "(progn (some) (big) (expression))" is deleted, so the buffer contains just e.g. "(current-buffer" If at step 2, the user types any characters after the "(", the progn won't be deleted; for example, typing instead: (a (progn (some) (big) (expression)) and doing completion and using M-RET to pick a completion doesn't delete the progn sexp. This is because elisp-completion-at-point returns a completion region covering the entire sexp after the start of the region. That sexp is "(progn (some) (big) (expression))" in the first case and "a" in the second case. I'm not sure how to fix this. I don't know all the features of elisp-completion-at-point, but maybe it shouldn't use (forward-sexp 1) when finding the end of the completion region. Maybe it should be doing something like (skip-syntax-forward "w_") to determine the end of the region? BTW, this completion region returned by elisp-completion-at-point also causes a bug in company-mode: since company-capf stops completion when the end of the completion region is after point, it's not possible to do Elisp company completion immediately after an open paren no matter how company is configured. In GNU Emacs 30.0.50 (build 20, x86_64-pc-linux-gnu, X toolkit, cairo version 1.15.12, Xaw scroll bars) of 2023-12-27 built on igm-qws-u22796a Repository revision: b9c0ce0a400f18e1bba4e3491c94994d73ef9405 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12011000 System Description: Rocky Linux 8.9 (Green Obsidian) Configured using: 'configure -C 'CFLAGS=-O0 -g3' --with-gif=ifavailable --with-x-toolkit=lucid' Configured features: CAIRO DBUS FREETYPE GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XINPUT2 XPM LUCID ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction 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 minibuffer-regexp-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 emacsbug message mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search time-date subr-x mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd touch-screen 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 seq simple cl-generic indonesian philippine 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 theme-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 dbusbind inotify dynamic-setting system-font-setting font-render-setting cairo x-toolkit xinput2 x multi-tty move-toolbar make-network-process emacs) Memory information: ((conses 16 243422 25806) (symbols 48 9546 0) (strings 32 31424 2459) (string-bytes 1 846405) (vectors 16 10420) (vector-slots 8 158724 18572) (floats 8 43 21) (intervals 56 49602 0) (buffers 984 12)) ------------=_1705604822-17835-1--