From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: k3tu0isui@gmail.com Newsgroups: gmane.emacs.bugs Subject: bug#45747: [PATCH] mercury-mode font lock fix Date: Sat, 9 Jan 2021 20:59:49 +0530 Message-ID: <20210109152949.6tpygnvvbyj4jtlx@sildranDT.localdomain> References: <20210109132243.zrd4ojp24ps4desd@sildranDT.localdomain> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="nwt6mwzdgx4cilck" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19531"; mail-complaints-to="usenet@ciao.gmane.io" To: 45747@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 09 16:31:14 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 1kyGCw-000512-7l for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 09 Jan 2021 16:31:14 +0100 Original-Received: from localhost ([::1]:47734 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kyGCv-0006RK-AB for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 09 Jan 2021 10:31:13 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51452) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kyGCk-0006R9-3Q for bug-gnu-emacs@gnu.org; Sat, 09 Jan 2021 10:31:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40903) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kyGCj-0001e0-SH for bug-gnu-emacs@gnu.org; Sat, 09 Jan 2021 10:31:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kyGCj-0000Aw-Mz for bug-gnu-emacs@gnu.org; Sat, 09 Jan 2021 10:31:01 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <20210109132243.zrd4ojp24ps4desd@sildranDT.localdomain> Resent-From: k3tu0isui@gmail.com Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 09 Jan 2021 15:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45747 X-GNU-PR-Package: emacs Original-Received: via spool by 45747-submit@debbugs.gnu.org id=B45747.1610206211615 (code B ref 45747); Sat, 09 Jan 2021 15:31:01 +0000 Original-Received: (at 45747) by debbugs.gnu.org; 9 Jan 2021 15:30:11 +0000 Original-Received: from localhost ([127.0.0.1]:52449 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kyGBv-00009q-51 for submit@debbugs.gnu.org; Sat, 09 Jan 2021 10:30:11 -0500 Original-Received: from mail-pj1-f45.google.com ([209.85.216.45]:50254) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kyGBr-000080-6u for 45747@debbugs.gnu.org; Sat, 09 Jan 2021 10:30:10 -0500 Original-Received: by mail-pj1-f45.google.com with SMTP id lj6so5276522pjb.0 for <45747@debbugs.gnu.org>; Sat, 09 Jan 2021 07:30:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition; bh=BWHkGR6uw+qh3Ff4bSlHbXRhQmNkvgdcXS5IMUrgiCI=; b=tVt3HyHbQatdP2DIJTJ/N1nfBa4Pbqj9EJRUtrSvpp6DX/VuOypqQjjBGe+4U/4b4o deYvSnkK6Hqr1cH6elTjuLnHO/qg2M5llz14wz+TW1Mr4Grzlcv+HS+Y/9nAeonADHHC F9HRVPOaak7n9qJvXGHDKVMdNkhSYBlwzTq4VWQNG/dI6VWDk2rfn0WDviGteCHQSrBq GAs/bGEgnpOQM6JwtLlgJuqiWKNw3IOWMRS4tAiKyuPSNtSI9KLEE5XdIy40NMdOlHO+ SQASdQsTw077gqG4ewegaCeh+rl8+WuE+LcKuifKJ4ZetEJ8JJkcrB9kdZtq5SdTwd+k cuMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition; bh=BWHkGR6uw+qh3Ff4bSlHbXRhQmNkvgdcXS5IMUrgiCI=; b=p5T6bJgISa+y89eh+rl8J40vuFX4JzJTD8X4KploE3juUeNEfrlA0hj02qnRFOCzf+ uk0J1g6BKArq1BhAURX2Z/8avRtrtij1KCfm/t0wULYuYTc2jrZYunf9DJTb2lc8gD8u BtbpKuKjpzENP9FCx8xDuXQojpEgMYHKVcdW2XEyS2phsTw3TyQ8DdImt3PuGZosFCN0 74as6VjDe8QojgaY9npzT8eXA3k+mQox0ZR8xdA8z144fr88qzXxm+Ams/5ZViJXUQiw MbMgWLQUaYCJiNj0340gLbiTDWUXs7YDCU7+WF7wRzJRy9ACExhRo9r6ovFvGfLH6poc qVww== X-Gm-Message-State: AOAM531drRVflmd/onTJBba4bz+zqikYngkSe2ViEgWNmTFRHK0uk5Bs kfqyhP+t6a/U19TIJ8ZoJbzwJkeS3so= X-Google-Smtp-Source: ABdhPJxwEnX7xw84q+BCFiyj935U7ByzKazCJlQNeXa+FEQl2/ZTYvoVWxRx8neTdtq/qY7LC7VUYg== X-Received: by 2002:a17:902:ac98:b029:da:cd0f:b6a4 with SMTP id h24-20020a170902ac98b02900dacd0fb6a4mr8994103plr.71.1610206200524; Sat, 09 Jan 2021 07:30:00 -0800 (PST) Original-Received: from sildranDT.localdomain ([2401:4900:33aa:15dc:34f6:2e6f:98cd:b259]) by smtp.gmail.com with ESMTPSA id r123sm12574064pfr.68.2021.01.09.07.29.56 for <45747@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Jan 2021 07:29:59 -0800 (PST) Content-Disposition: inline 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:197552 Archived-At: --nwt6mwzdgx4cilck Content-Type: text/plain; charset=us-ascii Content-Disposition: inline The problem seems to be arising due to mercury-mode being defined as a major-mode rather than a different system under prolog mode. I changed a line in prolog-font-lock-keywords to work with mercury-mode and added a call to prolog-mode-variables in define-derived-mode mercury-mode to setup the required variables for font lock keywords. --nwt6mwzdgx4cilck Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="emacs-mercury.patch" diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el index c8f6c12a3f..742274a479 100644 --- a/lisp/progmodes/prolog.el +++ b/lisp/progmodes/prolog.el @@ -1201,7 +1201,8 @@ mercury-mode-map (define-derived-mode mercury-mode prolog-mode "Prolog[Mercury]" "Major mode for editing Mercury programs. Actually this is just customized `prolog-mode'." - (setq-local prolog-system 'mercury)) + (setq-local prolog-system 'mercury) + (prolog-mode-variables)) ;;------------------------------------------------------------------- @@ -2082,7 +2083,8 @@ prolog-font-lock-keywords (delq nil (cond - ((eq major-mode 'prolog-mode) + ((or (eq major-mode 'prolog-mode) + (eq major-mode 'mercury-mode)) (list head-predicates head-predicates-1 --nwt6mwzdgx4cilck--