From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#35496: 27.0.50; smie-blink-matching-open blinks token before point after RET Date: Wed, 08 May 2019 13:42:19 -0400 Message-ID: References: <4cfccfa9-ee9d-3bc0-30a3-36d656f96de8@yandex.ru> <25c51540-6c49-ba79-bbb4-e60b1e616fc6@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="117485"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 35496@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed May 08 19:43:14 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hOQb3-000URr-Rz for geb-bug-gnu-emacs@m.gmane.org; Wed, 08 May 2019 19:43:13 +0200 Original-Received: from localhost ([127.0.0.1]:40969 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOQb2-0000O2-T4 for geb-bug-gnu-emacs@m.gmane.org; Wed, 08 May 2019 13:43:12 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:42766) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOQaw-0000Nk-Lp for bug-gnu-emacs@gnu.org; Wed, 08 May 2019 13:43:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hOQat-0002nS-F3 for bug-gnu-emacs@gnu.org; Wed, 08 May 2019 13:43:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48639) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hOQas-0002n8-Nc for bug-gnu-emacs@gnu.org; Wed, 08 May 2019 13:43:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hOQas-0007l7-FK for bug-gnu-emacs@gnu.org; Wed, 08 May 2019 13:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 08 May 2019 17:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35496 X-GNU-PR-Package: emacs Original-Received: via spool by 35496-submit@debbugs.gnu.org id=B35496.155733734929762 (code B ref 35496); Wed, 08 May 2019 17:43:02 +0000 Original-Received: (at 35496) by debbugs.gnu.org; 8 May 2019 17:42:29 +0000 Original-Received: from localhost ([127.0.0.1]:33950 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hOQaK-0007jy-Tx for submit@debbugs.gnu.org; Wed, 08 May 2019 13:42:29 -0400 Original-Received: from mail01.iro.umontreal.ca ([132.204.25.201]:45888) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hOQaJ-0007ja-5M for 35496@debbugs.gnu.org; Wed, 08 May 2019 13:42:27 -0400 Original-Received: from mail01.iro.umontreal.ca (mail01.iro.umontreal.ca [127.0.0.1]) by mail01.iro.umontreal.ca (Postfix) with ESMTP id A6D9F8941C1F for <35496@debbugs.gnu.org>; Wed, 8 May 2019 13:42:21 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; h=content-type:content-type:mime-version:user-agent:in-reply-to :date:date:references:message-id:subject:subject:to:from:from; s=dkim; t=1557337341; x=1558201342; bh=aqtRg/PkXN/kwMHwEeii4kNR STUSz7+37klZOgEjNT4=; b=aYnXAC+BP8XJ0vx0sCYFo1FMkxTfk+8TuVinEdIc j8rOv9405SaY0FHmKA2cMghAZfCg4qG16Cq3ZUdK2Ett8SjMJNhFoizCNn5z8m6c goVeOwPvxFB2qYTwn1JPDDpkyeQfEdDeYz2jqQT1pGJPRs9wYes10jBTR9N3RW1z YBjFjsc00GoMXqcJNy0q+aKvfhX7e1o3Q79jo52yRnFjFWQ4ogRq+PGuBJs5jnsn JkzwKCyRo+4wL0vgk6FXi/B8M9bJqf05JuI9MJwfkFtqdOHmOPTbzKM5xWdGMqdp y08j7ecVTMR/zASaXEmhjNC3uk3j1KLDxT39qi6rGvw+kA== X-Virus-Scanned: amavisd-new at iro.umontreal.ca Original-Received: from mail01.iro.umontreal.ca ([127.0.0.1]) by mail01.iro.umontreal.ca (mail01.iro.umontreal.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xfsEqG6pOYZl for <35496@debbugs.gnu.org>; Wed, 8 May 2019 13:42:21 -0400 (EDT) Original-Received: from alfajor (modemcable213.149-175-137.mc.videotron.ca [137.175.149.213]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id ADFBA8941C0E; Wed, 8 May 2019 13:42:20 -0400 (EDT) In-Reply-To: <25c51540-6c49-ba79-bbb4-e60b1e616fc6@yandex.ru> (Dmitry Gutov's message of "Wed, 8 May 2019 12:51:00 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:158954 Archived-At: >>> 1. Disable show-paren-mode if it's enabled. >>> 2. Evalute the attached .el file (which defined a major mode). >>> 3. Create a new bufferand type M-x foo-mode. >>> 4. Type 'def foo do' (without quotes) and press RET. >>> 5. Cursor will hang around on the first line even after the newline >>> is inserted. >> >> It's not a bug, it's a feature: we can't highlight the matching `def` >> when you hit the `o` because we don't know yet whether you actually >> intended to type `do` or a longer identifier, so we postpone the >> blinking to the next char. > > But we don't end up blinking to `def` after RET, we blink to `do`. That's not what I see when I try your recipe: it blinks to the "d" of "def", as it should, for me (both with Emacs'` master` and with Debian's Emacs-26.1). > SMIE fills it automatically based on the current set of tokens. Indeed, but you can tweak it by hand afterwards. > If I add it myself, yeah, the behavior is better in this case. I've been wondering for a while now if it's not just "in this case" but in general. > But I kinda buy your reasoning about not having it there (even though > it's not a panacea: the user can type whatever token, not only ones in > the smie-closer-alist. I agree that only considering smie-closer-alist is probably not a great choice. It seemed obvious when I wrote it, but I don't know why, and I can't justify it now. [ Maybe it's because I was working on octave-mode around that time and didn't want to blink on "end" when the user likes to write the full-form "endfunction"? But even that doesn't sound like a good justification. ] > Overall, I feel that the smie-blink-matching-inners might be too much as > default anyway. So it's not a big deal if elixir-mode has to disable it. I don't think it's specific to elixir-mode but is rather a user-preference. Maybe it should default to nil, but I haven't found a mode where smie-blink-matching-inners should be disabled *because of the mode* rather than because that's what the user prefers. Stefan