GNU bug report logs - #78806
[PATCH] (smerge-refine-region): Add support for a virtual "other cursor"

Previous Next

Package: emacs;

Reported by: Stefan Monnier <monnier <at> iro.umontreal.ca>

Date: Mon, 16 Jun 2025 11:12:01 UTC

Severity: normal

Tags: patch

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


Message #25 received at 78806 <at> debbugs.gnu.org (full text, mbox):

From: Jonas Bernoulli <jonas <at> bernoul.li>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 78806 <at> debbugs.gnu.org
Subject: Re: bug#78806: [PATCH] (smerge-refine-region): Add support for a
 virtual "other cursor"
Date: Thu, 26 Jun 2025 17:08:59 +0200
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

> The patch below adds support to `smerge-refine-region` for keeping
> a kind of "virtual cursor" that shows the "corresponding" point in the
> other part of a diff.

Neat!

Unfortunately the before-string added by smerge--refine-highlight-change
result in misalignment, making it hard to be confident about the
correctness of whitespace changes when looking at diffs only.

Using (space :width 0.1) instead of (space :width 0.5) helps a lot, but
if there are multiple instances on a single line, their widths add up.
If there are multiple such items on a line, it also gets quite noisy,
to the point of being distracting.  Maybe I'll get used to that after
a while; the feature is too new to tell.

I am undecided whether this is needed at all, and suspect it is not just
a matter of familiarity but also personal taste.  I.e., the width should
probably be customizable and zero should be one of the valid values.

I have experimented with using an "incomplete box" instead of a before-
string.

-              (overlay-put ol (if (= beg olbeg) 'before-string 'after-string)
-                           (propertize
-                            " " (car-safe x) (cdr-safe x)
-                            'display '(space :width 0.5)))))
+              (overlay-put ol 'face '(:box (:line-width (-2 . 0) :style nil)))))

Unfortunately that draws two lines.

It would be nice if the widths of the four sides of a box could be set
individually, not just in pairs.  (Adding two new overlay properties
before-line and after-line, which handle negative values the same as
the :line-width of :box, might also be an option.)  I am bringing such
lines up in the context of this new feature, but this is not the first
time I wished something like this existed.

     Cheers,
     Jonas




This bug report was last modified 55 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.