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#64428: [PATCH] Fix flymake mode line scrolling with pixel-scroll-precision-mode Date: Fri, 7 Jul 2023 12:47:10 +0100 Message-ID: References: <87zg4eq8xn.fsf@catern.com> <83ilaxij8c.fsf@gnu.org> <833521i1ag.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="39439"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Spencer Baugh , 64428@debbugs.gnu.org, sbaugh@catern.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 07 13:49:07 2023 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 1qHjxS-000A8l-1t for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 07 Jul 2023 13:49:06 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qHjwX-00067W-QO; Fri, 07 Jul 2023 07:48:09 -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 1qHjwR-0005rt-Dk for bug-gnu-emacs@gnu.org; Fri, 07 Jul 2023 07:48:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qHjwQ-0007hr-RH for bug-gnu-emacs@gnu.org; Fri, 07 Jul 2023 07:48:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qHjwQ-0001tg-CX for bug-gnu-emacs@gnu.org; Fri, 07 Jul 2023 07:48: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: Fri, 07 Jul 2023 11:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64428 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 64428-submit@debbugs.gnu.org id=B64428.16887304527114 (code B ref 64428); Fri, 07 Jul 2023 11:48:02 +0000 Original-Received: (at 64428) by debbugs.gnu.org; 7 Jul 2023 11:47:32 +0000 Original-Received: from localhost ([127.0.0.1]:42688 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qHjvw-0001qg-1G for submit@debbugs.gnu.org; Fri, 07 Jul 2023 07:47:32 -0400 Original-Received: from mail-oi1-f172.google.com ([209.85.167.172]:44231) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qHjvr-0001qM-Ke for 64428@debbugs.gnu.org; Fri, 07 Jul 2023 07:47:30 -0400 Original-Received: by mail-oi1-f172.google.com with SMTP id 5614622812f47-3a1d9b64837so1626106b6e.0 for <64428@debbugs.gnu.org>; Fri, 07 Jul 2023 04:47:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688730441; x=1691322441; 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=bwF4ZCF65oQj2ZKyP9a+CuJQ+2bDrk3WZ3tljQFv5W8=; b=IapezcgzdBcGPOuyjPgE3XtuvBf9p+bbfX3v3zN6o9Q6z0HXPzG2fIoSwf0k9S9vun 7YI1iB/geeWL4a26qkEFtfPEIVKwTOngOGXXUWnrCwqBfGzO4dIy9kpGh7HIyACyJpqy tKOGe917C5yHk3p40ZjPminMX1LLtX2SHqJdZjvw5rCwtC2+B/SQGRFhdzW5pXGnVxmj l5dms5giWAh9ei2+/w1+qX9vVhAtxWC35c+MNCykvPK6XHjGeoUe40gqkiKlcqCFbdtc RDrsiAoWUHY41ho32hTxzf+sZPZPu25wrkW2g9RGT9V4tj8pykPvVrUEM1Qof2kQSxgc Ieqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688730441; x=1691322441; 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=bwF4ZCF65oQj2ZKyP9a+CuJQ+2bDrk3WZ3tljQFv5W8=; b=cccVC3egqaafsQg/CmwWgHPa3Eoq9OkJBFOf0OrZYdzZphqReXNhKUI5W8m0tC6gUk E6J0GYeUMbDldBiy7Sf+sAUPb/vFNICKf4RI6A8jkBvJ8SMaq0xQeFI7d9vOqGcrdH+s OJ/dx5J7HIbagOVp/MEZWe4ujjpYNs1MIY3qjjePrJf5NhnnEPG5PF+xozExuLeW7vjx lAkXPm7UGLJtRSwsKZS4iMVJGkv4E/NOK53C2U/bFlLqZSMyIXDViZGoqgdTshhHwo3l 6NC0ToXxOZ07iZRCom6Wz/LHHwUoIoCExefzwbw8oZB0Tpk5RgWGhcZu02j/PBH8qBKm y5nw== X-Gm-Message-State: ABy/qLZBzeF5/yRVl/mDhtL3diJJtD8vkE2Woqz1865hU4Yi4cSNsU5J y/+GewxhDszNwu1mQag9/ObmjVNwNU1Nz4AEE7w= X-Google-Smtp-Source: APBJJlFuCGbENtxdHaYOB4wvx/6krzjtOZlm6qatQG59egecpdTOPmnh30TOyzqAulO0Uztb9gwkCoG8gwRzoYZt0zQ= X-Received: by 2002:a05:6808:3008:b0:3a3:f289:8205 with SMTP id ay8-20020a056808300800b003a3f2898205mr89785oib.35.1688730440933; Fri, 07 Jul 2023 04:47:20 -0700 (PDT) In-Reply-To: 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:264718 Archived-At: On second thought, here are some comments that I think should be improved in Spencer's patch: > @@ -1479,21 +1505,8 @@ flymake--mode-line-counter > ((eq type :warning) "warnings") > ((eq type :note) "notes") > (t (format "%s diagnostics" type)))) > - keymap > - ,(let ((map (make-sparse-keymap))) > - (define-key map (vector 'mode-line > - mouse-wheel-down-event) > - (lambda (event) > - (interactive "e") > - (with-selected-window (posn-window (event-start event)) > - (flymake-goto-prev-error 1 (list type) t)))) > - (define-key map (vector 'mode-line > - mouse-wheel-up-event) > - (lambda (event) > - (interactive "e") > - (with-selected-window (posn-window (event-start event)) > - (flymake-goto-next-error 1 (list type) t)))) > - map)))))) > + type ,type Spencer, here you are recording the value of the `type` in a `type` text-property of the affected text. Generally, though this rule isn't enforced or always followed (at least by me), it's better to give these package-specific properties some longer package-specific name like `flymake--diagnostic-type`. This will prevent any clashes if the less-qualified `type` is ever defined to mean something else as a text-property. > + (interactive "e") > + (let* ((posn-string (posn-string (event-start event))) > + (type (get-text-property (cdr posn-string) 'type (car posn-stri= ng)))) > + (with-selected-window (posn-window (event-start event)) > + (flymake-goto-prev-error 1 (list type) t)))) And here, you could consider saving the value of (event-start event) by adding another early binding to that `let*`, maybe call it `estart`. This is much less important than the first comment though. Jo=C3=A3o