Hardcoded editor variables

13 views
Skip to first unread message

Bjarke Roune

unread,
Sep 11, 2012, 6:04:32 AM9/11/12
to lela-...@googlegroups.com
The code files in LELA that I've been looking at contain this at the bottom

// Local Variables:
// mode: C++
// tab-width: 8
// indent-tabs-mode: t
// c-basic-offset: 8
// End:

// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s:syntax=cpp.doxygen:foldmethod=syntax

I finally realized that this is the reason that I have been unable to set the tab space for viewing this code in Emacs to 4 without manually reloading the editor mode for each file. Is there a rationale for forcing editor settings in this way?

Bradford Hovinen

unread,
Sep 11, 2012, 6:57:21 AM9/11/12
to lela-...@googlegroups.com
Hello again Bjarke,

Yes, these lines are there to enforce a common indentation-style
throughout the library. I wish to avoid that changes are committed
with different indentation-styles, since that would make the code
unreadable after a while and is hard to undo without losing history.

Best regards,

-Bradford Hovinen

2012/9/11 Bjarke Roune <bjarke...@gmail.com>:

ederc

unread,
Sep 13, 2012, 2:48:15 AM9/13/12
to lela-...@googlegroups.com
Hi Bradford,

the problem I see is that there are lines with over 260 characters in LELA. As you possibly remember, on my laptop display with a width of only 1280 pixels it is nearly impossible for me to read files with such long lines. Also I know that this will mean a lot of dull work we need to find some solution for this.

Chris

Bradford Hovinen

unread,
Sep 14, 2012, 2:52:58 AM9/14/12
to lela-...@googlegroups.com
Hi Chris,

The problem is that by changing the indentation-style we effectively
lose the whole change-history.

Can you tell me which sections of code are particularly problematic?
Perhaps we can rearrange the code to reduce its width.

-Bradford

2012/9/13 ederc <ed...@mathematik.uni-kl.de>:

Bjarke Roune

unread,
Sep 16, 2012, 6:03:15 AM9/16/12
to lela-...@googlegroups.com
Hi Bradford,

Though this isn't as important as being able to read LELA source code on a smaller screen, it would also be nice to be able to have 2 files side-by-side in an IDE on a wide screen monitor or to be able to read LELA source files on Github (offers a maximum of 124 characters width):

  https://github.com/Singular/LELA/blob/master/lela/algorithms/faugere-lachartre.tcc

Long lines exist throughout the codebase. I think it will be difficult to achieve these goals without both decreasing the indentation level and adding line breaks to lines longer than some fixed number like 80 or 100. We could apply a new whitespace style while editing code for other reasons, slowly converging on a new style.

I was looking at ways to preserve history, and there are some techniques here, on either rewriting history or making git blame ignore whitespace changes:

  http://stackoverflow.com/questions/4112410/git-change-styling-whitespace-without-changing-ownership-blame

Cheers
Bjarke

Bradford Hovinen

unread,
Sep 18, 2012, 9:01:37 AM9/18/12
to lela-...@googlegroups.com
Hello all,

I'm okay with reducing the identation-size to four spaces (but no
fewer -- otherwise the code becomes really hard to read) if:

- It is done without losing change-history
- It is done uniformly on all files in the three
- The Emacs-directives in all the files are correspondingly changed,
so that future changes also use the new indentation-style.

If anyone wishes to undertake this change and can guarantee that the
three conditions above will be satisfied, then that person has my
blessing.

Best regards,

-Bradford Hovinen

2012/9/16 Bjarke Roune <bjarke...@gmail.com>:
Reply all
Reply to author
Forward
0 new messages