[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [elpa] externals/corfu a44c778 1/2: Yet another hack: posn-at-point
Re: [elpa] externals/corfu a44c778 1/2: Yet another hack: posn-at-point computation returns wrong y-coordinate on Emacs 28
Fri, 16 Jul 2021 02:46:48 +0200
On 7/15/21 4:07 PM, Stefan Monnier wrote:
>> Yet another hack: posn-at-point computation returns wrong y-coordinate
>> on Emacs 28
>> - (pos (posn-x-y (posn-at-point pos))))
>> + ;;; XXX HACK y-coordinate position computation is wrong
>> + ;;; if there exists a flymake underline overlay at that point.
>> + ;;; Take the y coordinate from the current point.
>> + (x (car (posn-x-y (posn-at-point pos))))
>> + (y (cdr (posn-x-y (posn-at-point (point))))))
> I would generally recommend against adding workarounds for bugs in
> development versions of Emacs (at least not before reporting the
> bug and also not before finding out that the bug won't be fixed
> promptly). Also I'd recommend making it clear in the code via
> comments and/or via version tests that this is a workaround for
> a specific bug in a specific version.
I agree with that. However I want to use the package now. There are
already many Emacs 28 users out there.
> PS: This is a general recommendation. I don't know if you've filed
> a bug report for it yet.
Not yet, for now I am only collecting and marking hacks and workarounds
in the code. There are already many workarounds for bugs in child
frames. The same applies to the Posframe package.
I've just recently discussed the child frame issues with Tassilo
(cc'ed), who stumbled over another issue, where the window manager Sway
ignored the no-accept-focus option, because Wayland does not support it.
Therefore Corfu and Posframe have to work around it. All these hacks and
workarounds are better done directly in the Emacs child frame/display
code, or even better in Gtk (in the case of Emacs pgtk) instead of
affecting every package, which uses the child frame API.