emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: moving some indentation tests


From: Noam Postavsky
Subject: Re: moving some indentation tests
Date: Mon, 3 Apr 2017 09:20:01 -0400

On Mon, Apr 3, 2017 at 7:11 AM, Phillip Lord <address@hidden> 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]