GNU bug report logs - #32012
27.0.50; jit-lock--run-functions broken

Previous Next

Package: emacs;

Reported by: Andreas Röhler <andreas.roehler <at> online.de>

Date: Fri, 29 Jun 2018 20:15:02 UTC

Severity: normal

Tags: notabug

Found in version 27.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 32012 in the body.
You can then email your comments to 32012 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#32012; Package emacs. (Fri, 29 Jun 2018 20:15:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Andreas Röhler <andreas.roehler <at> online.de>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 29 Jun 2018 20:15:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Andreas Röhler <andreas.roehler <at> online.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.50; jit-lock--run-functions broken
Date: Fri, 29 Jun 2018 22:16:55 +0200
Running into it from ert-tests which call ‘jit-lock-fontify-now’

When reproduced from emacs -Q in scratch-buffer:

Debugger entered--Lisp error: (wrong-number-of-arguments (2 . 2) 0)
  jit-lock--run-functions()
  eval((jit-lock--run-functions) nil)
  elisp--eval-last-sexp(nil)
  eval-last-sexp(nil)
  funcall-interactively(eval-last-sexp nil)
  call-interactively(eval-last-sexp nil nil)
  command-execute(eval-last-sexp)

AFAIU caused by

jit-lock--run-functions from jit-lock.el, line 378, last line below

          (setq loose-beg (min loose-beg this-beg))
          (setq loose-end (max loose-end this-end))
          nil)))
    `(,(min tight-beg beg) ,(max tight-end end) ,loose-beg ,loose-end)))

‘min’ fails as ‘tight-beg’ is still nil, not updated from setq inside
pcase above.

GNU Emacs 27.0.50 (build 1, i686-pc-linux-gnu, GTK+ Version 3.14.5) of
 2018-05-29




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32012; Package emacs. (Sat, 30 Jun 2018 06:35:02 GMT) Full text and rfc822 format available.

Message #8 received at 32012 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Andreas Röhler <andreas.roehler <at> online.de>
Cc: 32012 <at> debbugs.gnu.org
Subject: Re: bug#32012: 27.0.50; jit-lock--run-functions broken
Date: Sat, 30 Jun 2018 09:34:38 +0300
> From: Andreas Röhler <andreas.roehler <at> online.de>
> Date: Fri, 29 Jun 2018 22:16:55 +0200
> 
> Running into it from ert-tests which call ‘jit-lock-fontify-now’
> 
> When reproduced from emacs -Q in scratch-buffer:
> 
> Debugger entered--Lisp error: (wrong-number-of-arguments (2 . 2) 0)
>    jit-lock--run-functions()
>    eval((jit-lock--run-functions) nil)
>    elisp--eval-last-sexp(nil)
>    eval-last-sexp(nil)
>    funcall-interactively(eval-last-sexp nil)
>    call-interactively(eval-last-sexp nil nil)
>    command-execute(eval-last-sexp)

Why did you think you can call that function tis way?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32012; Package emacs. (Sat, 30 Jun 2018 06:53:01 GMT) Full text and rfc822 format available.

Message #11 received at 32012 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Röhler <andreas.roehler <at> online.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 32012 <at> debbugs.gnu.org
Subject: Re: bug#32012: 27.0.50; jit-lock--run-functions broken
Date: Sat, 30 Jun 2018 08:54:49 +0200

On 30.06.2018 08:34, Eli Zaretskii wrote:
>> From: Andreas Röhler <andreas.roehler <at> online.de>
>> Date: Fri, 29 Jun 2018 22:16:55 +0200
>>
>> Running into it from ert-tests which call ‘jit-lock-fontify-now’
>>
>> When reproduced from emacs -Q in scratch-buffer:
>>
>> Debugger entered--Lisp error: (wrong-number-of-arguments (2 . 2) 0)
>>     jit-lock--run-functions()
>>     eval((jit-lock--run-functions) nil)
>>     elisp--eval-last-sexp(nil)
>>     eval-last-sexp(nil)
>>     funcall-interactively(eval-last-sexp nil)
>>     call-interactively(eval-last-sexp nil nil)
>>     command-execute(eval-last-sexp)
> 
> Why did you think you can call that function tis way?
> 

Hmm, by looking at its signature

(defun jit-lock-fontify-now (&optional start end)

Why that shouldn't work?

Coming here because when using font-lock-fontify-buffer in ert-tests, 
get a warning for interactive use only. Should use font-lock-ensure.
But font-lock-ensure isn't known from ert.

Maybe another bug?

Need with-buffer-prepared-for-jit-lock which seems not being provided by 
uncompiled font-lock.el

Thanks,
Andreas





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32012; Package emacs. (Sat, 30 Jun 2018 10:58:02 GMT) Full text and rfc822 format available.

Message #14 received at 32012 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Andreas Röhler <andreas.roehler <at> online.de>
Cc: 32012 <at> debbugs.gnu.org
Subject: Re: bug#32012: 27.0.50; jit-lock--run-functions broken
Date: Sat, 30 Jun 2018 13:57:51 +0300
> Cc: 32012 <at> debbugs.gnu.org
> From: Andreas Röhler <andreas.roehler <at> online.de>
> Date: Sat, 30 Jun 2018 08:54:49 +0200
> 
> On 30.06.2018 08:34, Eli Zaretskii wrote:
> >> From: Andreas Röhler <andreas.roehler <at> online.de>
> >> Date: Fri, 29 Jun 2018 22:16:55 +0200
> >>
> >> Running into it from ert-tests which call ‘jit-lock-fontify-now’
> >>
> >> When reproduced from emacs -Q in scratch-buffer:
> >>
> >> Debugger entered--Lisp error: (wrong-number-of-arguments (2 . 2) 0)
> >>     jit-lock--run-functions()
> >>     eval((jit-lock--run-functions) nil)
> >>     elisp--eval-last-sexp(nil)
> >>     eval-last-sexp(nil)
> >>     funcall-interactively(eval-last-sexp nil)
> >>     call-interactively(eval-last-sexp nil nil)
> >>     command-execute(eval-last-sexp)
> > 
> > Why did you think you can call that function tis way?
> > 
> 
> Hmm, by looking at its signature
> 
> (defun jit-lock-fontify-now (&optional start end)
> 
> Why that shouldn't work?

That's not what the backtrace suggests.  It suggests that you invoked
jit-lock--run-functions via eval-last-sexp.

> Coming here because when using font-lock-fontify-buffer in ert-tests, 
> get a warning for interactive use only. Should use font-lock-ensure.
> But font-lock-ensure isn't known from ert.

I don't know what that means.  Which ert-tests are you talking about,
and how did you run them?  And what does that have to do with invoking
the function via eval-last-sexp?

> Maybe another bug?

I think any bug in jit-lock would have been reported long ago, since
that package is constantly used by the display engine since Emacs 21.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32012; Package emacs. (Sat, 30 Jun 2018 11:18:02 GMT) Full text and rfc822 format available.

Message #17 received at 32012 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Röhler <andreas.roehler <at> online.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 32012 <at> debbugs.gnu.org
Subject: Re: bug#32012: 27.0.50; jit-lock--run-functions broken
Date: Sat, 30 Jun 2018 13:19:40 +0200

On 30.06.2018 12:57, Eli Zaretskii wrote:
>> Cc: 32012 <at> debbugs.gnu.org
>> From: Andreas Röhler <andreas.roehler <at> online.de>
>> Date: Sat, 30 Jun 2018 08:54:49 +0200
>>
>> On 30.06.2018 08:34, Eli Zaretskii wrote:
>>>> From: Andreas Röhler <andreas.roehler <at> online.de>
>>>> Date: Fri, 29 Jun 2018 22:16:55 +0200
>>>>
>>>> Running into it from ert-tests which call ‘jit-lock-fontify-now’
>>>>
>>>> When reproduced from emacs -Q in scratch-buffer:
>>>>
>>>> Debugger entered--Lisp error: (wrong-number-of-arguments (2 . 2) 0)
>>>>      jit-lock--run-functions()
>>>>      eval((jit-lock--run-functions) nil)
>>>>      elisp--eval-last-sexp(nil)
>>>>      eval-last-sexp(nil)
>>>>      funcall-interactively(eval-last-sexp nil)
>>>>      call-interactively(eval-last-sexp nil nil)
>>>>      command-execute(eval-last-sexp)
>>>
>>> Why did you think you can call that function tis way?
>>>
>>
>> Hmm, by looking at its signature
>>
>> (defun jit-lock-fontify-now (&optional start end)
>>
>> Why that shouldn't work?
> 
> That's not what the backtrace suggests.  It suggests that you invoked
> jit-lock--run-functions via eval-last-sexp.

Right. But the arguments are optional.
Wherefrom to expect it failing?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32012; Package emacs. (Sat, 30 Jun 2018 11:43:02 GMT) Full text and rfc822 format available.

Message #20 received at 32012 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Andreas Röhler <andreas.roehler <at> online.de>
Cc: 32012 <at> debbugs.gnu.org
Subject: Re: bug#32012: 27.0.50; jit-lock--run-functions broken
Date: Sat, 30 Jun 2018 14:42:16 +0300
> Cc: 32012 <at> debbugs.gnu.org
> From: Andreas Röhler <andreas.roehler <at> online.de>
> Date: Sat, 30 Jun 2018 13:19:40 +0200
> 
> >> Hmm, by looking at its signature
> >>
> >> (defun jit-lock-fontify-now (&optional start end)
> >>
> >> Why that shouldn't work?
> > 
> > That's not what the backtrace suggests.  It suggests that you invoked
> > jit-lock--run-functions via eval-last-sexp.
> 
> Right. But the arguments are optional.
> Wherefrom to expect it failing?

A function that has optional argument doesn't necessarily support
invocation without arguments in any arbitrary context.  It could
support that just in some specific cases.  You can clearly see in the
function that when Start and END are nil, the function sets them to
some values, but those values might not make sense in some arbitrary
invocation context.

Anyway, this discussion would have been much less theoretical if you
would to show what exactly did you do in ert tests that caused the
problem.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32012; Package emacs. (Sat, 30 Jun 2018 12:32:01 GMT) Full text and rfc822 format available.

Message #23 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Andreas Röhler <andreas.roehler <at> easy-emacs.de>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#32012: 27.0.50; jit-lock--run-functions broken
Date: Sat, 30 Jun 2018 14:33:50 +0200
[Message part 1 (text/plain, inline)]
On 30.06.2018 13:42, Eli Zaretskii wrote:
>> Cc: 32012 <at> debbugs.gnu.org
>> From: Andreas Röhler <andreas.roehler <at> online.de>
>> Date: Sat, 30 Jun 2018 13:19:40 +0200
>>
>>>> Hmm, by looking at its signature
>>>>
>>>> (defun jit-lock-fontify-now (&optional start end)
>>>>
>>>> Why that shouldn't work?
>>>
>>> That's not what the backtrace suggests.  It suggests that you invoked
>>> jit-lock--run-functions via eval-last-sexp.
>>
>> Right. But the arguments are optional.
>> Wherefrom to expect it failing?
> 
> A function that has optional argument doesn't necessarily support
> invocation without arguments in any arbitrary context.  It could
> support that just in some specific cases.  You can clearly see in the
> function that when Start and END are nil, the function sets them to
> some values, but those values might not make sense in some arbitrary
> invocation context.
> 
> Anyway, this discussion would have been much less theoretical if you
> would to show what exactly did you do in ert tests that caused the
> problem.
> 
> 
> 

Okay. Will look to for a real-world example, not just some minimal one.
For the moment, maybe have a look at attachment how the function in 
question gets fontified from emacs -Q - obviously 
with-buffer-prepared-for-jit-lock as keyword missing.


[wcb.png (image/png, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32012; Package emacs. (Sat, 30 Jun 2018 13:05:02 GMT) Full text and rfc822 format available.

Message #26 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Andreas Röhler <andreas.roehler <at> easy-emacs.de>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#32012: 27.0.50; jit-lock--run-functions broken
Date: Sat, 30 Jun 2018 15:06:23 +0200
On 30.06.2018 13:42, Eli Zaretskii wrote:
>> Cc: 32012 <at> debbugs.gnu.org
>> From: Andreas Röhler <andreas.roehler <at> online.de>
>> Date: Sat, 30 Jun 2018 13:19:40 +0200
>>
>>>> Hmm, by looking at its signature
>>>>
>>>> (defun jit-lock-fontify-now (&optional start end)
>>>>
>>>> Why that shouldn't work?
>>>
>>> That's not what the backtrace suggests.  It suggests that you invoked
>>> jit-lock--run-functions via eval-last-sexp.
>>
>> Right. But the arguments are optional.
>> Wherefrom to expect it failing?
> 
> A function that has optional argument doesn't necessarily support
> invocation without arguments in any arbitrary context.



When looking for a example-case, mistakenly did run 
jit-lock--run-functions, which requires args, Should run 
jit-lock-fontify-now - which might be evaluated in scratch - but doesn't 
help for the original issue.

While file a new report maybe.
Please close this, sorry for the noise and thanks for your care,

Andreas




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sat, 30 Jun 2018 13:53:02 GMT) Full text and rfc822 format available.

Notification sent to Andreas Röhler <andreas.roehler <at> online.de>:
bug acknowledged by developer. (Sat, 30 Jun 2018 13:53:02 GMT) Full text and rfc822 format available.

Message #31 received at 32012-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Andreas Röhler <andreas.roehler <at> easy-emacs.de>
Cc: 32012-done <at> debbugs.gnu.org
Subject: Re: bug#32012: 27.0.50; jit-lock--run-functions broken
Date: Sat, 30 Jun 2018 16:52:46 +0300
> From: Andreas Röhler <andreas.roehler <at> easy-emacs.de>
> Date: Sat, 30 Jun 2018 15:06:23 +0200
> 
> Please close this

Thanks, done.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 29 Jul 2018 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 46 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.