From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Matt DeBoard Newsgroups: gmane.emacs.devel Subject: Re: SMIE Date: Tue, 19 Aug 2014 22:19:43 -0500 Message-ID: References: <87y4ukr2kg.fsf@bzg.ath.cx> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7bdc05f2aaa69905010715ac X-Trace: ger.gmane.org 1408504842 6629 80.91.229.3 (20 Aug 2014 03:20:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 20 Aug 2014 03:20:42 +0000 (UTC) Cc: Bastien , Chad Brown , bozhidar.batsov@gmail.com, Stefan Monnier , emacs To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 20 05:20:37 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XJwRx-0001PW-Kd for ged-emacs-devel@m.gmane.org; Wed, 20 Aug 2014 05:20:37 +0200 Original-Received: from localhost ([::1]:53783 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJwRw-0002Mq-Li for ged-emacs-devel@m.gmane.org; Tue, 19 Aug 2014 23:20:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36831) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJwRp-0002Mi-SW for emacs-devel@gnu.org; Tue, 19 Aug 2014 23:20:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XJwRo-00011d-2t for emacs-devel@gnu.org; Tue, 19 Aug 2014 23:20:29 -0400 Original-Received: from mail-ig0-x22d.google.com ([2607:f8b0:4001:c05::22d]:54235) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJwRk-0000uB-Hd; Tue, 19 Aug 2014 23:20:24 -0400 Original-Received: by mail-ig0-f173.google.com with SMTP id h18so11030890igc.6 for ; Tue, 19 Aug 2014 20:20:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=10D5Ftzy2qd1/5dMv5WPGzdZavQKhBruhcQiQTfXBnE=; b=KSDmEUZ0ckogTBxRGZugitCyyV0GTouM0viIZ6DrIZp0bhxumDLKOwse+pnKn2w1k8 m5hG/nVVw5LHbKQUoWxYHGwQwlj3UPFTlJ9yAQYCh4XIOtAUYoA/2jNtmobPlTLVBae7 6pIH8OEVglWbce3BYyKBJ6TkYisPUSDOZdWVqsjeo2HYVLJdjEa4FEivP26buY0zB+tP oLBscwuosnEmhCm3xL8R54ZB7l9r3hyiNfb54T1HKH9QMaAyerlSqFgRtRuKDn6cLNoE biAZqgukxoUftiixd6q3xR3duRojzrx0MTr0TmW99KUP7Z+CGRoTYkTvM2XA2HS8Ewug iS9w== X-Received: by 10.50.61.195 with SMTP id s3mr9871900igr.29.1408504823455; Tue, 19 Aug 2014 20:20:23 -0700 (PDT) Original-Received: by 10.50.17.41 with HTTP; Tue, 19 Aug 2014 20:19:43 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4001:c05::22d X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:173773 Archived-At: --047d7bdc05f2aaa69905010715ac Content-Type: text/plain; charset=UTF-8 To bring the thread back around full-circle to the topic of SMIE... Stefan I wound up rewriting the `forward-token' and `backward-token' functions, discarding the previous code (which I inherited) in favor of much simpler, more concise code I found in `ruby-mode' and `swift-mode'. I took up this project (https://github.com/elixir-lang/emacs-elixir) just a couple months ago, so I thought the convolution of the code I replaced was a result of SMIE. I was skeptical about the degree to which I would be able to simplify the logic. However, after cutting out over 150 lines of code by leaning heavily on SMIE, I just wanted to say thanks. SMIE -- once you get it -- is really valuable. There's a learning curve for sure, but it's a really pragmatic tool. To any future readers who are looking for guidance on how to implement SMIE-driven indentation in your language mode, below are a few links of simple, concise, valid SMIE implementations that can serve as reference. In order of simplicity (IMO): elixir-mode: https://github.com/elixir-lang/emacs-elixir/blob/v1.4.8/elixir-smie.el swift-mode: https://github.com/chrisbarrett/swift-mode/blob/6abb78812bd5795950c1872787575c8eb72e8574/swift-mode.el ruby-mode: http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/progmodes/ruby-mode.el?h=emacs-24&id=2605b19cfa2ff47066c91dfd2650b40645d51b32 On Tue, Aug 19, 2014 at 9:27 PM, Richard Stallman wrote: > [[[ To any NSA and FBI agents reading my email: please consider ]]] > [[[ whether defending the US Constitution against all enemies, ]]] > [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > > What does it take to accept digital signatures from other countries? > E.g. from France? Can we help here? > > I don't know, but a priori it seems unlikely that you or I could > do anything that would change this legal issue. > > -- > Dr Richard Stallman > President, Free Software Foundation > 51 Franklin St > Boston MA 02110 > USA > www.fsf.org www.gnu.org > Skype: No way! That's nonfree (freedom-denying) software. > Use Ekiga or an ordinary phone call. > > --047d7bdc05f2aaa69905010715ac Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
To bring the thread back around full-circle to the topic o= f SMIE...

Stefan I wound up rewriting the `forward-token= ' and `backward-token' functions, discarding the previous code (whi= ch I inherited) in favor of much simpler, more concise code I found in `rub= y-mode' and `swift-mode'. I took up this project (https://github.com= /elixir-lang/emacs-elixir) just a couple months ago, so I thought the c= onvolution of the code I replaced was a result of SMIE. I was skeptical abo= ut the degree to which I would be able to simplify the logic.

However, after cutting out over 150 lines of code by le= aning heavily on SMIE, I just wanted to say thanks. SMIE -- once you get it= -- is really valuable. There's a learning curve for sure, but it's= a really pragmatic tool.

To any future readers who are looking for guidance on how to= implement SMIE-driven indentation in your language mode, below are a few l= inks of simple, concise, valid SMIE implementations that can serve as refer= ence. In order of simplicity (IMO):

elixir-mode:


swift-mode:


ruby-mode:



O= n Tue, Aug 19, 2014 at 9:27 PM, Richard Stallman <rms@gnu.org> wro= te:
[[[ To any NSA and FBI agent= s reading my email: please consider=C2=A0 =C2=A0 ]]]
[[[ whether defending the US Constitution against all enemies,=C2=A0 =C2=A0= =C2=A0]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]<= br>
=C2=A0 =C2=A0 What does it take to accept digital sig= natures from other countries?
=C2=A0 =C2=A0 E.g. from France?=C2=A0 Can we help here?

I don't know, but a priori it seems unlikely that you or I could<= br> do anything that would change this legal issue.

--
Dr Richard Stallman
President, Free Software Foundation
51 Franklin St
Boston MA 02110
USA
www.fsf.org=C2=A0 www.gnu.org
Skype: No way! That's nonfree (freedom-denying) software.
=C2=A0 Use Ekiga or an ordinary phone call.


--047d7bdc05f2aaa69905010715ac--