all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Steve Purcell <steve@sanityinc.com>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: Bozhidar Batsov <bozhidar@batsov.com>, emacs-devel <emacs-devel@gnu.org>
Subject: Re: Problem case for ruby-mode indentation
Date: Mon, 4 Nov 2013 13:50:23 +0000	[thread overview]
Message-ID: <C7E5B1CD-E8D8-4BAB-A3BE-BECFC70D5ACF@sanityinc.com> (raw)
In-Reply-To: <CAM9Zgm1tDTr+a0sXCcH=THvvefJJU_pUFePuh-JGYJ5=v0POSA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2664 bytes --]

Thanks — only hours after sending the email did it occur to me that a bug report might have been a better idea…

I’ll make a point of addressing the group directly next time.

Really exciting to see all the work being done on ruby-mode recently!

-Steve



On 4 Nov 2013, at 13:44, Bozhidar Batsov <bozhidar@batsov.com> wrote:

> I'll probably start testing more extensively the smie indentation logic soon. So far things are looking pretty good, I'm sure that by the time 24.4 gets released we'll have the best indentation implementation ruby-mode has ever had.
> 
> 
> On 4 November 2013 12:58, Dmitry Gutov <dgutov@yandex.ru> wrote:
> Hi Steve,
> 
> On 03.11.2013 15:22, Steve Purcell wrote:
> I noticed a case in which heredoc indentation gets messed up with ruby-mode from Emacs HEAD:
> 
> if something_wrong?             # ruby-move-to-block-skips-heredoc
>    ActiveSupport::Deprecation.warn(<<-eowarn, foo)
>    boo hoo
> end  (bah)
> eowarn
> foo
> end
> 
> Seems like it’s the parens inside the heredoc which confuse matters. It’s the same with/without `ruby-use-smie`.
> 
> You probably didn't switch major mode after changing the value of `ruby-use-smie'. It only takes effect in `ruby-mode' function, so you'd have to `M-x text-mode', `M-x ruby-mode'. I do see different indentation with SMIE enabled than with it disabled.
> 
> Should be fixed now, in 114935 (with SMIE). Although, as usual, I'm not sure whether that solution is the best one.
> 
> Here’s another example from some proprietary code, which seems to confirm that issue:
> 
>      connection.execute sanitize_sql_array([<<-end_sql, charity.id, Markup.db_regexp_for_references("charity", charity.all_names), charity.id])
>      INSERT INTO charities_news_items (charity_id, news_item_id)
>      SELECT ? AS charity_id, id AS news_item_id
>      FROM news_items WHERE text ~ ?
>      AND id NOT IN (SELECT news_item_id FROM charities_news_items WHERE charity_id = ?)
>                     end_sql
> 
> (Make sure you view this with a monospaced font, of course.)
> 
> Also looks fixed now.
> 
> To be fair, this has never really worked perfectly, but I think this is a little more broken than I remember it. :-)
> 
> The old indentation engine reinvents parse-partial-sexp, poorly, so it doesn't really consider the insides of heredoc as a string. SMIE has its difficulties, but it handles syntax entities better.
> 
> P.S. Please do use `M-x report-emacs-bug', or at least write to emacs-devel. I'm not the only person taking care of ruby-mode now. There's at least Stefan, and looks like Bozhidar is also joining the fray.
> 
> 


[-- Attachment #2: Type: text/html, Size: 4172 bytes --]

      reply	other threads:[~2013-11-04 13:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <F0657697-BC48-4B13-918F-4C42C36D936D@sanityinc.com>
2013-11-04 10:58 ` Problem case for ruby-mode indentation Dmitry Gutov
2013-11-04 13:44   ` Bozhidar Batsov
2013-11-04 13:50     ` Steve Purcell [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C7E5B1CD-E8D8-4BAB-A3BE-BECFC70D5ACF@sanityinc.com \
    --to=steve@sanityinc.com \
    --cc=bozhidar@batsov.com \
    --cc=dgutov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.