From unknown Sat Sep 13 09:20:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34787: New defcustom to govern TAB completion Resent-From: Alex Branham Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 08 Mar 2019 18:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 34787 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 34787@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.155206929631514 (code B ref -1); Fri, 08 Mar 2019 18:22:02 +0000 Received: (at submit) by debbugs.gnu.org; 8 Mar 2019 18:21:36 +0000 Received: from localhost ([127.0.0.1]:36631 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h2K7j-0008CD-FE for submit@debbugs.gnu.org; Fri, 08 Mar 2019 13:21:35 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34895) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h2K7h-0008Bv-IW for submit@debbugs.gnu.org; Fri, 08 Mar 2019 13:21:34 -0500 Received: from lists.gnu.org ([209.51.188.17]:59619) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h2K7c-0008Js-Cb for submit@debbugs.gnu.org; Fri, 08 Mar 2019 13:21:28 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49249) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2K7Z-0000Wl-Ul for bug-gnu-emacs@gnu.org; Fri, 08 Mar 2019 13:21:28 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2K7Y-0008H6-Sq for bug-gnu-emacs@gnu.org; Fri, 08 Mar 2019 13:21:25 -0500 Received: from mail-ot1-x329.google.com ([2607:f8b0:4864:20::329]:46239) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h2K7Y-0008G9-Ld for bug-gnu-emacs@gnu.org; Fri, 08 Mar 2019 13:21:24 -0500 Received: by mail-ot1-x329.google.com with SMTP id c18so18150190otl.13 for ; Fri, 08 Mar 2019 10:21:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=user-agent:from:to:subject:date:message-id:mime-version; bh=Up2ogg63I35AhXEkdxWVX/N9UHaEOLWBrrrkVP9OP8A=; b=pEBEK1Y/AqdDA5cjFA/+/JggbDJichHjmQ+8/rtzaNXXE5sq1sfH0u2OBB/EPqT+C+ kRXcmMeFJ5FITegJi2VvcVsvnH+On8Y9JFssfgBlOhQdnT0rhwAkJVUBqPjMFwcn9roY NwEzdlbY1SakkTzSQ9TEFwI3DV4yb4QzSPhpvc0TM5/K5GJxYPNQFEB04KHyeD/vxh+j EWFGRN+DmuRSUEMetJHJeO+x2NOI02Ofd4IRaXr3b05ZCPcFZxxULJrsNsZf/FBOHI6E /4OwZmv8xir7lOPXoTRvfZJFHfbGOTdEASHwG7nZQHhpECixTDYGC68vq4tqWGUQxgkt kJPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:user-agent:from:to:subject:date:message-id :mime-version; bh=Up2ogg63I35AhXEkdxWVX/N9UHaEOLWBrrrkVP9OP8A=; b=tdTWLcXE2AhLMavwFx5rcjlZXrLYdgLq7rtzV7qcJpQKtKbp4GnwwkD4549fg4NOAb 0AY/7IDHd1ymRb38eQrub5329RxuqXechom0kCS8zxqG4sp+GFGEBmjY58jOWMn4aC9C yFzZ3JRAUEhkHvBWaDtP1F8nI8v2AybsfCzHS0+qwA0PLfrtSyKEAgZpULUnTqAug7Tx EfCukiHvz/2xYW1hKDvMLvz/cyBJtQ+7nsSgQru3bj6XWYBuwkex5TCUXiMZVefg6rwu WjIUFzdHSfFUysaqUfF2EupYNjv4nGhb8ct4puUcgcVGgWIvSwq7QO4K80nvxe/GMKAc cA5A== X-Gm-Message-State: APjAAAVPba2GJkkiX3NA6zN/bwXmchn7CJnGcRKuUjsb0AbLi4ueNbLl XvMSY2i6lDWoWza69UFPklb/cJnG X-Google-Smtp-Source: APXvYqyL6kB2IvowhnAJQAKPwjNDRVhhtH074g2uhG58fQ8PXoxfp5XQ9iHKx3OiJlk/1luSIrSEGw== X-Received: by 2002:a05:6830:1297:: with SMTP id z23mr13470007otp.257.1552069283086; Fri, 08 Mar 2019 10:21:23 -0800 (PST) Received: from earth (cpe-70-114-192-208.austin.res.rr.com. [70.114.192.208]) by smtp.gmail.com with ESMTPSA id j18sm3256437otl.40.2019.03.08.10.21.21 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 10:21:22 -0800 (PST) User-agent: mu4e 1.1.0; emacs 27.0.50 From: Alex Branham Date: Fri, 08 Mar 2019 12:21:20 -0600 Message-ID: <87h8cdqlb3.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::329 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: 1.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: -0.0 (/) --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hello - In ESS, we have 'ess-first-tab-never-complete' which governs whether TAB offers completion. The gist of it is that if you're in a buffer (with | representing point): (def|var foo) and you hit TAB, you might not want completion offered. I've put together a patch that incorporates this into Emacs by adding a new defcustom `tab-first-completion'. The values are currently based on ESS's implementation, though we can certainly change that if we want. Perhaps it should be a function that receives one argument (position) and if it returns non-nil, then we complete? Is this something people would be interested in adding? Thanks, Alex From=20eb4c1a9c8bcd2f5018150b0502e8ed945c181e74 Mon Sep 17 00:00:00 2001 From: Alex Branham Date: Fri, 8 Mar 2019 12:09:04 -0600 Subject: [PATCH] New defcustom tab-first-completion * lisp/indent.el (tab-always-indent): Mention 'tab-first-completion'. (tab-first-completion): New defcustom. (indent-for-tab-command): Use 'tab-first-completion'. Bug# =2D-- lisp/indent.el | 40 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/lisp/indent.el b/lisp/indent.el index 34757a43d7..08087effa6 100644 =2D-- a/lisp/indent.el +++ b/lisp/indent.el @@ -51,6 +51,7 @@ If nil, hitting TAB indents the current line if point is = at the left margin or in the line's indentation, otherwise it inserts a \"real\" TAB characte= r. If `complete', TAB first tries to indent the current line, and if the line was already indented, then try to complete the thing at point. +See also `tab-first-completion'. Some programming language modes have their own variable to control this, e.g., `c-tab-always-indent', and do not respect this variable." @@ -60,6 +61,27 @@ e.g., `c-tab-always-indent', and do not respect this var= iable." (const :tag "Indent if inside indentation, else TAB" nil) (const :tag "Indent, or if already indented complete" complete))) +(defcustom tab-first-completion nil + "Governs the behavior of TAB completion on the first press of the key. +When nil, complete. When `eol', only complete if point is at the +end of a line. When `word', complete unless the next character +has word syntax (according to `syntax-after'). When +`word-or-paren', complete unless the next character is part of a +word or a parenthesis. When `word-or-paren-or-punct', complete +unless the next character is part of a word, parenthesis, or +punctuation. Typing TAB a second time always results in +completion. + +This variable has no effect unless `tab-always-indent' is `complete'." + :group 'indent + :type '(choice + (const :tag "Always complete" nil) + (const :tag "Unless at the end of a line" 'eol) + (const :tag "Unless looking at a word" 'word) + (const :tag "Unless at a word or parenthesis" 'word-or-paren) + (const :tag "Unless at a word, parenthesis, or punctuation." 'wo= rd-or-paren-or-punct)) + :version "27.1") + (defun indent-according-to-mode () "Indent line in proper way for current major mode. @@ -111,7 +133,7 @@ or performs symbol completion, depending on `tab-always= -indent'. The function called to actually indent the line or insert a tab is given by the variable `indent-line-function'. =2DIf a prefix argument is given, after this function indents the +If a prefix argument is given (ARG), after this function indents the current line or inserts a tab, it also rigidly indents the entire balanced expression which starts at the beginning of the current line, to reflect the current line's indentation. @@ -139,7 +161,8 @@ prefix argument is ignored." (t (let ((old-tick (buffer-chars-modified-tick)) (old-point (point)) =2D (old-indent (current-indentation))) + (old-indent (current-indentation)) + (syn (syntax-after (point)))) ;; Indent the line. (or (not (eq (indent--funcall-widened indent-line-function) 'noinden= t)) @@ -152,7 +175,18 @@ prefix argument is ignored." ;; If the text was already indented right, try completion. ((and (eq tab-always-indent 'complete) (eq old-point (point)) =2D (eq old-tick (buffer-chars-modified-tick))) + (eq old-tick (buffer-chars-modified-tick)) + (or (null tab-first-completion) + (eq last-command this-command) + (and (equal tab-first-completion 'eol) + (eolp)) + (and (member tab-first-completion '(word word-or-paren wo= rd-or-paren-or-punct)) + (not (member 2 syn))) + (and (member tab-first-completion '(word-or-paren word-or= -paren-or-punct)) + (not (or (member 4 syn) + (member 5 syn)))) + (and (equal tab-first-completion 'word-or-paren-or-punct) + (not (member 1 syn))))) (completion-at-point)) ;; If a prefix argument was given, rigidly indent the following =2D- 2.19.2 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEeEJ4XAMgliXNXicpHkInolPpmscFAlyCsqAACgkQHkInolPp msdkGQf/bC9TfBOy/3XXrdrrEjM3rMO+/9EYpgq/yHnqUa/ergq1oFeA9NR00gnS qrvQVeXKhM3yJ2aiT6SXp+rZYHE/Kw4As+3qbuqYXYHHtBC+ti+mNA1TNJuGqqgi qeUetS4jIBy3Es+UAf+suZk6FZpUrafOT2F6AChhhq1LI3SHRTWd/g5LBvZSZgbl lf27jNdDJn+TtNiAIhRiIWXN6wEOnEhgQ651ZGRMhjkM+n++R+od6SZm4pmA505U HMjqCgEFp0GEQ0HI2WXK5/8lRL/9/QQqzwplw6orTU5M5mRmPqywYipTTY3HaUH+ XaiJxhWZ6pIkbnKgKMFQS28k+iiP3g== =kepH -----END PGP SIGNATURE----- --=-=-=-- From unknown Sat Sep 13 09:20:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34787: New defcustom to govern TAB completion Resent-From: Alex Branham Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 08 Mar 2019 19:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34787 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 34787@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15520733556922 (code B ref -1); Fri, 08 Mar 2019 19:30:02 +0000 Received: (at submit) by debbugs.gnu.org; 8 Mar 2019 19:29:15 +0000 Received: from localhost ([127.0.0.1]:36687 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h2LBC-0001nY-QY for submit@debbugs.gnu.org; Fri, 08 Mar 2019 14:29:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48630) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h2LBB-0001nJ-Fm for submit@debbugs.gnu.org; Fri, 08 Mar 2019 14:29:14 -0500 Received: from lists.gnu.org ([209.51.188.17]:55298) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h2LB6-0001BU-Bi for submit@debbugs.gnu.org; Fri, 08 Mar 2019 14:29:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34771) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2LB5-0001uO-Hu for bug-gnu-emacs@gnu.org; Fri, 08 Mar 2019 14:29:08 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2LB4-0001AA-Ts for bug-gnu-emacs@gnu.org; Fri, 08 Mar 2019 14:29:07 -0500 Received: from mail-oi1-x22a.google.com ([2607:f8b0:4864:20::22a]:45770) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h2LB4-00019h-No for bug-gnu-emacs@gnu.org; Fri, 08 Mar 2019 14:29:06 -0500 Received: by mail-oi1-x22a.google.com with SMTP id t82so16740251oie.12 for ; Fri, 08 Mar 2019 11:29:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:subject:in-reply-to:date:message-id :mime-version; bh=NWjayVMD5c+jQuzjfRQ4K1Oue5n1QFuB6lmfZKkUADI=; b=OUY++sHHMfG8GDTd9YqjctfBmaiJDQ6L+jqmIFL26TFp+OK7QAEAaooMgbFIIcfUId bqLZ6/lbcfehH01Q1erPHBa+f2CWUFFlwKTMQEu+j0RMYTHlY433PA3YtZrgLSQyqcl9 nkMiAVgB7WhRZiMD7acdsARVGS7VZUQsEJ5GfPqBflWerZD4/tE10I2i+279KCeNlJX4 VkclkFbPOSzhdeqFBIwcGF/E7BATINkxKRZmV+EOngo5uBl2hFALI1AjalYH+lRwQpgq Hz4ucpPwqEYCqsD6fC+IBBhazhnEblmTqGLUMfmb97KlIR5mXTC7NlQew4YC0tg7oU6Z jO7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:subject :in-reply-to:date:message-id:mime-version; bh=NWjayVMD5c+jQuzjfRQ4K1Oue5n1QFuB6lmfZKkUADI=; b=kllHqxSLJAWVrEbsWfBvqHTcFOlmr/dQePmFbly9sYszb8C6SiCJTW/kkfXzcUjhbD fOQUdvNGIycdskx1TNoCcr2VI92qh6YO9SuG9eRZBMO4vWcy12ZW0w4qTHzySCDAUrl+ rnzi/r9nM9kSzhwD+F5pZY2zAarLUoXN4Tb8927RRxA75DfV/6GmsKgJRsmrzIh68GyF dMJPeFxXvu0drXyogB8+BMC2xA1EMpqMKkSLLZjB2Ir098YUqPDi/aAcMA7QtNldhsaR Elhm/04GGZ/Uhx1++D+mgA4vSvPY2zGSc4i5EQ/YiwRNESCMeaV486MdH6jNq0JZ6anF 1p1w== X-Gm-Message-State: APjAAAXi+l/pdEXC9DH6KXMlf4PunWrJ7nZkL8axppnc5HISptLH41iE tZ8+MAzkXz7o7bMcYmJvs3bIAg3e X-Google-Smtp-Source: APXvYqygSFHVOn2pcTp9ARFIp8TmwFz+nQTAntDgvma28mgp/XNO8lC7EUeatG5ke5xHiCWATSReLg== X-Received: by 2002:aca:f2c4:: with SMTP id q187mr9379446oih.168.1552073345251; Fri, 08 Mar 2019 11:29:05 -0800 (PST) Received: from earth (cpe-70-114-192-208.austin.res.rr.com. [70.114.192.208]) by smtp.gmail.com with ESMTPSA id h67sm3493989otb.36.2019.03.08.11.29.04 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 11:29:04 -0800 (PST) References: <87h8cdqlb3.fsf@gmail.com> User-agent: mu4e 1.1.0; emacs 27.0.50 From: Alex Branham In-reply-to: <87h8cdqlb3.fsf@gmail.com> Date: Fri, 08 Mar 2019 13:29:03 -0600 Message-ID: <87ftrxqi68.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::22a X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: 1.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: -0.0 (/) On Fri 08 Mar 2019 at 12:21, Alex Branham wrote: > @@ -139,7 +161,8 @@ prefix argument is ignored." > (t > (let ((old-tick (buffer-chars-modified-tick)) > (old-point (point)) > - (old-indent (current-indentation))) > + (old-indent (current-indentation)) > + (syn (syntax-after (point)))) ^^^^^ should be (syn `(,(syntax-after (point)))) I accidentally sent the wrong patch; this part needs to be quoted. Alex From unknown Sat Sep 13 09:20:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34787: New defcustom to govern TAB completion Resent-From: Alex Branham Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 May 2019 13:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34787 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 34787@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.155878962514378 (code B ref -1); Sat, 25 May 2019 13:08:01 +0000 Received: (at submit) by debbugs.gnu.org; 25 May 2019 13:07:05 +0000 Received: from localhost ([127.0.0.1]:48385 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hUWO9-0003jp-DQ for submit@debbugs.gnu.org; Sat, 25 May 2019 09:07:05 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60552) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hUWO4-0003jG-Dg for submit@debbugs.gnu.org; Sat, 25 May 2019 09:07:01 -0400 Received: from lists.gnu.org ([209.51.188.17]:59897) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hUWNv-0003sF-2b for submit@debbugs.gnu.org; Sat, 25 May 2019 09:06:52 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46657) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hUWNs-0005Q4-Ku for bug-gnu-emacs@gnu.org; Sat, 25 May 2019 09:06:50 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hUWNq-0003og-3T for bug-gnu-emacs@gnu.org; Sat, 25 May 2019 09:06:48 -0400 Received: from mail-ot1-x32f.google.com ([2607:f8b0:4864:20::32f]:38222) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hUWNm-0003Hc-JN for bug-gnu-emacs@gnu.org; Sat, 25 May 2019 09:06:43 -0400 Received: by mail-ot1-x32f.google.com with SMTP id s19so11121873otq.5 for ; Sat, 25 May 2019 06:06:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:subject:in-reply-to:date:message-id :mime-version; bh=sKHzMBgZLvRSPz20CGIUVdhXh20HPNoPO76AW5KLTXE=; b=WAKVX3ZfbOmfWZbiyodXC83zwvUKHmwHNv1jjBK9r2oqkZ06zGsNxKfNZVQE+QtX1X JL8MAPjsEwAlL3x+1+sLEYSW5szlhT8I9q7zaXwDZ5SDGz3WSyrYp/YHuUGPtp8m7hhY d/8LIoEUYuPpaphdWUGRIqMY366Wqx1xs3sU+JiH7jsoBz3qOySugVZqphjW1lydLVkI dp10ZIxob2n2aPTHxbvAuYXMmemCqGMr7dQzr7GceEPHf2rCF2THWHxknGMd1ugTDm7N qCm2j5sIvMP6Xyf38es3Tr7lT6zOjg/HygbQsRnHekTJedEfIWPQi0sTsLWHd4xmKTGr qhyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:subject :in-reply-to:date:message-id:mime-version; bh=sKHzMBgZLvRSPz20CGIUVdhXh20HPNoPO76AW5KLTXE=; b=RHq1gVJ8lyWLk8L/FLrxFSmPuCOZ1DuCOffj4Sm68eKt5tH+7s+IrD+QRTmCbH5aEj FdQcD7iGBONZfYKUGv/8kjTL04T8Q2R443dnjORmHGPefvdkYQxOCQv3ClKoAj+owNAF ZHMgEMBGFkGBJGtpB9rTY6hyODRSAV1Tt0EY++XdvlVkgirkztPr/9B5pArne+V979qw Fue/uOXnydw80588oi9lI0glyT6KZkW1GeUhHjxyuRz9N+r8XjEdTNDdo8rBg2jHSq7H oyPum/Vley7YwMUo7KigheJIp3SJvWb/OVJTZort5gKiBNWYJiQ0nKI7mc6Cjdus7rDl IMZA== X-Gm-Message-State: APjAAAWJKwzlZ3w/ZEe8lQtlEJYLGE2eoNmunuenPWC2T4al6OAaUvY3 s+SRAFW4krlkyhOQyNlrfNPHEBga X-Google-Smtp-Source: APXvYqwLN3Xpm7L089UBiNZXrXMsAWG/JFaeQymRYdRG2JdQ5KvwqVr7BEuApfSzhSjKL/TACl0Cpg== X-Received: by 2002:a9d:5e19:: with SMTP id d25mr17612089oti.316.1558789562790; Sat, 25 May 2019 06:06:02 -0700 (PDT) Received: from mars (cpe-70-114-192-208.austin.res.rr.com. [70.114.192.208]) by smtp.gmail.com with ESMTPSA id 43sm1989046oth.47.2019.05.25.06.06.00 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 25 May 2019 06:06:01 -0700 (PDT) References: <87h8cdqlb3.fsf@gmail.com> User-agent: mu4e 1.2.0; emacs 27.0.50 From: Alex Branham In-reply-to: <87h8cdqlb3.fsf@gmail.com> Date: Sat, 25 May 2019 08:05:59 -0500 Message-ID: <87a7favg3s.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::32f X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: -1.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: -2.3 (--) Hi - Just following up on this since I didn't hear back. If people are interested, great. If not, I can close this bug report. As a quick reminder/TLDR - the proposal is to add a defcustom that governs whether TAB offers completion when hit the first time. The thinking is that if point is in the middle of a word, you may not want completion. Thanks, Alex On Fri 08 Mar 2019 at 12:21, Alex Branham wrote: > Hello - > > In ESS, we have 'ess-first-tab-never-complete' which governs whether TAB > offers completion. The gist of it is that if you're in a buffer (with | > representing point): > > (def|var foo) > > and you hit TAB, you might not want completion offered. I've put > together a patch that incorporates this into Emacs by adding a new > defcustom `tab-first-completion'. The values are currently based on > ESS's implementation, though we can certainly change that if we want. > Perhaps it should be a function that receives one argument (position) > and if it returns non-nil, then we complete? > > Is this something people would be interested in adding? > > Thanks, > Alex > > > From eb4c1a9c8bcd2f5018150b0502e8ed945c181e74 Mon Sep 17 00:00:00 2001 > From: Alex Branham > Date: Fri, 8 Mar 2019 12:09:04 -0600 > Subject: [PATCH] New defcustom tab-first-completion > > * lisp/indent.el (tab-always-indent): Mention 'tab-first-completion'. > (tab-first-completion): New defcustom. > (indent-for-tab-command): Use 'tab-first-completion'. > > Bug# > --- > lisp/indent.el | 40 +++++++++++++++++++++++++++++++++++++--- > 1 file changed, 37 insertions(+), 3 deletions(-) > > diff --git a/lisp/indent.el b/lisp/indent.el > index 34757a43d7..08087effa6 100644 > --- a/lisp/indent.el > +++ b/lisp/indent.el > @@ -51,6 +51,7 @@ If nil, hitting TAB indents the current line if point is at the left margin > or in the line's indentation, otherwise it inserts a \"real\" TAB character. > If `complete', TAB first tries to indent the current line, and if the line > was already indented, then try to complete the thing at point. > +See also `tab-first-completion'. > > Some programming language modes have their own variable to control this, > e.g., `c-tab-always-indent', and do not respect this variable." > @@ -60,6 +61,27 @@ e.g., `c-tab-always-indent', and do not respect this variable." > (const :tag "Indent if inside indentation, else TAB" nil) > (const :tag "Indent, or if already indented complete" complete))) > > +(defcustom tab-first-completion nil > + "Governs the behavior of TAB completion on the first press of the key. > +When nil, complete. When `eol', only complete if point is at the > +end of a line. When `word', complete unless the next character > +has word syntax (according to `syntax-after'). When > +`word-or-paren', complete unless the next character is part of a > +word or a parenthesis. When `word-or-paren-or-punct', complete > +unless the next character is part of a word, parenthesis, or > +punctuation. Typing TAB a second time always results in > +completion. > + > +This variable has no effect unless `tab-always-indent' is `complete'." > + :group 'indent > + :type '(choice > + (const :tag "Always complete" nil) > + (const :tag "Unless at the end of a line" 'eol) > + (const :tag "Unless looking at a word" 'word) > + (const :tag "Unless at a word or parenthesis" 'word-or-paren) > + (const :tag "Unless at a word, parenthesis, or punctuation." 'word-or-paren-or-punct)) > + :version "27.1") > + > > (defun indent-according-to-mode () > "Indent line in proper way for current major mode. > @@ -111,7 +133,7 @@ or performs symbol completion, depending on `tab-always-indent'. > The function called to actually indent the line or insert a tab > is given by the variable `indent-line-function'. > > -If a prefix argument is given, after this function indents the > +If a prefix argument is given (ARG), after this function indents the > current line or inserts a tab, it also rigidly indents the entire > balanced expression which starts at the beginning of the current > line, to reflect the current line's indentation. > @@ -139,7 +161,8 @@ prefix argument is ignored." > (t > (let ((old-tick (buffer-chars-modified-tick)) > (old-point (point)) > - (old-indent (current-indentation))) > + (old-indent (current-indentation)) > + (syn (syntax-after (point)))) > > ;; Indent the line. > (or (not (eq (indent--funcall-widened indent-line-function) 'noindent)) > @@ -152,7 +175,18 @@ prefix argument is ignored." > ;; If the text was already indented right, try completion. > ((and (eq tab-always-indent 'complete) > (eq old-point (point)) > - (eq old-tick (buffer-chars-modified-tick))) > + (eq old-tick (buffer-chars-modified-tick)) > + (or (null tab-first-completion) > + (eq last-command this-command) > + (and (equal tab-first-completion 'eol) > + (eolp)) > + (and (member tab-first-completion '(word word-or-paren word-or-paren-or-punct)) > + (not (member 2 syn))) > + (and (member tab-first-completion '(word-or-paren word-or-paren-or-punct)) > + (not (or (member 4 syn) > + (member 5 syn)))) > + (and (equal tab-first-completion 'word-or-paren-or-punct) > + (not (member 1 syn))))) > (completion-at-point)) > > ;; If a prefix argument was given, rigidly indent the following From unknown Sat Sep 13 09:20:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34787: New defcustom to govern TAB completion Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 May 2019 13:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34787 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Alex Branham Cc: 34787@debbugs.gnu.org Received: via spool by 34787-submit@debbugs.gnu.org id=B34787.155879146417512 (code B ref 34787); Sat, 25 May 2019 13:38:02 +0000 Received: (at 34787) by debbugs.gnu.org; 25 May 2019 13:37:44 +0000 Received: from localhost ([127.0.0.1]:48431 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hUWro-0004YO-95 for submit@debbugs.gnu.org; Sat, 25 May 2019 09:37:44 -0400 Received: from mail-it1-f170.google.com ([209.85.166.170]:36341) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hUWrm-0004YB-Bu for 34787@debbugs.gnu.org; Sat, 25 May 2019 09:37:42 -0400 Received: by mail-it1-f170.google.com with SMTP id e184so17916498ite.1 for <34787@debbugs.gnu.org>; Sat, 25 May 2019 06:37:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=Rl9rtLiTOjND1Cq9zaqkQ52CAz8FeQuInQTvLn2U2Nw=; b=FxD1aeoxn+JJLjMMqqIyJwa7mGc+VZs74ZmOCCe+MIzJyo3fe3ofT5px8nF/kEOjQe uLTEXMsVMtrai3viMCd6jmBMn82Ex94cJ0q22WhzKyYK+c+FCtudN9KhqAYb3sBD41Jb MX104Y2myRs2B3WjKg1h6KtpIO86DalbFa703NH1EEDwJr6HtysGsSnOjnIWma21y1ko XnYxHXqnEUFJZP2qFPQVsvdvB+hGZU2tMWPrgfm5utzTb6pPMjhUDpEw2iQo/2do49Md W+mxX0QWICieWepa4T7ZEPj+DpuxN7ao5/HCSLA24r4RxV3TTHEZveNICL3cn7mTU0ns PgOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=Rl9rtLiTOjND1Cq9zaqkQ52CAz8FeQuInQTvLn2U2Nw=; b=bcMO0lbNFnq/ddg03+3GrYAMhdsRlC8Q5TS0jI/hpcAs/L1drXHFW8ySKW1wpKtRhW ZuIOgWvwcW/EKmRQFE4td+PE3RgbSJ0Prc4JPoU+JShYcViCPcMt719obgyMTghD7IuK 6wjNLpXPQ+Ba8CIWEOKyH7l3PvKD3Zz/4bP180At1eR86r88ufT+Grnv+BGrSMVTl4cf G8LFMf4AJEG3hGMZjJjBJpC4dzfh2i39wpQdT5utwLbbHmZfWhXrCM5rrplIn2+oD3Yh Nhent0/Q+zZk8qX2wTgXbigCEsVk/FOBSBVqF50Qsy7z96mUuKmLwskvbbL8mO7CEgZ3 ILtw== X-Gm-Message-State: APjAAAV0Gl9QBixZdZkn67zJPETFEIolhRCrCNgB6oLj6DZZ7HQtOHRx qLCgNgFgfN9F4irOuNaW+pZ/vBQu X-Google-Smtp-Source: APXvYqywHII60G7uS0RHFSjm92pJUZlfm45vgeE59D/JAl8QcGE6USSVppzKPPCJsYdfaVqiJwHSqw== X-Received: by 2002:a24:6294:: with SMTP id d142mr22182967itc.102.1558791456649; Sat, 25 May 2019 06:37:36 -0700 (PDT) Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.gmail.com with ESMTPSA id k5sm1851997iob.32.2019.05.25.06.37.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 25 May 2019 06:37:35 -0700 (PDT) From: Noam Postavsky References: <87h8cdqlb3.fsf@gmail.com> <87a7favg3s.fsf@gmail.com> Date: Sat, 25 May 2019 09:37:35 -0400 In-Reply-To: <87a7favg3s.fsf@gmail.com> (Alex Branham's message of "Sat, 25 May 2019 08:05:59 -0500") Message-ID: <87v9xy8xk0.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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 (-) Alex Branham writes: > As a quick reminder/TLDR - the proposal is to add a defcustom that > governs whether TAB offers completion when hit the first time. The > thinking is that if point is in the middle of a word, you may not want > completion. How would it interact with the existing tab-always-indent? Would it make sense to combine them? From unknown Sat Sep 13 09:20:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34787: New defcustom to govern TAB completion Resent-From: Alex Branham Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 May 2019 13:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34787 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Noam Postavsky Cc: 34787@debbugs.gnu.org Received: via spool by 34787-submit@debbugs.gnu.org id=B34787.155879179318074 (code B ref 34787); Sat, 25 May 2019 13:44:01 +0000 Received: (at 34787) by debbugs.gnu.org; 25 May 2019 13:43:13 +0000 Received: from localhost ([127.0.0.1]:48436 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hUWx6-0004hS-TV for submit@debbugs.gnu.org; Sat, 25 May 2019 09:43:13 -0400 Received: from mail-oi1-f175.google.com ([209.85.167.175]:46978) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hUWx4-0004hE-RW for 34787@debbugs.gnu.org; Sat, 25 May 2019 09:43:11 -0400 Received: by mail-oi1-f175.google.com with SMTP id 203so8992390oid.13 for <34787@debbugs.gnu.org>; Sat, 25 May 2019 06:43:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=oXo5xpfDHPDWrgctKUfQyQg67mQxHSHu6fgEy4nR4hk=; b=EB2ikAyzdjmA8UkMjU5IW1PZQY6tm+XuPGjmAYQX5eB9zA+DzARAvAV+2mNjPGLEQg NCrIyLfBnc3W2U9UcymqnfEGFZv8UQaBTbr2g6IRdzz1iONVdvrwIZBMMn6FK0j/n/bY KGG8BCdS6VnVoeUvs0Xj33jG/9VivY5G1JuYpq1xiHXYYerMrrUiAWTySaf0I8Ld4Yw0 57b8o1C2TD+zye3IED24dby/zR5SY2YdIBdblWKEDBLrnOY9C6veI3xSjpwyI79WH+VJ xoKrA0m1g5CpB44grUMWjbCLRIDp5qqSUgDmhOzW8KKvQ0FYTf511c6qZOgeMjcxE/4D hJ9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=oXo5xpfDHPDWrgctKUfQyQg67mQxHSHu6fgEy4nR4hk=; b=rqjZDh9rrbBc31cns+OPI+6cr+nb9ErfmTSRtj3cxl89wvNbOyGsE1K2xLDZYysGBr iHtSJPgvWe+/s62kBJXk3BFfW/5ltKVF8jHW6RiRmtx4rocQgnQX8AFVJ72j/dTJPD4e CF3UNHX1Wc28w12jGFbcqoFb4gbwXuRSnhKqwyWK67NqBZTr/g2v0HQVZAQUomVe/I9P ozOZP0L1Zn8lTZ6gT7T7N2E1rTbj/cl4JwX3FBWUPN/sM75YL0/UyDeF3jEXlny8R+sa UiT8fD7SQ3McbD56GmSlzeLLkD6MlDvaZbL0SLMQiV/ENzlF6XrfA2ErLFHZ8Xs9o0SX yI+g== X-Gm-Message-State: APjAAAVnAEbUYfRHeoc8V7di6BXpX5qk7giMvP5Neh2//rDeCZQmmuUi MFRThFjRpYUXNPP4l3Og46kAYl0F X-Google-Smtp-Source: APXvYqwqTxBxHRjugieMfc8maEw7ns9eGOPWmR+Hfd42SKULN0bHXcjXlKFP4+jXsbNXeobIZU8OKA== X-Received: by 2002:aca:5b83:: with SMTP id p125mr9202505oib.164.1558791784324; Sat, 25 May 2019 06:43:04 -0700 (PDT) Received: from mars (cpe-70-114-192-208.austin.res.rr.com. [70.114.192.208]) by smtp.gmail.com with ESMTPSA id e4sm1904714oti.64.2019.05.25.06.43.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 25 May 2019 06:43:03 -0700 (PDT) References: <87h8cdqlb3.fsf@gmail.com> <87a7favg3s.fsf@gmail.com> <87v9xy8xk0.fsf@gmail.com> User-agent: mu4e 1.2.0; emacs 27.0.50 From: Alex Branham In-reply-to: <87v9xy8xk0.fsf@gmail.com> Date: Sat, 25 May 2019 08:43:02 -0500 Message-ID: <878suuvee1.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" 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 On Sat 25 May 2019 at 08:37, Noam Postavsky wrote: > Alex Branham writes: > >> As a quick reminder/TLDR - the proposal is to add a defcustom that >> governs whether TAB offers completion when hit the first time. The >> thinking is that if point is in the middle of a word, you may not want >> completion. > > How would it interact with the existing tab-always-indent? Would it > make sense to combine them? The way we have it in ESS currently is that they're two separate variables. One (our version of tab-always-indent) governs whether TAB offers completion and another (what I'm proposing adding to Emacs) governs whether the first press of TAB should offer completion based on context. Alex --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEeEJ4XAMgliXNXicpHkInolPpmscFAlzpRmYACgkQHkInolPp mseMSggAk34paBf+OmepxXT9HuJv/bS0BAl3OPXsbaDgaJsZs3qw9B7vh33kMLfk +KzDYqJevt6WiAs3NA/AZkoskd9UcW4U3hiCbgL6tfXoBgm89sLnjsfy/UbosPwm ySLcdEQ7yMeUct5Lw/PhbrE/DHpgfe1/gpN8zY6bf+C34xkXzW4A5d8n1IJFSIwW G6jnj3NoTXgOh2OWPFv4lW5g2ptwDBe3YV40jcrsZEcd3OfqM81xkPhj6AhL5sS7 rRLU/plcm1SOpNXtG3w0kTkerRfmC0Wp9rBNGmtyAAy3d7P3vOZ12NvMkeMDV8yc lD2PCMc/i/XgX8jKASU+fgohZQ9u3A== =9lmZ -----END PGP SIGNATURE----- --=-=-=-- From unknown Sat Sep 13 09:20:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34787: New defcustom to govern TAB completion Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 05 Jun 2019 01:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34787 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Alex Branham Cc: 34787@debbugs.gnu.org Received: via spool by 34787-submit@debbugs.gnu.org id=B34787.155969942424446 (code B ref 34787); Wed, 05 Jun 2019 01:51:01 +0000 Received: (at 34787) by debbugs.gnu.org; 5 Jun 2019 01:50:24 +0000 Received: from localhost ([127.0.0.1]:46150 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hYL4J-0006ME-FH for submit@debbugs.gnu.org; Tue, 04 Jun 2019 21:50:23 -0400 Received: from mail-it1-f170.google.com ([209.85.166.170]:56158) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hYL4E-0006Lt-LV for 34787@debbugs.gnu.org; Tue, 04 Jun 2019 21:50:19 -0400 Received: by mail-it1-f170.google.com with SMTP id i21so1148648ita.5 for <34787@debbugs.gnu.org>; Tue, 04 Jun 2019 18:50:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=FP7IR4EI9gCIxO+G3Qde290hF8xEW61PUR7mSo4CeHQ=; b=fRhTzuJfCLcuIYXpnvxwLWyngrtO/r8IjZ4aI6w8Nc1gYUbVq5p7fxKc6kw3JAY8Ye HQ56P4Su19DMjuzHpk+E5ldIN+IaPjYSzIVehvbUhoOyaCv05V2fw1yNQyyKXd722mV0 yqnT3h6r6aeGVkNCxk0Cn2NKkumA2zUXPxpJDLl0uqEVj1QWCLGH2z56Xb5HsUh9lF5A c6HiPhT5bxhFA/sPoj7xtwrB27FoM1TVsRsawd0UEX4Jz/u79bUPUQnN9sri9A9aY61c A4Waf04XMfx70+DHjoyNJAqRiR8QINMyZ+hont3/DtxXoI8rlcn3EGRkAE8vamp4C1Ev 6KIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=FP7IR4EI9gCIxO+G3Qde290hF8xEW61PUR7mSo4CeHQ=; b=fF5X+YZbhM012hynXOM+1vPK1TDbit0spYMzLRdHPmqqM1H+d1QjWHirChMbikRwpG s2Nuy2rZGeACIs/94EVL/UWqPQhvuL+35+K/WLN9ghJUvkrNmBIcmE10RhsFoN5RnvKV 7wD8iqYWiEUC9ZwDZlD87tMNYU6x8QN7OhFnibxy2JjyBgYxa+4VnH0NWGz0sSHfKE45 tqctDqr6KN/9YInZ9NDoYJBIbs3mA2Um8IOroGoAh812eyYfVhz99omZcXwJB7uFrXa/ HxGvUMYa71qu18tg9b/Zbll8Lmmd7mw0MLk2yuZ/+c2S6B8HOP33Cc2DWNYROyItnS9U 9eng== X-Gm-Message-State: APjAAAWvdgqYQGvZ6KzXRITn4pirQlZ/37B6WDZ7BHeTTfz8g+WJ5WAg t1NELcAu02bKFXF4lvIedvr92MKX X-Google-Smtp-Source: APXvYqxjoy87e4QFvviKXYub8sU+BAn6y67l546wWbsOz9Q5eb5FNTlj6cuG+o3TUj6Pn1AROlYOyA== X-Received: by 2002:a24:5587:: with SMTP id e129mr17432169itb.72.1559699412747; Tue, 04 Jun 2019 18:50:12 -0700 (PDT) Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.gmail.com with ESMTPSA id 69sm8307970itl.7.2019.06.04.18.50.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 04 Jun 2019 18:50:12 -0700 (PDT) From: Noam Postavsky References: <87h8cdqlb3.fsf@gmail.com> <87a7favg3s.fsf@gmail.com> <87v9xy8xk0.fsf@gmail.com> <878suuvee1.fsf@gmail.com> Date: Tue, 04 Jun 2019 21:50:11 -0400 In-Reply-To: <878suuvee1.fsf@gmail.com> (Alex Branham's message of "Sat, 25 May 2019 08:43:02 -0500") Message-ID: <87y32g3ing.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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 (-) Alex Branham writes: > On Sat 25 May 2019 at 08:37, Noam Postavsky wrote: > >> Alex Branham writes: >> >>> As a quick reminder/TLDR - the proposal is to add a defcustom that >>> governs whether TAB offers completion when hit the first time. The >>> thinking is that if point is in the middle of a word, you may not want >>> completion. >> >> How would it interact with the existing tab-always-indent? Would it >> make sense to combine them? > > The way we have it in ESS currently is that they're two separate > variables. One (our version of tab-always-indent) governs whether TAB > offers completion and another (what I'm proposing adding to Emacs) > governs whether the first press of TAB should offer completion based on > context. Oh, I see, it only affects people who have already customized tab-always-indent to a non-default value (specifically, `complete'). So I guess the idea is that (setq tab-always-indent 'complete) triggers too many accidental completions to be a reasonable setting? I think it would be nicer if the option's values could be `(word paren)', `(word paren punct) instead of `word-or-paren', `word-or-paren-or-punct', etc. From unknown Sat Sep 13 09:20:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34787: New defcustom to govern TAB completion Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Aug 2020 19:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34787 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Noam Postavsky Cc: 34787@debbugs.gnu.org, Alex Branham Received: via spool by 34787-submit@debbugs.gnu.org id=B34787.159829694830493 (code B ref 34787); Mon, 24 Aug 2020 19:23:01 +0000 Received: (at 34787) by debbugs.gnu.org; 24 Aug 2020 19:22:28 +0000 Received: from localhost ([127.0.0.1]:59311 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAI32-0007vl-1w for submit@debbugs.gnu.org; Mon, 24 Aug 2020 15:22:28 -0400 Received: from mail-yb1-f169.google.com ([209.85.219.169]:43865) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAI2z-0007vJ-Nu for 34787@debbugs.gnu.org; Mon, 24 Aug 2020 15:22:26 -0400 Received: by mail-yb1-f169.google.com with SMTP id m200so5781116ybf.10 for <34787@debbugs.gnu.org>; Mon, 24 Aug 2020 12:22:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:user-agent :mime-version:date:message-id:subject:to:cc; bh=oyTIkrxB79bSQd28uD9fNGlzULMv+L5zf9IJkZhTFnk=; b=XLzexYyCtlNF3wpM8pnI66infG2fEAC6OYJ3qXpytwrYFEAz9ja8NZsgi8VrkZJjDb YyEk4+LV4nCUiWaNgVevCrsZ1DaS+vo4mdy6JQG08yKbNnjFyGnxRl/FoV7auI2g6i8U dQRhduwjU4gwjTB4ldzWW4CU7/+Pef7gpxKa5y3qBeMnqmpFJDh50OA1xKjpkMnCzOJp L5Uuz+Vx7kJjqUX6v2yKmu3Yalc8kZUQ8pRVBwWzZ6ieq7lhRX5OK0wgEvN+UuSDFdzA azslkIzFRMLMwN+wN64V9WmQ2SuJ7MQVdRloJZODIYalj0e4UNdIKkbquonc4UwbPPdT wCBQ== X-Gm-Message-State: AOAM532eDSNMYfXf+NHKJxvB36zqglt7m7CsIgOr6S9UCQO1uVYTy0Up Q4B4TwU60rvJPLlvY0GYG1IlPqS6s1PCv47Aks9H+e8vJ1yB/w== X-Google-Smtp-Source: ABdhPJyGYlScXQfY0AOJT5xMm5Rlf8mW5vaH4c4CvRVm9w7t2z4M+q9hnY+sYuDWav1PcgKjQScAilX8C48TBmZKNb8= X-Received: by 2002:a25:9843:: with SMTP id k3mr9842270ybo.466.1598296940341; Mon, 24 Aug 2020 12:22:20 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 24 Aug 2020 12:22:20 -0700 From: Stefan Kangas In-Reply-To: <87y32g3ing.fsf@gmail.com> (Noam Postavsky's message of "Tue, 04 Jun 2019 21:50:11 -0400") References: <87h8cdqlb3.fsf@gmail.com> <87a7favg3s.fsf@gmail.com> <87v9xy8xk0.fsf@gmail.com> <878suuvee1.fsf@gmail.com> <87y32g3ing.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Date: Mon, 24 Aug 2020 12:22:20 -0700 Message-ID: Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.5 (/) 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.5 (/) Noam Postavsky writes: > Alex Branham writes: > >> On Sat 25 May 2019 at 08:37, Noam Postavsky wrote: >> >>> Alex Branham writes: >>> >>>> As a quick reminder/TLDR - the proposal is to add a defcustom that >>>> governs whether TAB offers completion when hit the first time. The >>>> thinking is that if point is in the middle of a word, you may not want >>>> completion. >>> >>> How would it interact with the existing tab-always-indent? Would it >>> make sense to combine them? >> >> The way we have it in ESS currently is that they're two separate >> variables. One (our version of tab-always-indent) governs whether TAB >> offers completion and another (what I'm proposing adding to Emacs) >> governs whether the first press of TAB should offer completion based on >> context. > > Oh, I see, it only affects people who have already customized > tab-always-indent to a non-default value (specifically, `complete'). > > So I guess the idea is that (setq tab-always-indent 'complete) triggers > too many accidental completions to be a reasonable setting? I think it > would be nicer if the option's values could be `(word paren)', `(word > paren punct) instead of `word-or-paren', `word-or-paren-or-punct', etc. (That was one year ago.) Are you still working on this? Best regards, Stefan Kangas From unknown Sat Sep 13 09:20:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34787: New defcustom to govern TAB completion Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Oct 2020 05:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34787 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Alex Branham Cc: 34787@debbugs.gnu.org Received: via spool by 34787-submit@debbugs.gnu.org id=B34787.160265340629617 (code B ref 34787); Wed, 14 Oct 2020 05:31:02 +0000 Received: (at 34787) by debbugs.gnu.org; 14 Oct 2020 05:30:06 +0000 Received: from localhost ([127.0.0.1]:49753 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kSZMT-0007hH-S6 for submit@debbugs.gnu.org; Wed, 14 Oct 2020 01:30:06 -0400 Received: from quimby.gnus.org ([95.216.78.240]:54902) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kSZMR-0007ce-C7 for 34787@debbugs.gnu.org; Wed, 14 Oct 2020 01:30:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=N4CxDiFp6I0ZN3PVlAmNPTLam9Rbwh/vjpo8hyGE4HQ=; b=NjJ3tvDDzRh0kJ2H51EhSGisRm 8ITsIPxxYTKe5ZPtt3cftGSHDqTeMB8kaCs3DCnAJHQt39/ApZ7JJ1QzHCdSY/0nwNw5JIyfog2ez kyIiIiRDss2I/8z/J2nq6OqkOLjhajddRER95VHk1heMs9WMqRwdBejLbB4UFs3HWHZY=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kSZMI-0007OL-5Y; Wed, 14 Oct 2020 07:29:57 +0200 From: Lars Ingebrigtsen References: <87h8cdqlb3.fsf@gmail.com> <87ftrxqi68.fsf@gmail.com> X-Now-Playing: Efterklang's _Tripper_: "Step Aside" Date: Wed, 14 Oct 2020 07:29:52 +0200 In-Reply-To: <87ftrxqi68.fsf@gmail.com> (Alex Branham's message of "Fri, 08 Mar 2019 13:29:03 -0600") Message-ID: <87eem1z86n.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Alex Branham writes: > On Fri 08 Mar 2019 at 12:21, Alex Branham wrote: > >> @@ -139, 7 +161, 8 @@ prefix argument is ignored." >> (t >> (let ((old-tick (buffer-chars-modified-tick)) >> (old-point ( [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 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 (-) Alex Branham writes: > On Fri 08 Mar 2019 at 12:21, Alex Branham wrote: > >> @@ -139,7 +161,8 @@ prefix argument is ignored." >> (t >> (let ((old-tick (buffer-chars-modified-tick)) >> (old-point (point)) >> - (old-indent (current-indentation))) >> + (old-indent (current-indentation)) >> + (syn (syntax-after (point)))) > ^^^^^ should be (syn `(,(syntax-after (point)))) > > I accidentally sent the wrong patch; this part needs to be quoted. I played around with this a bit, and it seems to work very well, and quite naturally. So I've applied this to Emacs 28. Noam made the suggestion of making this a list of values like (word paren) instead of word-or-paren, and that does seem like a good idea, but either works. I guess somebody might want (word punct) and not word-and-paren-and-punct, for instance? So if somebody were to change this to work that way instead, I wouldn't mind, but I think it's probably fine as is. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 14 01:30:11 2020 Received: (at control) by debbugs.gnu.org; 14 Oct 2020 05:30:11 +0000 Received: from localhost ([127.0.0.1]:49756 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kSZMZ-0007nx-8p for submit@debbugs.gnu.org; Wed, 14 Oct 2020 01:30:11 -0400 Received: from quimby.gnus.org ([95.216.78.240]:54928) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kSZMX-0007fo-Sd for control@debbugs.gnu.org; Wed, 14 Oct 2020 01:30:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=4IyE4jygJleB07ZJm/plU8z4F1NfPBUnwpuo7JuQc2M=; b=q89auQPAVFXfCqr0AugZqzVWZA ZPiklzhvJKwiAgfYJkioVIpZ5cL0DvXTgTVFRaddmrfTBbSZuVefxXJZoPfDxxuJ9lO5QALKyW3gE +mKJTN7lBVk3uROzoxNehKtYgZGCaMDSkD5fCeF8ADTDuCtPbdjbWqZycw7Xb1oetS7Q=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kSZMP-0007On-OC for control@debbugs.gnu.org; Wed, 14 Oct 2020 07:30:04 +0200 Date: Wed, 14 Oct 2020 07:30:00 +0200 Message-Id: <87d01lz86f.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #34787 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 34787 fixed close 34787 28.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control 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 (-) tags 34787 fixed close 34787 28.1 quit