unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: /srv/bzr/emacs/trunk r111061: Fix for bad test in ruby-mode-tests.el.
       [not found] <E1Tf2rc-00087q-Kb@vcs.savannah.gnu.org>
@ 2012-12-02 23:58 ` Dmitry Gutov
  2012-12-03  4:13   ` Chong Yidong
  0 siblings, 1 reply; 17+ messages in thread
From: Dmitry Gutov @ 2012-12-02 23:58 UTC (permalink / raw)
  To: Chong Yidong; +Cc: emacs-devel

Hi Chong,

Chong Yidong <cyd@gnu.org> writes:
> ------------------------------------------------------------
> revno: 111061
> committer: Chong Yidong <cyd@gnu.org>
> branch nick: trunk
> timestamp: Sun 2012-12-02 14:06:32 +0800
> message:
>   Fix for bad test in ruby-mode-tests.el.
>   
>   * automated/ruby-mode-tests.el (ruby-add-log-current-method-examples):
>   Don't use loop macro, to allow automated testing to work.
> modified:
>   test/ChangeLog
>   test/automated/ruby-mode-tests.el

Is there some way to run all tests in automated fashion (which I broke)?

Would it have been better if I 'require'd cl-lib and used the prefixed
version of the macro?

Is it considered okay that you've replaced spaces with tabs?

> === modified file 'test/ChangeLog'
> --- a/test/ChangeLog	2012-11-20 04:24:09 +0000
> +++ b/test/ChangeLog	2012-12-02 06:06:32 +0000
> @@ -1,3 +1,9 @@
> +2012-12-02  Chong Yidong  <cyd@gnu.org>
> +
> +	* automated/ruby-mode-tests.el
> +	(ruby-add-log-current-method-examples): Don't use loop macro, to
> +	allow automated testing to work.
> +
>  2012-11-20  Stefan Monnier  <monnier@iro.umontreal.ca>
>  
>  	* automated/advice-tests.el (advice-tests--data): Remove.
>
> === modified file 'test/automated/ruby-mode-tests.el'
> --- a/test/automated/ruby-mode-tests.el	2012-11-14 12:17:21 +0000
> +++ b/test/automated/ruby-mode-tests.el	2012-12-02 06:06:32 +0000
> @@ -296,21 +296,23 @@
>    (let ((pairs '(("foo" . "#foo")
>                   ("C.foo" . ".foo")
>                   ("self.foo" . ".foo"))))
> -    (loop for (name . value) in pairs
> -          do (with-temp-buffer
> -               (insert (ruby-test-string
> -                        "module M
> +    (dolist (pair pairs)
> +      (let ((name  (car pair))
> +	    (value (cdr pair)))
> +	(with-temp-buffer
> +	  (insert (ruby-test-string
> +		   "module M
>                          |  class C
>                          |    def %s
>                          |    end
>                          |  end
>                          |end"
> -                        name))
> -               (ruby-mode)
> -               (search-backward "def")
> -               (forward-line)
> -               (should (string= (ruby-add-log-current-method)
> -                                (format "M::C%s" value)))))))
> +		   name))
> +	  (ruby-mode)
> +	  (search-backward "def")
> +	  (forward-line)
> +	  (should (string= (ruby-add-log-current-method)
> +			   (format "M::C%s" value))))))))
>  
>  (defvar ruby-block-test-example
>    (ruby-test-string



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

* Re: /srv/bzr/emacs/trunk r111061: Fix for bad test in ruby-mode-tests.el.
  2012-12-02 23:58 ` /srv/bzr/emacs/trunk r111061: Fix for bad test in ruby-mode-tests.el Dmitry Gutov
@ 2012-12-03  4:13   ` Chong Yidong
  2012-12-03 18:45     ` Dmitry Gutov
  0 siblings, 1 reply; 17+ messages in thread
From: Chong Yidong @ 2012-12-03  4:13 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: emacs-devel

Dmitry Gutov <dgutov@yandex.ru> writes:

> Is there some way to run all tests in automated fashion (which I
> broke)?

Do `make check' from the top level of the tree.

> Would it have been better if I 'require'd cl-lib and used the prefixed
> version of the macro?

Sure, that would probably have worked too.



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

* Re: /srv/bzr/emacs/trunk r111061: Fix for bad test in ruby-mode-tests.el.
  2012-12-03  4:13   ` Chong Yidong
@ 2012-12-03 18:45     ` Dmitry Gutov
  2012-12-03 19:48       ` Stefan Monnier
  0 siblings, 1 reply; 17+ messages in thread
From: Dmitry Gutov @ 2012-12-03 18:45 UTC (permalink / raw)
  To: Chong Yidong; +Cc: emacs-devel

On 03.12.2012 8:13, Chong Yidong wrote:
> Dmitry Gutov <dgutov@yandex.ru> writes:
>
>> Is there some way to run all tests in automated fashion (which I
>> broke)?
>
> Do `make check' from the top level of the tree.
>
>> Would it have been better if I 'require'd cl-lib and used the prefixed
>> version of the macro?
>
> Sure, that would probably have worked too.

Thanks for the answers.

What about the third question? Last time I've seen a discussion about 
whitespace style in Emacs codebase, I think it was somewhat of a 
consensus that spaces > tabs (which is also my preference), but doing 
whitespace-only commits was declared verboten, so I can't just revert 
that part of the change.



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

* Re: /srv/bzr/emacs/trunk r111061: Fix for bad test in ruby-mode-tests.el.
  2012-12-03 18:45     ` Dmitry Gutov
@ 2012-12-03 19:48       ` Stefan Monnier
  2012-12-03 19:55         ` Burton Samograd
                           ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Stefan Monnier @ 2012-12-03 19:48 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: Chong Yidong, emacs-devel

> What about the third question? Last time I've seen a discussion about
> whitespace style in Emacs codebase, I think it was somewhat of a consensus
> that spaces > tabs (which is also my preference), but doing whitespace-only
> commits was declared verboten, so I can't just revert that part of
> the change.

There are better things to do in life than worry about how the
whitespace you don't see is represented internally,


        Stefan



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

* Re: /srv/bzr/emacs/trunk r111061: Fix for bad test in ruby-mode-tests.el.
  2012-12-03 19:48       ` Stefan Monnier
@ 2012-12-03 19:55         ` Burton Samograd
  2012-12-03 21:03           ` Dmitry Gutov
  2012-12-03 21:54           ` Stefan Monnier
  2012-12-03 20:00         ` Dmitry Gutov
  2012-12-04  8:44         ` Stephen Leake
  2 siblings, 2 replies; 17+ messages in thread
From: Burton Samograd @ 2012-12-03 19:55 UTC (permalink / raw)
  To: emacs-devel

Stefan Monnier <monnier@IRO.UMontreal.CA> writes:

> There are better things to do in life than worry about how the
> whitespace you don't see is represented internally,

Not when someone has tabs set to 4 and someone else to 8, or 3, or 6 and
you're set to use spaces.

--
Burton Samograd




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

* Re: /srv/bzr/emacs/trunk r111061: Fix for bad test in ruby-mode-tests.el.
  2012-12-03 19:48       ` Stefan Monnier
  2012-12-03 19:55         ` Burton Samograd
@ 2012-12-03 20:00         ` Dmitry Gutov
  2012-12-04  8:44         ` Stephen Leake
  2 siblings, 0 replies; 17+ messages in thread
From: Dmitry Gutov @ 2012-12-03 20:00 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Chong Yidong, emacs-devel

On 03.12.2012 23:48, Stefan Monnier wrote:
>> What about the third question? Last time I've seen a discussion about
>> whitespace style in Emacs codebase, I think it was somewhat of a consensus
>> that spaces > tabs (which is also my preference), but doing whitespace-only
>> commits was declared verboten, so I can't just revert that part of
>> the change.
>
> There are better things to do in life than worry about how the
> whitespace you don't see is represented internally,

Sure, there are. But I do see it, courtesy of whitespace-mode.

--Dmitry



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

* Re: /srv/bzr/emacs/trunk r111061: Fix for bad test in ruby-mode-tests.el.
  2012-12-03 19:55         ` Burton Samograd
@ 2012-12-03 21:03           ` Dmitry Gutov
  2012-12-03 21:20             ` Burton Samograd
  2012-12-03 21:54           ` Stefan Monnier
  1 sibling, 1 reply; 17+ messages in thread
From: Dmitry Gutov @ 2012-12-03 21:03 UTC (permalink / raw)
  To: Burton Samograd; +Cc: emacs-devel

Burton Samograd <burton@samograd.ca> writes:

> Stefan Monnier <monnier@IRO.UMontreal.CA> writes:
>
>> There are better things to do in life than worry about how the
>> whitespace you don't see is represented internally,
>
> Not when someone has tabs set to 4 and someone else to 8, or 3, or 6 and
> you're set to use spaces.

This particular potential problem is taken care of in .dir-locals.el at
the top of the Emacs directory tree.

--Dmitry



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

* Re: /srv/bzr/emacs/trunk r111061: Fix for bad test in ruby-mode-tests.el.
  2012-12-03 21:03           ` Dmitry Gutov
@ 2012-12-03 21:20             ` Burton Samograd
  0 siblings, 0 replies; 17+ messages in thread
From: Burton Samograd @ 2012-12-03 21:20 UTC (permalink / raw)
  To: emacs-devel

Dmitry Gutov <dgutov@yandex.ru> writes:

> Burton Samograd <burton@samograd.ca> writes:
>
>> Stefan Monnier <monnier@IRO.UMontreal.CA> writes:
>>
>>> There are better things to do in life than worry about how the
>>> whitespace you don't see is represented internally,
>>
>> Not when someone has tabs set to 4 and someone else to 8, or 3, or 6 and
>> you're set to use spaces.
>
> This particular potential problem is taken care of in .dir-locals.el at
> the top of the Emacs directory tree.

If only we could use that solution at my work...

--
Burton Samograd




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

* Re: /srv/bzr/emacs/trunk r111061: Fix for bad test in ruby-mode-tests.el.
  2012-12-03 19:55         ` Burton Samograd
  2012-12-03 21:03           ` Dmitry Gutov
@ 2012-12-03 21:54           ` Stefan Monnier
  1 sibling, 0 replies; 17+ messages in thread
From: Stefan Monnier @ 2012-12-03 21:54 UTC (permalink / raw)
  To: Burton Samograd; +Cc: emacs-devel

>> There are better things to do in life than worry about how the
>> whitespace you don't see is represented internally,
> Not when someone has tabs set to 4 and someone else to 8, or 3, or 6 and
> you're set to use spaces.

There are *much* better things to do in life than set tab-width to
a non-8 value in emacs-lisp-mode.


        Stefan



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

* Re: /srv/bzr/emacs/trunk r111061: Fix for bad test in ruby-mode-tests.el.
  2012-12-03 19:48       ` Stefan Monnier
  2012-12-03 19:55         ` Burton Samograd
  2012-12-03 20:00         ` Dmitry Gutov
@ 2012-12-04  8:44         ` Stephen Leake
  2012-12-04 14:51           ` Stefan Monnier
  2 siblings, 1 reply; 17+ messages in thread
From: Stephen Leake @ 2012-12-04  8:44 UTC (permalink / raw)
  To: emacs-devel

Stefan Monnier <monnier@IRO.UMontreal.CA> writes:

>> What about the third question? Last time I've seen a discussion about
>> whitespace style in Emacs codebase, I think it was somewhat of a consensus
>> that spaces > tabs (which is also my preference), but doing whitespace-only
>> commits was declared verboten, so I can't just revert that part of
>> the change.
>
> There are better things to do in life than worry about how the
> whitespace you don't see is represented internally,

Which is why there needs to be a clear policy, supported by Emacs tools,
that everyone knows and follows.

-- 
-- Stephe



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

* Re: /srv/bzr/emacs/trunk r111061: Fix for bad test in ruby-mode-tests.el.
  2012-12-04  8:44         ` Stephen Leake
@ 2012-12-04 14:51           ` Stefan Monnier
  2012-12-04 17:55             ` martin rudalics
  2012-12-05  3:49             ` Stephen Leake
  0 siblings, 2 replies; 17+ messages in thread
From: Stefan Monnier @ 2012-12-04 14:51 UTC (permalink / raw)
  To: Stephen Leake; +Cc: emacs-devel

> Which is why there needs to be a clear policy, supported by Emacs tools,
> that everyone knows and follows.

And the policy is: don't modify TABs or spaces on lines you do
not otherwise change.


        Stefan



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

* Re: /srv/bzr/emacs/trunk r111061: Fix for bad test in ruby-mode-tests.el.
  2012-12-04 14:51           ` Stefan Monnier
@ 2012-12-04 17:55             ` martin rudalics
  2012-12-04 18:07               ` Stefan Monnier
  2012-12-05  3:49             ` Stephen Leake
  1 sibling, 1 reply; 17+ messages in thread
From: martin rudalics @ 2012-12-04 17:55 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Stephen Leake, emacs-devel

 > And the policy is: don't modify TABs or spaces on lines you do
 > not otherwise change.

Easier said than done when you are used to invoke `indent-sexp' on the
sexp enclosing a small change.

martin



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

* Re: /srv/bzr/emacs/trunk r111061: Fix for bad test in ruby-mode-tests.el.
  2012-12-04 17:55             ` martin rudalics
@ 2012-12-04 18:07               ` Stefan Monnier
  2012-12-05  9:41                 ` martin rudalics
  0 siblings, 1 reply; 17+ messages in thread
From: Stefan Monnier @ 2012-12-04 18:07 UTC (permalink / raw)
  To: martin rudalics; +Cc: Stephen Leake, emacs-devel

>> And the policy is: don't modify TABs or spaces on lines you do
>> not otherwise change.
> Easier said than done when you are used to invoke `indent-sexp' on the
> sexp enclosing a small change.

AFAIK indent-sexp won't touch a line that's already properly indented,
so TABs will only be changed to spaces (or vice versa) if you do
fix the indentation, which is OK.


        Stefan



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

* Re: /srv/bzr/emacs/trunk r111061: Fix for bad test in ruby-mode-tests.el.
  2012-12-04 14:51           ` Stefan Monnier
  2012-12-04 17:55             ` martin rudalics
@ 2012-12-05  3:49             ` Stephen Leake
  2012-12-05  4:56               ` Stefan Monnier
  1 sibling, 1 reply; 17+ messages in thread
From: Stephen Leake @ 2012-12-05  3:49 UTC (permalink / raw)
  To: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> Which is why there needs to be a clear policy, supported by Emacs tools,
>> that everyone knows and follows.
>
> And the policy is: don't modify TABs or spaces on lines you do
> not otherwise change.

That's clear.

But the other part of the question was: are we supposed to use tabs or
spaces when editing new or old code?

It's easy enough to tell Emacs which to use, and it's best if all code
in a project follows a common standard.

I don't see any documentation on this in the various READMEs in the
Emacs source tree (but I may have missed something).

I thought this was mentioned in the Gnu coding standards (I have a note
in my .emacs for C style that says the Gnu coding standard requires tabs),
but I don't see it in the current version at
http://www.gnu.org/prep/standards/standards.html

-- 
-- Stephe



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

* Re: /srv/bzr/emacs/trunk r111061: Fix for bad test in ruby-mode-tests.el.
  2012-12-05  3:49             ` Stephen Leake
@ 2012-12-05  4:56               ` Stefan Monnier
  0 siblings, 0 replies; 17+ messages in thread
From: Stefan Monnier @ 2012-12-05  4:56 UTC (permalink / raw)
  To: Stephen Leake; +Cc: emacs-devel

> But the other part of the question was: are we supposed to use tabs or
> spaces when editing new or old code?

Irrelevant.  Use whichever you like.

> it's best if all code in a project follows a common standard.

Yes, but that doesn't mean you need to pay attention to
irrelevant details.


        Stefan



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

* Re: /srv/bzr/emacs/trunk r111061: Fix for bad test in ruby-mode-tests.el.
  2012-12-04 18:07               ` Stefan Monnier
@ 2012-12-05  9:41                 ` martin rudalics
  2012-12-05 14:54                   ` Stefan Monnier
  0 siblings, 1 reply; 17+ messages in thread
From: martin rudalics @ 2012-12-05  9:41 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Stephen Leake, emacs-devel

 > AFAIK indent-sexp won't touch a line that's already properly indented,
 > so TABs will only be changed to spaces (or vice versa) if you do
 > fix the indentation, which is OK.

Right.  But if you, say, introduce a new let binding somewhere at the
beginning of a defun and later on decide that you don't need it but do
want to keep other changes you made in between, reindenting will leave
whitespace changes in the new code.

martin



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

* Re: /srv/bzr/emacs/trunk r111061: Fix for bad test in ruby-mode-tests.el.
  2012-12-05  9:41                 ` martin rudalics
@ 2012-12-05 14:54                   ` Stefan Monnier
  0 siblings, 0 replies; 17+ messages in thread
From: Stefan Monnier @ 2012-12-05 14:54 UTC (permalink / raw)
  To: martin rudalics; +Cc: Stephen Leake, emacs-devel

>> AFAIK indent-sexp won't touch a line that's already properly indented,
>> so TABs will only be changed to spaces (or vice versa) if you do
>> fix the indentation, which is OK.
> Right.  But if you, say, introduce a new let binding somewhere at the
> beginning of a defun and later on decide that you don't need it but do
> want to keep other changes you made in between, reindenting will leave
> whitespace changes in the new code.

Better not worry about it.


        Stefan



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

end of thread, other threads:[~2012-12-05 14:54 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <E1Tf2rc-00087q-Kb@vcs.savannah.gnu.org>
2012-12-02 23:58 ` /srv/bzr/emacs/trunk r111061: Fix for bad test in ruby-mode-tests.el Dmitry Gutov
2012-12-03  4:13   ` Chong Yidong
2012-12-03 18:45     ` Dmitry Gutov
2012-12-03 19:48       ` Stefan Monnier
2012-12-03 19:55         ` Burton Samograd
2012-12-03 21:03           ` Dmitry Gutov
2012-12-03 21:20             ` Burton Samograd
2012-12-03 21:54           ` Stefan Monnier
2012-12-03 20:00         ` Dmitry Gutov
2012-12-04  8:44         ` Stephen Leake
2012-12-04 14:51           ` Stefan Monnier
2012-12-04 17:55             ` martin rudalics
2012-12-04 18:07               ` Stefan Monnier
2012-12-05  9:41                 ` martin rudalics
2012-12-05 14:54                   ` Stefan Monnier
2012-12-05  3:49             ` Stephen Leake
2012-12-05  4:56               ` Stefan Monnier

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).