* bug#32012: 27.0.50; jit-lock--run-functions broken
@ 2018-06-29 20:16 Andreas Röhler
2018-06-30 6:34 ` Eli Zaretskii
0 siblings, 1 reply; 9+ messages in thread
From: Andreas Röhler @ 2018-06-29 20:16 UTC (permalink / raw)
To: 32012
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#32012: 27.0.50; jit-lock--run-functions broken
2018-06-29 20:16 bug#32012: 27.0.50; jit-lock--run-functions broken Andreas Röhler
@ 2018-06-30 6:34 ` Eli Zaretskii
2018-06-30 6:54 ` Andreas Röhler
0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2018-06-30 6:34 UTC (permalink / raw)
To: Andreas Röhler; +Cc: 32012
> From: Andreas Röhler <andreas.roehler@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?
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#32012: 27.0.50; jit-lock--run-functions broken
2018-06-30 6:34 ` Eli Zaretskii
@ 2018-06-30 6:54 ` Andreas Röhler
2018-06-30 10:57 ` Eli Zaretskii
0 siblings, 1 reply; 9+ messages in thread
From: Andreas Röhler @ 2018-06-30 6:54 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 32012
On 30.06.2018 08:34, Eli Zaretskii wrote:
>> From: Andreas Röhler <andreas.roehler@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
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#32012: 27.0.50; jit-lock--run-functions broken
2018-06-30 6:54 ` Andreas Röhler
@ 2018-06-30 10:57 ` Eli Zaretskii
2018-06-30 11:19 ` Andreas Röhler
0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2018-06-30 10:57 UTC (permalink / raw)
To: Andreas Röhler; +Cc: 32012
> Cc: 32012@debbugs.gnu.org
> From: Andreas Röhler <andreas.roehler@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@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.
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#32012: 27.0.50; jit-lock--run-functions broken
2018-06-30 10:57 ` Eli Zaretskii
@ 2018-06-30 11:19 ` Andreas Röhler
2018-06-30 11:42 ` Eli Zaretskii
0 siblings, 1 reply; 9+ messages in thread
From: Andreas Röhler @ 2018-06-30 11:19 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 32012
On 30.06.2018 12:57, Eli Zaretskii wrote:
>> Cc: 32012@debbugs.gnu.org
>> From: Andreas Röhler <andreas.roehler@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@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?
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#32012: 27.0.50; jit-lock--run-functions broken
2018-06-30 11:19 ` Andreas Röhler
@ 2018-06-30 11:42 ` Eli Zaretskii
2018-06-30 12:33 ` Andreas Röhler
2018-06-30 13:06 ` Andreas Röhler
0 siblings, 2 replies; 9+ messages in thread
From: Eli Zaretskii @ 2018-06-30 11:42 UTC (permalink / raw)
To: Andreas Röhler; +Cc: 32012
> Cc: 32012@debbugs.gnu.org
> From: Andreas Röhler <andreas.roehler@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.
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#32012: 27.0.50; jit-lock--run-functions broken
2018-06-30 11:42 ` Eli Zaretskii
@ 2018-06-30 12:33 ` Andreas Röhler
2018-06-30 13:06 ` Andreas Röhler
1 sibling, 0 replies; 9+ messages in thread
From: Andreas Röhler @ 2018-06-30 12:33 UTC (permalink / raw)
To: 32012
[-- Attachment #1: Type: text/plain, Size: 1292 bytes --]
On 30.06.2018 13:42, Eli Zaretskii wrote:
>> Cc: 32012@debbugs.gnu.org
>> From: Andreas Röhler <andreas.roehler@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.
[-- Attachment #2: wcb.png --]
[-- Type: image/png, Size: 138740 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#32012: 27.0.50; jit-lock--run-functions broken
2018-06-30 11:42 ` Eli Zaretskii
2018-06-30 12:33 ` Andreas Röhler
@ 2018-06-30 13:06 ` Andreas Röhler
2018-06-30 13:52 ` Eli Zaretskii
1 sibling, 1 reply; 9+ messages in thread
From: Andreas Röhler @ 2018-06-30 13:06 UTC (permalink / raw)
To: 32012
On 30.06.2018 13:42, Eli Zaretskii wrote:
>> Cc: 32012@debbugs.gnu.org
>> From: Andreas Röhler <andreas.roehler@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
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2018-06-30 13:52 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-29 20:16 bug#32012: 27.0.50; jit-lock--run-functions broken Andreas Röhler
2018-06-30 6:34 ` Eli Zaretskii
2018-06-30 6:54 ` Andreas Röhler
2018-06-30 10:57 ` Eli Zaretskii
2018-06-30 11:19 ` Andreas Röhler
2018-06-30 11:42 ` Eli Zaretskii
2018-06-30 12:33 ` Andreas Röhler
2018-06-30 13:06 ` Andreas Röhler
2018-06-30 13:52 ` Eli Zaretskii
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.