* bug#6967: flymake not cleaning after itself (kill-buffer)
@ 2010-09-01 19:19 S Boucher
2010-10-24 17:14 ` Chong Yidong
0 siblings, 1 reply; 5+ messages in thread
From: S Boucher @ 2010-09-01 19:19 UTC (permalink / raw)
To: 6967
That's with emacs 23.2
flymake-kill-buffer-hook does not actually kill the flymake process. So, if flymake is used in conjunction with semantic, it gets problematic.
When semantic does background parsing, it may find-file/kill-buffer for files not already in memory. If semantic proceeds to kill-buffer while a flymake process is running, then a window pops up asking whether the buffer's process should be killed (because kill-buffer asks before killing processes).
It seems like flymake-kill-buffer-hook should kill the buffer, so that by the time semantic calls kill-buffer, there won't be a process to query about.
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#6967: flymake not cleaning after itself (kill-buffer)
2010-09-01 19:19 bug#6967: flymake not cleaning after itself (kill-buffer) S Boucher
@ 2010-10-24 17:14 ` Chong Yidong
2010-10-25 11:15 ` Eric M. Ludlam
0 siblings, 1 reply; 5+ messages in thread
From: Chong Yidong @ 2010-10-24 17:14 UTC (permalink / raw)
To: S Boucher; +Cc: Eric Ludlam, 6967
S Boucher <stbya@yahoo.com> writes:
> flymake-kill-buffer-hook does not actually kill the flymake process.
> So, if flymake is used in conjunction with semantic, it gets
> problematic.
>
> When semantic does background parsing, it may find-file/kill-buffer
> for files not already in memory. If semantic proceeds to kill-buffer
> while a flymake process is running, then a window pops up asking
> whether the buffer's process should be killed (because kill-buffer
> asks before killing processes).
>
> It seems like flymake-kill-buffer-hook should kill the buffer, so that
> by the time semantic calls kill-buffer, there won't be a process to
> query about.
It would be wrong for flymake-kill-buffer-hook to kill the buffer,
because there may be other functions on the hook that may need to
examine the buffer state.
The problem here seems to be that when Semantic visits files to parse
them, Flymake is enabled when it should not. I'm guessing you are using
flymake-find-file-hook, is that correct?
Maybe the solution is for Semantic to either avoid using
find-file[-noselect], or detect if Flymake is on and disable it for
files that are only being parsed temporarily. Eric, what do you think?
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#6967: flymake not cleaning after itself (kill-buffer)
2010-10-24 17:14 ` Chong Yidong
@ 2010-10-25 11:15 ` Eric M. Ludlam
2010-10-25 16:20 ` Stefan Monnier
2010-10-25 21:54 ` S Boucher
0 siblings, 2 replies; 5+ messages in thread
From: Eric M. Ludlam @ 2010-10-25 11:15 UTC (permalink / raw)
To: Chong Yidong; +Cc: S Boucher, Eric Ludlam, 6967
On 10/24/2010 01:14 PM, Chong Yidong wrote:
> S Boucher<stbya@yahoo.com> writes:
>
>> flymake-kill-buffer-hook does not actually kill the flymake process.
>> So, if flymake is used in conjunction with semantic, it gets
>> problematic.
>>
>> When semantic does background parsing, it may find-file/kill-buffer
>> for files not already in memory. If semantic proceeds to kill-buffer
>> while a flymake process is running, then a window pops up asking
>> whether the buffer's process should be killed (because kill-buffer
>> asks before killing processes).
>>
>> It seems like flymake-kill-buffer-hook should kill the buffer, so that
>> by the time semantic calls kill-buffer, there won't be a process to
>> query about.
>
> It would be wrong for flymake-kill-buffer-hook to kill the buffer,
> because there may be other functions on the hook that may need to
> examine the buffer state.
>
> The problem here seems to be that when Semantic visits files to parse
> them, Flymake is enabled when it should not. I'm guessing you are using
> flymake-find-file-hook, is that correct?
>
> Maybe the solution is for Semantic to either avoid using
> find-file[-noselect], or detect if Flymake is on and disable it for
> files that are only being parsed temporarily. Eric, what do you think?
Semantic uses semantic-find-file-noselect which clears out a list of
hooks and settings before calling find-file-noselect to avoid problems
like this.
Semantic needs a variant of find-file that puts a buffer into the
correct mode, which in turn runs the major-mode hook. It also needs to
run the mode-local hooks, but doesn't run miscellaneous other
interactive tool hooks.
I suppose Semantic could also have a pre-find-file hook that authors of
modes like flymake could install a temporary uninstall hook into, but
that seems kind of strange.
Eric
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#6967: flymake not cleaning after itself (kill-buffer)
2010-10-25 11:15 ` Eric M. Ludlam
@ 2010-10-25 16:20 ` Stefan Monnier
2010-10-25 21:54 ` S Boucher
1 sibling, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2010-10-25 16:20 UTC (permalink / raw)
To: Eric M. Ludlam; +Cc: S Boucher, Chong Yidong, Eric Ludlam, 6967
> Semantic needs a variant of find-file that puts a buffer into the correct
> mode, which in turn runs the major-mode hook. It also needs to run the
> mode-local hooks, but doesn't run miscellaneous other interactive
> tool hooks.
IIUC Semantic visits those files "temporarily" (i.e. it will kill the
buffer afterwards, although probably not if the buffer already existed).
I think this need is not specific to Semantic, and so we should provide
this functionality in files.el. Maybe in a `with-found-file' macro.
Stefan
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#6967: flymake not cleaning after itself (kill-buffer)
2010-10-25 11:15 ` Eric M. Ludlam
2010-10-25 16:20 ` Stefan Monnier
@ 2010-10-25 21:54 ` S Boucher
1 sibling, 0 replies; 5+ messages in thread
From: S Boucher @ 2010-10-25 21:54 UTC (permalink / raw)
To: Chong Yidong, Eric M. Ludlam; +Cc: Eric Ludlam, 6967
> Semantic needs a variant of find-file that puts a buffer
> into the correct mode, which in turn runs the major-mode
> hook. It also needs to run the mode-local hooks, but
> doesn't run miscellaneous other interactive tool hooks.
>
> I suppose Semantic could also have a pre-find-file hook
> that authors of modes like flymake could install a temporary
> uninstall hook into, but that seems kind of strange.
A generic flag that indicates whether it is background find-file should be enough for flymake to decide not to run subprocesses, and for other modes to decide based on this flag.
Still, I think that on kill-buffer, flymake should just kill the process.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-10-25 21:54 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-01 19:19 bug#6967: flymake not cleaning after itself (kill-buffer) S Boucher
2010-10-24 17:14 ` Chong Yidong
2010-10-25 11:15 ` Eric M. Ludlam
2010-10-25 16:20 ` Stefan Monnier
2010-10-25 21:54 ` S Boucher
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).