From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#73863: 30.0.91; Unexpected cursor movement with flymake-show-diagnostics-at-end-of-line Date: Sun, 20 Oct 2024 10:28:50 +0100 Message-ID: References: <86r08dmm0h.fsf@gnu.org> <86plnxmfdt.fsf@gnu.org> <86y12kjks0.fsf@gnu.org> <86a5ezjkx8.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17729"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 73863@debbugs.gnu.org, Romain Ouabdelkader To: Eli Zaretskii , Spencer Baugh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 20 11:31:10 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1t2SHG-0004Qr-D1 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 20 Oct 2024 11:31:10 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t2SGu-00030x-Kd; Sun, 20 Oct 2024 05:30:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t2SGk-0002zH-Fj for bug-gnu-emacs@gnu.org; Sun, 20 Oct 2024 05:30:46 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t2SGj-0006yR-IN for bug-gnu-emacs@gnu.org; Sun, 20 Oct 2024 05:30:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:From:In-Reply-To:References:MIME-Version:To:Subject; bh=rMhXfl8d1GdICTXlHt8RALUhOOk7tpdBfYeBGYPEWaM=; b=V0iuDA1kZlsY1XwZaYlDjpDwtjWhcJtNAH7WiIg4kDljUQ9BjoMFGZ/r1PyMqH/FUlsQv+H7VXO52J8nS+Oi2GnptendteMpdYtSGwBcVq1VcCzmHh+ds7jGIY50+vCFykdFpb36kRPwI84GYCSUb6J3HzeSI5c0Y2PKWkGSeqeSl+lLdwrIw9s2XIV8ta32ClrSF/3XDCAEATI/WNLyI/6i7APmaBoHF00wclJhIYS6aFT291f+WfN6cBHB8XZvKYxDhePNgtZP1ivxdDRJuFEmNfXKtGlmjtoOjx/3shE5jnLssU63/x7c6jdo2A4GkZ/Cmm0VBap8ciF2dzGTLQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t2SH8-00053v-Bs for bug-gnu-emacs@gnu.org; Sun, 20 Oct 2024 05:31:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 20 Oct 2024 09:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73863 X-GNU-PR-Package: emacs Original-Received: via spool by 73863-submit@debbugs.gnu.org id=B73863.172941663519310 (code B ref 73863); Sun, 20 Oct 2024 09:31:02 +0000 Original-Received: (at 73863) by debbugs.gnu.org; 20 Oct 2024 09:30:35 +0000 Original-Received: from localhost ([127.0.0.1]:45871 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2SGg-000519-Vv for submit@debbugs.gnu.org; Sun, 20 Oct 2024 05:30:35 -0400 Original-Received: from mail-oo1-f42.google.com ([209.85.161.42]:58650) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2SGe-0004wo-3Z for 73863@debbugs.gnu.org; Sun, 20 Oct 2024 05:30:32 -0400 Original-Received: by mail-oo1-f42.google.com with SMTP id 006d021491bc7-5e5568f1b6eso1662548eaf.1 for <73863@debbugs.gnu.org>; Sun, 20 Oct 2024 02:30:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729416541; x=1730021341; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=rMhXfl8d1GdICTXlHt8RALUhOOk7tpdBfYeBGYPEWaM=; b=jBnNrUyW2fFpgibzTDeNHSW9CS8TA1Q6k2FWX/cnZkkvPjBns7xVByffZ95lBMf6Rt stPN25FatYqpJxR+GTxFz9d1RH8FnUb2Py9qw3Lz448UyxH/UkRNxQG58bo+mpiPnQSG 8zb8I5Yin7+7an7r8et9PaexTWPfPAicEyy8hp5YzuMgcR1t6SKkZ/cCdkCmydY2yCyb fkeo0r29QCO37qdTJgpuoZjBKrGyepCezdwtHtCTRzeM/V1vFLJHCBXgzAGS7J3kfMGJ yoPRkHayGzHHP+YGcmrigdRPXB6SLuVACB2/UUuWReZ8bWcPfs4cN8Pw+6+r1kQ8NEVO 5IsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729416541; x=1730021341; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rMhXfl8d1GdICTXlHt8RALUhOOk7tpdBfYeBGYPEWaM=; b=E5izk6eqiqZnaZ1znRk22u9c40fPZ8JDZoML5jGRluK9wBUxJuVvj92u7Cov1mUg/k o2+fPwnFpNdpbBenHY1/pb9ff+K3oAh/ERa/Ey5r41wX6YKmb+Ei78ELB8ReZnZbhynd eEEDRsyTrNSZRdHxsnFA1a0zVz2FUO3oXvtrMF8B8xNbbbXVnP0CJsp9p8SiMXW13Xa1 bq+6LqdWsTtm6Wy2lHIZ+kqZV6xF0jzo8jEmDXgQOD3s7CRFJa1Lm12vpdB9npYLvBIx b8TRQMg12r1oqFnN6Gf4UhdAtBEWQSq00GgoOOsmZAGNimvX+ror12mugD875RqeuZoz sNlw== X-Forwarded-Encrypted: i=1; AJvYcCXArgU5ZxdN0lV3r9YUk4D5jZ2Sf7EDTQifuvFf4/ec9xEWtv3gDj2ri/AUcAVS0Ckhv+wVbg==@debbugs.gnu.org X-Gm-Message-State: AOJu0YyQ2w1oTBrJtkB53Xee2Qinz4HexOBHfcmo4g+hYdT3wH/M0UYk 9BgqrTrwyKCvCn6D7ZPWnf1aPozOF+96oaEBIlNYZNpCvrjTcJucR4AUoF8T394N43DBPCA1jX0 I43c4pe2g3FPIPu8O2otXVbWN5sA= X-Google-Smtp-Source: AGHT+IEJWchzvivvEVRzsJ+ivgtlf6mO4TaYv8bxpZKr5dyKdnJn7hR9bZNUBXrTpLFtc1jmGgviCoDA+ih8PxGtX0U= X-Received: by 2002:a4a:b3c1:0:b0:5eb:b292:bb85 with SMTP id 006d021491bc7-5ebb292bd62mr1062475eaf.6.1729416541220; Sun, 20 Oct 2024 02:29:01 -0700 (PDT) In-Reply-To: <86a5ezjkx8.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:293943 Archived-At: Flymake queries should be directed to Spencer Baugh But if this fixes the user's problem and doesn't hurt anyone who does have wide enough windows and on top of that sufficient testing is done, I don't object to this solution. I don't know what that problem is. Does the user want their cursor to show at the end of the intangible overlay? If so, that's odd: I designed this feature to be as little intrusive as pos= sible i.e. so that turning it on has no other effect than some text appearing at the end of line -- and only at the end of line. If there is little spac= e, I would say the right thing to do is to truncate, not wrap to the next line To try and answer your question, I don't think it is used by other Flymake parts (the function name hints at it: flymake--eol- means "end of line"). However, I advise to give it testing (with multiple diagnostics on one line, for example). I remember trying many variations on these things and each had its drawbacks. But possibly (probably?) I didn't test this one. Anyway, do test this out with other flymake eol users and consider the impact to users with wide enough windows: if there's no impact I don't see why this wouldn't be acceptable. But that is for Spencer or you to decide. Jo=C3=A3o On Sun, Oct 20, 2024 at 8:25=E2=80=AFAM Eli Zaretskii wrote: > > > From: Romain Ouabdelkader > > Date: Sat, 19 Oct 2024 15:41:05 +0200 > > Cc: 73863@debbugs.gnu.org > > > > So this problem only happens when the window is not wide enough, and > > the diagnostic wraps to the next screen line? > > > > Yes that's correct, this happens to me quite often when I have two wind= ows open side by side. > > This is actually what flymake.el requests the display engine to do: it > asks it to show the cursor on the first character of the diagnostic's > before-string: > > (put-text-property 0 1 'cursor t summary) > > So when you use C-n, Emacs moves point to the end of the > before-string, but the 'cursor' property tells it to show the cursor > on the first character of the before-string, which is on a previous > screen line. So the display engine obeys and shows the cursor there. > > The following simple patch seems to give much better results. Jo=C3=A3o, > is the code in question used by any Flymake feature other than this > new flymake-show-diagnostics-at-end-of-line option? If so, we'll > probably need some condition to move the 'cursor' property to end of > string (assuming you don't object to this solution). > > diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el > index 9a6b62c..0ef1ed0 100644 > --- a/lisp/progmodes/flymake.el > +++ b/lisp/progmodes/flymake.el > @@ -835,8 +835,12 @@ flymake--eol-overlay-summary > (1- (length diags))) > 'face 'flymake-eol-information-fa= ce))))) > (t > - (mapconcat #'summarize diags " ")))))) > - (put-text-property 0 1 'cursor t summary) > + (mapconcat #'summarize diags " "))))) > + (last-pos (1- (length summary)))) > + ;; Put the 'cursor' property on the last character of the summary, > + ;; so that vertical-motion produces the expected results when the > + ;; summary wraps to next screen lines. > + (put-text-property last-pos (1+ last-pos) 'cursor t summary) > summary))) > > (defun flymake--update-eol-overlays () --=20 Jo=C3=A3o T=C3=A1vora