From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.emacs.devel Subject: Re: toggling diff-auto-refine Date: Sun, 30 Dec 2007 18:03:22 +0100 Message-ID: <87tzm0nmhx.fsf@ambire.localdomain> References: <87prwpr42e.fsf@ambire.localdomain> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1199034349 24968 80.91.229.12 (30 Dec 2007 17:05:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 30 Dec 2007 17:05:49 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 30 18:06:04 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1J91bP-0001JQ-R2 for ged-emacs-devel@m.gmane.org; Sun, 30 Dec 2007 18:05:44 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J91b3-0008RT-FG for ged-emacs-devel@m.gmane.org; Sun, 30 Dec 2007 12:05:09 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J91ay-0008RB-Tz for emacs-devel@gnu.org; Sun, 30 Dec 2007 12:05:04 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J91ay-0008Qw-Km for emacs-devel@gnu.org; Sun, 30 Dec 2007 12:05:04 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J91ay-0008Qt-B7 for emacs-devel@gnu.org; Sun, 30 Dec 2007 12:05:04 -0500 Original-Received: from ppp-64-39.21-151.libero.it ([151.21.39.64] helo=ambire.localdomain) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1J91ax-0002Gc-KE for emacs-devel@gnu.org; Sun, 30 Dec 2007 12:05:04 -0500 Original-Received: from ttn by ambire.localdomain with local (Exim 4.63) (envelope-from ) id 1J91ZK-0001fx-9O for emacs-devel@gnu.org; Sun, 30 Dec 2007 18:03:22 +0100 In-Reply-To: <87prwpr42e.fsf@ambire.localdomain> (Thien-Thi Nguyen's message of "Sat, 29 Dec 2007 15:03:21 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:85694 Archived-At: --=-=-= i see that smerge-mode.el has a similar feature, so now have expanded the initial proposal slightly. patch description: Merge `smerge-auto-refine' and `diff-auto-refine' variables into `diff-auto-refine' minor mode. motivation: for convenience. w/o the minor mode, you have to do M-: (setq diff-auto-refine (not diff-auto-refine)) RET followed by `C-c C-b' (diff-refine-hunk) when you want it. w/ the minor mode, you can do M-x diff-auto-refine RET entry for lisp/ChangeLog: * smerge-mode.el: Require diff-mode when compiling. (smerge-auto-refine): Delete defcustom var. (smerge-next, smerge-prev): Use diff-auto-refine. * diff-mode.el (diff-auto-refine): Delete defcustom var. (diff-auto-refine): New minor mode (command + var). diff below. any objections? thi _______________________________________________________ --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=.ttn.diff-auto-refine.diff *** lisp/smerge-mode.el.~1.58.~ Fri Nov 23 08:59:10 2007 --- lisp/smerge-mode.el Sun Dec 30 17:23:09 2007 *************** *** 46,52 **** ;;; Code: ! (eval-when-compile (require 'cl)) ;;; The real definition comes later. --- 46,52 ---- ;;; Code: ! (eval-when-compile (require 'cl) (require 'diff-mode)) ;;; The real definition comes later. *************** *** 79,89 **** :group 'smerge :type 'boolean) - (defcustom smerge-auto-refine t - "Automatically highlight changes in detail as the user visits conflicts." - :group 'smerge - :type 'boolean) - (defface smerge-mine '((((min-colors 88) (background light)) (:foreground "blue1")) --- 79,84 ---- *************** *** 258,264 **** ;; Define smerge-next and smerge-prev (easy-mmode-define-navigation smerge smerge-begin-re "conflict" nil nil ! (if smerge-auto-refine (condition-case nil (smerge-refine) (error nil)))) (defconst smerge-match-names ["conflict" "mine" "base" "other"]) --- 253,259 ---- ;; Define smerge-next and smerge-prev (easy-mmode-define-navigation smerge smerge-begin-re "conflict" nil nil ! (if diff-auto-refine (condition-case nil (smerge-refine) (error nil)))) (defconst smerge-match-names ["conflict" "mine" "base" "other"]) *** lisp/diff-mode.el.~1.122.~ Tue Oct 30 11:53:38 2007 --- lisp/diff-mode.el Sun Dec 30 17:18:58 2007 *************** *** 90,100 **** :type 'boolean :group 'diff-mode) - (defcustom diff-auto-refine t - "Automatically highlight changes in detail as the user visits hunks." - :type 'boolean - :group 'diff-mode) - (defcustom diff-mode-hook nil "Run after setting up the `diff-mode' major mode." :type 'hook --- 90,95 ---- *************** *** 198,203 **** --- 193,209 ---- `((,diff-minor-mode-prefix . ,diff-mode-shared-map)) "Keymap for `diff-minor-mode'. See also `diff-mode-shared-map'.") + (define-minor-mode diff-auto-refine + "Automatically highlight changes in detail as the user visits hunks. + Additionally, when in Diff mode, refine the current hunk. + When not in Diff mode, clear variable `diff-auto-refine' unconditionally." + :group 'diff-mode :init-value nil :lighter " Auto-Refine" + ;; If the "auto refinement" concept becomes useful in + ;; other contexts, we can remove this sanity check. --ttn + (setq diff-auto-refine (when (eq 'diff-mode major-mode) + diff-auto-refine)) + (when diff-auto-refine + (condition-case-no-debug nil (diff-refine-hunk) (error nil)))) ;;;; ;;;; font-lock support *** etc/NEWS.~1.1632.~ Sat Dec 29 01:19:53 2007 --- etc/NEWS Sun Dec 30 17:24:36 2007 *************** *** 258,267 **** This is enabled if isearch-buffers-multi is non-nil. ** smerge-refine highlights word-level details of changes in conflict. - It's used automatically as you move through conflicts, see smerge-auto-refine. - ** diff-refine-hunk highlights word-level details of changes in a diff hunk. ! It's used automatically as you move through hunks, see diff-auto-refine. ** archive-mode has basic support to browse Rar archives. --- 258,266 ---- This is enabled if isearch-buffers-multi is non-nil. ** smerge-refine highlights word-level details of changes in conflict. ** diff-refine-hunk highlights word-level details of changes in a diff hunk. ! Both of these can be done automatically as you move through hunks. ! See diff-auto-refine. ** archive-mode has basic support to browse Rar archives. Diffs between working revision and workfile end here. --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --=-=-=--