From unknown Tue Jun 17 01:50:25 2025 X-Loop: help-debbugs@gnu.org Subject: bug#51549: 29.0.50; flymake error when filename contain '%' Resent-From: Ola x Nilsson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Nov 2021 11:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 51549 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 51549@debbugs.gnu.org X-Debbugs-Original-To: Received: via spool by submit@debbugs.gnu.org id=B.163576753522076 (code B ref -1); Mon, 01 Nov 2021 11:53:02 +0000 Received: (at submit) by debbugs.gnu.org; 1 Nov 2021 11:52:15 +0000 Received: from localhost ([127.0.0.1]:33863 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mhVrK-0005jz-9w for submit@debbugs.gnu.org; Mon, 01 Nov 2021 07:52:14 -0400 Received: from lists.gnu.org ([209.51.188.17]:33752) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mhVrF-0005jp-Hz for submit@debbugs.gnu.org; Mon, 01 Nov 2021 07:52:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57068) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mhVrF-0002dH-9y for bug-gnu-emacs@gnu.org; Mon, 01 Nov 2021 07:52:09 -0400 Received: from smtp1.axis.com ([195.60.68.17]:40803) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mhVrB-0006CD-QW for bug-gnu-emacs@gnu.org; Mon, 01 Nov 2021 07:52:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1635767525; x=1667303525; h=from:to:subject:date:message-id:mime-version; bh=VcP2o+HnVA0jUHOA3G/rlLzYw+z9Gpn80EcT/yF+7Sw=; b=CE61Iuw6ylxyPT6PpXIrfl9qAhhMDCC/jJmi71wS692vnTrRTgRK9zfJ r+a7FQrRaVAqejkGIA2zu4a2KxHc688km+1fQsJ5j6PvrPM7CozI0JzlA FJSsfC86oho3IJBRk0H1PKD2SWDLJae+dXMTMtQJg3lJCdFSGKEheChIJ Q+WevbvcfRNsZ/aUKrAaGbj3q2uDfF3JapSIxxg5sVdqPe4I6LNscYHVg OizgupOUfaxWwehLFdCdiSlfQY5n4EHF8iTENafMk90ECV8QTKnmfPxMX INew+FCGZQ5GLLLXHN47Ga1cL/PTvbMXdHlIMTrRkR+dqy2cDnaM0XcIz A==; User-agent: mu4e 1.4.15; emacs 29.0.50 From: Ola x Nilsson Date: Mon, 1 Nov 2021 12:52:00 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=195.60.68.17; envelope-from=Ola.x.Nilsson@axis.com; helo=smtp1.axis.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) 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: -2.4 (--) Flymake includes the buffer name in `warning-type-format' (see `flymake--log-1'). When the file name - and the buffer name - contain a % character it is very probable that the `format' call in `display-warning' either fails or produce unexpected results. In my case I used a file name arm-trusted-firmware-2.4_%.bbappend with a local flymake backend running a local linter. The local backend uses a process sentinel to process errors and generate flymake diagnostic objects with (flymake-make-diagnostic source beg end type msg) where source is the buffer visiting arm-trusted-firmware-2.4_%.bbappend, bed and end set from `flymake-diag-region' type is :warning and msg is a string with the error message from the linter. In GNU Emacs 29.0.50 (build 3, x86_64-pc-linux-gnu, GTK+ Version 3.24.5, cairo version 1.16.0) of 2021-10-28 built on lnxolani1 Repository revision: cb949963570ad0dbe272109f0245ca21029e2e5c Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12004000 System Description: Debian GNU/Linux 10 (buster) Configured using: 'configure --with-native-compilation' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM GTK3 ZLIB Important settings: value of $LC_MONETARY: en_GB.UTF-8 value of $LC_NUMERIC: en_GB.UTF-8 value of $LC_TIME: en_GB.UTF-8 value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: ELisp/l Minor modes in effect: magit-auto-revert-mode: t checkdoc-minor-mode: t delete-trailing-whitespace-mode: t hes-mode: t desktop-save-mode: t flycheck-mode: t global-git-commit-mode: t which-function-mode: t display-time-mode: t global-auto-revert-mode: t override-global-mode: t shell-dirtrack-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-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 column-number-mode: t line-number-mode: t indent-tabs-mode: t Load-path shadows: /home/olani/.emacs.d/elpa-lnxolani1-29.0.50/dpkg-dev-el-20190824.2314/debian-autoloads hides /home/olani/.emacs.d/elpa-lnxolani1-29.0.50/debian-el-20201011.1543/debian-autoloads /home/olani/.emacs.d/elpa-lnxolani1-29.0.50/magit-20210928.1325/magit-section-pkg hides /home/olani/.emacs.d/elpa-lnxolani1-29.0.50/magit-section-20210829.1849/magit-section-pkg /home/olani/.emacs.d/elpa-lnxolani1-29.0.50/transient-20210920.1038/transient hides /usr/local/share/emacs/29.0.50/lisp/transient Features: (shadow emacsbug dabbrev edebug cus-edit loadhist vc-dir ewoc vc-filewise cl-print debug backtrace cus-start cus-load url-http-ntlm ntlm hmac-md5 hex-util md4 url-http url-gw url-cache eww xdg url-queue mm-url gnus nnheader rect magit-bundle magit-patch magit-subtree magit-gitignore magit-imerge ispell macrostep-c cmacexp macrostep eieio-opt speedbar ezimage dframe shortdoc coan-c c-style-axis vc-clearcase trace tq coan-lilypond coan-semc coan-todochiku incdec help-fns hideif hideshow coan-cc cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs coan-gmake make-mode magit-ediff ediff ediff-merg ediff-mult ediff-wind ediff-diff ediff-help ediff-init ediff-util rng-xsd xsd-regexp rng-cmpct rng-nxml rng-valid rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt rng-util rng-pttrn nxml-ns nxml-mode nxml-outln nxml-rap sgml-mode facemenu nxml-util nxml-enc xmltok disp-table view pp descr-text coan-magit-gerrit magit-gerrit log-view vc-annotate bitbake-build-dir wid-edit coan-magit-functions mmm-cmds dired-aux coan-dired goto-addr vc-mtn vc-hg vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs gerrit-buttons magit-extras magit-imenu git-rebase coan-magit magit-submodule magit-obsolete magit-popup magit-blame magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit magit-sequence magit-notes magit-worktree magit-tag magit-merge magit-branch magit-reset magit-files magit-refs magit-status magit magit-repos magit-apply magit-wip magit-log magit-diff smerge-mode diff magit-core magit-autorevert magit-margin magit-transient magit-process magit-mode vc display-fill-column-indicator shr-color color shr kinsoku svg xml dom misearch multi-isearch gnutls network-stream nsm mailalias qp sort face-remap mail-extr coan cl gee-email gee-gerrit-rest mu4e mu4e-org org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-footnote org-src ob-comint org-pcomplete org-list org-faces org-entities noutline outline org-version ob-emacs-lisp ob-core ob-eval org-table oc-basic bibtex ol org-keys oc org-compat org-macs org-loaddefs mu4e-main mu4e-view cal-menu calendar cal-loaddefs mu4e-headers mu4e-compose mu4e-context mu4e-draft mu4e-actions ido rfc2368 smtpmail sendmail mu4e-mark mu4e-message flow-fill mu4e-proc mu4e-utils doc-view image-mode exif mu4e-lists mule-util hl-line mu4e-vars mu4e-meta bblint let-alist bitbake generic conf-bitbake-mode bitbake-ff grep find-file bitbake-mmm flycheck-checkbashisms sh-script smie executable mmm-sh-here-doc mmm-mode mmm-univ mmm-class mmm-region bitbake-functions bitbake-compat checkdoc coan-elisp skeleton delete-trailing-whitespace-mode init highlight-escape-sequences woman man pcase anaphora dired-rainbow dired-hacks-utils autoinsert mmm-sample mmm-auto mmm-vars mmm-utils mmm-compat t32-auto coan-list midnight desktop frameset flycheck-flawfinder flycheck-cstyle flycheck find-func python-black reformatter python tramp-sh bug-reference find-dired git-commit with-editor transient server log-edit message rmc puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mailabbrev mail-utils gmm-utils mailheader pcvs-util add-log magit-git magit-section magit-utils crm dash edmacro kmacro gitignore-mode conf-mode flymake-git-whitespace flymake-proc flymake project compile text-property-search thingatpt vc-git diff-mode vc-dispatcher advice coan-29.0.50-autoloads autoload radix-tree lisp-mnt mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr whitespace which-func imenu time avoid autorevert filenotify jka-compr use-package use-package-ensure use-package-delight use-package-diminish use-package-bind-key bind-key easy-mmode use-package-core finder-inf coan-system tramp tramp-loaddefs trampver tramp-integration files-x tramp-compat shell pcomplete comint ansi-color ring parse-time iso8601 time-date ls-lisp format-spec dpkg-dev-el debian-el url-auth info package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util mailcap url-handlers url-parse auth-source eieio eieio-core eieio-loaddefs password-cache json map url-vars comp comp-cstr warnings rx cl-seq cl-macs cl-extra help-mode seq gv subr-x byte-opt cl-loaddefs cl-lib bytecomp byte-compile cconv early-init iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer 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 emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit x multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 2351826 196419) (symbols 48 60287 194) (strings 32 373582 28488) (string-bytes 1 11152651) (vectors 16 149160) (vector-slots 8 3218814 467321) (floats 8 645 2556) (intervals 56 169534 4504) (buffers 992 151)) -- Ola x Nilsson From unknown Tue Jun 17 01:50:25 2025 X-Loop: help-debbugs@gnu.org Subject: bug#51549: 29.0.50; flymake error when filename contain '%' Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 06 Nov 2021 08:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51549 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Ola x Nilsson Cc: 51549@debbugs.gnu.org, =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Received: via spool by 51549-submit@debbugs.gnu.org id=B51549.163618746230779 (code B ref 51549); Sat, 06 Nov 2021 08:32:01 +0000 Received: (at 51549) by debbugs.gnu.org; 6 Nov 2021 08:31:02 +0000 Received: from localhost ([127.0.0.1]:48316 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mjH6M-0007zz-A2 for submit@debbugs.gnu.org; Sat, 06 Nov 2021 04:31:02 -0400 Received: from mail-pj1-f53.google.com ([209.85.216.53]:33630) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mjH6J-0007sc-P6 for 51549@debbugs.gnu.org; Sat, 06 Nov 2021 04:31:00 -0400 Received: by mail-pj1-f53.google.com with SMTP id w33-20020a17090a6ba400b001a722a06212so1715916pjj.0 for <51549@debbugs.gnu.org>; Sat, 06 Nov 2021 01:30:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:in-reply-to:references:user-agent :mime-version:date:message-id:subject:to:cc :content-transfer-encoding; bh=aeOgI0Uy6FndRhiIK/9gYQj8QROMze3P5/v7UlhM7oo=; b=av2yHU2+CQJPZYWWBV0/eY1Q3N2HVSfIawGk3SYuo+hJ4S5CP0ZBgpl+ZQ85d9gpnj 5+VjQNy9XFMuRIITFik95PyTEWhoo9OQlwUeKnKqwhElf9ESSOJan3zbNPs5qWmuK7ef +g8ecFZG4iIJzYFo0SKdZTD11NGSE9HP+jCpPttTAMwONH2O6l6rOqNKXey4XsykopLf +rXUPajeXncvUOUg3p9zEq/kt+5d+2GsqD7P/lrSTIsKruqjpqjWdYIGHv3scKJFEhHP M4HHlt2QSognvv7D4TEyN/rtEaYHtM3Iyj3wUAmEUZp8QdBD6isWfcoc90x0DQ/TqkUh Z9JQ== X-Gm-Message-State: AOAM533vdYWGHX6+x9tqgiMSgtqBWTsoOSbBUXt+lSgEz0WBXq+E5wxH cH3wuy9e/qXkLZ7ARo987RDjZ3Gec6nHcpDf6+0= X-Google-Smtp-Source: ABdhPJzsrawHkaQfeYpNq0y4IUpt+6auqRYZrfgF9QFGFphucRHpkQ7BqTJo2tqousNhztvb2a9LC+Vy2Pa5xevTIUE= X-Received: by 2002:a17:90b:1e0e:: with SMTP id pg14mr35937240pjb.143.1636187454062; Sat, 06 Nov 2021 01:30:54 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sat, 6 Nov 2021 01:30:53 -0700 From: Stefan Kangas In-Reply-To: (Ola x. Nilsson's message of "Mon, 1 Nov 2021 12:52:00 +0100") References: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Date: Sat, 6 Nov 2021 01:30:53 -0700 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.5 (/) 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.5 (/) tags 51549 + confirmed thanks Ola x Nilsson writes: > Flymake includes the buffer name in `warning-type-format' (see > `flymake--log-1'). > When the file name - and the buffer name - contain a % character it is > very probable that the `format' call in `display-warning' either fails > or produce unexpected results. > > In my case I used a file name arm-trusted-firmware-2.4_%.bbappend with a > local flymake backend running a local linter. > The local backend uses a process sentinel to process errors and generate > flymake diagnostic objects with > > (flymake-make-diagnostic source beg end type msg) > > where > source is the buffer visiting arm-trusted-firmware-2.4_%.bbappend, > bed and end set from `flymake-diag-region' > type is :warning > and msg is a string with the error message from the linter. Thanks for the bug report. I can reproduce this using this contrived example: ./src/emacs -Q --eval "(progn (require 'flymake) (find-file \"/tmp/foo%sbar.c\") \ (flymake--log-1 :emergency nil \"foo\"))" I now see in the *Warnings* buffer: Emergency [flymake fooflymakebar.c]: foo The expected output is: Emergency [flymake foo%sbar.c]: foo Your analysis of why the problem happens seems correct to me, but I'm not sure how to best fix it. Jo=C3=A3o, what do you think? From unknown Tue Jun 17 01:50:25 2025 X-Loop: help-debbugs@gnu.org Subject: bug#51549: 29.0.50; flymake error when filename contain '%' 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: Sat, 06 Nov 2021 09:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51549 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed To: Stefan Kangas Cc: Ola x Nilsson , 51549@debbugs.gnu.org Received: via spool by 51549-submit@debbugs.gnu.org id=B51549.163619149418159 (code B ref 51549); Sat, 06 Nov 2021 09:39:02 +0000 Received: (at 51549) by debbugs.gnu.org; 6 Nov 2021 09:38:14 +0000 Received: from localhost ([127.0.0.1]:48431 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mjI9O-0004io-En for submit@debbugs.gnu.org; Sat, 06 Nov 2021 05:38:14 -0400 Received: from mail-pl1-f172.google.com ([209.85.214.172]:40880) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mjI9L-0004iZ-5P for 51549@debbugs.gnu.org; Sat, 06 Nov 2021 05:38:13 -0400 Received: by mail-pl1-f172.google.com with SMTP id v20so12571433plo.7 for <51549@debbugs.gnu.org>; Sat, 06 Nov 2021 02:38:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=sTQFR4KDnR5jghPIg6A5Lf4uFP1JzwgjvCNGfyGRJOk=; b=EgIHqwNMnU0QN5Uq4r63Z+ljMTGa8QzWqPDyI6KHXsHfXdMSA0qmdYM0W2JesXRlKX spQ6UtgOEgEHmafuAC5yeHbsQQSYL8aVfA+i9dxI1JE4uasxgg6kMe5AL+1FTvU2Ifz0 g2mWksFv84xYB8/FlLL02AmCwuWGbVgOsKzqDm++vOk1PpNBXR0MFudeldJzi9sLFu88 j9JFuBv7eBwIMvDPTr0gzarQ5ZuCVzNDyNbmNxX+QpLxyhBcp+dZdrlEWhTu06XPydV+ vI+0LBWS0cY4Nxlw4YPtxvnhpWN36TrUhevnwO4Sm0mbal0Vj8npCX3OhFDsWOuBxrBI hjEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=sTQFR4KDnR5jghPIg6A5Lf4uFP1JzwgjvCNGfyGRJOk=; b=7rz0wBGeHRTJ+8rCj3077/aRxbXX23j4s6AraNmZOwUDAqIWbvqyyIaAmkzn4XKI9k Fo04eLykE0ZbhstYx/hjr0vZ7gfDAAmgaC8DwomgyOgRSNDAg7IMQ+Ln7dGLyN5YlbyP mdti3F5P1teA571VTsXLEYcnOtA3BbXxZotAJTZvHfzTL9RBgPvm4Yshi4ce1XT026qL qrrVWRxF13OxxCfWNZyf7J4vk/HMV5CqeP2L6qUD+0GWS6D02qeB14uMJ9lAQNINBC4I a/29auT2M+DQ5+CVXR6K7zwcvvYQK7ddRrNAt0PsxSjbFCT91Pxt6ZGEitHOAQnYr9r2 9SsQ== X-Gm-Message-State: AOAM532QzsSseXJ76FWzo6jLpXEL4fB0COuOA6Y6uFgwreY9S8YHLl0F e7KPTm2omYGquebXOkORBILXPNvj3/qTpxneTA0= X-Google-Smtp-Source: ABdhPJy/BeuIznAAH5TwSV5rglGTcGHRM056whKSo4No/eJ6BmmDClnomCXSnNlWcStdwoNV0rVxQhyCozDBSMCj9Rg= X-Received: by 2002:a17:90a:df97:: with SMTP id p23mr36608667pjv.3.1636191485149; Sat, 06 Nov 2021 02:38:05 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Date: Sat, 6 Nov 2021 09:37:54 +0000 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) 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 (-) Hi Stefan, Ola Thanks for the report. I don't have much time to look into this but this looks like the typical problem where a user-provided string is being passed as the first argument of format/message. In these cases, one normally makes it so that the first argument is simply the string "%s" and then the second argument is that user-provided thing. Thanks very much for looking into this, Jo=C3=A3o On Sat, Nov 6, 2021 at 8:30 AM Stefan Kangas wrote: > > tags 51549 + confirmed > thanks > > Ola x Nilsson writes: > > > Flymake includes the buffer name in `warning-type-format' (see > > `flymake--log-1'). > > When the file name - and the buffer name - contain a % character it is > > very probable that the `format' call in `display-warning' either fails > > or produce unexpected results. > > > > In my case I used a file name arm-trusted-firmware-2.4_%.bbappend with = a > > local flymake backend running a local linter. > > The local backend uses a process sentinel to process errors and generat= e > > flymake diagnostic objects with > > > > (flymake-make-diagnostic source beg end type msg) > > > > where > > source is the buffer visiting arm-trusted-firmware-2.4_%.bbappend, > > bed and end set from `flymake-diag-region' > > type is :warning > > and msg is a string with the error message from the linter. > > Thanks for the bug report. I can reproduce this using this contrived > example: > > ./src/emacs -Q --eval "(progn (require 'flymake) (find-file > \"/tmp/foo%sbar.c\") \ > (flymake--log-1 :emergency nil \"foo\"))" > > I now see in the *Warnings* buffer: > > Emergency [flymake fooflymakebar.c]: foo > > The expected output is: > > Emergency [flymake foo%sbar.c]: foo > > Your analysis of why the problem happens seems correct to me, but I'm > not sure how to best fix it. Jo=C3=A3o, what do you think? --=20 Jo=C3=A3o T=C3=A1vora From unknown Tue Jun 17 01:50:25 2025 X-Loop: help-debbugs@gnu.org Subject: bug#51549: 29.0.50; flymake error when filename contain '%' Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 06 Nov 2021 11:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51549 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Cc: Ola x Nilsson , 51549@debbugs.gnu.org Received: via spool by 51549-submit@debbugs.gnu.org id=B51549.163619694327994 (code B ref 51549); Sat, 06 Nov 2021 11:10:01 +0000 Received: (at 51549) by debbugs.gnu.org; 6 Nov 2021 11:09:03 +0000 Received: from localhost ([127.0.0.1]:48586 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mjJZG-0007HR-Px for submit@debbugs.gnu.org; Sat, 06 Nov 2021 07:09:02 -0400 Received: from mail-pj1-f46.google.com ([209.85.216.46]:43904) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mjJZF-0007Gu-KM for 51549@debbugs.gnu.org; Sat, 06 Nov 2021 07:09:02 -0400 Received: by mail-pj1-f46.google.com with SMTP id nh10-20020a17090b364a00b001a69adad5ebso5180880pjb.2 for <51549@debbugs.gnu.org>; Sat, 06 Nov 2021 04:09:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:in-reply-to:references:mime-version:date :message-id:subject:to:cc:content-transfer-encoding; bh=quRvbMSUcb/O70TBZWY0UDpppqb+P4hvtxu6AGnxVSM=; b=rQkvDgCSwAwLZfLr0wZbMeExaBNgmCJOuPJoooDcT/uKbfx70dqdy9JnuLGfCC8V4R voi/Xn/+V7Pg/TmgaBMYn1L1cw8sBXNlzUJKAtuzCcJiaipWXBkX5JWL3reePd7fCXbg io9KT1fe3XzfEZ5h7PpDPklG+IM13KtBcBsSlmP/AkmneMQMSExyE/fYJQDzqwXZkFOA 50PGP94erMe8tYtG6/b+2zx+81QpQuRAqKOsKT8EPkp5tagPVyIkA4KkFwtbzG1Vlwut Xa7ou9CCDvXl7iXhjVDSwa6Epm4cQ+fEe/sHGqnEyWMO8JkqduLyByBRVuzbmrFRVKVZ LHhQ== X-Gm-Message-State: AOAM532J+vwWBabf8OiSXbSOkkZ5pa/VY8l03HRqiRQIBIbC2sWpzZAI /4BF/TyO8td1wanYIjog8LgoiCJlDDOCOfUfzLg= X-Google-Smtp-Source: ABdhPJw66hNPzbSo4Uf9QnviUOs+mcmSZ33ZmOVENRjATg98MNe5Y+DGLZOw/CkYyx45/9Jn8V3EeBNxPNpPGFjRpeM= X-Received: by 2002:a17:902:c145:b0:142:50c3:c2a with SMTP id 5-20020a170902c14500b0014250c30c2amr7693759plj.32.1636196935531; Sat, 06 Nov 2021 04:08:55 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sat, 6 Nov 2021 04:08:55 -0700 From: Stefan Kangas In-Reply-To: References: MIME-Version: 1.0 Date: Sat, 6 Nov 2021 04:08:55 -0700 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.5 (/) 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.5 (/) Jo=C3=A3o T=C3=A1vora writes: > Thanks for the report. I don't have much time to look into this but > this looks like the typical problem where a user-provided > string is being passed as the first argument of format/message. > > In these cases, one normally makes it so that the first > argument is simply the string "%s" and then the second > argument is that user-provided thing. That's what I thought too, until I looked at the code. Unfortunately, the fix we both thought of isn't that trivial as we set `warning-type-format' like this: (warning-type-format (format " [%s %s]" (or sublog 'flymake) (current-buffer))) And then we run `display-warning', which uses this variable as the first argument to format. Is there a strong need to have this format for flymake warnings? Emergency [flymake foo%sbar.c]: foo If not, my best idea for fixing this is to remove the filename from the `warning-type-format', and put it in the message instead. That would be a backwards-incompatible change, however. From unknown Tue Jun 17 01:50:25 2025 X-Loop: help-debbugs@gnu.org Subject: bug#51549: 29.0.50; flymake error when filename contain '%' 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: Sat, 06 Nov 2021 16:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51549 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed To: Stefan Kangas Cc: Ola x Nilsson , 51549@debbugs.gnu.org Received: via spool by 51549-submit@debbugs.gnu.org id=B51549.16362171785508 (code B ref 51549); Sat, 06 Nov 2021 16:47:01 +0000 Received: (at 51549) by debbugs.gnu.org; 6 Nov 2021 16:46:18 +0000 Received: from localhost ([127.0.0.1]:50320 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mjOpe-0001Qm-2l for submit@debbugs.gnu.org; Sat, 06 Nov 2021 12:46:18 -0400 Received: from mail-pj1-f43.google.com ([209.85.216.43]:53157) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mjOpc-0001QZ-Bf for 51549@debbugs.gnu.org; Sat, 06 Nov 2021 12:46:16 -0400 Received: by mail-pj1-f43.google.com with SMTP id h24so4066353pjq.2 for <51549@debbugs.gnu.org>; Sat, 06 Nov 2021 09:46:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=MvV5kTExy3iEof+Fdu+D8hFwH2nFtFQ4CDTH9qP26aQ=; b=Lz6ocqPgkjfzQ3r37LNqYqVl1O0w0rkyRvXnoEBfzBj3a2ga8iOG8nusug99DIg7SW 8/XhL2R4i04FT4ko5u38gfKfpqtIMf0BBcSmcxZ5FbOIiCfeMRAIbJ4pVAmN//PIZtjH zoLvp5I8yLNvRCpvVzZCSUMz8iCQP2G05Dmxwq01Zw/bja8/pwZzk1/VE3WgNfTtXC0d RRry0LnScNpD8jvebcbk0Y9fmhEFP3WbLjOaDUhOutOdHAIWAf2stg/l7Jca6Z0XRgHh sUV3s15/+Wx3MVdrXYZeXTLuEUJSAqLhADraOlVFZZ/yQqB2bOfrfX+drmNhmua4XAnw LYKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=MvV5kTExy3iEof+Fdu+D8hFwH2nFtFQ4CDTH9qP26aQ=; b=49JjJ/1epgtM7QuIhgwJVE0YLnGrYigQv/8ZlSY08cFn1cOwTZug+1oo0zL4ZgLJQh 73q8kojp4rHEjsajOyjjogW7tQxTgrWUidtd84ZPQkIOcTenyu2RrURDD4qSr2mmOC39 7W84f2KeBH+6daA70IedQD0pMzdMAWdeCQgoq3n/FHz7HV3GwPGVwNUYh9GLJMGYtlqi btaDAeyuCkswvJBFUrrr0z7Qf0rn8lnDlXpRFus2UbW0uYQpyd88B38bAZ03vgNCs01A ok6g8zPeOpAEj+XZtRaNNuVPnY+p3GH8QRJZ+baNBMPtrUHXzpQ6pmfV5lo8u5YJA9k4 8D/A== X-Gm-Message-State: AOAM533fJ7ALFQiJdqTvS1ooESftl+PT9WFr3/BPlnwi6f0Okkgd/bGT mh9elaS5XOwEtUauiVlOJaInxQe0bPUspb82ITE= X-Google-Smtp-Source: ABdhPJyEoCeTQZNFARpSpmsJNPC+G+fmjL0VUWhZua7xavvVjJXc3ycxaYixA2R3a+LrDfCFub4BqIMFZlW4XzKFaAo= X-Received: by 2002:a17:90b:188e:: with SMTP id mn14mr38723095pjb.91.1636217170509; Sat, 06 Nov 2021 09:46:10 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Date: Sat, 6 Nov 2021 16:45:59 +0000 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) 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 Sat, Nov 6, 2021 at 11:08 AM Stefan Kangas wrote: > That's what I thought too, until I looked at the code. Unfortunately, > the fix we both thought of isn't that trivial as we set > `warning-type-format' like this: > > (warning-type-format > (format " [%s %s]" > (or sublog 'flymake) > (current-buffer))) Ah I see. Then maybe the problem is how that is used forward. > And then we run `display-warning', which uses this variable as the first > argument to format. > > Is there a strong need to have this format for flymake warnings? Absolutely not. This is probably one of the most over-engineered things I put in Flymake. It's occasionally useful, but not terribly so. > Emergency [flymake foo%sbar.c]: foo > > If not, my best idea for fixing this is to remove the filename from the > `warning-type-format', and put it in the message instead. That would be > a backwards-incompatible change, however. Yes, do what you think is best, and thanks in advance. It's good to have the buffer name where the warning came from, but it doesn't have to be in that exact place. Maybe just escaping the "%" in the return value of `current-buffer` would work though? Doubling the "%" into "%%", perhaps. Jo=C3=A3o From unknown Tue Jun 17 01:50:25 2025 X-Loop: help-debbugs@gnu.org Subject: bug#51549: 29.0.50; flymake error when filename contain '%' Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 06 Nov 2021 20:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51549 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Cc: Ola x Nilsson , 51549@debbugs.gnu.org Received: via spool by 51549-submit@debbugs.gnu.org id=B51549.163622917413293 (code B ref 51549); Sat, 06 Nov 2021 20:07:02 +0000 Received: (at 51549) by debbugs.gnu.org; 6 Nov 2021 20:06:14 +0000 Received: from localhost ([127.0.0.1]:50864 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mjRx7-0003SK-UH for submit@debbugs.gnu.org; Sat, 06 Nov 2021 16:06:14 -0400 Received: from mail-pf1-f177.google.com ([209.85.210.177]:39920) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mjRx6-0003S2-V9 for 51549@debbugs.gnu.org; Sat, 06 Nov 2021 16:06:13 -0400 Received: by mail-pf1-f177.google.com with SMTP id x64so12140730pfd.6 for <51549@debbugs.gnu.org>; Sat, 06 Nov 2021 13:06:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:in-reply-to:references:mime-version:date :message-id:subject:to:cc:content-transfer-encoding; bh=eApyoCcwyYdR2dtkXRG4KeI8XLVVYdTzxbSQVtusizA=; b=uDFvvGhdm8lziW1mGsXXaCRjQIWJ6rbv+8hVPcXvq0PwJCBdYETzkpoafY+w9NQ4u6 Oh4cz2Wv4SBfUcJf0lYsuCNT6xiL5Aua+plzGLHCr10iYWPGgj4jJarVExo+ADEwRKKd hkrnz7yQZLYg1L6eOqYM7Hl+dzLpyFG5QTErjhAsIV3WXeo/ZVAjfr/AbhAzFNir+zkV CF+5MosITx5nYuK7wDe7rOwDbqO9SNsuHwFhZ6sQnDS0xJd0MiR/YH/hF26X/7FTTwq2 7mpGsFdmQNoF9OdA4qPKL6H9UCM9LtRmyaQmd1s+r6dRhG3kYOI/NWFDVVf6b82GMmwg y4bg== X-Gm-Message-State: AOAM533RO1nE2NyAqn8WCO4ZiBo3jsZ0LW+FmFHC86F/dOEw+l7+bP3j rG0RwR9OuGotk4YhK8BN6EqJwAhESbXxUtqZ87c= X-Google-Smtp-Source: ABdhPJywqGMrV2QAtA+o1V2kv9MJ4/5gBp6d0d3YO+o74Ux9DJJHFfjSwiwkjelYWWLvebJfTAyWrqFds0iPYtN4oJ4= X-Received: by 2002:a62:1a03:0:b0:494:64b5:3e01 with SMTP id a3-20020a621a03000000b0049464b53e01mr20770666pfa.35.1636229166861; Sat, 06 Nov 2021 13:06:06 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sat, 6 Nov 2021 13:06:06 -0700 From: Stefan Kangas In-Reply-To: References: MIME-Version: 1.0 Date: Sat, 6 Nov 2021 13:06:06 -0700 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.5 (/) 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.5 (/) close 51549 28.1 thanks Jo=C3=A3o T=C3=A1vora writes: > Yes, do what you think is best, and thanks in advance. > It's good to have the buffer name where the warning came from, > but it doesn't have to be in that exact place. Maybe just > escaping the "%" in the return value of `current-buffer` > would work though? Doubling the "%" into "%%", perhaps. Doh! Of course, that's the other obvious thing to do, thanks for reminding me. Now fixed on emacs-28 in commit d85cf33e49. Ola, thanks again for the bug report.