all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* moving some indentation tests
@ 2017-04-02  9:47 Tom Tromey
  2017-04-02 11:46 ` Michael Albinus
                   ` (4 more replies)
  0 siblings, 5 replies; 21+ messages in thread
From: Tom Tromey @ 2017-04-02  9:47 UTC (permalink / raw)
  To: Emacs discussions

Currently indentation tests seem to be in test/manual/indent.  However,
most of these could be run automatically.  So, I'd like to move them so
that they'll be run by the ordinary "make check".

I'm thinking I would move the files to test/data and then write a new
test that simply iterates over these files and checking that
re-indentation works.

Not all the files can be moved this way -- a few currently fail.  I
wouldn't move those.

Let me know what you think.

Tom



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

* Re: moving some indentation tests
  2017-04-02  9:47 moving some indentation tests Tom Tromey
@ 2017-04-02 11:46 ` Michael Albinus
  2017-04-02 16:06   ` Tom Tromey
  2017-04-02 15:53 ` Eli Zaretskii
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 21+ messages in thread
From: Michael Albinus @ 2017-04-02 11:46 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Emacs discussions

Tom Tromey <tom@tromey.com> writes:

> I'm thinking I would move the files to test/data and then write a new
> test that simply iterates over these files and checking that
> re-indentation works.

test/file-organization.org makes another proposal. You shall create a
FEATURE-resources directory, given the test file is called FEATURE-tests.el.

> Tom

Best regards, Michael.



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

* Re: moving some indentation tests
  2017-04-02  9:47 moving some indentation tests Tom Tromey
  2017-04-02 11:46 ` Michael Albinus
@ 2017-04-02 15:53 ` Eli Zaretskii
  2017-04-02 15:58 ` Dmitry Gutov
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 21+ messages in thread
From: Eli Zaretskii @ 2017-04-02 15:53 UTC (permalink / raw)
  To: Tom Tromey; +Cc: emacs-devel

> From: Tom Tromey <tom@tromey.com>
> Date: Sun, 02 Apr 2017 03:47:26 -0600
> 
> Currently indentation tests seem to be in test/manual/indent.  However,
> most of these could be run automatically.  So, I'd like to move them so
> that they'll be run by the ordinary "make check".
> 
> I'm thinking I would move the files to test/data and then write a new
> test that simply iterates over these files and checking that
> re-indentation works.
> 
> Not all the files can be moved this way -- a few currently fail.  I
> wouldn't move those.
> 
> Let me know what you think.

Sounds good, but please use the convention pointed out by Michael
regarding the data files.

Thanks.



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

* Re: moving some indentation tests
  2017-04-02  9:47 moving some indentation tests Tom Tromey
  2017-04-02 11:46 ` Michael Albinus
  2017-04-02 15:53 ` Eli Zaretskii
@ 2017-04-02 15:58 ` Dmitry Gutov
  2017-04-02 16:05   ` Tom Tromey
  2017-04-02 20:31 ` Phillip Lord
  2017-04-06  3:28 ` Tom Tromey
  4 siblings, 1 reply; 21+ messages in thread
From: Dmitry Gutov @ 2017-04-02 15:58 UTC (permalink / raw)
  To: Tom Tromey, Emacs discussions

On 02.04.2017 12:47, Tom Tromey wrote:

> Not all the files can be moved this way -- a few currently fail.  I
> wouldn't move those.

I'd rather avoid splitting them. Do we have a lot of failures, and would 
it be hard to try to appoint people responsible for them?



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

* Re: moving some indentation tests
  2017-04-02 15:58 ` Dmitry Gutov
@ 2017-04-02 16:05   ` Tom Tromey
  0 siblings, 0 replies; 21+ messages in thread
From: Tom Tromey @ 2017-04-02 16:05 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: Tom Tromey, Emacs discussions

>>>>> "Dmitry" == Dmitry Gutov <dgutov@yandex.ru> writes:

Dmitry> On 02.04.2017 12:47, Tom Tromey wrote:
>> Not all the files can be moved this way -- a few currently fail.  I
>> wouldn't move those.

Dmitry> I'd rather avoid splitting them. Do we have a lot of failures, and
Dmitry> would it be hard to try to appoint people responsible for them?

Here are the failures.

5 matches for "failed" in buffer: Log
     41:Makefile:13: recipe for target 'octave.m.test' failed
   1947:Makefile:13: recipe for target 'pascal.pas.test' failed
   2037:Makefile:13: recipe for target 'perl.perl.test' failed
   2072:Makefile:13: recipe for target 'scheme.scm.test' failed
   2097:Makefile:13: recipe for target 'shell.rc.test' failed


It's simple to move remaining ones if they are fixed.
I think it's preferable by far, though, not to wait, unless the fixes
are imminent.

Tom



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

* Re: moving some indentation tests
  2017-04-02 11:46 ` Michael Albinus
@ 2017-04-02 16:06   ` Tom Tromey
  2017-04-02 18:16     ` Michael Albinus
  0 siblings, 1 reply; 21+ messages in thread
From: Tom Tromey @ 2017-04-02 16:06 UTC (permalink / raw)
  To: Michael Albinus; +Cc: Tom Tromey, Emacs discussions

>>>>> "Michael" == Michael Albinus <michael.albinus@gmx.de> writes:

Michael> test/file-organization.org makes another proposal. You shall
Michael> create a FEATURE-resources directory, given the test file is
Michael> called FEATURE-tests.el.

Alright.
I saw this file but since test/data exists and isn't documented, I
assumed it was out of date.

Tom



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

* Re: moving some indentation tests
  2017-04-02 16:06   ` Tom Tromey
@ 2017-04-02 18:16     ` Michael Albinus
  0 siblings, 0 replies; 21+ messages in thread
From: Michael Albinus @ 2017-04-02 18:16 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Emacs discussions

Tom Tromey <tom@tromey.com> writes:

> I saw this file but since test/data exists and isn't documented, I
> assumed it was out of date.

I believe test/data is rather out of date. Maybe we shall rearrange it?

> Tom

Best regards, Michael.



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

* Re: moving some indentation tests
  2017-04-02  9:47 moving some indentation tests Tom Tromey
                   ` (2 preceding siblings ...)
  2017-04-02 15:58 ` Dmitry Gutov
@ 2017-04-02 20:31 ` Phillip Lord
  2017-04-02 21:02   ` Noam Postavsky
  2017-04-06  3:28 ` Tom Tromey
  4 siblings, 1 reply; 21+ messages in thread
From: Phillip Lord @ 2017-04-02 20:31 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Emacs discussions

Tom Tromey <tom@tromey.com> writes:

> Currently indentation tests seem to be in test/manual/indent.  However,
> most of these could be run automatically.  So, I'd like to move them so
> that they'll be run by the ordinary "make check".
>
> I'm thinking I would move the files to test/data and then write a new
> test that simply iterates over these files and checking that
> re-indentation works.

My own package, assess, provides good support for this kind of
functionality. In particular, you can do this:


(assess-roundtrip-indentation=
 'emacs-lisp-mode
 "
(assess-with-find-file
    \"~/.emacs\"
  (buffer-string))")
  
if you want to see what you are indenting. And, 

(assess-file-roundtrip-indentation=
  "assess.el")

if you want to use a file.

I've been planning to add this to core -- I was hoping to wait till we
have a "core ELPA" packaging sorted out, but this might be some time. If
it would be helpful for the indentation tests, I could add this.

Phil



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

* Re: moving some indentation tests
  2017-04-02 20:31 ` Phillip Lord
@ 2017-04-02 21:02   ` Noam Postavsky
  2017-04-03 11:11     ` Phillip Lord
  0 siblings, 1 reply; 21+ messages in thread
From: Noam Postavsky @ 2017-04-02 21:02 UTC (permalink / raw)
  To: Phillip Lord; +Cc: Tom Tromey, Emacs discussions

On Sun, Apr 2, 2017 at 4:31 PM, Phillip Lord <phillip.lord@russet.org.uk> wrote:
>
> My own package, assess, provides good support for this kind of
> functionality. In particular, you can do this:
>
>
> (assess-roundtrip-indentation=
>  'emacs-lisp-mode
>  "
> (assess-with-find-file
>     \"~/.emacs\"
>   (buffer-string))")

For indent-sexp tests I just wrote this sort of thing in line (see
test/lisp/emacs-lisp/lisp-mode-tests.el). Would have been handy to
have some pre-written functions for it. After a quick glance I think
there are two issues that would get in the way of using the code
currently in assess for those tests though (ignoring the non-Emacs
deps).

I found that adding indentation and then reindenting turned up some
different bugs than removing indentation and reindenting. It looks
like assess only does the latter right now.

Also, AFAICT, it doesn't preserve indentation inside multi-line string literals.



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

* Re: moving some indentation tests
  2017-04-02 21:02   ` Noam Postavsky
@ 2017-04-03 11:11     ` Phillip Lord
  2017-04-03 13:20       ` Noam Postavsky
  0 siblings, 1 reply; 21+ messages in thread
From: Phillip Lord @ 2017-04-03 11:11 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: Tom Tromey, Emacs discussions

Noam Postavsky <npostavs@users.sourceforge.net> writes:

> On Sun, Apr 2, 2017 at 4:31 PM, Phillip Lord <phillip.lord@russet.org.uk> wrote:
>>
>> My own package, assess, provides good support for this kind of
>> functionality. In particular, you can do this:
>>
>>
>> (assess-roundtrip-indentation=
>>  'emacs-lisp-mode
>>  "
>> (assess-with-find-file
>>     \"~/.emacs\"
>>   (buffer-string))")
>
> For indent-sexp tests I just wrote this sort of thing in line (see
> test/lisp/emacs-lisp/lisp-mode-tests.el). Would have been handy to
> have some pre-written functions for it. After a quick glance I think
> there are two issues that would get in the way of using the code
> currently in assess for those tests though (ignoring the non-Emacs
> deps).
>
> I found that adding indentation and then reindenting turned up some
> different bugs than removing indentation and reindenting. It looks
> like assess only does the latter right now.

Indeed it does. Do you have an example of the former? I am not sure
exactly the test proceedure that you are thinking of but I'd be happy to
add this. I think this kind of thing is why having pre-rolled
functions is good; getting this right is worth the effort.


> Also, AFAICT, it doesn't preserve indentation inside multi-line string
> literals.

It should do. This example:

(assess-roundtrip-indentation=
  'emacs-lisp-mode
"
(assess-with-find-file
    \"~/.emacs\"
  (buffer-string))")

returns "t" for me.

Phil



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

* Re: moving some indentation tests
  2017-04-03 11:11     ` Phillip Lord
@ 2017-04-03 13:20       ` Noam Postavsky
  2017-04-03 16:39         ` Phillip Lord
  0 siblings, 1 reply; 21+ messages in thread
From: Noam Postavsky @ 2017-04-03 13:20 UTC (permalink / raw)
  To: Phillip Lord; +Cc: Tom Tromey, Emacs discussions

On Mon, Apr 3, 2017 at 7:11 AM, Phillip Lord <phillip.lord@russet.org.uk> wrote:
>>
>> I found that adding indentation and then reindenting turned up some
>> different bugs than removing indentation and reindenting. It looks
>> like assess only does the latter right now.
>
> Indeed it does. Do you have an example of the former?

In (ert-deftest indent-sexp ()...) in
test/lisp/emacs-lisp/lisp-mode-tests.el where it says ";; Correctly
remove indentation". It's fairly simplistic, I just add an increasing
number of leading spaces to every line except for blank ones and lines
containing "noindent" (that's to avoid string literals). Oh, current
master is missing the check for blanks lines though, that's still
pending on my local branch:

              (unless (looking-at "noindent\\|^[[:blank:]]*$")
                (insert (make-string n ?\s)))

>
> (assess-roundtrip-indentation=
>   'emacs-lisp-mode
> "
> (assess-with-find-file
>     \"~/.emacs\"
>   (buffer-string))")
>
> returns "t" for me.

I meant multi-line string literals in the code being indented. I might
be misreading, but I think

(assess-roundtrip-indentation=
 'emacs-lisp-mode "\
\"a
\s\s\s\s\smulti
\s\sline
string-literal
\s\s\swith random leading space\"")

would return nil.



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

* Re: moving some indentation tests
  2017-04-03 13:20       ` Noam Postavsky
@ 2017-04-03 16:39         ` Phillip Lord
  2017-04-03 20:38           ` Noam Postavsky
  0 siblings, 1 reply; 21+ messages in thread
From: Phillip Lord @ 2017-04-03 16:39 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: Tom Tromey, Emacs discussions

Noam Postavsky <npostavs@users.sourceforge.net> writes:

> On Mon, Apr 3, 2017 at 7:11 AM, Phillip Lord <phillip.lord@russet.org.uk> wrote:
>>>
>>> I found that adding indentation and then reindenting turned up some
>>> different bugs than removing indentation and reindenting. It looks
>>> like assess only does the latter right now.
>>
>> Indeed it does. Do you have an example of the former?
>
> In (ert-deftest indent-sexp ()...) in
> test/lisp/emacs-lisp/lisp-mode-tests.el where it says ";; Correctly
> remove indentation". It's fairly simplistic, I just add an increasing
> number of leading spaces to every line except for blank ones and lines
> containing "noindent" (that's to avoid string literals). Oh, current
> master is missing the check for blanks lines though, that's still
> pending on my local branch:
>
>               (unless (looking-at "noindent\\|^[[:blank:]]*$")
>                 (insert (make-string n ?\s)))

Ah, so you put in some relatively random indentation (well, not random),
and then reindent it, rather than starting from totally unindented.

I will add that, if it gives different results!

>>
>> (assess-roundtrip-indentation=
>>   'emacs-lisp-mode
>> "
>> (assess-with-find-file
>>     \"~/.emacs\"
>>   (buffer-string))")
>>
>> returns "t" for me.
>
> I meant multi-line string literals in the code being indented. I might
> be misreading, but I think
>
> (assess-roundtrip-indentation=
>  'emacs-lisp-mode "\
> \"a
> \s\s\s\s\smulti
> \s\sline
> string-literal
> \s\s\swith random leading space\"")
>
> would return nil.

Just so. The diff is:

Differ at:*** /tmp/a6466fOB	2017-04-03 17:32:04.268554341 +0100
--- /tmp/b6466sYH	2017-04-03 17:32:04.316554609 +0100
***************
*** 1,5 ****
  \"a
! multi
! line
  string-literal
! with random leading space\"
\\ No newline at end of file
--- 1,5 ----
  \"a
!      multi
!   line
  string-literal
!    with random leading space\"
\\ No newline at end of file

"

So the string gets indented.

Although I think emacs-lisp-mode is not working correctly here. In my hands:

"
(hello
(world))
"

indents to

"
(hello
 (world))
"

in emacs-lisp mode. So I'm not 100% sure this is assess not working.



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

* Re: moving some indentation tests
  2017-04-03 16:39         ` Phillip Lord
@ 2017-04-03 20:38           ` Noam Postavsky
  2017-04-07 15:51             ` Phillip Lord
  0 siblings, 1 reply; 21+ messages in thread
From: Noam Postavsky @ 2017-04-03 20:38 UTC (permalink / raw)
  To: Phillip Lord; +Cc: Tom Tromey, Emacs discussions

On Mon, Apr 3, 2017 at 12:39 PM, Phillip Lord
<phillip.lord@russet.org.uk> wrote:
>
> Ah, so you put in some relatively random indentation (well, not random),
> and then reindent it, rather than starting from totally unindented.

Yes, exactly. Arbitrary, but not random because if you have a test
failure it would be annoying to debug it with different indentation
each time!

>
> Although I think emacs-lisp-mode is not working correctly here. In my hands:
>
> "
> (hello
> (world))
> "
>
> indents to
>
> "
> (hello
>  (world))
> "
>
> in emacs-lisp mode. So I'm not 100% sure this is assess not working.

Ah, because lisp-indent-line doesn't check the parse context.
`indent-sexp' does the right thing, if called outside the string (and
also inside since #21343 was fixed).

I believe my patches at
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25122#77 will fix this
for `indent-region' (since I happened to copy the syntax-ppss fix from
#21343). Probably `lisp-indent-line' should also use syntax-ppss to
get the correct parse context.



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

* Re: moving some indentation tests
  2017-04-02  9:47 moving some indentation tests Tom Tromey
                   ` (3 preceding siblings ...)
  2017-04-02 20:31 ` Phillip Lord
@ 2017-04-06  3:28 ` Tom Tromey
  2017-04-06 14:11   ` Eli Zaretskii
  4 siblings, 1 reply; 21+ messages in thread
From: Tom Tromey @ 2017-04-06  3:28 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Emacs discussions

>>>>> "Tom" == Tom Tromey <tom@tromey.com> writes:

Tom> I'm thinking I would move the files to test/data and then write a new
Tom> test that simply iterates over these files and checking that
Tom> re-indentation works.

This turns out to be kind of a pain because there's no good way to pick
a name for the new file.  I tried test/lisp/indentation-tests.el, but
then the Makefile wants to find a dependency lisp/indentation.el.  I
wanted to choose a name that *wasn't* the same as any other existing
lisp file, because this test crosses file boundaries.

Any advice?  It seems to me that this indentation scheme is not so
great, in that it forces all the tests to appear in a single file, which
could be unwieldy for larger lisp sources.

Tom



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

* Re: moving some indentation tests
  2017-04-06  3:28 ` Tom Tromey
@ 2017-04-06 14:11   ` Eli Zaretskii
  2017-04-06 14:32     ` Michael Albinus
                       ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Eli Zaretskii @ 2017-04-06 14:11 UTC (permalink / raw)
  To: Tom Tromey; +Cc: emacs-devel

> From: Tom Tromey <tom@tromey.com>
> Date: Wed, 05 Apr 2017 21:28:05 -0600
> Cc: Emacs discussions <emacs-devel@gnu.org>
> 
> >>>>> "Tom" == Tom Tromey <tom@tromey.com> writes:
> 
> Tom> I'm thinking I would move the files to test/data and then write a new
> Tom> test that simply iterates over these files and checking that
> Tom> re-indentation works.
> 
> This turns out to be kind of a pain because there's no good way to pick
> a name for the new file.  I tried test/lisp/indentation-tests.el, but
> then the Makefile wants to find a dependency lisp/indentation.el.  I
> wanted to choose a name that *wasn't* the same as any other existing
> lisp file, because this test crosses file boundaries.
> 
> Any advice?

How about picking up a name of an existing source file that is somehow
related to the tests?

If that's not good enough, I think we need some new infrastructure for
this in test/Makefile, e.g. a way of specifying a rule that tells Make
which source files are prerequisites for the given test file, so that
when one of the prerequisites changes, the tests are automatically
run.



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

* Re: moving some indentation tests
  2017-04-06 14:11   ` Eli Zaretskii
@ 2017-04-06 14:32     ` Michael Albinus
  2017-04-06 14:33     ` Noam Postavsky
  2017-04-07 15:54     ` Phillip Lord
  2 siblings, 0 replies; 21+ messages in thread
From: Michael Albinus @ 2017-04-06 14:32 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Tom Tromey, emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

Hi Eli,

> If that's not good enough, I think we need some new infrastructure for
> this in test/Makefile, e.g. a way of specifying a rule that tells Make
> which source files are prerequisites for the given test file, so that
> when one of the prerequisites changes, the tests are automatically
> run.

That would be great! tramp-tests.el depends on much more files but
tramp.el.

Best regards, Michael.



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

* Re: moving some indentation tests
  2017-04-06 14:11   ` Eli Zaretskii
  2017-04-06 14:32     ` Michael Albinus
@ 2017-04-06 14:33     ` Noam Postavsky
  2017-04-06 15:53       ` Tom Tromey
  2017-04-07 15:54     ` Phillip Lord
  2 siblings, 1 reply; 21+ messages in thread
From: Noam Postavsky @ 2017-04-06 14:33 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Tom Tromey, Emacs developers

On Thu, Apr 6, 2017 at 10:11 AM, Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Tom Tromey <tom@tromey.com>
>> Date: Wed, 05 Apr 2017 21:28:05 -0600
>> Cc: Emacs discussions <emacs-devel@gnu.org>
>>
>> >>>>> "Tom" == Tom Tromey <tom@tromey.com> writes:
>>
>> Tom> I'm thinking I would move the files to test/data and then write a new
>> Tom> test that simply iterates over these files and checking that
>> Tom> re-indentation works.
>>
>> This turns out to be kind of a pain because there's no good way to pick
>> a name for the new file.  I tried test/lisp/indentation-tests.el, but
>> then the Makefile wants to find a dependency lisp/indentation.el.  I
>> wanted to choose a name that *wasn't* the same as any other existing
>> lisp file, because this test crosses file boundaries.
>>
>> Any advice?
>
> How about picking up a name of an existing source file that is somehow
> related to the tests?

Yeah, shouldn't the js indentation tests go in lisp/progmodes/js-tests.el, etc?



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

* Re: moving some indentation tests
  2017-04-06 14:33     ` Noam Postavsky
@ 2017-04-06 15:53       ` Tom Tromey
  0 siblings, 0 replies; 21+ messages in thread
From: Tom Tromey @ 2017-04-06 15:53 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: Eli Zaretskii, Tom Tromey, Emacs developers

>>>>> "Noam" == Noam Postavsky <npostavs@users.sourceforge.net> writes:

>> How about picking up a name of an existing source file that is somehow
>> related to the tests?

Noam> Yeah, shouldn't the js indentation tests go in lisp/progmodes/js-tests.el, etc?

The current tests are just a bunch of files that should not be changed
by re-indentation.  This has the nice property that a new test can be
written by just dropping a file in the correct directory.

It's possible of course to split these by major mode.  But, that's
significantly more work, both for moving the tests and for writing new
tests, and furthermore, IMO of course, doesn't provide any real benefit.

Tom



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

* Re: moving some indentation tests
  2017-04-03 20:38           ` Noam Postavsky
@ 2017-04-07 15:51             ` Phillip Lord
  2017-04-07 16:06               ` Noam Postavsky
  0 siblings, 1 reply; 21+ messages in thread
From: Phillip Lord @ 2017-04-07 15:51 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: Tom Tromey, Emacs discussions

Noam Postavsky <npostavs@users.sourceforge.net> writes:

> On Mon, Apr 3, 2017 at 12:39 PM, Phillip Lord
> <phillip.lord@russet.org.uk> wrote:
>>
>> Ah, so you put in some relatively random indentation (well, not random),
>> and then reindent it, rather than starting from totally unindented.
>
> Yes, exactly. Arbitrary, but not random because if you have a test
> failure it would be annoying to debug it with different indentation
> each time!
>
>>
>> Although I think emacs-lisp-mode is not working correctly here. In my hands:
>>
>> "
>> (hello
>> (world))
>> "
>>
>> indents to
>>
>> "
>> (hello
>>  (world))
>> "
>>
>> in emacs-lisp mode. So I'm not 100% sure this is assess not working.
>
> Ah, because lisp-indent-line doesn't check the parse context.
> `indent-sexp' does the right thing, if called outside the string (and
> also inside since #21343 was fixed).
>
> I believe my patches at
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25122#77 will fix this
> for `indent-region' (since I happened to copy the syntax-ppss fix from
> #21343). Probably `lisp-indent-line' should also use syntax-ppss to
> get the correct parse context.

So, in this case, assess is working? lisp-indent-line is, effectively,
broken?

Phil



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

* Re: moving some indentation tests
  2017-04-06 14:11   ` Eli Zaretskii
  2017-04-06 14:32     ` Michael Albinus
  2017-04-06 14:33     ` Noam Postavsky
@ 2017-04-07 15:54     ` Phillip Lord
  2 siblings, 0 replies; 21+ messages in thread
From: Phillip Lord @ 2017-04-07 15:54 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Tom Tromey, emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:
>> Any advice?
>
> How about picking up a name of an existing source file that is somehow
> related to the tests?
>
> If that's not good enough, I think we need some new infrastructure for
> this in test/Makefile, e.g. a way of specifying a rule that tells Make
> which source files are prerequisites for the given test file, so that
> when one of the prerequisites changes, the tests are automatically
> run.

The current scheme just uses a heuristic to guess the name of the
prerequisities. Where this doesn't work, there is nothing to prevent
people from adding these by hand, of course. That would be a good thing
in my book. If there is enough commonality, we can add new heuristics to
generate the manual rules.

Phil



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

* Re: moving some indentation tests
  2017-04-07 15:51             ` Phillip Lord
@ 2017-04-07 16:06               ` Noam Postavsky
  0 siblings, 0 replies; 21+ messages in thread
From: Noam Postavsky @ 2017-04-07 16:06 UTC (permalink / raw)
  To: Phillip Lord; +Cc: Tom Tromey, Emacs discussions

On Fri, Apr 7, 2017 at 11:51 AM, Phillip Lord
<phillip.lord@russet.org.uk> wrote:
> Noam Postavsky <npostavs@users.sourceforge.net> writes:
>> Ah, because lisp-indent-line doesn't check the parse context.
>> `indent-sexp' does the right thing, if called outside the string (and
>> also inside since #21343 was fixed).
>>
>> I believe my patches at
>> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25122#77 will fix this
>> for `indent-region' (since I happened to copy the syntax-ppss fix from
>> #21343). Probably `lisp-indent-line' should also use syntax-ppss to
>> get the correct parse context.
>
> So, in this case, assess is working? lisp-indent-line is, effectively,
> broken?

I think both assess and lisp-indent-line are broken for this case, in
different ways. js-indent-line seems to handle this correctly though.
So you should be able to test assess with js-mode.



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

end of thread, other threads:[~2017-04-07 16:06 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-02  9:47 moving some indentation tests Tom Tromey
2017-04-02 11:46 ` Michael Albinus
2017-04-02 16:06   ` Tom Tromey
2017-04-02 18:16     ` Michael Albinus
2017-04-02 15:53 ` Eli Zaretskii
2017-04-02 15:58 ` Dmitry Gutov
2017-04-02 16:05   ` Tom Tromey
2017-04-02 20:31 ` Phillip Lord
2017-04-02 21:02   ` Noam Postavsky
2017-04-03 11:11     ` Phillip Lord
2017-04-03 13:20       ` Noam Postavsky
2017-04-03 16:39         ` Phillip Lord
2017-04-03 20:38           ` Noam Postavsky
2017-04-07 15:51             ` Phillip Lord
2017-04-07 16:06               ` Noam Postavsky
2017-04-06  3:28 ` Tom Tromey
2017-04-06 14:11   ` Eli Zaretskii
2017-04-06 14:32     ` Michael Albinus
2017-04-06 14:33     ` Noam Postavsky
2017-04-06 15:53       ` Tom Tromey
2017-04-07 15:54     ` Phillip Lord

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.