0

I've see a few similar questions:

I have tried all above and none solve problem.

Problem:

When writing in emacs and then keeping file versions tracked with git, using M-q (fill paragraph) to reorganize text causes a problem where text gets moved off line to the extent that when after a scanning edit any given line looks indistinguishable from the edited line in git. What happens is after a few changes too many lines are affected by running M-q that git has to replace multiple lines form a one word changed in one line; too many lines are effected by one small change.

example:

start text

I was reminded this as want in the section before the beide and 
having just finished my shift. The same new recruit walked on
behind me to replace me.

edited text

I was reminded of this because while in the section before the beige
and having just finished my shift. The same new recruit walked on
behind me to replace me.

from the start text to the edited text and gets pushed off to a new line, meaning that git will see both of these lines as changed.

git solution:

If sentence are put on one line, git will only see that line as having changed when the sentence is edited.

example:

start text

I was reminded this as want in the section before the beide and 
having just finished my shift.
The same new recruit walked on behind me to replace me.

edited text

I was reminded of this because while in the section before the beige
and having just finished my shift.
The same new recruit walked on behind me to replace me.

The second sentence dose not get changed it git. It now dose not matter that git will see the first 2 lines as changed because they are both the same sentence.

emacs:

I'm thinking that it would be nice to have minor mode that sets punctuation such as ., ,, ?, and !, but sometimes should be after a ' or ", but only if the preceding charter is an other punctuation, as potions in insert new lines after. It would be nice to couple this behaviour with auto-fill-mode so that this style is automatically enforced by emacs.

To re-hash above:

(setq punctuation '("." "," "?" "!"))
(if (in (at-charater) (or punctuation (dolist (x punctuation) (dolist (y '("\"" "'")) (concat x y)))))
(insert "\n")))

;; where `(at-charater)` is searching through charaters in buffer.

example of desired effect:

It is nice to eat apples.
I like carrots,
peas,
and baked beans.
I was reminded of this because while in the section before the beige
and having just finished my shift.

I said,
"This is some example text."
'And you think you can pain with these brushes?'
It was then made apparent that the subject was not the matter at hand.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.