all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* fine differences for entire diff in diff mode
@ 2018-06-19 20:02 Samuel Wales
  2018-07-05 18:55 ` Samuel Wales
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Samuel Wales @ 2018-06-19 20:02 UTC (permalink / raw)
  To: help-gnu-emacs

i know that i can do fine differences for a hunk.

is there a command to do fine differences for the entire buffer?

thanks.



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

* Re: fine differences for entire diff in diff mode
  2018-06-19 20:02 fine differences for entire diff in diff mode Samuel Wales
@ 2018-07-05 18:55 ` Samuel Wales
  2018-07-06 16:06 ` Keith Waclena
  2018-07-11 14:28 ` Stefan Monnier
  2 siblings, 0 replies; 8+ messages in thread
From: Samuel Wales @ 2018-07-05 18:55 UTC (permalink / raw)
  To: help-gnu-emacs

alternatively, a function rather than a command.

On 6/19/18, Samuel Wales <samologist@gmail.com> wrote:
> i know that i can do fine differences for a hunk.
>
> is there a command to do fine differences for the entire buffer?
>
> thanks.
>


-- 
The Kafka Pandemic: <http://thekafkapandemic.blogspot.com>

The disease DOES progress. MANY people have died from it. And ANYBODY
can get it at any time.

"You’ve really gotta quit this and get moving, because this is murder
by neglect." ---
<http://www.meaction.net/2017/02/03/pwme-people-with-me-are-being-murdered-by-neglect>.



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

* Re: fine differences for entire diff in diff mode
  2018-06-19 20:02 fine differences for entire diff in diff mode Samuel Wales
  2018-07-05 18:55 ` Samuel Wales
@ 2018-07-06 16:06 ` Keith Waclena
  2018-07-06 21:33   ` Samuel Wales
  2018-07-11 14:28 ` Stefan Monnier
  2 siblings, 1 reply; 8+ messages in thread
From: Keith Waclena @ 2018-07-06 16:06 UTC (permalink / raw)
  To: Samuel Wales; +Cc: help-gnu-emacs

Samuel Wales <samologist@gmail.com> writes:

> i know that i can do fine differences for a hunk.
>
> is there a command to do fine differences for the entire buffer?
>
> thanks.

I wanted the same thing and couldn't find it, so I wrote this:

(defun kw-diff-highlights ()
  "Plow through all the hunks in this diff, which has the side-effect of refining
the micro-differences in each."
  (save-excursion
    (goto-char (point-min))
    (let ((pr (make-progress-reporter "Refining diff hunks... ")))
      (condition-case err
          (while t                      ; loop exited when diff-hunk-next raises an error at EOB
            (progress-reporter-update pr)
            (diff-hunk-next))
        (user-error nil)
        (error (message "kw-diff-highlights: unexpected error: %S" err)))
      (progress-reporter-done pr))))

(add-hook 'diff-mode-hook 'kw-diff-highlights)


--
Keith Waclena / Arch Linux / OCaml / M-x / ATKQJ / YASD / gc'e'a' / \clef treble
http://www.lib.uchicago.edu/keith/    gpg 5DA89C7DECA0D55A
n.p.: I'll Make You Sorry (Screaming Females)



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

* Re: fine differences for entire diff in diff mode
  2018-07-06 16:06 ` Keith Waclena
@ 2018-07-06 21:33   ` Samuel Wales
  0 siblings, 0 replies; 8+ messages in thread
From: Samuel Wales @ 2018-07-06 21:33 UTC (permalink / raw)
  To: keith; +Cc: help-gnu-emacs

thank you!

it looks like you even did error handling and progress report.


On 7/6/18, Keith Waclena <keith@lib.uchicago.edu> wrote:
> Samuel Wales <samologist@gmail.com> writes:
>
>> i know that i can do fine differences for a hunk.
>>
>> is there a command to do fine differences for the entire buffer?
>>
>> thanks.
>
> I wanted the same thing and couldn't find it, so I wrote this:
>
> (defun kw-diff-highlights ()
>   "Plow through all the hunks in this diff, which has the side-effect of
> refining
> the micro-differences in each."
>   (save-excursion
>     (goto-char (point-min))
>     (let ((pr (make-progress-reporter "Refining diff hunks... ")))
>       (condition-case err
>           (while t                      ; loop exited when diff-hunk-next
> raises an error at EOB
>             (progress-reporter-update pr)
>             (diff-hunk-next))
>         (user-error nil)
>         (error (message "kw-diff-highlights: unexpected error: %S" err)))
>       (progress-reporter-done pr))))
>
> (add-hook 'diff-mode-hook 'kw-diff-highlights)
>
>
> --
> Keith Waclena / Arch Linux / OCaml / M-x / ATKQJ / YASD / gc'e'a' / \clef
> treble
> http://www.lib.uchicago.edu/keith/    gpg 5DA89C7DECA0D55A
> n.p.: I'll Make You Sorry (Screaming Females)
>


-- 
The Kafka Pandemic: <http://thekafkapandemic.blogspot.com>

The disease DOES progress. MANY people have died from it. And ANYBODY
can get it at any time.

"You’ve really gotta quit this and get moving, because this is murder
by neglect." ---
<http://www.meaction.net/2017/02/03/pwme-people-with-me-are-being-murdered-by-neglect>.



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

* Re: fine differences for entire diff in diff mode
  2018-06-19 20:02 fine differences for entire diff in diff mode Samuel Wales
  2018-07-05 18:55 ` Samuel Wales
  2018-07-06 16:06 ` Keith Waclena
@ 2018-07-11 14:28 ` Stefan Monnier
  2018-07-11 16:51   ` Andy Moreton
  2018-07-21 23:39   ` Samuel Wales
  2 siblings, 2 replies; 8+ messages in thread
From: Stefan Monnier @ 2018-07-11 14:28 UTC (permalink / raw)
  To: help-gnu-emacs

> I know that i can do fine differences for a hunk.
> is there a command to do fine differences for the entire buffer?

I just pushed to Emacs's `master` branch a patch which makes all diffs
highlight with refinement automatically.  It's not quite what you asked for,
in the sense that there's no separate command and it doesn't refine the
whole diff (it's only done on-the-fly as the various hunks get
displayed, thanks to jit-lock), but I think there's a good chance it
will cover your needs ;-)


        Stefan




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

* Re: fine differences for entire diff in diff mode
  2018-07-11 14:28 ` Stefan Monnier
@ 2018-07-11 16:51   ` Andy Moreton
  2018-07-15 13:33     ` Stefan Monnier
  2018-07-21 23:39   ` Samuel Wales
  1 sibling, 1 reply; 8+ messages in thread
From: Andy Moreton @ 2018-07-11 16:51 UTC (permalink / raw)
  To: help-gnu-emacs

On Wed 11 Jul 2018, Stefan Monnier wrote:

>> I know that i can do fine differences for a hunk.
>> is there a command to do fine differences for the entire buffer?
>
> I just pushed to Emacs's `master` branch a patch which makes all diffs
> highlight with refinement automatically.  It's not quite what you asked for,
> in the sense that there's no separate command and it doesn't refine the
> whole diff (it's only done on-the-fly as the various hunks get
> displayed, thanks to jit-lock), but I think there's a good chance it
> will cover your needs ;-)
>
>
>         Stefan

This change is extremely irritiating. It is fine to introduce a new
feature, but is a regression from previous behaviour and should not be
on by default.

    AndyM




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

* Re: fine differences for entire diff in diff mode
  2018-07-11 16:51   ` Andy Moreton
@ 2018-07-15 13:33     ` Stefan Monnier
  0 siblings, 0 replies; 8+ messages in thread
From: Stefan Monnier @ 2018-07-15 13:33 UTC (permalink / raw)
  To: help-gnu-emacs

> This change is extremely irritiating. It is fine to introduce a new
> feature, but is a regression from previous behaviour and should not be
> on by default.

It's hard to address this kind of request since based on this
description I'm not even sure I know what it is "This change" is
supposed to refer to.

Please clarify what it is that irritates you.  If it's the actual fact
that "fine highlight" is displayed, then my anecdotal evidence is that
you're in the minority (which is why I enabled this by default,
currently).


        Stefan




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

* Re: fine differences for entire diff in diff mode
  2018-07-11 14:28 ` Stefan Monnier
  2018-07-11 16:51   ` Andy Moreton
@ 2018-07-21 23:39   ` Samuel Wales
  1 sibling, 0 replies; 8+ messages in thread
From: Samuel Wales @ 2018-07-21 23:39 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: help-gnu-emacs

thank you!  it will be a few years before i encounter it, when my os
upgrades.  :]  but in meantime i have kw's version.

i think it would be good as a command or funciton to turn it off when
the fine differences are too noisy and distracting.  but sometimes one
wants to turn fine differences back on.


On 7/11/18, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>> I know that i can do fine differences for a hunk.
>> is there a command to do fine differences for the entire buffer?
>
> I just pushed to Emacs's `master` branch a patch which makes all diffs
> highlight with refinement automatically.  It's not quite what you asked
> for,
> in the sense that there's no separate command and it doesn't refine the
> whole diff (it's only done on-the-fly as the various hunks get
> displayed, thanks to jit-lock), but I think there's a good chance it
> will cover your needs ;-)
>
>
>         Stefan
>
>
>


-- 
The Kafka Pandemic: <http://thekafkapandemic.blogspot.com>

The disease DOES progress. MANY people have died from it. And ANYBODY
can get it at any time.

"You’ve really gotta quit this and get moving, because this is murder
by neglect." ---
<http://www.meaction.net/2017/02/03/pwme-people-with-me-are-being-murdered-by-neglect>.



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

end of thread, other threads:[~2018-07-21 23:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-19 20:02 fine differences for entire diff in diff mode Samuel Wales
2018-07-05 18:55 ` Samuel Wales
2018-07-06 16:06 ` Keith Waclena
2018-07-06 21:33   ` Samuel Wales
2018-07-11 14:28 ` Stefan Monnier
2018-07-11 16:51   ` Andy Moreton
2018-07-15 13:33     ` Stefan Monnier
2018-07-21 23:39   ` Samuel Wales

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.