emacs-devel
[Top][All Lists]
Advanced

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

Re: Two issues with the new Flymake


From: Lele Gaifax
Subject: Re: Two issues with the new Flymake
Date: Fri, 03 Nov 2017 15:07:07 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux)

Stefan Monnier <address@hidden> writes:

> [ Please report such problems via M-x report-emacs-bug, so they get
>   a bug-number.  ]

My bad, sorry.

>> The first problem is something that happens when I add new code at the end of
>> the source: if I write something and then quickly enough partially delete it
>> with `delete-backward-char' and replace it with something else, at times
>> Flymake reports an error message about unexpected report from the backend
>
> What is the exact message you get?

Luckily it was simple to get one (previous attempts did not succeed, most
likely because I was focused on writing the code and resisted the temptation
to do a context switch :-).

In a python-mode buffer I appended "def pippo(@):" at the end of the buffer,
and quickly deleted the last three characters (that is, "@):"): the "@"
triggered an error in the checker tool (I'm using flake8 at the moment, but I
think that's irrelevant), and as soon as Flymake got that it emitted

  error in process sentinel: flymake-error: [Flymake] Invalid region line=417 
col=13
  error in process sentinel: [Flymake] Invalid region line=417 col=13

obviously because line 417 shrinked to 10 characters.

>
>> The second one is a strange interaction with the `python-shell-send-region' 
>> (a
>> feature that I use very seldom): when I execute that, I get the following
>> error message
>
>>    Error in post-command-hook (#[0
>>    "\304\305\303\242\306#\210r\302q\210\307\310\311\301\"\300\")\207" [nil
>>    (post-command on-display) #<killed buffer> (#0) remove-hook
>>    post-command-hook nil flymake-start remove post-command] 4]): (error
>>    "Selecting deleted buffer")
>
> This #[...] thingy above is the
>
>         ((start-post-command
>           ()
>           (remove-hook 'post-command-hook #'start-post-command
>                        nil)
>           (with-current-buffer buffer
>             (flymake-start (remove 'post-command deferred) force)))
>
> function from flymake-start and the error comes from with-current-buffer
> because `buffer` is not live any more when that code is run.

Thanks a lot for the analysis and even more for the explanation!

> ...
>
> So I think the patch below should fix this.  I pushed it to `emacs-26`.

Great, will try that as soon as I can upgrade my installation and will report
back.

Thanks again,
ciao, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
address@hidden  |                 -- Fortunato Depero, 1929.




reply via email to

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