From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ivan Andrus Newsgroups: gmane.emacs.devel Subject: Re: SMIE Date: Tue, 19 Aug 2014 21:57:46 -0600 Message-ID: <97B176AD-AB59-4589-BB7C-3751A424A77B@gmail.com> References: <87y4ukr2kg.fsf@bzg.ath.cx> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_B9CF8F50-3736-469D-8195-1FCD11A36F7D" X-Trace: ger.gmane.org 1408507105 29664 80.91.229.3 (20 Aug 2014 03:58:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 20 Aug 2014 03:58:25 +0000 (UTC) Cc: Stefan Monnier , emacs To: Matt DeBoard Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 20 05:58:19 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 1XJx2Q-0003e2-4I for ged-emacs-devel@m.gmane.org; Wed, 20 Aug 2014 05:58:18 +0200 Original-Received: from localhost ([::1]:53821 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJx2P-0006w3-LY for ged-emacs-devel@m.gmane.org; Tue, 19 Aug 2014 23:58:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42004) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJx25-0006vK-K7 for emacs-devel@gnu.org; Tue, 19 Aug 2014 23:58:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XJx1z-00047Z-6P for emacs-devel@gnu.org; Tue, 19 Aug 2014 23:57:57 -0400 Original-Received: from mail-ig0-x22c.google.com ([2607:f8b0:4001:c05::22c]:35708) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJx1y-000470-Uv for emacs-devel@gnu.org; Tue, 19 Aug 2014 23:57:51 -0400 Original-Received: by mail-ig0-f172.google.com with SMTP id h15so11036622igd.5 for ; Tue, 19 Aug 2014 20:57:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=C+9JfsPvphYzzKo4qUyD8uxnih1Ag9Lk2WPEKfAnw7Y=; b=Xrx0LI2A55ii6ibpB4JIxNT+BqrDHPhaZY7oA/kaJpMoSI33qOgbISrdEl2jGYc18Z VcNppng/WrXZUvr50WtG29hY2O9qE+9wuBSTyPvcldjvRz+yOJqeS1EWWhCLDn8WHw3o 1gQ8p3dUDtTS/tumXkSE85pOzihhy9GlvqtofKyTZ801eRsl+Mi+Sjq8hT3U5OJJgjL5 MbmKxVsVRR/+FKYerwJS89VRCrCyb6cJT1Q36xI//dTiQv+moqXMrI/iPnYtFnxekUM4 NR74rzcU7KsJyetRinzObtRFFRc5OVO5wTZRT96jfVvlWxFMogeSKjTYYmsgIj0xMC8H ZM8A== X-Received: by 10.42.216.198 with SMTP id hj6mr6890158icb.65.1408507069780; Tue, 19 Aug 2014 20:57:49 -0700 (PDT) Original-Received: from [192.168.0.3] (75-162-242-144.slkc.qwest.net. [75.162.242.144]) by mx.google.com with ESMTPSA id il3sm6096110igb.4.2014.08.19.20.57.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 19 Aug 2014 20:57:49 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.1878.6) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4001:c05::22c 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:173774 Archived-At: --Apple-Mail=_B9CF8F50-3736-469D-8195-1FCD11A36F7D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii I enjoyed using it for gap-mode [1] once I got the hang of it, though I = would hesitate to suggest that people should look at my implementation. = :-) And I love, love, love the sexp-based movement it gives me for = free. -Ivan [1] https://bitbucket.org/gvol/gap-mode/src/tip/gap-smie.el?at=3Ddefault On Aug 19, 2014, at 9:19 PM, Matt DeBoard = wrote: > To bring the thread back around full-circle to the topic of SMIE... >=20 > 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. >=20 > 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. >=20 > 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): >=20 > elixir-mode: >=20 > https://github.com/elixir-lang/emacs-elixir/blob/v1.4.8/elixir-smie.el >=20 > swift-mode: >=20 > = https://github.com/chrisbarrett/swift-mode/blob/6abb78812bd5795950c1872787= 575c8eb72e8574/swift-mode.el >=20 > ruby-mode: >=20 > = http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/progmodes/ruby-mode.e= l?h=3Demacs-24&id=3D2605b19cfa2ff47066c91dfd2650b40645d51b32 >=20 >=20 > 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. ]]] >=20 > What does it take to accept digital signatures from other = countries? > E.g. from France? Can we help here? >=20 > I don't know, but a priori it seems unlikely that you or I could > do anything that would change this legal issue. >=20 > -- > 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. >=20 >=20 --Apple-Mail=_B9CF8F50-3736-469D-8195-1FCD11A36F7D Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii I = enjoyed using it for gap-mode [1] once I got the hang of it, though I = would hesitate to suggest that people should look at my implementation. = :-)  And I love, love, love the sexp-based movement it gives me for = free.

-Ivan

[1] https://bitbucket.org/gvol/gap-mode/src/tip/gap-smie.el?at=3Ddefault


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:


swift-mode:


ruby-mode:



On Tue, Aug 19, 2014 at 9:27 PM, Richard Stallman = <rms@gnu.org> 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.



= --Apple-Mail=_B9CF8F50-3736-469D-8195-1FCD11A36F7D--