all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: charles@aurox.ch (Charles A. Roelli)
Cc: 32991@debbugs.gnu.org
Subject: bug#32991: 27.0.50; diff-auto-refine-mode a no-op
Date: Sun, 13 Jan 2019 18:33:15 -0500	[thread overview]
Message-ID: <jwvva2si1e7.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <m24lacwcj2.fsf@aurox.ch> (Charles A. Roelli's message of "Sun, 13 Jan 2019 21:03:29 +0100")

> -(defcustom diff-font-lock-refine t
> -  "If non-nil, font-lock highlighting includes hunk refinement."
> +(defcustom diff-refine 'font-lock
> +  "If non-nil, enable hunk refinement.
> +
> +The value `font-lock' means to refine during font-lock.
> +The value `navigation' means to refine each hunk as you visit it
> +with `diff-hunk-next' or `diff-hunk-prev'.
> +
> +You can always manually refine a hunk with `diff-refine-hunk'."
>    :version "27.1"
> -  :type 'boolean)
> +  :type '(choice (const :tag "Don't refine hunks" nil)
> +                 (const :tag "Refine hunks during font-lock" font-lock)
> +                 (const :tag "Refine hunks during navigation" navigation)))

Good.

> -(define-minor-mode diff-auto-refine-mode
> -  "Toggle automatic diff hunk finer highlighting (Diff Auto Refine mode).
> -
> -Diff Auto Refine mode is a buffer-local minor mode used with
> -`diff-mode'.  When enabled, Emacs automatically highlights
> -changes in detail as the user visits hunks.  When transitioning
> -from disabled to enabled, it tries to refine the current hunk, as
> -well."
> -  :group 'diff-mode :init-value t :lighter nil ;; " Auto-Refine"
> -  (when diff-auto-refine-mode
> -    (condition-case-unless-debug nil (diff-refine-hunk) (error nil))))

I think for backward compatiblity reason, we should keep this minor
mode, tho mark it obsolete and change its code to set diff-refine to
`navigation`.

> -;; Define diff-{hunk,file}-{prev,next}
> -(easy-mmode-define-navigation
> - diff-hunk diff-hunk-header-re "hunk" diff-end-of-hunk diff-restrict-view
[...]
> +(defun diff-hunk-next (&optional count interactive)
[...]
> +(defun diff-hunk-prev (&optional count interactive)

This change seems unrelated.  I'd rather we stick to the refinement itself.

>  ;; Define smerge-next and smerge-prev
>  (easy-mmode-define-navigation smerge smerge-begin-re "conflict" nil nil
> -  (if diff-auto-refine-mode
> +  (if (eq diff-refine 'navigation)
>        (condition-case nil (smerge-refine) (error nil))))

Hmm... I want to set my `diff-refined` to `font-lock` yet I also want my
smerge conflicts to be refined when I navigate to them.
Maybe the test here should be just whether diff-refine is non-nil?


        Stefan





  reply	other threads:[~2019-01-13 23:33 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-08 18:30 bug#32991: 27.0.50; diff-auto-refine-mode a no-op Charles A. Roelli
2018-10-08 21:00 ` Stefan Monnier
2018-10-09 19:15   ` Charles A. Roelli
2018-10-09 19:54     ` Stefan Monnier
2018-10-10 18:31       ` Charles A. Roelli
2018-10-10 19:21         ` Stefan Monnier
2018-10-13 13:42           ` Charles A. Roelli
2018-10-13 18:51             ` Stefan Monnier
2019-01-13 14:36           ` Charles A. Roelli
2019-01-13 20:03             ` Charles A. Roelli
2019-01-13 23:33               ` Stefan Monnier [this message]
2019-01-15 20:25                 ` Charles A. Roelli
2019-02-11 20:14                   ` Stefan Monnier
2019-02-18 19:06                     ` Charles A. Roelli
2019-02-18 20:44                       ` Stefan Monnier
2019-02-24 16:12                         ` Charles A. Roelli
2019-02-27 15:04                           ` Stefan Monnier
2019-03-03 20:51                             ` Charles A. Roelli
2019-03-05 21:38                               ` Juri Linkov
2019-03-07 19:23                                 ` Charles A. Roelli
2019-01-30 21:04                 ` Juri Linkov
2019-02-01  7:38                   ` Stefan Monnier
2019-02-03 11:42                     ` Charles A. Roelli
2019-02-03 12:37                       ` Stefan Monnier
2019-02-03 14:19                         ` Charles A. Roelli
2019-02-11 20:15                           ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvva2si1e7.fsf-monnier+emacsbugs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=32991@debbugs.gnu.org \
    --cc=charles@aurox.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.