zsh-workers
 help / color / mirror / code / Atom feed
* Is there any interest in indentation patches?
@ 2008-07-20  0:21 Richard Hartmann
  2008-07-20  5:40 ` Andrey Borzenkov
  2008-07-20  8:05 ` Bart Schaefer
  0 siblings, 2 replies; 8+ messages in thread
From: Richard Hartmann @ 2008-07-20  0:21 UTC (permalink / raw)
  To: Zsh hackers list

I have been going through a few functions and there is no clear style
when it comes to indentation. Some files use whitespaces, some use tabs,
many use a combination of the two. Some use 2 chars, some use 4. No idea
if the commit noise is wanted, but I could prepare a batch of patches to
fix this. It's work no one wants to do, anyway :p

Is that wasted effort or a worthwhile thing to do?


Richard


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

* Re: Is there any interest in indentation patches?
  2008-07-20  0:21 Is there any interest in indentation patches? Richard Hartmann
@ 2008-07-20  5:40 ` Andrey Borzenkov
  2008-07-20  8:33   ` Richard Hartmann
  2008-07-20  8:05 ` Bart Schaefer
  1 sibling, 1 reply; 8+ messages in thread
From: Andrey Borzenkov @ 2008-07-20  5:40 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 835 bytes --]

On Sunday 20 July 2008, Richard Hartmann wrote:
> 
> I have been going through a few functions and there is no clear style
> when it comes to indentation. Some files use whitespaces, some use tabs,
> many use a combination of the two. Some use 2 chars, some use 4. No idea
> if the commit noise is wanted, but I could prepare a batch of patches to
> fix this. It's work no one wants to do, anyway :p
> 

If you will start it, may I ask to add standard mode lines for vi
(and possibly emacs) so that selected style is ensured in the future?

> Is that wasted effort or a worthwhile thing to do?
> 

In general, I guess, yes. The main problem with functions is they
have overly long lines, specifically where _arguments is used.

May be we could switch off line folding although I always has mixed
feelings about it.

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: Is there any interest in indentation patches?
  2008-07-20  0:21 Is there any interest in indentation patches? Richard Hartmann
  2008-07-20  5:40 ` Andrey Borzenkov
@ 2008-07-20  8:05 ` Bart Schaefer
  2008-07-20  8:37   ` Richard Hartmann
  1 sibling, 1 reply; 8+ messages in thread
From: Bart Schaefer @ 2008-07-20  8:05 UTC (permalink / raw)
  To: Zsh hackers list

On Jul 20,  2:21am, Richard Hartmann wrote:
}
} I have been going through a few functions

You mean shell functions as opposed to C functions?

} and there is no clear style when it comes to indentation. Some files
} use whitespaces, some use tabs, many use a combination of the two.
} Some use 2 chars, some use 4. No idea if the commit noise is wanted,
} but I could prepare a batch of patches to fix this.

My personal preference would be that this NOT be done.  It makes it
difficult to see from one file revision to the next what's a semantic
change and what was merely whitespace being fixed up.

It's one thing if the indentation is actually so bad that it impairs
readability -- in that case I'd be more inclined to fix it.  Changing
strictly for the sake of consistency does not seem to me worthwhile.
To maintain it going forward, we'd have to implement a policy of
reformatting every function that is contributed to the sources.


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

* Re: Is there any interest in indentation patches?
  2008-07-20  5:40 ` Andrey Borzenkov
@ 2008-07-20  8:33   ` Richard Hartmann
  2008-07-20  9:49     ` Nikolai Weibull
  0 siblings, 1 reply; 8+ messages in thread
From: Richard Hartmann @ 2008-07-20  8:33 UTC (permalink / raw)
  To: Andrey Borzenkov; +Cc: zsh-workers

On Sun, Jul 20, 2008 at 07:40, Andrey Borzenkov <arvidjaar@newmail.ru> wrote:

> If you will start it, may I ask to add standard mode lines for vi
> (and possibly emacs) so that selected style is ensured in the future?

Yes, if I do it, that would be a Good Thing.


> In general, I guess, yes. The main problem with functions is they
> have overly long lines, specifically where _arguments is used.

Should be doable :)


Richard


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

* Re: Is there any interest in indentation patches?
  2008-07-20  8:05 ` Bart Schaefer
@ 2008-07-20  8:37   ` Richard Hartmann
  0 siblings, 0 replies; 8+ messages in thread
From: Richard Hartmann @ 2008-07-20  8:37 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: Zsh hackers list

On Sun, Jul 20, 2008 at 10:05, Bart Schaefer <schaefer@brasslantern.com> wrote:

> You mean shell functions as opposed to C functions?

Yes.


> My personal preference would be that this NOT be done.  It makes it
> difficult to see from one file revision to the next what's a semantic
> change and what was merely whitespace being fixed up.

Yes, that is the the one huge downside of whitespace commits.
If there was a single coding style, that one huge commit would
(possibly) be OK. That is exactly why I asked the ML.


> It's one thing if the indentation is actually so bad that it impairs
> readability -- in that case I'd be more inclined to fix it.  Changing
> strictly for the sake of consistency does not seem to me worthwhile.
> To maintain it going forward, we'd have to implement a policy of
> reformatting every function that is contributed to the sources.

Once the initial effort is finished, maintaining the status quo could
be done via commit hooks and a little checker script.


Richard


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

* Re: Is there any interest in indentation patches?
  2008-07-20  8:33   ` Richard Hartmann
@ 2008-07-20  9:49     ` Nikolai Weibull
  2008-07-20 12:17       ` Richard Hartmann
  0 siblings, 1 reply; 8+ messages in thread
From: Nikolai Weibull @ 2008-07-20  9:49 UTC (permalink / raw)
  To: Richard Hartmann; +Cc: Andrey Borzenkov, zsh-workers

On Sun, Jul 20, 2008 at 10:33, Richard Hartmann
<richih.mailinglist@gmail.com> wrote:

> On Sun, Jul 20, 2008 at 07:40, Andrey Borzenkov <arvidjaar@newmail.ru> wrote:

>> If you will start it, may I ask to add standard mode lines for vi
>> (and possibly emacs) so that selected style is ensured in the future?

> Yes, if I do it, that would be a Good Thing.

Please don't.  Adding mode-lines is not the right way to maintain
consistency.  Commit hooks, as you mention elsewhere, are far
superior.


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

* Re: Is there any interest in indentation patches?
  2008-07-20  9:49     ` Nikolai Weibull
@ 2008-07-20 12:17       ` Richard Hartmann
  2008-07-20 16:10         ` Nikolai Weibull
  0 siblings, 1 reply; 8+ messages in thread
From: Richard Hartmann @ 2008-07-20 12:17 UTC (permalink / raw)
  To: Nikolai Weibull; +Cc: Andrey Borzenkov, zsh-workers

On Sun, Jul 20, 2008 at 11:49, Nikolai Weibull <now@bitwi.se> wrote:

> Please don't.  Adding mode-lines is not the right way to maintain
> consistency.  Commit hooks, as you mention elsewhere, are far
> superior.

The modeline I would have the most interest in would be

  set ft=zsh

so my highlighting works correctly :)


Richard


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

* Re: Is there any interest in indentation patches?
  2008-07-20 12:17       ` Richard Hartmann
@ 2008-07-20 16:10         ` Nikolai Weibull
  0 siblings, 0 replies; 8+ messages in thread
From: Nikolai Weibull @ 2008-07-20 16:10 UTC (permalink / raw)
  To: Richard Hartmann; +Cc: Andrey Borzenkov, zsh-workers

On Sun, Jul 20, 2008 at 14:17, Richard Hartmann
<richih.mailinglist@gmail.com> wrote:
> On Sun, Jul 20, 2008 at 11:49, Nikolai Weibull <now@bitwi.se> wrote:

>> Please don't.  Adding mode-lines is not the right way to maintain
>> consistency.  Commit hooks, as you mention elsewhere, are far
>> superior.

> The modeline I would have the most interest in would be
>
>  set ft=zsh
>
> so my highlighting works correctly :)

That will be fixed in Vim 7.3.  Bram didn't want to add my addition to
$VIMRUNTIME/scripts.vim before 7.2.  Anyway, it will look for

  emulate zsh

and the like, which should be in more or less every Zsh script anyway.

Also, you can always add your own patterns to your own filetype.vim, for example

au BufNewFile,BufRead /usr/share/zsh/**/* setf  zsh

(or something similar).


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

end of thread, other threads:[~2008-07-20 16:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-20  0:21 Is there any interest in indentation patches? Richard Hartmann
2008-07-20  5:40 ` Andrey Borzenkov
2008-07-20  8:33   ` Richard Hartmann
2008-07-20  9:49     ` Nikolai Weibull
2008-07-20 12:17       ` Richard Hartmann
2008-07-20 16:10         ` Nikolai Weibull
2008-07-20  8:05 ` Bart Schaefer
2008-07-20  8:37   ` Richard Hartmann

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).