From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Sebastien Vauban" Newsgroups: gmane.emacs.help Subject: Diff could also show the changes within lines Date: Fri, 07 Feb 2014 17:50:49 +0100 Organization: Sebastien Vauban Message-ID: <86y51mx3x2.fsf@somewhere.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1391792118 806 80.91.229.3 (7 Feb 2014 16:55:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 7 Feb 2014 16:55:18 +0000 (UTC) To: help-gnu-emacs-mXXj517/zsQ@public.gmane.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org-mXXj517/zsQ@public.gmane.org Fri Feb 07 17:55:27 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WBoi5-0001Kw-Hs for geh-help-gnu-emacs@m.gmane.org; Fri, 07 Feb 2014 17:55:25 +0100 Original-Received: from localhost ([::1]:42561 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WBoi5-0000xz-0G for geh-help-gnu-emacs@m.gmane.org; Fri, 07 Feb 2014 11:55:25 -0500 Original-Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 52 Injection-Info: mx05.eternal-september.org; posting-host="402b34550bd938aa98825778083dce0e"; logging-data="24752"; mail-complaints-to="abuse-VVbKFVtnif8H+i2N2EyTrmui9UKz+5OX@public.gmane.org"; posting-account="U2FsdGVkX1+h36dFbbueRIXR56JY8Wtk" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (windows-nt) X-Url: Under construction... X-Archive: encrypt Cancel-Lock: sha1:bmbJt+ykjwjgsmigTln1zP22cDE= sha1:3zhGbDnV4zLHiS20YiSBnJwDKbM= Original-Xref: usenet.stanford.edu gnu.emacs.help:203696 X-BeenThere: help-gnu-emacs-mXXj517/zsQ@public.gmane.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org-mXXj517/zsQ@public.gmane.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org-mXXj517/zsQ@public.gmane.org Xref: news.gmane.org gmane.emacs.help:95966 Archived-At: 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