From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Sam Halliday Newsgroups: gmane.emacs.bugs Subject: bug#36432: 26.2; SMIE does not request forward tokens when point is at point-max Date: Sat, 29 Jun 2019 13:34:06 +0100 Message-ID: References: <83y31kfumo.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="129271"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 36432@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 29 14:35:26 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.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hhCZc-000XPU-Sd for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Jun 2019 14:35:21 +0200 Original-Received: from localhost ([::1]:39408 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hhCZb-0001S3-Nr for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Jun 2019 08:35:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37790) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hhCZM-0001Ri-3N for bug-gnu-emacs@gnu.org; Sat, 29 Jun 2019 08:35:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hhCZK-0000tv-MG for bug-gnu-emacs@gnu.org; Sat, 29 Jun 2019 08:35:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58258) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hhCZK-0000tj-Iu for bug-gnu-emacs@gnu.org; Sat, 29 Jun 2019 08:35:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hhCZK-0006O4-Cb for bug-gnu-emacs@gnu.org; Sat, 29 Jun 2019 08:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Sam Halliday Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 29 Jun 2019 12:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36432 X-GNU-PR-Package: emacs Original-Received: via spool by 36432-submit@debbugs.gnu.org id=B36432.156181165624497 (code B ref 36432); Sat, 29 Jun 2019 12:35:02 +0000 Original-Received: (at 36432) by debbugs.gnu.org; 29 Jun 2019 12:34:16 +0000 Original-Received: from localhost ([127.0.0.1]:43569 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hhCYZ-0006N3-TG for submit@debbugs.gnu.org; Sat, 29 Jun 2019 08:34:16 -0400 Original-Received: from mail-vs1-f46.google.com ([209.85.217.46]:33122) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hhCYW-0006Mo-Mz for 36432@debbugs.gnu.org; Sat, 29 Jun 2019 08:34:13 -0400 Original-Received: by mail-vs1-f46.google.com with SMTP id m8so5902398vsj.0 for <36432@debbugs.gnu.org>; Sat, 29 Jun 2019 05:34:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Df3zBlmsm3MOYHPVi1Z4oGpJIt2YMAzandBQzspzCdk=; b=gosrBqpxqhmMFAqfw2/AYvtbzaxI+MLqxsloi6KAxPhnS16hQr7DI6KFAPQjQFwJLQ vWuBkDvuQt3fsa6OhOjXm0oljGEv0sI9XWuuMsv5mOi4jFoIRtbzMJtjpzik+EOtjt5p RlmhRIF+ml0phYuZXD3jnypPotIsR6rZ0aP8kFs6EPDjopHfFXc+ToPvhuwzX1yDUT74 uQl5XFMuArDwjwUHhWDOeQ28w8ja6KRmH4I0YnkFD1xyhCaJn3uTFhaMIkxJ0bFrUvgZ Rlf91L59/jW7uK0/xf24JeFGXFjroDnbvzsQGV/3oq3AkgcsM193+yFwvaeFuq60KCHr YMmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Df3zBlmsm3MOYHPVi1Z4oGpJIt2YMAzandBQzspzCdk=; b=r9VA8EdAJLOeaxi5NUYIEXOgdXEn8V0+SGX9H8hlWgC0wNgpyU3aUaNqoArVjvFjig lFMHdY5L7PB+owVVj1SrG72D+ORFzPhXF4LNtGk1J7SFa8BEy+9NGbWc7M48Vmwk/WOn J2ro3dOlewM4XDk4GOUIFPSTl//ymxu0Ffv6jKU0MVz35FyIWUZJbxhgVwc1TdhZNXXc qLPh+0uApLZwpBr/84K+4ih/6RITrU90EX9TORdGjP41VkLsny23RQ3dKHmjP2jbkx48 Z4zEQYE6A4AohaxD4XJT/3IBUp8eN6TZeUk9Ip3rvboWOIcLB6oKIsml2lL9QJfbIS9v RMFg== X-Gm-Message-State: APjAAAUxUeq5xxTt9Ooud6+tqO7DwyGLEZHPrt0wEuSVmDZyK27Y+6FN W68WjC2pJaaqvgIdkTDxILWmJAnJpdXDL1uYr40= X-Google-Smtp-Source: APXvYqy+4l51zPwO1z1Pc/yfxscS65AZHeobFvOCdZ5GwE0Y1bASYIvSm/hO3KvUlEbJxp4iisnru3wXBK8CNV2DDds= X-Received: by 2002:a67:d611:: with SMTP id n17mr9443328vsj.156.1561811647019; Sat, 29 Jun 2019 05:34:07 -0700 (PDT) Original-Received: by 2002:a9f:2427:0:0:0:0:0 with HTTP; Sat, 29 Jun 2019 05:34:06 -0700 (PDT) In-Reply-To: <83y31kfumo.fsf@gnu.org> 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:161819 Archived-At: On 29/06/2019, Eli Zaretskii wrote: >> From: Sam Halliday >> Date: Sat, 29 Jun 2019 13:14:01 +0100 >> >> SMIE (via a `indent-for-tab-command') does not request forward tokens >> from the lexer when point is at `point-max'. >> >> This might sound like a strange bug report: why should smie expect >> there to be any tokens when it is already at point-max? The answer is: >> virtual tokens. For example, Haskell may have many closing curly >> brackets that live at the end of the buffer. > > ??? There can be noting at point-max, as that position is beyond the > last buffer position. Did you mean the position just before that? Or > am I missing something here? > I mean at point-max. Consider this layout algorithm https://gitlab.com/tseenshe/haskell-tng.el/blob/tng/haskell-tng-layout.el and this lexer https://gitlab.com/tseenshe/haskell-tng.el/blob/tng/haskell-tng-lexer.el that can continue to produce tokens even when the point is at the very end of the buffer. e.g. input https://gitlab.com/tseenshe/haskell-tng.el/blob/tng/test/src/layout.hs with layout https://gitlab.com/tseenshe/haskell-tng.el/blob/tng/test/src/layout.hs.layout just tokens https://gitlab.com/tseenshe/haskell-tng.el/blob/tng/test/src/layout.hs.lexer note the trailing } that exists at the very end of the file. SMIE always misses this.