From: Bozhidar Batsov <bozhidar@batsov.com>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: Steve Purcell <steve@sanityinc.com>, emacs-devel <emacs-devel@gnu.org>
Subject: Re: Problem case for ruby-mode indentation
Date: Mon, 4 Nov 2013 15:44:07 +0200 [thread overview]
Message-ID: <CAM9Zgm1tDTr+a0sXCcH=THvvefJJU_pUFePuh-JGYJ5=v0POSA@mail.gmail.com> (raw)
In-Reply-To: <52777DD7.1020305@yandex.ru>
[-- Attachment #1: Type: text/plain, Size: 2401 bytes --]
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: 3288 bytes --]
next prev parent reply other threads:[~2013-11-04 13:44 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 [this message]
2013-11-04 13:50 ` Steve Purcell
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAM9Zgm1tDTr+a0sXCcH=THvvefJJU_pUFePuh-JGYJ5=v0POSA@mail.gmail.com' \
--to=bozhidar@batsov.com \
--cc=dgutov@yandex.ru \
--cc=emacs-devel@gnu.org \
--cc=steve@sanityinc.com \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).