all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Diff could also show the changes within lines
@ 2012-10-05 14:37 Tom
  2012-10-05 14:39 ` Drew Adams
  2012-10-05 15:09 ` chandan r
  0 siblings, 2 replies; 53+ messages in thread
From: Tom @ 2012-10-05 14:37 UTC (permalink / raw)
  To: help-gnu-emacs

When doing diffs it often occurs to me the diff output could be
more readable if it showed the actual changes within lines.

Something like this (I mean the concept, the actual implemenation shown
may not be the best output which can be achieved), so you don't have to
search for the changes within the line:

http://stackoverflow.com/questions/1265949/multiple-changes-in-one-line-with-diff-
tool/1266114#1266114

It doesn't even necessarily need support from the external diff tool,
because diffs are usually not huge, so the highlighting of the changes
could be done in lisp by parsing the diff output.

Has anyone tried improving diff like this? Is there a package which does 
this?




^ permalink raw reply	[flat|nested] 53+ messages in thread
* Diff could also show the changes within lines
@ 2014-02-07 16:50 Sebastien Vauban
  2014-02-08  4:58 ` Michael Heerdegen
       [not found] ` <mailman.14135.1391835521.10748.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 53+ messages in thread
From: Sebastien Vauban @ 2014-02-07 16:50 UTC (permalink / raw)
  To: help-gnu-emacs-mXXj517/zsQ

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


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

end of thread, other threads:[~2014-03-21 11:46 UTC | newest]

Thread overview: 53+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-05 14:37 Diff could also show the changes within lines Tom
2012-10-05 14:39 ` Drew Adams
2012-10-05 14:47   ` Tom
2012-10-05 16:32   ` Doug Lewan
2012-10-05 15:09 ` chandan r
2012-10-05 14:57   ` Tom
2012-10-05 16:26     ` Tom
2012-10-05 18:11       ` Tom
     [not found]       ` <mailman.10388.1349460693.855.help-gnu-emacs@gnu.org>
2012-11-10  8:58         ` Sebastien Vauban
2012-11-10 15:30           ` Tom
2012-11-12 20:00             ` Oleksandr Gavenko
2012-11-13  8:45               ` Tom
     [not found]           ` <mailman.12687.1352561429.855.help-gnu-emacs@gnu.org>
2012-11-14 14:31             ` Sebastien Vauban
2012-11-14 18:03               ` Tom
     [not found]               ` <mailman.12981.1352916228.855.help-gnu-emacs@gnu.org>
2012-11-14 22:07                 ` Sebastien Vauban
2012-11-15  6:36                   ` Tom
     [not found]                   ` <mailman.13015.1352961428.855.help-gnu-emacs@gnu.org>
2012-11-15 10:04                     ` Sebastien Vauban
2012-11-15 10:15                       ` Tom
     [not found]                       ` <mailman.13023.1352974557.855.help-gnu-emacs@gnu.org>
2012-11-15 11:29                         ` Sebastien Vauban
2012-11-15 12:30                           ` Tom
     [not found]                           ` <mailman.13025.1352982671.855.help-gnu-emacs@gnu.org>
2012-11-15 15:20                             ` Sebastien Vauban
2012-11-15 16:32                               ` Tom
2012-11-16 15:30                                 ` Stefan Monnier
2012-11-16 16:40                                   ` Tom
     [not found]                                   ` <mailman.13097.1353084086.855.help-gnu-emacs@gnu.org>
2012-11-19 14:48                                     ` Stefan Monnier
     [not found]                               ` <mailman.13033.1352997200.855.help-gnu-emacs@gnu.org>
2012-11-15 18:17                                 ` Sebastien Vauban
2012-11-15 18:53                                   ` Tom
     [not found]                                   ` <mailman.13043.1353005666.855.help-gnu-emacs@gnu.org>
2012-11-15 21:34                                     ` Sebastien Vauban
2012-11-16 16:24                                       ` Tom
2012-11-19 12:51                                       ` Sebastien Vauban
2012-11-19 17:45                                         ` Tom
     [not found]     ` <mailman.10380.1349454390.855.help-gnu-emacs@gnu.org>
2012-10-06 13:10       ` Stefan Monnier
2012-10-07 14:10         ` Tom
  -- strict thread matches above, loose matches on Subject: below --
2014-02-07 16:50 Sebastien Vauban
2014-02-08  4:58 ` Michael Heerdegen
     [not found] ` <mailman.14135.1391835521.10748.help-gnu-emacs@gnu.org>
2014-02-08 12:53   ` Sebastien Vauban
2014-02-10 15:55   ` Sebastien Vauban
2014-02-12 11:35     ` Michael Heerdegen
     [not found]     ` <mailman.14857.1392204947.10748.help-gnu-emacs@gnu.org>
2014-02-18 10:09       ` Sebastien Vauban
2014-02-18 11:01         ` Sebastien Vauban
2014-02-18 11:02           ` Sebastien Vauban
2014-02-18 16:07             ` Michael Heerdegen
     [not found]             ` <mailman.15440.1392739818.10748.help-gnu-emacs@gnu.org>
2014-02-18 19:01               ` Sebastien Vauban
2014-02-18 22:12                 ` Michael Heerdegen
     [not found]                 ` <mailman.15497.1392761564.10748.help-gnu-emacs@gnu.org>
2014-02-19 11:08                   ` Sebastien Vauban
2014-02-19 17:54                     ` Michael Heerdegen
2014-02-18 13:40           ` Stefan Monnier
2014-02-18 16:08             ` Michael Heerdegen
2014-02-18 16:04         ` Michael Heerdegen
2014-02-18 16:04         ` Michael Heerdegen
2014-02-18 16:05         ` Michael Heerdegen
2014-03-20 13:31       ` Sebastien Vauban
2014-03-21 11:46         ` Michael Heerdegen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.