Warren Young wrote:
> Rick Gutleber wrote:
>> Ah, tabs, the bane of my existence, which is why I made a point to
>> never use them about, oh, 20 years ago.
> I'd be happier using spaces if the editors I used would treat them
> exactly like tabs. :) Some editors the kids are using these days
> don't quite get how to do this. If it takes me 4 keystrokes to cursor
> through an indent level, I'm back to tabs.
That's a great idea. I'm sure any smart editor can be made to do that.
The one I use doesn't have that option, but I know how to make it do
it. In fact, I think I'll try it out.
>> I realized there were whitespace changes in the patch, some of which
>> seemed to have been caused by trailing white space on lines (which I
>> have my editor set to strip) in addition to tabs vs. spaces. I redid
>> my changes to eliminate some of it, but should have done more.
> It can be tricky to back such changes out, because it isn't obvious
> what whitespace is needed to pacify svn's diff.
"set list" in vi shows tabs as "^I". Doing a side-by-side comparison is
then trivial. Turns out there are trailing spaces _and_ tabs on some lines.
> I find that the simplest method is to make a copy of the patch file,
> revert your changes, hand-hack the patch to remove the unwanted change
> lines, and reapply it. The hard part is not breaking the patch, which
> is why you keep a pristine copy. Do this enough times and you figure
> out what's precious to patch(1) and what isn't.
That's exactly what I did. In the future, I simply need to use an
editor (or change the settings on mine) that doesn't touch anything you
don't explicitly edit. I have Multi-edit* set to automatically strip
trailing blanks and use spaces (it converts tabs on line you touch).
For diffs I use this:
alias svndiff='svn diff --diff-cmd /usr/bin/diff --extensions
'\''--expand-tabs --ignore-all-space --ignore-blank-lines
--ignore-space-change --minimal'\'' '
so those little, syntactically neutral changes don't make noise.
*Yes, I'm still wedded to doing editing in a Windows program, I've been
using it since 1988, back when it was a simple DOS program written in
Turbo Pascal, sorry, I've got too much momentum to get serious about
learning vi for more than the basics. ME is now very dated, but it does
what I want. I'd actually like to get them to let me switch my desktop
at work to Linux, in which case I like Kate and find jEdit pretty good,
and there are tons of other options... and I could even learn hardcore
vi... it is very streamlined. But when Multi-edit is an option I go
with that. I've got muscle-memories so engrained my children were born
with them. ;-)