unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: master d067ac5: Remove more compat code from prolog.el
       [not found] ` <20200925093756.C7849209D4@vcs0.savannah.gnu.org>
@ 2020-09-25 12:39   ` Stefan Monnier
  2020-09-25 13:49     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2020-09-25 12:39 UTC (permalink / raw)
  To: emacs-devel; +Cc: Lars Ingebrigtsen

> @@ -1999,7 +1997,7 @@ Argument BOUND is a buffer position limiting searching."
>           (if (eq prolog-system 'mercury)
>               (list
>                (regexp-opt prolog-directives-i 'words)
> -              0 'prolog-warning-face)))
> +              0 prolog-warning-face)))
>          ;; Inferior mode specific patterns
>          (prompt
>           ;; FIXME: Should be handled by comint already.

I think this one is wrong: the font-lock data-structure built here
should contain at this position an *expression* that returns a face when
passed to `eval`.

IOW with the above change the value held by `prolog-warning-face` needs
to be "an expression that evaluates to a face" rather than "a face name".

This will still work as long as `prolog-warning-face` has value
`font-lock-warning-face` since it's both the name of a face and the name
of an expression whose value is that same face (because it's also the
name of a variable whose value is, by default, itself).


        Stefan




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: master d067ac5: Remove more compat code from prolog.el
  2020-09-25 12:39   ` master d067ac5: Remove more compat code from prolog.el Stefan Monnier
@ 2020-09-25 13:49     ` Lars Ingebrigtsen
  2020-09-25 14:04       ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Ingebrigtsen @ 2020-09-25 13:49 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> @@ -1999,7 +1997,7 @@ Argument BOUND is a buffer position limiting searching."
>>           (if (eq prolog-system 'mercury)
>>               (list
>>                (regexp-opt prolog-directives-i 'words)
>> -              0 'prolog-warning-face)))
>> +              0 prolog-warning-face)))
>>          ;; Inferior mode specific patterns
>>          (prompt
>>           ;; FIXME: Should be handled by comint already.
>
> I think this one is wrong: the font-lock data-structure built here
> should contain at this position an *expression* that returns a face when
> passed to `eval`.
>
> IOW with the above change the value held by `prolog-warning-face` needs
> to be "an expression that evaluates to a face" rather than "a face name".

All the other places there used the variable instead of the symbol,
I think?  For instance:

         ;; FIXME: Add to compilation-error-regexp-alist instead.
         (cond
          ((eq prolog-system 'sicstus)
           '("[ \t]*[0-9]+[ \t]+[0-9]+[ \t]*\\(Fail\\):"
             1 prolog-warning-face))
          ((eq prolog-system 'swi)
           '("[ \t]*\\(Fail\\):[ \t]*([ \t0-9]*)" 1 prolog-warning-face))

So I was just trying to make it more consistent.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: master d067ac5: Remove more compat code from prolog.el
  2020-09-25 13:49     ` Lars Ingebrigtsen
@ 2020-09-25 14:04       ` Stefan Monnier
  2020-09-25 14:06         ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2020-09-25 14:04 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: emacs-devel

>>>           (if (eq prolog-system 'mercury)
>>>               (list
>>>                (regexp-opt prolog-directives-i 'words)
>>> -              0 'prolog-warning-face)))
>>> +              0 prolog-warning-face)))
>>>          ;; Inferior mode specific patterns
[...]
> All the other places there used the variable instead of the symbol,
> I think?  For instance:
>
>          ;; FIXME: Add to compilation-error-regexp-alist instead.
>          (cond
>           ((eq prolog-system 'sicstus)
>            '("[ \t]*[0-9]+[ \t]+[0-9]+[ \t]*\\(Fail\\):"
>              1 prolog-warning-face))
>           ((eq prolog-system 'swi)
>            '("[ \t]*\\(Fail\\):[ \t]*([ \t0-9]*)" 1 prolog-warning-face))

Those other places are within a quote.


        Stefan




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: master d067ac5: Remove more compat code from prolog.el
  2020-09-25 14:04       ` Stefan Monnier
@ 2020-09-25 14:06         ` Lars Ingebrigtsen
  0 siblings, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2020-09-25 14:06 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> Those other places are within a quote.

One of these days I'll learn to read.

I've now reverted that bit.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-09-25 14:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20200925093755.19433.41297@vcs0.savannah.gnu.org>
     [not found] ` <20200925093756.C7849209D4@vcs0.savannah.gnu.org>
2020-09-25 12:39   ` master d067ac5: Remove more compat code from prolog.el Stefan Monnier
2020-09-25 13:49     ` Lars Ingebrigtsen
2020-09-25 14:04       ` Stefan Monnier
2020-09-25 14:06         ` Lars Ingebrigtsen

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).