unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: phillip.lord@russet.org.uk (Phillip Lord)
To: Noam Postavsky <npostavs@users.sourceforge.net>
Cc: Tom Tromey <tom@tromey.com>, Emacs discussions <emacs-devel@gnu.org>
Subject: Re: moving some indentation tests
Date: Mon, 03 Apr 2017 17:39:16 +0100	[thread overview]
Message-ID: <874ly5cuob.fsf@russet.org.uk> (raw)
In-Reply-To: <CAM-tV-_u_6Fc-Nmd2-nN9OtQ1HpEiHeZOMzD+-OSWM=qnGcKFw@mail.gmail.com> (Noam Postavsky's message of "Mon, 3 Apr 2017 09:20:01 -0400")

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.



  reply	other threads:[~2017-04-03 16:39 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=874ly5cuob.fsf@russet.org.uk \
    --to=phillip.lord@russet.org.uk \
    --cc=emacs-devel@gnu.org \
    --cc=npostavs@users.sourceforge.net \
    --cc=tom@tromey.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).