From unknown Fri Jun 13 06:09:32 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#34418 <34418@debbugs.gnu.org> To: bug#34418 <34418@debbugs.gnu.org> Subject: Status: 27.0.50; Flymake adds markup to buffers not specified in `flymake-make-diagnostic' Reply-To: bug#34418 <34418@debbugs.gnu.org> Date: Fri, 13 Jun 2025 13:09:32 +0000 retitle 34418 27.0.50; Flymake adds markup to buffers not specified in `fly= make-make-diagnostic' reassign 34418 emacs submitter 34418 Philipp severity 34418 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 10 14:44:15 2019 Received: (at submit) by debbugs.gnu.org; 10 Feb 2019 19:44:15 +0000 Received: from localhost ([127.0.0.1]:42792 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gsv1S-0001Za-N5 for submit@debbugs.gnu.org; Sun, 10 Feb 2019 14:44:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51206) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gsv1R-0001ZN-P1 for submit@debbugs.gnu.org; Sun, 10 Feb 2019 14:44:14 -0500 Received: from lists.gnu.org ([209.51.188.17]:42369) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gsv1M-00024Q-JG for submit@debbugs.gnu.org; Sun, 10 Feb 2019 14:44:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37167) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gsv1L-0006aA-7h for bug-gnu-emacs@gnu.org; Sun, 10 Feb 2019 14:44:08 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_50, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gsutN-0007Ff-3k for bug-gnu-emacs@gnu.org; Sun, 10 Feb 2019 14:35:55 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:54020) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gsutD-00078u-Sg for bug-gnu-emacs@gnu.org; Sun, 10 Feb 2019 14:35:45 -0500 Received: by mail-wm1-x32f.google.com with SMTP id d15so13379651wmb.3 for ; Sun, 10 Feb 2019 11:35:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=/NmegW9VIGPnVOnOr5SYJpLYs7QWFrPNAExrqw4rusw=; b=lhz1eXsCK8mSmk0+HNqGGV9A5OrN2nGqPj1QyH3YJz77hwK23pKD3n9f/9RCRNfDMz yY7olC6/60+sIiPiaAa6g0q0B983vXdHpdKLdxmEN05V/qsy2wLO2Juq64cHWxPoouMJ g2wEZgZF2MrOl93btO4gZIpLfAwy5sr3j7qCTg5NVdXNTFMKs91s0gbgcg0+ju1uiY29 2mv8ogdoYZa+u4PPNYoHFyCh5vzMy00qq7o8R3EvXpw1L59Pzd8hrGWPBjPP8EjwUTaR /iKWECuKHb1gUmbjOv33DYJvqGcVLbXkpOsQxsXA5uw01ijZ7ad+4sg6lBJypOC74Oag 4Ciw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=/NmegW9VIGPnVOnOr5SYJpLYs7QWFrPNAExrqw4rusw=; b=Na2yOogTjFyJd6vN/FIG559/FsNsqumM28BjT49XQ8lOhmjcwc4x+QDNj8JarT5Hj9 GaGiMDeWkYKhFn/lIQwUJyMNm6qNoj+l4QJzKXKE+NSko2Du5A/smRZhAREVGGrND9SG C6wJRQLfK9hI4Yta9kn6GKOXNsDR455R0N9nZDJDXucx6BM9SIR7bFjFNmMTS3N1v2Pz k5eopvExUJmHqhGOuKNyWQDtFma75P4/a0xYypN2IDXa7oa7EYMxQsGI9Ac2w8NKRVOD 0gf3dnc84X89+0AQOxgRdb/R5fg0lKjjdfOPBWCgMZADTfqkqOrpu5CJP7W5jV9Am9pf re2g== X-Gm-Message-State: AHQUAuaizLVHA/VX2wWF1pqIl7xVWPH0X5cpNkaqO887lRSJcr7ZGguA 3z+dKc/gI0FpRHRmFZ1Yt7hXZLjO X-Google-Smtp-Source: AHgI3IaeMjg9/A2+Xx6yehGGLelp35SSYTWzssBkPc4KdU91cNHWSizNs860qDiDy2B1SvCeJFMjDQ== X-Received: by 2002:a1c:c282:: with SMTP id s124mr6443514wmf.105.1549827339778; Sun, 10 Feb 2019 11:35:39 -0800 (PST) Received: from p ([2001:4c50:25a:f300:e0af:b2b6:5385:a84c]) by smtp.gmail.com with ESMTPSA id m6sm4750536wrv.24.2019.02.10.11.35.38 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 10 Feb 2019 11:35:39 -0800 (PST) From: Philipp To: bug-gnu-emacs@gnu.org Subject: 27.0.50; Flymake adds markup to buffers not specified in `flymake-make-diagnostic' Date: Sun, 10 Feb 2019 20:35:35 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32f X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 1. Create two scratch buffers *a* and *b* (e.g. C-x b *a* RET). 2. Insert some text into the buffers (e.g. "text a" and "text b", respectively) 3. Add a trivial Flymake backend to buffer *b*. E.g., select *b* and run M-: with the following code: Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: gnu.org] 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (p.stephani2[at]gmail.com) 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (p.stephani2[at]gmail.com) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.2 (/) 1. Create two scratch buffers *a* and *b* (e.g. C-x b *a* RET). 2. Insert some text into the buffers (e.g. "text a" and "text b", respectively) 3. Add a trivial Flymake backend to buffer *b*. E.g., select *b* and run M-: with the following code: (add-hook 'flymake-diagnostic-functions (lambda (report-fn &rest _args) (funcall report-fn (list (with-current-buffer "*a*" (flymake-make-diagnostic (current-buffer) (point-min) (point-max) :error "message")))))) Note that this backend adds a diagnostic for buffer *a*, not *b*. 4. Enable Flymake mode in buffer *b*. Buffer *b* will now show a diagnostic, even though it was reported for buffer *a*. This should either add a diagnostic for buffer *a* or signal an error. See https://lists.gnu.org/archive/html/help-gnu-emacs/2018-12/msg00170.html for more context. In GNU Emacs 27.0.50 (build 37, x86_64-apple-darwin18.2.0, NS appkit-1671.20 Version 10.14.3 (Build 18D109)) of 2019-02-10 built on p Repository revision: 24695e8977c3d048e60d1fe3714b789567c2213c Repository branch: master Windowing system distributor 'Apple', version 10.3.1671 System Description: Mac OS X 10.14.3 Recent messages: C-+ is undefined Region has 0 lines, 0 words, and 0 characters. M-+ is undefined Use +,-,0 for further adjustment [5 times] Loading flymake...done next-line: End of buffer user-error: End of history; no default available ((lambda (report-fn &rest _args) (funcall report-fn (list ...))) flymake-proc-legacy-flymake) Flymake mode enabled in current buffer [2 times] mwheel-scroll: Beginning of buffer [4 times] mwheel-scroll: Beginning of buffer Configured using: 'configure --without-xml2 --with-modules --without-pop --with-mailutils --enable-gcc-warnings=warn-only --enable-checking=yes --enable-check-lisp-object-type 'CFLAGS=-ggdb3 -O0'' Configured features: IMAGEMAGICK NOTIFY KQUEUE ACL GNUTLS ZLIB TOOLKIT_SCROLL_BARS NS MODULES THREADS JSON PDUMPER LCMS2 GMP Important settings: value of $LANG: de_DE.UTF-8 locale-coding-system: utf-8-unix Major mode: Messages Minor modes in effect: tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny seq byte-opt bytecomp byte-compile cconv dired dired-loaddefs format-spec rfc822 mml mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils cl-macs gv cl-seq flymake-proc flymake easymenu compile comint ansi-color ring warnings thingatpt cl-loaddefs cl-lib face-remap elec-pair tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/ns-win ns-win ucs-normalize mule-util term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads kqueue cocoa ns lcms2 multi-tty make-network-process emacs) Memory information: ((conses 16 56619 10244) (symbols 48 6929 1) (strings 32 17753 1870) (string-bytes 1 600979) (vectors 16 11313) (vector-slots 8 139126 16778) (floats 8 29 130) (intervals 56 213 28) (buffers 992 14)) From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 02 12:04:30 2019 Received: (at 34418) by debbugs.gnu.org; 2 Nov 2019 16:04:30 +0000 Received: from localhost ([127.0.0.1]:32906 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iQvt7-0003ij-Ut for submit@debbugs.gnu.org; Sat, 02 Nov 2019 12:04:30 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:56262) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iQvt6-0003iT-DE for 34418@debbugs.gnu.org; Sat, 02 Nov 2019 12:04:29 -0400 Received: by mail-wm1-f67.google.com with SMTP id m17so3101963wmi.5 for <34418@debbugs.gnu.org>; Sat, 02 Nov 2019 09:04:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=Jxv+VPpC+OAoXuThRpGuYDjXCC93eZkpNt0u/CxOgEo=; b=kuLlBq+FVCJj7WPYJN41FVf5Fuj7wRA9nB/rHwc+stWtGfqnvophLNo8BRMNfALI1k 4K7bDL0F8WamulGuwXHJMNMhpofPW85osGE/QqXrbwIsrdWHW9uWJuNdDg7HGqVuKk+M sApFzTw69IJ9nVzfb2jy66IaiKKQwuedKBS22sfuQJgSJXF4rJRyLdLg8CASV9a6gX0h GDhZqO4h8vB2yY5+t7xSNlah61e+UcU+eFHqo8DZFZmcMvtLpcIgDMr794hNz0w0jgOU IYA/EeTgJRArCibBw9+so0YMOPOLC4ZmksgQDIzBrCeB/Ee1056uhPGeFfxrkVuxnutQ BcCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=Jxv+VPpC+OAoXuThRpGuYDjXCC93eZkpNt0u/CxOgEo=; b=J3MiuaGNYaBhmX0XVrsURW6F7WPNrPHgZosJpKh1rKUNf2JEidBnGFqMC9YEDOuG0o meFGLj2e+MZg5ElWC7UDIXejxqSbxYWwZNkIX0+BTpiDAavoZSUxPw0fQf9fV3ugsbCc j1WLUg5d9SCPbqfDVwMjKitey2RI/g9j79DqTaNrLA4WC889GsqLCdvztmpIKtgJk4L5 70iEEAxjvlN+foJ17ns0pJNeoLaLbRENcQQcaqK+qFzaM1ei8xcIanXUMCKJxKMhEOzH 3nkHZZ4rUO0od5VpPmhsgKn+S3bv2ct8U7UL3FppZhXwEgL0bmK840HJAUfo+vqeNRGQ oXnQ== X-Gm-Message-State: APjAAAWBzp4/EXydBl0AV9jY9OU/5bNeKQky3YSTdcQDLvk214Fb0JZO /T/PJWbNp0WIbIDrBkshamilcQbY X-Google-Smtp-Source: APXvYqx4FLZyAftKbbP8tgMUG0M3lcJ/yllpboji/CmTL4nTXhvaQhJzrVXjj3oPxS1wFMHTSgOlDQ== X-Received: by 2002:a1c:4089:: with SMTP id n131mr16161875wma.86.1572710660931; Sat, 02 Nov 2019 09:04:20 -0700 (PDT) Received: from lolita.yourcompany.com ([2001:818:d820:9500:1ebb:afd8:ab26:f0f6]) by smtp.gmail.com with ESMTPSA id x8sm10878097wrr.43.2019.11.02.09.04.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Nov 2019 09:04:20 -0700 (PDT) From: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= To: Philipp Subject: Re: 27.0.50; Flymake adds markup to buffers not specified in `flymake-make-diagnostic' References: Date: Sat, 02 Nov 2019 16:04:15 +0000 In-Reply-To: (Philipp's message of "Sun, 10 Feb 2019 20:35:35 +0100") Message-ID: <87o8xumfi8.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34418 Cc: 34418@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Philipp writes: > 1. Create two scratch buffers *a* and *b* (e.g. C-x b *a* RET). > > 2. Insert some text into the buffers (e.g. "text a" and "text b", > respectively) > > 3. Add a trivial Flymake backend to buffer *b*. E.g., select *b* and > run M-: with the following code: >=20=20=20=20 > (add-hook 'flymake-diagnostic-functions > (lambda (report-fn &rest _args) > (funcall report-fn (list (with-current-buffer "*a*" > (flymake-make-diagnostic (current-buffer) > (point-min) (point-max) > :error "message")))))) >=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 > Note that this backend adds a diagnostic for buffer *a*, not *b*. >=20=20=20=20 > 4. Enable Flymake mode in buffer *b*. > > Buffer *b* will now show a diagnostic, even though it was reported for > buffer *a*. This should either add a diagnostic for buffer *a* or > signal an error. Hi Phillip, Sorry for the very slow turnaround. The behaviour for handling the mismatch between the (1) the buffer passed to flymake-make-diagnostic (2) the buffer where the report function executes is unspecified and it is so by design. I've yet to come to a good conclusion on what that behaviour should be, and maybe you can help me. Let's see some plausible real-world scenarios. 1. Some uses of Flymake, notably Eglot's via LSP (Language Server Protocol) can possibly take advantage of a good definition of this behaviour, for aggregating the errors reports across a project for example. So `flymake-make-diagnostic` could be specified to take a BUFFER-OR-FILE, and we could heuristically decide to add the diagnostic to, say, a per-project database. 2. In another simpler scenario, checking .c file might issue errors for included .h files, and if that file is open in a buffer, we could go there and highlight the error. Could we really? Maybe not, because the error was probably generated for the on-disk copy of the .h file, whose contents might differ wildly from the buffer's. Then again, a smart backend could consider that. So maybe your "error" proposal makes sense, maybe it doesn't. I'd rather not commit to an API right now that could block evolution. For now I've added a note to the manual's description of flymake-make-diagnostic and a protection to flymake--handle-report that will ignore such diagnostics. What do you think? Jo=C3=A3o From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 22 19:33:27 2019 Received: (at control) by debbugs.gnu.org; 23 Nov 2019 00:33:27 +0000 Received: from localhost ([127.0.0.1]:55721 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iYJMd-0000kn-B0 for submit@debbugs.gnu.org; Fri, 22 Nov 2019 19:33:27 -0500 Received: from mail-wr1-f54.google.com ([209.85.221.54]:44933) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iYJMW-0000kS-Rm for control@debbugs.gnu.org; Fri, 22 Nov 2019 19:33:23 -0500 Received: by mail-wr1-f54.google.com with SMTP id i12so10664046wrn.11 for ; Fri, 22 Nov 2019 16:33:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:to:from:subject:mime-version :content-transfer-encoding; bh=qL1vTzR9mJ/iFsVsW+/roXBlAraChj09buzkt+V0LoY=; b=LPcSprT0/9/0Zke1vYJN4Mrhk9z2x1og9Rx/X88IYQOYuFkdMuoDIQtCHmvz6RpM9y w1mP6ADEap6z1BKTNqg+ax8JQaQGncRNSq2R0IH/Dh5I/gnq8+prR1nfhjQHIDm770Eu 4a0yatgocGcsyy6u3scpho+aTXicFWIfQB9JxOjLqXQ9Y/hb818NW0W7AeHXPG5jV3bF oMMuC4krqRePklUMHcOBmWYNJF51HQfBExULO+zfBXzg27Jy5Ghg+jz1Nks/MtoHuXgF 6QBHkETrieTuFMeaNHeGCHKWvaarKigci+xhBu9kUnvHKIFCKrsblvACVP0WwQ8dOG6j VsXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:to:from:subject:mime-version :content-transfer-encoding; bh=qL1vTzR9mJ/iFsVsW+/roXBlAraChj09buzkt+V0LoY=; b=sRe135JeGP8M7ypkgm95rR7cwxgiaL/yEIH+vP62jqGRUCURfaBI5mcLn5rkaAdlh7 NFMIY04Thfqjgs6bKPnesHoMDn0tl+9t52ls2+QEdninJRvLwEWNVu0MsHiJXD+3+byX 8lG+sm8I+3AqICU9qkjle5xDWzEEmP+8ORdnyF8f2WkMFbersQdYqsvJuK9MzMMpMjwG uMHImzI2vv/jz/zgD01C1R/eDgdfEmuZGFmxTZDIckxJYgOw65Mei5rHQMId41QnbXRR uDGahLulRgtqOHeFje97/FKAGhJCDn4tIa0adtMgmbXHsRuoV01kdNho6M/VLfInQ1EO +Jvg== X-Gm-Message-State: APjAAAWWtFdmfWbw34FR0kT3HsSdaaGVDWGEAQspitHy1YxCA2uNsZOt qPttfmcqlOg/V2+8tE6exXbdC3uMpdY= X-Google-Smtp-Source: APXvYqzXJ/OjE/ndLKWtQJqnhO9kKmqebtmqxBE/a+9tzEUpeATMCkkY0WeXhZ8buwRUAX5UlIKf6A== X-Received: by 2002:adf:dc4b:: with SMTP id m11mr5911824wrj.344.1574469194964; Fri, 22 Nov 2019 16:33:14 -0800 (PST) Received: from lolita.yourcompany.com ([2001:818:d820:9500:1ebb:afd8:ab26:f0f6]) by smtp.gmail.com with ESMTPSA id b14sm33843wmj.18.2019.11.22.16.33.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Nov 2019 16:33:14 -0800 (PST) Date: Sat, 23 Nov 2019 00:33:13 +0000 Message-Id: <87y2w7a0ty.fsf@gmail.com> To: control@debbugs.gnu.org From: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Subject: control message for bug #34418 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: fixed 34418 27.1 quit Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (joaotavora[at]gmail.com) -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.221.54 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.221.54 listed in list.dnswl.org] 1.1 MALFORMED_FREEMAIL Bad headers on message from free email service X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.1 (/) fixed 34418 27.1 quit From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 23 09:47:34 2021 Received: (at 34418) by debbugs.gnu.org; 23 Jun 2021 13:47:35 +0000 Received: from localhost ([127.0.0.1]:40654 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lw3E6-0004G2-Ed for submit@debbugs.gnu.org; Wed, 23 Jun 2021 09:47:34 -0400 Received: from quimby.gnus.org ([95.216.78.240]:48906) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lw3E4-0004AQ-D2 for 34418@debbugs.gnu.org; Wed, 23 Jun 2021 09:47:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=BRIkh0zv2A797mfH1JqHrYwGwNo7SHF7AKSeQQfEPOI=; b=KG3jguqWC8O3hyGVXU7A1tGgz4 00OiBMBqxIubqpZIBnFkAqtIFZ+WvR3HWIdsLZfGAO+oU2y1iB95AHxGKwTHh/xWksxDGscRygntg yvNSE1CjbtRk3LDRYDUVMuL4+fA6UPDrv/K4gHxkA7kzhOceEIFgvBCZQoMORQhprTwQ=; Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lw3Dw-0005Jf-3V; Wed, 23 Jun 2021 15:47:26 +0200 From: Lars Ingebrigtsen To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Subject: Re: bug#34418: 27.0.50; Flymake adds markup to buffers not specified in `flymake-make-diagnostic' References: <87o8xumfi8.fsf@gmail.com> X-Now-Playing: The Clash's _Sandinista!_: "If Music Could Talk" Date: Wed, 23 Jun 2021 15:47:23 +0200 In-Reply-To: <87o8xumfi8.fsf@gmail.com> (=?utf-8?Q?=22Jo=C3=A3o_T=C3=A1vor?= =?utf-8?Q?a=22's?= message of "Sat, 02 Nov 2019 16:04:15 +0000") Message-ID: <87r1gslml0.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: João Távora writes: > For now I've added a note to the manual's description of > flymake-make-diagnostic and a protection to flymake--handle-report that > will ignore such diagnostics. What do you think? Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 34418 Cc: Philipp , 34418@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Jo=C3=A3o T=C3=A1vora writes: > For now I've added a note to the manual's description of > flymake-make-diagnostic and a protection to flymake--handle-report that > will ignore such diagnostics. What do you think? This was over a year ago, and there was no response. Reading the report, I'm not sure whether there's anything further to be done here, or whether it can be closed? --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 05 12:51:12 2021 Received: (at 34418) by debbugs.gnu.org; 5 Jul 2021 16:51:12 +0000 Received: from localhost ([127.0.0.1]:46589 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0RoO-0000Kp-CI for submit@debbugs.gnu.org; Mon, 05 Jul 2021 12:51:12 -0400 Received: from mail-wm1-f49.google.com ([209.85.128.49]:43646) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0RoL-0000KZ-NX for 34418@debbugs.gnu.org; Mon, 05 Jul 2021 12:51:10 -0400 Received: by mail-wm1-f49.google.com with SMTP id q18-20020a1ce9120000b02901f259f3a250so376260wmc.2 for <34418@debbugs.gnu.org>; Mon, 05 Jul 2021 09:51:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=mf1wr134SGJFfVbDDTGi2niJYpbP/o3GZskFvCfjP68=; b=CsVhD0e9CyjyjYhIXJrpZ94WDJFg7fq/6LBUv1bOvjV6dh9+T4ABgXSapHQsa0facO egYtGox8AvcPRljdZ4GY1lLb9N6PVMVqm8+F2umkGlgH8bA+jvSplY37ixc3DaB9HsVB Du6mZ8nO1ytMRMFN8dXc+FduSYz2q27FuPZ3j11YhR/u8vxrhBT6z6YQQSwwgBDbshD/ 7ERduVS9ykS9Xau+Kg20rc0Lb979AYRGsDzOzHYdlHZ/Pkdp+4UfKKaUWW1tl+CcSDH/ IiYACdB+G5f6gJzjNDPW8AiAIMN3pG4hBe63K+JrdnE/Td23Lf/qRZC/uFuHLom7yXdU zrPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=mf1wr134SGJFfVbDDTGi2niJYpbP/o3GZskFvCfjP68=; b=qXEZkKDERezkdN2aZXU4nk/3y9k2T4sp6XbyuuRBZn5GHMWUMK0X53QlbhXxbmZlpx 6cMPw0/SVTWZjMQKLGQzRsD9Y344hHFF8WYwgzFv9sLTZmn7NE+J1k+UDXKEZuKRrXuy rv5CDnB9YOEE/tNEAdcT+lKNHNF37T09zVNuqEOpQzYRiOZWCtmdJe6Ht09sJyFBJEGR UhbGW8W+kgz14pwo/BXfZ6r1MacpDA48phzKOMkk7kD9eHBG/ByZge/1ofKCcb+dAr/W xDTbanyD7eg2KRiKSq6+ctUTp49ca59QQusfvhi2T5OAYYr2jAKGOxPzeSGLAsRRKAHd 8oyw== X-Gm-Message-State: AOAM530t41TCfjYcNydST3AyoZIb1CoFYcbeAyJOc67VOaQAzvg3FlVL 6jNRdYV61G34HeWx+Xyafe8= X-Google-Smtp-Source: ABdhPJzFBdJTqWZJc4yNj8nRAV3f1qCNda+o10Ir2k0ngdTFSfhcPd/DyLy9ombIMwCXqsGZrlTojw== X-Received: by 2002:a05:600c:2cd2:: with SMTP id l18mr15440792wmc.142.1625503863768; Mon, 05 Jul 2021 09:51:03 -0700 (PDT) Received: from smtpclient.apple ([46.128.198.100]) by smtp.gmail.com with ESMTPSA id y8sm13601046wrr.76.2021.07.05.09.51.03 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Jul 2021 09:51:03 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.100.0.2.22\)) Subject: Re: 27.0.50; Flymake adds markup to buffers not specified in `flymake-make-diagnostic' From: Philipp In-Reply-To: <87o8xumfi8.fsf@gmail.com> Date: Mon, 5 Jul 2021 18:51:02 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <87o8xumfi8.fsf@gmail.com> To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= X-Mailer: Apple Mail (2.3654.100.0.2.22) X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 34418 Cc: 34418@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) > Am 02.11.2019 um 17:04 schrieb Jo=C3=A3o T=C3=A1vora = : >=20 > Philipp writes: >=20 >> 1. Create two scratch buffers *a* and *b* (e.g. C-x b *a* RET). >>=20 >> 2. Insert some text into the buffers (e.g. "text a" and "text b", >> respectively) >>=20 >> 3. Add a trivial Flymake backend to buffer *b*. E.g., select *b* and >> run M-: with the following code: >>=20 >> (add-hook 'flymake-diagnostic-functions >> (lambda (report-fn &rest _args) >> (funcall report-fn (list (with-current-buffer = "*a*" >> (flymake-make-diagnostic (current-buffer) >> (point-min) (point-max) >> :error "message")))))) >>=20 >> Note that this backend adds a diagnostic for buffer *a*, not *b*. >>=20 >> 4. Enable Flymake mode in buffer *b*. >>=20 >> Buffer *b* will now show a diagnostic, even though it was reported = for >> buffer *a*. This should either add a diagnostic for buffer *a* or >> signal an error. >=20 > Hi Phillip, >=20 > Sorry for the very slow turnaround. >=20 > The behaviour for handling the mismatch between the (1) the buffer > passed to flymake-make-diagnostic (2) the buffer where the report > function executes is unspecified and it is so by design. >=20 > I've yet to come to a good conclusion on what that behaviour should = be, > and maybe you can help me. Let's see some plausible real-world = scenarios. >=20 > 1. Some uses of Flymake, notably Eglot's via LSP (Language Server > Protocol) can possibly take advantage of a good definition of this > behaviour, for aggregating the errors reports across a project for > example. So `flymake-make-diagnostic` could be specified to take a > BUFFER-OR-FILE, and we could heuristically decide to add the > diagnostic to, say, a per-project database. >=20 > 2. In another simpler scenario, checking .c file might issue errors = for > included .h files, and if that file is open in a buffer, we could go > there and highlight the error. Could we really? Maybe not, because > the error was probably generated for the on-disk copy of the .h = file, > whose contents might differ wildly from the buffer's. Then again, a > smart backend could consider that. >=20 > So maybe your "error" proposal makes sense, maybe it doesn't. I'd > rather not commit to an API right now that could block evolution. I wouldn't say signaling an error now would block evolution. I don't = think we have a principle like "anything that signals an error now will = continue doing so in the future." >=20 > For now I've added a note to the manual's description of > flymake-make-diagnostic and a protection to flymake--handle-report = that > will ignore such diagnostics. What do you think? Adding a note to the manual is definitely a good idea. I'm not so sure = about (silently) ignoring "wrong" diagnostics -- after all, the backend = definition then contains a bug, and it's generally a good idea to help = developers find and fix bugs by being explicit about them. So I'd still = favor signaling an error, with the potential to change the behavior if = we find a good use for such diagnostics.= From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 05 12:56:50 2021 Received: (at 34418) by debbugs.gnu.org; 5 Jul 2021 16:56:50 +0000 Received: from localhost ([127.0.0.1]:46597 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0Rtq-0000TG-D9 for submit@debbugs.gnu.org; Mon, 05 Jul 2021 12:56:50 -0400 Received: from mail-pj1-f42.google.com ([209.85.216.42]:55889) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0Rtp-0000T4-Bt for 34418@debbugs.gnu.org; Mon, 05 Jul 2021 12:56:49 -0400 Received: by mail-pj1-f42.google.com with SMTP id l11so12015549pji.5 for <34418@debbugs.gnu.org>; Mon, 05 Jul 2021 09:56:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=1metvXRzwBRAtC30uhrAsVq4hK2mT+AhQMf5wuIUGWM=; b=b6ZVgmYNdZ2sS6TBMbeuCl/CL3tGijsY5k5UoHD7beqM4LlEXy30/woryNQABMy4Ij I6jays3/kGORjpyYXKIYLwV7E1vZXUYqQKYfunja+Oy2/35OOvkqPQs0Eo0IeT8/JyZx 1/m5mzPL64eaAJypmtneDdmnAFVIZ1LQ99BDRBXSBqbb2l62tnayq2OjpcMzhKGb0n0n az6biRWgZ3o6qFIY4KQTbKNz+Pklz0+04gSC7ruW2gnwbStHCHj4wR7CrA5UtKTVFVeE QmtgeNO7XrtkyBhzfICBVQSGtZtDAQ5YERXCkDzAgW401AzqqCkEgLuCOaleFvpMRpV/ c5TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=1metvXRzwBRAtC30uhrAsVq4hK2mT+AhQMf5wuIUGWM=; b=CdavFewd+HUNJiIRbdltzKOdZGAbaaoIBEuCh6mHtO+/ZzvnupWKQddpkBZ9Bg0nJ4 dwCTvkmwBaH44CU+dMwC9m67i1+ApPJrHB0bbks9EN8RjFg6cwhPv9retMClLdOa3NgN KJkwI00kLkcGs3LoaiYpL2jj8MCPY5ti7MKb01IZltVTeN3HsKnRHCvA5gG9OONEM+gr bQeoYnKTbMUtq0DpG+2tYoGHWeuterCGVjmQ3c6W6CE1FiAKW+FV2fuTvR9UJhUNPlh8 MFP/MSqdijNhJDh7RAqSgLs+0g+eQccn/FH9FgRHMlyNXaRvQSLs6GSfGxhxM1s5lvoU o/qw== X-Gm-Message-State: AOAM531WwGFdf9CyQcXb4HE0oODRS0jshBZj3YR6mjM9s6Qs/xHVUW0B QTFLaehpLYpIINhTJphfsPKXlQzaGqyIIjGaj4o= X-Google-Smtp-Source: ABdhPJya+fk4qd9ljhJg2whKpvfx+UWn0huq3/LRxoOtzsn4en2ZfXKH4NJ+8Xo5JCaXrOdDQdKkXMDJHjPmnbbS7mU= X-Received: by 2002:a17:902:7b87:b029:128:345d:f596 with SMTP id w7-20020a1709027b87b0290128345df596mr13195573pll.36.1625504203367; Mon, 05 Jul 2021 09:56:43 -0700 (PDT) MIME-Version: 1.0 References: <87o8xumfi8.fsf@gmail.com> In-Reply-To: From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Date: Mon, 5 Jul 2021 17:56:31 +0100 Message-ID: Subject: Re: 27.0.50; Flymake adds markup to buffers not specified in `flymake-make-diagnostic' To: Philipp Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34418 Cc: 34418@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Mon, Jul 5, 2021 at 5:51 PM Philipp wrote: > > > > > Am 02.11.2019 um 17:04 schrieb Jo=C3=A3o T=C3=A1vora : > > > > Philipp writes: > > > >> 1. Create two scratch buffers *a* and *b* (e.g. C-x b *a* RET). > >> > >> 2. Insert some text into the buffers (e.g. "text a" and "text b", > >> respectively) > >> > >> 3. Add a trivial Flymake backend to buffer *b*. E.g., select *b* and > >> run M-: with the following code: > >> > >> (add-hook 'flymake-diagnostic-functions > >> (lambda (report-fn &rest _args) > >> (funcall report-fn (list (with-current-buffer "*a*" > >> (flymake-make-diagnostic (current-buffer) > >> (point-min) (point-max) > >> :error "message")))))) > >> > >> Note that this backend adds a diagnostic for buffer *a*, not *b*. > >> > >> 4. Enable Flymake mode in buffer *b*. > >> > >> Buffer *b* will now show a diagnostic, even though it was reported for > >> buffer *a*. This should either add a diagnostic for buffer *a* or > >> signal an error. > > > > Hi Phillip, > > > > Sorry for the very slow turnaround. > > > > The behaviour for handling the mismatch between the (1) the buffer > > passed to flymake-make-diagnostic (2) the buffer where the report > > function executes is unspecified and it is so by design. > > > > I've yet to come to a good conclusion on what that behaviour should be, > > and maybe you can help me. Let's see some plausible real-world scenari= os. > > > > 1. Some uses of Flymake, notably Eglot's via LSP (Language Server > > Protocol) can possibly take advantage of a good definition of this > > behaviour, for aggregating the errors reports across a project for > > example. So `flymake-make-diagnostic` could be specified to take a > > BUFFER-OR-FILE, and we could heuristically decide to add the > > diagnostic to, say, a per-project database. > > > > 2. In another simpler scenario, checking .c file might issue errors for > > included .h files, and if that file is open in a buffer, we could go > > there and highlight the error. Could we really? Maybe not, because > > the error was probably generated for the on-disk copy of the .h file, > > whose contents might differ wildly from the buffer's. Then again, a > > smart backend could consider that. > > > > So maybe your "error" proposal makes sense, maybe it doesn't. I'd > > rather not commit to an API right now that could block evolution. > > I wouldn't say signaling an error now would block evolution. I don't thi= nk we have a principle like "anything that signals an error now will contin= ue doing so in the future." And yet, but experience shows that programs rely on externally observable behaviour again and again, and I have little reason to believe errors are an exception to that. So unless we're reasonably sure that the changes we make to a piece of behavior make sense in the long run, better not do them. I think there's prior art with negative overlay priorities, for example: last I checked manual said "please don't use these, as we haven't decided on what they might mean". Or something like that. I don't think an error make sense there, either. Jo=C3=A3o