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?K=C3=A9vin?= Le Gouguec Newsgroups: gmane.emacs.bugs Subject: bug#51899: Odd highlighting in compilation mode Date: Tue, 16 Nov 2021 22:31:42 +0100 Message-ID: <87v90rpz29.fsf@gmail.com> References: <87wnl8hvle.8.fsf@jidanni.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="12316"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 51899@debbugs.gnu.org To: =?UTF-8?Q?=E7=A9=8D=E4=B8=B9=E5=B0=BC?= Dan Jacobson Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 16 22:32:09 2021 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 1mn63l-00031M-Nn for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 16 Nov 2021 22:32:09 +0100 Original-Received: from localhost ([::1]:54484 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mn63k-0007Sm-GM for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 16 Nov 2021 16:32:08 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:41088) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mn63e-0007SW-FR for bug-gnu-emacs@gnu.org; Tue, 16 Nov 2021 16:32:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47816) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mn63e-0002yw-7B for bug-gnu-emacs@gnu.org; Tue, 16 Nov 2021 16:32:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mn63e-000082-3b for bug-gnu-emacs@gnu.org; Tue, 16 Nov 2021 16:32:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 16 Nov 2021 21:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51899 X-GNU-PR-Package: emacs Original-Received: via spool by 51899-submit@debbugs.gnu.org id=B51899.163709831332504 (code B ref 51899); Tue, 16 Nov 2021 21:32:02 +0000 Original-Received: (at 51899) by debbugs.gnu.org; 16 Nov 2021 21:31:53 +0000 Original-Received: from localhost ([127.0.0.1]:59362 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mn63U-0008Rw-P1 for submit@debbugs.gnu.org; Tue, 16 Nov 2021 16:31:53 -0500 Original-Received: from mail-wm1-f42.google.com ([209.85.128.42]:52211) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mn63T-0008MJ-1o for 51899@debbugs.gnu.org; Tue, 16 Nov 2021 16:31:51 -0500 Original-Received: by mail-wm1-f42.google.com with SMTP id z200so338834wmc.1 for <51899@debbugs.gnu.org>; Tue, 16 Nov 2021 13:31:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=6dqe/kNJxZWlbYFSbyabdbE6Gd9LrYxOrui8E29PmgA=; b=aR2XE8CVaHn/MiroB+9zFqndOy5wEkoD7eslr1pvm5QeF805S6+mZpj7B96BmdrkbG IIarhms6a++//dtevN3LhS9MOnIs3qdt/7bMLpX9PPN4I2ywemZIbuIPu8sE/xtCEeOS 7Seb5UqgOLVmnmsMCeRxn/yiy5iI/adEItrFrhzrhIOp/8NpkfX7Kwm+hZU0NfCIu3ed IsHFVm3VSnst6cF/YGTM/WXjGC93JOwfpuh1D/+OrSEZbDb3Xf/wKXDLiQZTAZGu2cqX /b9ZUY1a+3l1PUMK1Q0ROZhhxB0fpYcyELptjlasDgI3A20Ixzg3bXQ0L1SfVt+KzeDE IB+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=6dqe/kNJxZWlbYFSbyabdbE6Gd9LrYxOrui8E29PmgA=; b=F2bsKtgIwO0dbY+sam3NAHEUaRrePkmCHkQEHr8vbBnT4bCl3QzQcOgdEYposkiPTA 8YgJg/dYje/CzVJ0vi+dVTbuNZZoc/XGyXkIIcKmsPe/ZXxwWi3TD8NB4ZGlON317+zE mpOB1wLFO6HBxllHRqAquyI02WrVuLiR87wUaP53WXUn73sqZEAywJES3azQgrIbB9A7 OzcuJhvj47LrleD9pRDwrUjnYaPlW7QP3ZVb4cK4KXjdrvxHVQNRtWsyZMC6ES1zw2jn D0o2afP+UaztgCYdOVNZ7+mBJrU7SgJ1ZTF+n/LzQUJERydkioH0vAR7lj0gmh8Yrt6d pT5Q== X-Gm-Message-State: AOAM530VzNaU/tLBuHZYwiVaPFtoHYtL6ZTiGobER4dx4z5NaUhHJ1eP 9afMFhHbz+UEtrVm0x3nP+qaqm2BB7M= X-Google-Smtp-Source: ABdhPJxVoUELeqavMB642YuCBf+z9NKDnE3K5BTqcSX4QLtz+ccMm4ZQ6lIfmLp1iWvUD5vMursEQg== X-Received: by 2002:a1c:4d15:: with SMTP id o21mr72846757wmh.171.1637098304901; Tue, 16 Nov 2021 13:31:44 -0800 (PST) Original-Received: from amdahl30 ([2a01:e0a:253:fe0:2ef0:5dff:fed2:7b49]) by smtp.gmail.com with ESMTPSA id t9sm19558535wrx.72.2021.11.16.13.31.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Nov 2021 13:31:44 -0800 (PST) In-Reply-To: <87wnl8hvle.8.fsf@jidanni.org> ("=?UTF-8?Q?=E7=A9=8D=E4=B8=B9=E5=B0=BC?= Dan Jacobson"'s message of "Wed, 17 Nov 2021 01:13:49 +0800") 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" Xref: news.gmane.io gmane.emacs.bugs:220160 Archived-At: =E7=A9=8D=E4=B8=B9=E5=B0=BC Dan Jacobson writes: > "/tmp/$(basename" is highlighted. Yup, I guess that's due to this bit this from compilation-mode-font-lock-keywords: > (" --?o\\(?:utfile\\|utput\\)?[=3D ]\\(\\S +\\)" . 1) The heuristic, I guess, is "highlight things that look like output arguments". Maybe it could do with a smarter font-lock matcher? I'm not knowledgeable enough with font-lock to see how that could work; I think we'd want to skip over the --?o\\(?:utfile\\|utput\\)?[=3D ] part, then match everything that we find by forward-sexp'ing until (char-after) matches [ ;&|] (or we hit "no next sexp")? No idea if that's expressible with font-lock matchers. > One $m is highlighted, the others and $i etc. aren't. compilation-mode mostly expects command outputs, not shell scripts sources, so I don't know how much shell syntax we want the mode to highlight by default. The font-lock rule discussed above does show we expect some shell commands, but compilation-mode seems more concerned with bits relevant to the compilation process (i.e. here, the output files) than with shell syntax in general. > I have no opinions on what should be highlighted. Just be consistent. The consistency compilation-mode aims for, IIUC, is "highlight outputs of the compilation process".