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


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Jonas Bernoulli <jonas <at> bernoul.li>
Cc: 78806 <at> debbugs.gnu.org
Subject: bug#78806: [PATCH] (smerge-refine-region): Add support for a virtual "other cursor"
Date: Thu, 26 Jun 2025 12:52:59 -0400
> 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.

Oh, my, I hadn't noticed that I included this part of my local hacks.
It's not directly related to the shadow-cursor (well, except that
I coded it at the same time some months ago).

The misalignment makes it definitely not acceptable (at least for the
default config).  I've now commented out that code.

> Using (space :width 0.1) instead of (space :width 0.5) helps a lot, but

It's still jarring.

> I am undecided whether this is needed at all,

It's not.  I personally want(ed?) some way to highlight the "insertion"
place, and that is the state of that current experiment.
It was not meant for `master`.

> 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.

Yup.  🙁

> 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.

That would be a nice way to provide the feature I want without
introducing the kind of misalignment that my current hack causes, yes.
It should be fairly easy to extend `:line-width` to allow
4 distinct numbers.


        Stefan





This bug report was last modified 56 days ago.

Previous Next


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