bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#45747: 27.1; mercury-mode font lock bug


From: Lars Ingebrigtsen
Subject: bug#45747: 27.1; mercury-mode font lock bug
Date: Sun, 10 Jan 2021 13:51:11 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]