[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Diff could also show the changes within lines
From: |
Sebastien Vauban |
Subject: |
Diff could also show the changes within lines |
Date: |
Fri, 07 Feb 2014 17:50:49 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (windows-nt) |
Hello,
This code, obtained after several iterations in October 2012 [1], did work
for some time.
Though, I can't get it working anymore with GNU Emacs 24.3.50.1
(i686-pc-mingw32) of 2013-10-19.
--8<---------------cut here---------------start------------->8---
;; mode for viewing/editing context diffs
(with-eval-after-load "diff-mode"
;; highlight the changes with better granularity
(defun my-diff-make-fine-diffs ()
(interactive)
(let (diff-auto-refine-mode) ; avoid refining the hunks redundantly
...
(condition-case nil
(save-excursion
(goto-char (point-min))
(while (not (eobp))
(diff-hunk-next)
(diff-refine-hunk))) ; ... when this does it.
(error nil))
(run-at-time 0.0 nil
(lambda ()
(if (eq major-mode 'diff-mode)
;; put back the cursor only if still in a Diff buffer
;; after the delay
(goto-char (point-min)))))))
(defun my-diff-make-fine-diffs-if-necessary ()
"Auto-refine only the small regions."
(unless (> (buffer-size) 20000)
(my-diff-make-fine-diffs)))
;; enable Diff Auto-Refine mode
(add-hook 'diff-mode-hook
'my-diff-make-fine-diffs-if-necessary))
--8<---------------cut here---------------end--------------->8---
Now, while it's still being called, and still going in the `while' loop,
it does not refine any hunk anymore...
Any idea on what could go wrong?
Best regards,
Seb
[1] See
https://groups.google.com/forum/#!msg/gnu.emacs.help/-PFoXXV_RLY/W-J0rS5BZ00J
--
Sebastien Vauban
- Diff could also show the changes within lines,
Sebastien Vauban <=
- Message not available
- Re: Diff could also show the changes within lines, Sebastien Vauban, 2014/02/10
- Re: Diff could also show the changes within lines, Michael Heerdegen, 2014/02/12
- Message not available
- Re: Diff could also show the changes within lines, Sebastien Vauban, 2014/02/18
- Re: Diff could also show the changes within lines, Sebastien Vauban, 2014/02/18
- Re: Diff could also show the changes within lines, Sebastien Vauban, 2014/02/18
- Re: Diff could also show the changes within lines, Michael Heerdegen, 2014/02/18
- Message not available
- Re: Diff could also show the changes within lines, Sebastien Vauban, 2014/02/18
- Re: Diff could also show the changes within lines, Michael Heerdegen, 2014/02/18