Please remove me from your group!

----- Original Message -----
From: "Xavier de Gaye" [EMAIL PROTECTED]
Sent: 11/09/2008 05:18 PM CET
To: vim-dev <[EMAIL PROTECTED]>
Subject: netbeans killed events




It is not clear if netbeans "killed" events are correctly sent by Vim.

For example with 2 windows displaying each a different buffer,
':[N]bunload' will trigger a "killed" event, and ':quit' on this same
buffer will not trigger the event, however both commands have the same
effects.

"killed" events are sent by netbeans_file_closed().
Below is the reverse call-graph of netbeans_file_closed() (in this
graph, a function is called by all functions at the next indentation
level):

netbeans_file_closed: (a)
    close_buffer
        set_curbuf
        do_ecmd
        ex_window
        win_close
        win_close_othertab
        ...
        do_buffer
            goto_buffer
            nb_do_cmd: (b) when processing "close" netbeans command
            do_bufdel: (c)
                ex_bunload
                nb_do_cmd: (d) only if "netbeansBuffer", when
                           processing "stopDocumentListen" netbeans
                           command

The global variable netbeansCloseFile is only used in
netbeans_file_closed() and do_bufdel().
(a) pseudo code for netbeans_file_closed():
    if netbeansCloseFile
        send "killed" event and "forget" the reference to the Vim
        buffer in the netbeans buffer structure
    else
        debug message: "Ignoring file_closed. File was closed from
        IDE" and return
(b) nb_do_cmd: does not trigger a "killed" event
(c) do_bufdel: set netbeansCloseFile = 1 at start, reset to zero
                 before function exit
(d) nb_do_cmd: triggers a "killed" event only if the buffer is a
               "netbeansBuffer"

Occurences of "killed" events:
* Only bunload, bdelete and bwipeout Vim commands trigger a "killed"
  event
* In (d), why the netbeans application would want to receive a
  "killed" event when it is the one that sets the buffer as a
  "netbeansBuffer" and the one that is responsible for sending the
  "stopDocumentListen" command that triggers this event ? This does
  not make sense

Note also that when setting netbeans debug mode, the message "Ignoring
file_closed. File was closed from IDE" is printed when a buffer is
closed by any Vim command other than bunload, bdelete, bwipeout and
this message is obviously wrong since it is closed from Vim, not from
the IDE.

Conclusion:
As it is, "killed" events are useless for the netbeans application
(but they cannot be ignored as the bufno reference is not anymore
valid after receiving the event).
I would like to propose to remove the global netbeansCloseFile
entirely from the code, expecting that this would cause a "killed"
event whenever a buffer is not anymore visible in any window, but I
don't know Vim code sufficiently to be sure that this is the case.


Xavier


______________________________________________________________________


This message contains information which may be confidential and privileged.  
Unless you are the addressee (or authorized to receive for the addressee), you 
may not use, copy, re-transmit, or disclose to anyone the message or any 
information contained in the message. If you have received the message in 
error, please advise the sender by reply e-mail @WMA.com, and delete the 
message. E-mail communication is highly susceptible to spoofing, spamming, and 
other tampering, some of which may be harmful to your computer. If you are 
concerned about the authenticity of the message or the source, please contact 
the sender directly. Please be advised that the William Morris Agency does not 
render legal services.

Please consider the environment before printing this email.



--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui