help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: idle-timer for processing all buffers with selected minor-mode.


From: Tom
Subject: Re: idle-timer for processing all buffers with selected minor-mode.
Date: Sun, 28 Oct 2012 19:38:31 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Oleksandr Gavenko <gavenkoa <at> gmail.com> writes:

> 
> While I playing with dumb implementation for:
> 
>   http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12747
> 
> I got question. Firstly what I think (is I right?):
> 
>   Emacs allow move complicate job to time when it idle by using
>   'run-with-idle-timer'. 


A hook is better in this case. This is what I use for 
refining all chunks automatically:


(add-hook 'diff-mode-hook 'my-diff-stuff)

(defun my-diff-stuff ()
  (unless (or (eq this-command 'dvc-diff)
              (eq this-command 'dvc-generic-refresh)
              (> (buffer-size) 20000))
    (my-refine-all-diff-hunks)))


(defun my-refine-all-diff-hunks ()
  (interactive)
  (condition-case nil      
      (save-excursion
        (goto-char (point-min))
        (while (not (eobp))
          (diff-hunk-next)))
    (error nil)))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]