From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Michalis V." Newsgroups: gmane.emacs.bugs Subject: bug#24739: 25.1; conf-mode can't handle non escaped single quotes Date: Sat, 21 Aug 2021 18:39:04 +0300 Message-ID: <874kbierjb.fsf@cnu407c2zx.nsn-intra.net> References: <87lfwjh9u4.fsf@mouse.gnus.org> <875znnv2pt.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2022"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Lars Ingebrigtsen , Noam Postavsky , 24739@debbugs.gnu.org To: Diego Berrocal Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 21 17:40:15 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 1mHT6U-0000JA-Sa for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 21 Aug 2021 17:40:14 +0200 Original-Received: from localhost ([::1]:43172 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mHT6S-0000TK-Pp for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 21 Aug 2021 11:40:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49148) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mHT6I-0000TA-BC for bug-gnu-emacs@gnu.org; Sat, 21 Aug 2021 11:40:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54404) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mHT6I-0007An-3e for bug-gnu-emacs@gnu.org; Sat, 21 Aug 2021 11:40:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mHT6I-0005Zq-1F for bug-gnu-emacs@gnu.org; Sat, 21 Aug 2021 11:40:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Michalis V." Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Aug 2021 15:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24739 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 24739-submit@debbugs.gnu.org id=B24739.162956035621381 (code B ref 24739); Sat, 21 Aug 2021 15:40:01 +0000 Original-Received: (at 24739) by debbugs.gnu.org; 21 Aug 2021 15:39:16 +0000 Original-Received: from localhost ([127.0.0.1]:37717 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mHT5Y-0005Yn-3S for submit@debbugs.gnu.org; Sat, 21 Aug 2021 11:39:16 -0400 Original-Received: from mail-wm1-f67.google.com ([209.85.128.67]:41570) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mHT5W-0005Ya-W8 for 24739@debbugs.gnu.org; Sat, 21 Aug 2021 11:39:15 -0400 Original-Received: by mail-wm1-f67.google.com with SMTP id c129-20020a1c35870000b02902e6b6135279so7887219wma.0 for <24739@debbugs.gnu.org>; Sat, 21 Aug 2021 08:39:14 -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; bh=rZ1ajPQksjtxX4RIoNuOmRxicuDUDOeHma9QvzUpRtA=; b=X0OyBP+wvh4amob+TkAk+12haCCjvyi0KzCiD39hER3MQqLaWYAVtvZQfksteOOqB1 gnr6Prlvjswgyy+wfEB6Z3iKU7sfod02Mld78zbdHMAX2eVte22eblOBbXGpZj1aiO8y A2eKGYPBzcIgtUrTWPvCefxlBiHJYrj1oXxbprIEBArJ890d9X/nt18NnArbzW48PJo3 Nuj6+nsZhPclbWAbasEnT2GP6Q0DrW9BrRCkKbcJLFxubna15SX+4T9ym+cqJEm1tzKA LJFVT5wfxWx8lGDWwuN3qXc9bqY5NJRmgLyJs+SVUtkZbSE5b+fyE5/KOlhte00Nap8j u+rg== 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; bh=rZ1ajPQksjtxX4RIoNuOmRxicuDUDOeHma9QvzUpRtA=; b=R6z8s/JKcg8PjgUS5B3+ahwcZBEbUuEkoTX82fTpzhwSJOClZsyMIYYYjkm4xtCnK3 xIRBqEBjy559trlvmVe/XnLqYNMA9MVgmqzvuFtLKDBRwNl+dyL2MqrpaK667f7OApIz zA18xB36RjZ7QjBIwTp4w6XwY0WdRib/EwOfCEwAnkX3iDclTzFJUQsHOXdH2ZdJkLoy 09qfU7mDruX/U32jTbYcr6jTwhPZejT5tPTIpyaeB/YXe7tEYpMv+nwu4mjt3716IbSP 6jOiU5UiQQevAB3Ph8iOGn0QbufyazLGxkenHnZp7wN946Zb7Fm0dh+3+3Lvta6j6GY0 t6Vw== X-Gm-Message-State: AOAM5301BzrOYmV+qDrJF9dPRV0EVknh5CYhOQTx8KOgZF2PK61gshq8 nMSx3lWWQIXTcQjklXdIF6A= X-Google-Smtp-Source: ABdhPJy31WwXprIKO7PtKa0A9IC/2B2B5RFLmDBQrrQCIODVwhhD8eDSQuMIiDZYMMRsS5dwBye3+g== X-Received: by 2002:a1c:f613:: with SMTP id w19mr9022712wmc.9.1629560348981; Sat, 21 Aug 2021 08:39:08 -0700 (PDT) Original-Received: from cnu407c2zx.nsn-intra.net (109-178-191-99.pat.ren.cosmote.net. [109.178.191.99]) by smtp.gmail.com with ESMTPSA id p14sm7991386wmc.16.2021.08.21.08.39.07 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 21 Aug 2021 08:39:08 -0700 (PDT) X-Google-Original-From: "Michalis V." In-Reply-To: (Lars Ingebrigtsen's message of "Sun, 28 Jul 2019 11:50:56 +0200") 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:212370 Archived-At: Lars Ingebrigtsen writes: > Noam Postavsky writes: > >> Lars Ingebrigtsen writes: >> >>>> firstProperty=Hi I'm Diego >>>> secondProperty=I have a stringquote style. >> >>> No font-lock-string-face in sight, and there's no mention of it in the >>> file. So is this some general font-lock thing that's configured >>> somewhere else? Anybody know how this stuff works? >> >> font-lock-string-face comes from font-lock-syntactic-face-function, >> because ' has string delimiter syntax in conf-mode (see >> conf-mode-syntax-table). > > Hm... Oh! > > (modify-syntax-entry ?\' "\"" table) > > I was searching for ?' and only found the entry in > conf-toml-mode-syntax-table. I'll remove that superfluous backslash. > >> I think it should be possible to make a syntax-propertize rule that >> catches unmatched quotes and sets them to punctuation syntax. We do >> something similar in sgml-syntax-propertize. > > I see. hi, this conf-mode doesn't seem to follow the syntax-propertize structure so it doesn't look very trivial to do something similar as in sgml mode (at least as far as i managed to grasp the concept in there)..But the conf-mode author(s) seem like they were aware of this font-locking problem and had this workaround instead: (defun conf-quote-normal (arg) "Set the syntax of \\=' and \" to punctuation. With prefix ARG, only do it for \\=' if 1, or only for \" if 2. This only affects the current buffer. Some conf files use quotes to delimit strings, while others allow quotes as simple parts of the assigned value. In those files font locking will be wrong, and you can correct it with this command. (Some files even do both, i.e. quotes delimit strings, except when they are unbalanced, but hey...)" (interactive "P") (let ((table (copy-syntax-table (syntax-table)))) (when (or (not arg) (= (prefix-numeric-value arg) 1)) (modify-syntax-entry ?\' "." table)) (when (or (not arg) (= (prefix-numeric-value arg) 2)) (modify-syntax-entry ?\" "." table)) (set-syntax-table table) (font-lock-flush))) which is bound to C-c C-q and it will temporarily fix the incorrect string font-locking.. Any chance if it is sufficient for you Diego or do you think a more permanent solution should be implemented instead? thank you in advance, Michalis