all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#24648: 25.1; smie indentation in strings
@ 2016-10-09 16:45 Leo Liu
  2016-10-09 21:01 ` Stefan Monnier
  2016-10-12 10:00 ` Dmitry Gutov
  0 siblings, 2 replies; 8+ messages in thread
From: Leo Liu @ 2016-10-09 16:45 UTC (permalink / raw)
  To: 24648; +Cc: Stefan Monnier


1. Open a new buffer in octave-mode (or ruby mode)
2. Insert a string:

     "line 1
     line 2
     line 3"

3. Move point to the beginning of `line 2' and pressing TAB

line 2 will be indented freely. This is a big surprise. Regression?

Leo





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#24648: 25.1; smie indentation in strings
  2016-10-09 16:45 bug#24648: 25.1; smie indentation in strings Leo Liu
@ 2016-10-09 21:01 ` Stefan Monnier
  2016-10-12 10:00 ` Dmitry Gutov
  1 sibling, 0 replies; 8+ messages in thread
From: Stefan Monnier @ 2016-10-09 21:01 UTC (permalink / raw)
  To: Leo Liu; +Cc: 24648

> 1. Open a new buffer in octave-mode (or ruby mode)
> 2. Insert a string:
>
>      "line 1
>      line 2
>      line 3"
>
> 3. Move point to the beginning of `line 2' and pressing TAB
>
> line 2 will be indented freely. This is a big surprise. Regression?

What would you like instead?  You're indenting within a string, so
octave-mode has no idea what rule to follow since the string may
represent anything.  By design, it should behave like in text-mode, more
or less.


        Stefan





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#24648: 25.1; smie indentation in strings
  2016-10-09 16:45 bug#24648: 25.1; smie indentation in strings Leo Liu
  2016-10-09 21:01 ` Stefan Monnier
@ 2016-10-12 10:00 ` Dmitry Gutov
  2016-10-12 16:57   ` Leo Liu
  1 sibling, 1 reply; 8+ messages in thread
From: Dmitry Gutov @ 2016-10-12 10:00 UTC (permalink / raw)
  To: Leo Liu, 24648; +Cc: Stefan Monnier

On 09.10.2016 19:45, Leo Liu wrote:
>
> 1. Open a new buffer in octave-mode (or ruby mode)
> 2. Insert a string:
>
>      "line 1
>      line 2
>      line 3"
>
> 3. Move point to the beginning of `line 2' and pressing TAB
>
> line 2 will be indented freely. This is a big surprise. Regression?

This is actually intentional, and was added in commit f54e5ccf.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#24648: 25.1; smie indentation in strings
  2016-10-12 10:00 ` Dmitry Gutov
@ 2016-10-12 16:57   ` Leo Liu
  2016-10-12 17:08     ` Dmitry Gutov
  0 siblings, 1 reply; 8+ messages in thread
From: Leo Liu @ 2016-10-12 16:57 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: 24648, Stefan Monnier

On 2016-10-12 13:00 +0300, Dmitry Gutov wrote:
> This is actually intentional, and was added in commit f54e5ccf.

Look at that commit it is not clear what the intention is.

On 2016-10-09 17:01 -0400, Stefan Monnier wrote:
> What would you like instead?  You're indenting within a string, so
> octave-mode has no idea what rule to follow since the string may
> represent anything.  By design, it should behave like in text-mode, more
> or less.
>
>
>         Stefan

The behaviour in emacs 24 and before looks sane. I have a hard time
getting used to this change. Previously noindent means no indention now
it seems to mean any indention. And there are exceptions for example
lisp modes don't adopt this behaviour. Any ideas why?

Leo





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#24648: 25.1; smie indentation in strings
  2016-10-12 16:57   ` Leo Liu
@ 2016-10-12 17:08     ` Dmitry Gutov
  2016-10-12 17:39       ` Leo Liu
  0 siblings, 1 reply; 8+ messages in thread
From: Dmitry Gutov @ 2016-10-12 17:08 UTC (permalink / raw)
  To: Leo Liu; +Cc: 24648, Stefan Monnier

On 12.10.2016 19:57, Leo Liu wrote:
> I have a hard time
> getting used to this change. Previously noindent means no indention now
> it seems to mean any indention.

Only when you explicitly press TAB inside a string. That doesn't change 
region indentation, for instance.

To be clear, I probably don't care one way of the other. But just 
yesterday, a user requested this behavior in js2-mode: 
https://github.com/mooz/js2-mode/issues/227#issuecomment-253138470

> And there are exceptions for example
> lisp modes don't adopt this behaviour. Any ideas why?

Because most indent-line-function's don't return `noindent' when they 
should (in comments and strings).

We should probably patch that.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#24648: 25.1; smie indentation in strings
  2016-10-12 17:08     ` Dmitry Gutov
@ 2016-10-12 17:39       ` Leo Liu
  2016-10-12 17:43         ` Dmitry Gutov
  0 siblings, 1 reply; 8+ messages in thread
From: Leo Liu @ 2016-10-12 17:39 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: 24648, Stefan Monnier

On 2016-10-12 20:08 +0300, Dmitry Gutov wrote:
> Because most indent-line-function's don't return `noindent' when they
> should (in comments and strings).
>
> We should probably patch that.

SMIE handles comment and strings automatically by returning `noindent';
but pressing TAB still indents it anyway.

Leo





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#24648: 25.1; smie indentation in strings
  2016-10-12 17:39       ` Leo Liu
@ 2016-10-12 17:43         ` Dmitry Gutov
  2018-06-05 23:46           ` Noam Postavsky
  0 siblings, 1 reply; 8+ messages in thread
From: Dmitry Gutov @ 2016-10-12 17:43 UTC (permalink / raw)
  To: Leo Liu; +Cc: 24648, Stefan Monnier

On 12.10.2016 20:39, Leo Liu wrote:
> On 2016-10-12 20:08 +0300, Dmitry Gutov wrote:
>> Because most indent-line-function's don't return `noindent' when they
>> should (in comments and strings).
>>
>> We should probably patch that.
>
> SMIE handles comment and strings automatically by returning `noindent';
> but pressing TAB still indents it anyway.

Yes. That's the effect of the commit I've referenced earlier.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#24648: 25.1; smie indentation in strings
  2016-10-12 17:43         ` Dmitry Gutov
@ 2018-06-05 23:46           ` Noam Postavsky
  0 siblings, 0 replies; 8+ messages in thread
From: Noam Postavsky @ 2018-06-05 23:46 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: 24648, Leo Liu, Stefan Monnier

tags 24648 wontfix
close 24648
quit

Dmitry Gutov <dgutov@yandex.ru> writes:

> On 12.10.2016 20:39, Leo Liu wrote:
>> On 2016-10-12 20:08 +0300, Dmitry Gutov wrote:
>>> Because most indent-line-function's don't return `noindent' when they
>>> should (in comments and strings).
>>>
>>> We should probably patch that.
>>
>> SMIE handles comment and strings automatically by returning `noindent';
>> but pressing TAB still indents it anyway.
>
> Yes. That's the effect of the commit I've referenced earlier.

Sounds like wontfix to me.






^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-06-05 23:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-09 16:45 bug#24648: 25.1; smie indentation in strings Leo Liu
2016-10-09 21:01 ` Stefan Monnier
2016-10-12 10:00 ` Dmitry Gutov
2016-10-12 16:57   ` Leo Liu
2016-10-12 17:08     ` Dmitry Gutov
2016-10-12 17:39       ` Leo Liu
2016-10-12 17:43         ` Dmitry Gutov
2018-06-05 23:46           ` Noam Postavsky

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.