From: Lars Ingebrigtsen <larsi@gnus.org>
To: k3tu0isui@gmail.com
Cc: 45747@debbugs.gnu.org
Subject: bug#45747: 27.1; mercury-mode font lock bug
Date: Sun, 10 Jan 2021 13:51:11 +0100 [thread overview]
Message-ID: <87bldxuf9c.fsf_-_@gnus.org> (raw)
In-Reply-To: <20210109152949.6tpygnvvbyj4jtlx@sildranDT.localdomain> (k3tu0isui@gmail.com's message of "Sat, 9 Jan 2021 20:59:49 +0530")
k3tu0isui@gmail.com writes:
> 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.
[...]
> (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))
I'm not a Mercury mode user, but I don't quite understand this bit of
the patch -- mercury-mode is derived from prolog-mode, so
`prolog-mode-variables' should already be run at this point? So is that
bit necessary/
> - ((eq major-mode 'prolog-mode)
> + ((or (eq major-mode 'prolog-mode)
> + (eq major-mode 'mercury-mode))
> (list
> head-predicates
> head-predicates-1
This could perhaps be:
diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el
index c8f6c12a3f..1ac0210f81 100644
--- a/lisp/progmodes/prolog.el
+++ b/lisp/progmodes/prolog.el
@@ -2082,7 +2082,7 @@ prolog-font-lock-keywords
(delq
nil
(cond
- ((eq major-mode 'prolog-mode)
+ ((derived-mode-p 'prolog-mode)
(list
head-predicates
head-predicates-1
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
next prev parent reply other threads:[~2021-01-10 12:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-09 13:22 bug#45747: 27.1; mercury-mode font lock bug k3tu0isui
2021-01-09 15:29 ` bug#45747: [PATCH] mercury-mode font lock fix k3tu0isui
2021-01-10 12:51 ` Lars Ingebrigtsen [this message]
2021-01-10 13:28 ` bug#45747: 27.1; mercury-mode font lock bug k3tu0isui
2021-01-10 13:38 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bldxuf9c.fsf_-_@gnus.org \
--to=larsi@gnus.org \
--cc=45747@debbugs.gnu.org \
--cc=k3tu0isui@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).