From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#32766: Wrong syntax colors with backslash in a string (F90 mode) Date: Tue, 02 Feb 2021 16:25:27 +0100 Message-ID: <87k0rqjxug.fsf@gnus.org> References: <85507699.497150.1537311115648@mail.libero.it> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21414"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Glenn Morris , 32766@debbugs.gnu.org To: Angelo Graziosi Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 02 16:52:04 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 1l6xyF-0005Qq-KL for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 02 Feb 2021 16:52:03 +0100 Original-Received: from localhost ([::1]:38904 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l6xyE-0000fH-MA for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 02 Feb 2021 10:52:02 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:32948) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6xZ4-0007cF-8S for bug-gnu-emacs@gnu.org; Tue, 02 Feb 2021 10:26:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52690) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l6xZ4-0004bK-0V for bug-gnu-emacs@gnu.org; Tue, 02 Feb 2021 10:26:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l6xZ3-00086l-RO for bug-gnu-emacs@gnu.org; Tue, 02 Feb 2021 10:26:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 02 Feb 2021 15:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32766 X-GNU-PR-Package: emacs Original-Received: via spool by 32766-submit@debbugs.gnu.org id=B32766.161227954831135 (code B ref 32766); Tue, 02 Feb 2021 15:26:01 +0000 Original-Received: (at 32766) by debbugs.gnu.org; 2 Feb 2021 15:25:48 +0000 Original-Received: from localhost ([127.0.0.1]:36000 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l6xYq-000867-Ik for submit@debbugs.gnu.org; Tue, 02 Feb 2021 10:25:48 -0500 Original-Received: from quimby.gnus.org ([95.216.78.240]:34372) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l6xYn-00085g-T7 for 32766@debbugs.gnu.org; Tue, 02 Feb 2021 10:25:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: 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=gy6VZ733M7j8yhr/p+mgG5t8qJnpHuVwwtNNEQrzNME=; b=frExDB7j6O2zKYtQqonAOZDme1 haBnZJjiMAa1VJ8fJlhkCpxLKQ8f9K/5Ttru/ZIjc3F5KbJyfTIA/tqGVru7W0o1TeIVbN9Xt43x3 mvOndu2fWS9gzyaFldZaol6Cs8v5FMmzRLn7UPwyLESnQmdIYxRAtcW/Yc5rE0wAMXBk=; Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l6xYW-0005dv-Hy; Tue, 02 Feb 2021 16:25:39 +0100 X-Now-Playing: Casino Music's _Amour Sauvage_: "Faites Le Proton" In-Reply-To: <85507699.497150.1537311115648@mail.libero.it> (Angelo Graziosi's message of "Wed, 19 Sep 2018 00:51:55 +0200 (CEST)") 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:199148 Archived-At: Angelo Graziosi writes: > program foo > integer, parameter :: FOO = ichar('\') > integer, parameter :: BAR = 10 > end program foo This behaviour is still present in Emacs 28. f90-mode.el has the following: ;; I think that the f95 standard leaves the behavior of \ ;; unspecified, but that f2k will require it to be non-special. ;; Use `f90-backslash-not-special' to change. and indeed: (defun f90-backslash-not-special (&optional all) "Make the backslash character (\\) be non-special in the current buffer. With optional argument ALL, change the default for all present and future F90 buffers. F90 mode normally treats backslash as an escape character." (or (derived-mode-p 'f90-mode) (user-error "This function should only be used in F90 buffers")) (when (equal (char-syntax ?\\ ) ?\\ ) (or all (set-syntax-table (copy-syntax-table (syntax-table)))) (modify-syntax-entry ?\\ "."))) Executing this will make the snippet be fontified as the bug reporter expects. But I don't really know F90 any more -- would it make sense to flip the defaults now and make \ non-special? If that happened 21 years ago i F2K, then perhaps it's time? Adding Glenn to the CCs, since this was the commit that introduced the -not-special functions: commit 784d007b5033cb555482c9a50fbdaf5a10fa8ffa Author: Glenn Morris AuthorDate: Thu Nov 25 00:46:42 2004 +0000 (f90-smart-end, f90-previous-statement, f90-beginning-of-block): Doc fix. (f90-calculate-indent): Handle un-named PROGRAM blocks. (f90-end-of-block): Doc fix. Make check of outermost block conditional on value of `f90-smart-end'. (f90-block-match): Hack to deal with un-named PROGRAM blocks. Handle case where END-BLOCK is nil. (f90-match-end): Handle un-named PROGRAM blocks. (f90-backslash-not-special): New function. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no