Loading ...
Sorry, an error occurred while loading the content.
 

netbeans killed events

Expand Messages
  • Xavier de Gaye
    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
    Message 1 of 15 , Nov 9, 2008
      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

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_dev" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Holly Baril
      Please remove me from your group! ... From: Xavier de Gaye [xdegaye@gmail.com] Sent: 11/09/2008 05:18 PM CET To: vim-dev Subject: netbeans
      Message 2 of 15 , Nov 9, 2008
        Please remove me from your group!


        ----- Original Message -----
        From: "Xavier de Gaye" [xdegaye@...]
        Sent: 11/09/2008 05:18 PM CET
        To: vim-dev <vim-dev@...>
        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 @..., 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
        -~----------~----~----~----~------~----~------~--~---
      • Xavier de Gaye
        ... I have missed the following important point: the Vim signs placed in the buffer are removed by bdelete and by bwipeout, but not by bunload or by any other
        Message 3 of 15 , Nov 9, 2008
          On Sun, Nov 9, 2008 at 5:18 PM, Xavier de Gaye <xdegaye@...> wrote:
          > It is not clear if netbeans "killed" events are correctly sent by Vim.
          > ...
          > 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.


          I have missed the following important point: the Vim signs placed in
          the buffer are removed by bdelete and by bwipeout, but not by bunload
          or by any other Vim command.

          The netbeans application must keep track of the Vim signs, so I
          suggest:
          * the semantics of the "killed" event is:
          the bufno reference is invalid
          the signs have been removed by Vim
          * the code is changed so that only bdelete and bwipeout
          trigger a "killed" event (not bunload)
          * the documentation is updated accordingly


          Xavier

          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_dev" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • Tony Mechelynck
          ... The best-placed person to remove you from this group is yourself. There are two ways to do it, depending on how you interface with the group. a) If you
          Message 4 of 15 , Nov 9, 2008
            On 09/11/08 17:35, Holly Baril wrote:
            > Please remove me from your group!

            The best-placed person to remove you from this group is yourself. There
            are two ways to do it, depending on how you interface with the group.

            a) If you used the Google Groups interface, go back to
            http://groups.google.com/groups/mysubs?hl=en (log in if necessary) then
            turn the drop-down at far right on the "vim_dev" line to make it say
            "Unsubscribe". Then click "Save group settings". I'm not sure what
            happens afterwards, you may have to read a last email and obey it to
            confirm that you "really" want to unsubscribe -- or maybe not.

            b) If you used the vim.org interface, send an email to
            vim-dev-unsubscribe@... but MAKE SURE that the "From:" line on that
            email holds the exact address with which you subscribed and to which
            list mail is being sent. You will then get a last email at that address,
            telling you what to do in order to confirm that you really want to
            unsubscribe (and that it isn't some joker playing a bad-taste practical
            joke on you).


            Best regards,
            Tony.
            --
            We're knights of the round table
            We dance whene'er we're able
            We do routines and chorus scenes
            With footwork impeccable.
            We dine well here in Camelot
            We eat ham and jam and spam a lot.
            "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_dev" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          • Bram Moolenaar
            ... I think netbeans_file_closed() should be invoked whenever buf_freeall() has been called and the buffer used there is still valid (autocommands didn t get
            Message 5 of 15 , Nov 10, 2008
              Xavier de Gaye wrote:

              > 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.

              I think netbeans_file_closed() should be invoked whenever buf_freeall()
              has been called and the buffer used there is still valid (autocommands
              didn't get in the way). It might even be possible to do it at the end
              of buf_freeall(). Need to look very closely into what is being accessed
              to be able to decide where it should be done.

              Can you propose a patch for that?

              --
              hundred-and-one symptoms of being an internet addict:
              226. You sit down at the computer right after dinner and your spouse
              says "See you in the morning."

              /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
              /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
              \\\ download, build and distribute -- http://www.A-A-P.org ///
              \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

              --~--~---------~--~----~------------~-------~--~----~
              You received this message from the "vim_dev" maillist.
              For more information, visit http://www.vim.org/maillist.php
              -~----------~----~----~----~------~----~------~--~---
            • Bram Moolenaar
              ... One wonders what the original meaning for killed is: buffer deleted or unloaded? I don t know. What is more useful? Perhaps we need both a killed and
              Message 6 of 15 , Nov 10, 2008
                Xavier de Gaye wrote:

                > On Sun, Nov 9, 2008 at 5:18 PM, Xavier de Gaye <xdegaye@...> wrote:
                > > It is not clear if netbeans "killed" events are correctly sent by Vim.
                > > ...
                > > 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.
                >
                >
                > I have missed the following important point: the Vim signs placed in
                > the buffer are removed by bdelete and by bwipeout, but not by bunload
                > or by any other Vim command.
                >
                > The netbeans application must keep track of the Vim signs, so I
                > suggest:
                > * the semantics of the "killed" event is:
                > the bufno reference is invalid
                > the signs have been removed by Vim
                > * the code is changed so that only bdelete and bwipeout
                > trigger a "killed" event (not bunload)
                > * the documentation is updated accordingly

                One wonders what the original meaning for "killed" is: buffer deleted or
                unloaded? I don't know.

                What is more useful? Perhaps we need both a "killed" and an "unloaded"
                event?

                --
                hundred-and-one symptoms of being an internet addict:
                227. You sleep next to your monitor. Or on top of it.

                /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                \\\ download, build and distribute -- http://www.A-A-P.org ///
                \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

                --~--~---------~--~----~------------~-------~--~----~
                You received this message from the "vim_dev" maillist.
                For more information, visit http://www.vim.org/maillist.php
                -~----------~----~----~----~------~----~------~--~---
              • Xavier de Gaye
                ... Having unloaded events would be nice and would allow the netbeans application or IDE to know when a buffer is not visible. But the main problem is that
                Message 7 of 15 , Nov 11, 2008
                  On Mon, Nov 10, 2008 at 9:41 PM, Bram Moolenaar <Bram@...> wrote:
                  >
                  > Xavier de Gaye wrote:
                  >
                  >> On Sun, Nov 9, 2008 at 5:18 PM, Xavier de Gaye <xdegaye@...> wrote:
                  >> > It is not clear if netbeans "killed" events are correctly sent by Vim.
                  >> > ...
                  >> > 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.
                  >>
                  >>
                  >> I have missed the following important point: the Vim signs placed in
                  >> the buffer are removed by bdelete and by bwipeout, but not by bunload
                  >> or by any other Vim command.
                  >>
                  >> The netbeans application must keep track of the Vim signs, so I
                  >> suggest:
                  >> * the semantics of the "killed" event is:
                  >> the bufno reference is invalid
                  >> the signs have been removed by Vim
                  >> * the code is changed so that only bdelete and bwipeout
                  >> trigger a "killed" event (not bunload)
                  >> * the documentation is updated accordingly
                  >
                  > One wonders what the original meaning for "killed" is: buffer deleted or
                  > unloaded? I don't know.
                  >
                  > What is more useful? Perhaps we need both a "killed" and an "unloaded"
                  > event?


                  Having "unloaded" events would be nice and would allow the netbeans
                  application or IDE to know when a buffer is not visible.

                  But the main problem is that Vim and the netbeans application must
                  maintain the list of netbeans buffers and the corresponding signs
                  (netbeans annotations) in a consistent state. So I think buffer
                  deletion notifications (caused by bdelete and bwipeout commands, that
                  remove the signs in a buffer) are needed and should be mapped to
                  "killed" events.

                  I think this can be fixed by calling netbeans_file_closed() from
                  free_buffer_stuff(), just after buf_delete_signs(). This would cause a
                  "killed" event to be sent when bdelete or bwipeout are invoked.

                  What do you think ? I did not understand what issue is fixed by
                  calling netbeans_file_closed() from buf_freeall(), in your other mail.


                  Xavier

                  --~--~---------~--~----~------------~-------~--~----~
                  You received this message from the "vim_dev" maillist.
                  For more information, visit http://www.vim.org/maillist.php
                  -~----------~----~----~----~------~----~------~--~---
                • Bram Moolenaar
                  ... OK. So a :quit will not cause a killed event. ... It s just that calling netbeans_file_closed() from one place avoids that it s not called when making
                  Message 8 of 15 , Nov 11, 2008
                    Xavier de Gaye wrote:

                    > >> On Sun, Nov 9, 2008 at 5:18 PM, Xavier de Gaye <xdegaye@...> wrote:
                    > >> > It is not clear if netbeans "killed" events are correctly sent by Vim.
                    > >> > ...
                    > >> > 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.
                    > >>
                    > >>
                    > >> I have missed the following important point: the Vim signs placed in
                    > >> the buffer are removed by bdelete and by bwipeout, but not by bunload
                    > >> or by any other Vim command.
                    > >>
                    > >> The netbeans application must keep track of the Vim signs, so I
                    > >> suggest:
                    > >> * the semantics of the "killed" event is:
                    > >> the bufno reference is invalid
                    > >> the signs have been removed by Vim
                    > >> * the code is changed so that only bdelete and bwipeout
                    > >> trigger a "killed" event (not bunload)
                    > >> * the documentation is updated accordingly
                    > >
                    > > One wonders what the original meaning for "killed" is: buffer deleted or
                    > > unloaded? I don't know.
                    > >
                    > > What is more useful? Perhaps we need both a "killed" and an "unloaded"
                    > > event?
                    >
                    >
                    > Having "unloaded" events would be nice and would allow the netbeans
                    > application or IDE to know when a buffer is not visible.
                    >
                    > But the main problem is that Vim and the netbeans application must
                    > maintain the list of netbeans buffers and the corresponding signs
                    > (netbeans annotations) in a consistent state. So I think buffer
                    > deletion notifications (caused by bdelete and bwipeout commands, that
                    > remove the signs in a buffer) are needed and should be mapped to
                    > "killed" events.

                    OK. So a ":quit" will not cause a "killed" event.

                    > I think this can be fixed by calling netbeans_file_closed() from
                    > free_buffer_stuff(), just after buf_delete_signs(). This would cause a
                    > "killed" event to be sent when bdelete or bwipeout are invoked.
                    >
                    > What do you think ? I did not understand what issue is fixed by
                    > calling netbeans_file_closed() from buf_freeall(), in your other mail.

                    It's just that calling netbeans_file_closed() from one place avoids that
                    it's not called when making changes. But it may be called at the wrong
                    moment, one needs to inspect the code to check.

                    --
                    The term "free software" is defined by Richard M. Stallman as
                    being software that isn't necessarily for free. Confusing?
                    Let's call it "Stallman software" then!
                    -- Bram Moolenaar

                    /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                    /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                    \\\ download, build and distribute -- http://www.A-A-P.org ///
                    \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

                    --~--~---------~--~----~------------~-------~--~----~
                    You received this message from the "vim_dev" maillist.
                    For more information, visit http://www.vim.org/maillist.php
                    -~----------~----~----~----~------~----~------~--~---
                  • Tony Mechelynck
                    ... ...unless, maybe, the result is to exit Vim? (But this case ought to be covered by BufDelete.) ... Best regards, Tony. -- Main s Law: For every action
                    Message 9 of 15 , Nov 11, 2008
                      On 11/11/08 21:53, Bram Moolenaar wrote:
                      >
                      > Xavier de Gaye wrote:
                      >
                      >>>> On Sun, Nov 9, 2008 at 5:18 PM, Xavier de Gaye<xdegaye@...> wrote:
                      >>>>> It is not clear if netbeans "killed" events are correctly sent by Vim.
                      >>>>> ...
                      >>>>> 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.
                      >>>>
                      >>>> I have missed the following important point: the Vim signs placed in
                      >>>> the buffer are removed by bdelete and by bwipeout, but not by bunload
                      >>>> or by any other Vim command.
                      >>>>
                      >>>> The netbeans application must keep track of the Vim signs, so I
                      >>>> suggest:
                      >>>> * the semantics of the "killed" event is:
                      >>>> the bufno reference is invalid
                      >>>> the signs have been removed by Vim
                      >>>> * the code is changed so that only bdelete and bwipeout
                      >>>> trigger a "killed" event (not bunload)
                      >>>> * the documentation is updated accordingly
                      >>> One wonders what the original meaning for "killed" is: buffer deleted or
                      >>> unloaded? I don't know.
                      >>>
                      >>> What is more useful? Perhaps we need both a "killed" and an "unloaded"
                      >>> event?
                      >>
                      >> Having "unloaded" events would be nice and would allow the netbeans
                      >> application or IDE to know when a buffer is not visible.
                      >>
                      >> But the main problem is that Vim and the netbeans application must
                      >> maintain the list of netbeans buffers and the corresponding signs
                      >> (netbeans annotations) in a consistent state. So I think buffer
                      >> deletion notifications (caused by bdelete and bwipeout commands, that
                      >> remove the signs in a buffer) are needed and should be mapped to
                      >> "killed" events.
                      >
                      > OK. So a ":quit" will not cause a "killed" event.

                      ...unless, maybe, the result is to exit Vim? (But this case ought to be
                      covered by BufDelete.)

                      >
                      >> I think this can be fixed by calling netbeans_file_closed() from
                      >> free_buffer_stuff(), just after buf_delete_signs(). This would cause a
                      >> "killed" event to be sent when bdelete or bwipeout are invoked.
                      >>
                      >> What do you think ? I did not understand what issue is fixed by
                      >> calling netbeans_file_closed() from buf_freeall(), in your other mail.
                      >
                      > It's just that calling netbeans_file_closed() from one place avoids that
                      > it's not called when making changes. But it may be called at the wrong
                      > moment, one needs to inspect the code to check.
                      >

                      Best regards,
                      Tony.
                      --
                      Main's Law:
                      For every action there is an equal and opposite government
                      program.

                      --~--~---------~--~----~------------~-------~--~----~
                      You received this message from the "vim_dev" maillist.
                      For more information, visit http://www.vim.org/maillist.php
                      -~----------~----~----~----~------~----~------~--~---
                    • Xavier de Gaye
                      ... Yes. ... Ok. Xavier --~--~---------~--~----~------------~-------~--~----~ You received this message from the vim_dev maillist. For more information,
                      Message 10 of 15 , Nov 12, 2008
                        On Tue, Nov 11, 2008 at 9:53 PM, Bram Moolenaar <Bram@...> wrote:
                        >
                        > Xavier de Gaye wrote:
                        >
                        >> >> On Sun, Nov 9, 2008 at 5:18 PM, Xavier de Gaye <xdegaye@...> wrote:
                        >> >> > It is not clear if netbeans "killed" events are correctly sent by Vim.
                        >> >> > ...
                        >> >> > 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.
                        >> >>
                        >> >>
                        >> >> I have missed the following important point: the Vim signs placed in
                        >> >> the buffer are removed by bdelete and by bwipeout, but not by bunload
                        >> >> or by any other Vim command.
                        >> >>
                        >> >> The netbeans application must keep track of the Vim signs, so I
                        >> >> suggest:
                        >> >> * the semantics of the "killed" event is:
                        >> >> the bufno reference is invalid
                        >> >> the signs have been removed by Vim
                        >> >> * the code is changed so that only bdelete and bwipeout
                        >> >> trigger a "killed" event (not bunload)
                        >> >> * the documentation is updated accordingly
                        >> >
                        >> > One wonders what the original meaning for "killed" is: buffer deleted or
                        >> > unloaded? I don't know.
                        >> >
                        >> > What is more useful? Perhaps we need both a "killed" and an "unloaded"
                        >> > event?
                        >>
                        >>
                        >> Having "unloaded" events would be nice and would allow the netbeans
                        >> application or IDE to know when a buffer is not visible.
                        >>
                        >> But the main problem is that Vim and the netbeans application must
                        >> maintain the list of netbeans buffers and the corresponding signs
                        >> (netbeans annotations) in a consistent state. So I think buffer
                        >> deletion notifications (caused by bdelete and bwipeout commands, that
                        >> remove the signs in a buffer) are needed and should be mapped to
                        >> "killed" events.
                        >
                        > OK. So a ":quit" will not cause a "killed" event.

                        Yes.


                        >> I think this can be fixed by calling netbeans_file_closed() from
                        >> free_buffer_stuff(), just after buf_delete_signs(). This would cause a
                        >> "killed" event to be sent when bdelete or bwipeout are invoked.
                        >>
                        >> What do you think ? I did not understand what issue is fixed by
                        >> calling netbeans_file_closed() from buf_freeall(), in your other mail.
                        >
                        > It's just that calling netbeans_file_closed() from one place avoids that
                        > it's not called when making changes. But it may be called at the wrong
                        > moment, one needs to inspect the code to check.

                        Ok.


                        Xavier

                        --~--~---------~--~----~------------~-------~--~----~
                        You received this message from the "vim_dev" maillist.
                        For more information, visit http://www.vim.org/maillist.php
                        -~----------~----~----~----~------~----~------~--~---
                      • Xavier de Gaye
                        On Wed, Nov 12, 2008 at 1:00 AM, Tony Mechelynck ... Actually, when :quit causes Vim to exit, killed events are currently sent for each buffer known by
                        Message 11 of 15 , Nov 12, 2008
                          On Wed, Nov 12, 2008 at 1:00 AM, Tony Mechelynck
                          <antoine.mechelynck@...> wrote:
                          > On 11/11/08 21:53, Bram Moolenaar wrote:
                          >>
                          >> Xavier de Gaye wrote:
                          >>
                          >>>>> On Sun, Nov 9, 2008 at 5:18 PM, Xavier de Gaye<xdegaye@...>
                          >>>>> wrote:
                          >>>>>>
                          >>>>>> It is not clear if netbeans "killed" events are correctly sent by Vim.
                          >>>>>> ...
                          >>>>>> 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.
                          >>>>>
                          >>>>> I have missed the following important point: the Vim signs placed in
                          >>>>> the buffer are removed by bdelete and by bwipeout, but not by bunload
                          >>>>> or by any other Vim command.
                          >>>>>
                          >>>>> The netbeans application must keep track of the Vim signs, so I
                          >>>>> suggest:
                          >>>>> * the semantics of the "killed" event is:
                          >>>>> the bufno reference is invalid
                          >>>>> the signs have been removed by Vim
                          >>>>> * the code is changed so that only bdelete and bwipeout
                          >>>>> trigger a "killed" event (not bunload)
                          >>>>> * the documentation is updated accordingly
                          >>>>
                          >>>> One wonders what the original meaning for "killed" is: buffer deleted or
                          >>>> unloaded? I don't know.
                          >>>>
                          >>>> What is more useful? Perhaps we need both a "killed" and an "unloaded"
                          >>>> event?
                          >>>
                          >>> Having "unloaded" events would be nice and would allow the netbeans
                          >>> application or IDE to know when a buffer is not visible.
                          >>>
                          >>> But the main problem is that Vim and the netbeans application must
                          >>> maintain the list of netbeans buffers and the corresponding signs
                          >>> (netbeans annotations) in a consistent state. So I think buffer
                          >>> deletion notifications (caused by bdelete and bwipeout commands, that
                          >>> remove the signs in a buffer) are needed and should be mapped to
                          >>> "killed" events.
                          >>
                          >> OK. So a ":quit" will not cause a "killed" event.
                          >
                          > ...unless, maybe, the result is to exit Vim? (But this case ought to be
                          > covered by BufDelete.)

                          Actually, when ":quit" causes Vim to exit, "killed" events are
                          currently sent for each buffer known by netbeans, before the final
                          "disconnect" event that warns the application that netbeans is
                          terminating.



                          >>
                          >>> I think this can be fixed by calling netbeans_file_closed() from
                          >>> free_buffer_stuff(), just after buf_delete_signs(). This would cause a
                          >>> "killed" event to be sent when bdelete or bwipeout are invoked.
                          >>>
                          >>> What do you think ? I did not understand what issue is fixed by
                          >>> calling netbeans_file_closed() from buf_freeall(), in your other mail.
                          >>
                          >> It's just that calling netbeans_file_closed() from one place avoids that
                          >> it's not called when making changes. But it may be called at the wrong
                          >> moment, one needs to inspect the code to check.


                          Xavier

                          --~--~---------~--~----~------------~-------~--~----~
                          You received this message from the "vim_dev" maillist.
                          For more information, visit http://www.vim.org/maillist.php
                          -~----------~----~----~----~------~----~------~--~---
                        • Bram Moolenaar
                          ... Yes, I was thinking of :quit just closing a buffer, possibly unloading it. It s also possible that bufhidden is set to delete or wipe . So
                          Message 12 of 15 , Nov 12, 2008
                            Xavier de Gaye wrote:

                            > >> OK. So a ":quit" will not cause a "killed" event.
                            > >
                            > > ...unless, maybe, the result is to exit Vim? (But this case ought to be
                            > > covered by BufDelete.)
                            >
                            > Actually, when ":quit" causes Vim to exit, "killed" events are
                            > currently sent for each buffer known by netbeans, before the final
                            > "disconnect" event that warns the application that netbeans is
                            > terminating.

                            Yes, I was thinking of ":quit" just closing a buffer, possibly unloading
                            it. It's also possible that 'bufhidden' is set to "delete" or "wipe".
                            So generally: unloading doesn't trigger killed, deleting or wiping out
                            the buffer does.

                            --
                            hundred-and-one symptoms of being an internet addict:
                            248. You sign your letters with your e-mail address instead of your name.

                            /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                            /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                            \\\ download, build and distribute -- http://www.A-A-P.org ///
                            \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

                            --~--~---------~--~----~------------~-------~--~----~
                            You received this message from the "vim_dev" maillist.
                            For more information, visit http://www.vim.org/maillist.php
                            -~----------~----~----~----~------~----~------~--~---
                          • Xavier de Gaye
                            ... Right. I will propose a patch that sends a killed events for all these cases, plus for backward compatibily, when processing a stopDocumentListen
                            Message 13 of 15 , Nov 13, 2008
                              On Wed, Nov 12, 2008 at 10:45 PM, Bram Moolenaar <Bram@...> wrote:
                              >
                              > Xavier de Gaye wrote:
                              >
                              >> >> OK. So a ":quit" will not cause a "killed" event.
                              >> >
                              >> > ...unless, maybe, the result is to exit Vim? (But this case ought to be
                              >> > covered by BufDelete.)
                              >>
                              >> Actually, when ":quit" causes Vim to exit, "killed" events are
                              >> currently sent for each buffer known by netbeans, before the final
                              >> "disconnect" event that warns the application that netbeans is
                              >> terminating.
                              >
                              > Yes, I was thinking of ":quit" just closing a buffer, possibly unloading
                              > it. It's also possible that 'bufhidden' is set to "delete" or "wipe".
                              > So generally: unloading doesn't trigger killed, deleting or wiping out
                              > the buffer does.

                              Right.
                              I will propose a patch that sends a "killed" events for all these
                              cases, plus for backward compatibily, when processing a
                              "stopDocumentListen" netbeans command and the buffer is marked as a
                              "netbeansBuffer" buffer.


                              Xavier

                              --~--~---------~--~----~------------~-------~--~----~
                              You received this message from the "vim_dev" maillist.
                              For more information, visit http://www.vim.org/maillist.php
                              -~----------~----~----~----~------~----~------~--~---
                            • Xavier de Gaye
                              ... The attached patch is based on Vim subversion revision 1264, Vim version 7.2.49. Problem: killed netbeans events are not handled correctly. Solution: A
                              Message 14 of 15 , Nov 23, 2008
                                On Thu, Nov 13, 2008 at 9:55 PM, Xavier de Gaye <xdegaye@...> wrote:
                                > On Wed, Nov 12, 2008 at 10:45 PM, Bram Moolenaar <Bram@...> wrote:
                                >>
                                >> Xavier de Gaye wrote:
                                >>
                                >>> >> OK. So a ":quit" will not cause a "killed" event.
                                >>> >
                                >>> > ...unless, maybe, the result is to exit Vim? (But this case ought to be
                                >>> > covered by BufDelete.)
                                >>>
                                >>> Actually, when ":quit" causes Vim to exit, "killed" events are
                                >>> currently sent for each buffer known by netbeans, before the final
                                >>> "disconnect" event that warns the application that netbeans is
                                >>> terminating.
                                >>
                                >> Yes, I was thinking of ":quit" just closing a buffer, possibly unloading
                                >> it. It's also possible that 'bufhidden' is set to "delete" or "wipe".
                                >> So generally: unloading doesn't trigger killed, deleting or wiping out
                                >> the buffer does.
                                >
                                > Right.
                                > I will propose a patch that sends a "killed" events for all these
                                > cases, plus for backward compatibily, when processing a
                                > "stopDocumentListen" netbeans command and the buffer is marked as a
                                > "netbeansBuffer" buffer.


                                The attached patch is based on Vim subversion revision 1264, Vim
                                version 7.2.49.

                                Problem: "killed" netbeans events are not handled correctly.

                                Solution: A "killed" netbeans event is sent when the buffer is deleted
                                or wiped out (in this case, the netbeans annotations in this buffer
                                have been removed). A user can still remove a sign with the command
                                ":sign unplace" and this does not trigger a "killed" event.

                                Tests run on Vim 7.2.49:
                                Two buffers 'foo' and 'bar' displayed in split windows with a
                                netbeans annotations placed on buffer 'foo'.
                                A test is pass if a killed event is sent when (and only when) the
                                Vim signs are removed.

                                killed evt Vim signs test
                                removed
                                quit No No Ok
                                quit (bufhidden=delete) No Yes Failed
                                quit (bufhidden=wipe) No Yes Failed
                                bunload foo Yes No Failed
                                bdelete foo Yes Yes Ok
                                bwipeout foo Yes. Yes Ok
                                qall Yes Yes Ok
                                stopDocumentListen Yes Yes Ok

                                The last test has been run with 'clewn -d' and the commands:
                                @ bufId netbeansBuffer T
                                @ bufId stopDocumentListen

                                Tests run with the attached patch applied:

                                killed evt Vim signs status
                                removed
                                quit foo No No Ok
                                quit foo (bh=delete) Yes Yes Ok
                                quit foo (bh=wipe) Yes Yes Ok
                                bunload foo No No Ok
                                bdlete foo Yes Yes Ok
                                bwipeout foo Yes Yes Ok
                                qall Yes Yes Ok
                                stopDocumentListen Yes Yes Ok


                                Xavier

                                --~--~---------~--~----~------------~-------~--~----~
                                You received this message from the "vim_dev" maillist.
                                For more information, visit http://www.vim.org/maillist.php
                                -~----------~----~----~----~------~----~------~--~---
                              • Bram Moolenaar
                                ... Great, thanks. I ll look into it later. -- TALL KNIGHT OF NI: Ni! Monty Python and the Holy Grail PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar --
                                Message 15 of 15 , Nov 24, 2008
                                  Xavier de Gaye wrote:

                                  > On Thu, Nov 13, 2008 at 9:55 PM, Xavier de Gaye <xdegaye@...> wrote:
                                  > > On Wed, Nov 12, 2008 at 10:45 PM, Bram Moolenaar <Bram@...> wrote:
                                  > >>
                                  > >> Xavier de Gaye wrote:
                                  > >>
                                  > >>> >> OK. So a ":quit" will not cause a "killed" event.
                                  > >>> >
                                  > >>> > ...unless, maybe, the result is to exit Vim? (But this case ought to be
                                  > >>> > covered by BufDelete.)
                                  > >>>
                                  > >>> Actually, when ":quit" causes Vim to exit, "killed" events are
                                  > >>> currently sent for each buffer known by netbeans, before the final
                                  > >>> "disconnect" event that warns the application that netbeans is
                                  > >>> terminating.
                                  > >>
                                  > >> Yes, I was thinking of ":quit" just closing a buffer, possibly unloading
                                  > >> it. It's also possible that 'bufhidden' is set to "delete" or "wipe".
                                  > >> So generally: unloading doesn't trigger killed, deleting or wiping out
                                  > >> the buffer does.
                                  > >
                                  > > Right.
                                  > > I will propose a patch that sends a "killed" events for all these
                                  > > cases, plus for backward compatibily, when processing a
                                  > > "stopDocumentListen" netbeans command and the buffer is marked as a
                                  > > "netbeansBuffer" buffer.
                                  >
                                  >
                                  > The attached patch is based on Vim subversion revision 1264, Vim
                                  > version 7.2.49.
                                  >
                                  > Problem: "killed" netbeans events are not handled correctly.
                                  >
                                  > Solution: A "killed" netbeans event is sent when the buffer is deleted
                                  > or wiped out (in this case, the netbeans annotations in this buffer
                                  > have been removed). A user can still remove a sign with the command
                                  > ":sign unplace" and this does not trigger a "killed" event.
                                  >
                                  > Tests run on Vim 7.2.49:
                                  > Two buffers 'foo' and 'bar' displayed in split windows with a
                                  > netbeans annotations placed on buffer 'foo'.
                                  > A test is pass if a killed event is sent when (and only when) the
                                  > Vim signs are removed.
                                  >
                                  > killed evt Vim signs test
                                  > removed
                                  > quit No No Ok
                                  > quit (bufhidden=delete) No Yes Failed
                                  > quit (bufhidden=wipe) No Yes Failed
                                  > bunload foo Yes No Failed
                                  > bdelete foo Yes Yes Ok
                                  > bwipeout foo Yes. Yes Ok
                                  > qall Yes Yes Ok
                                  > stopDocumentListen Yes Yes Ok
                                  >
                                  > The last test has been run with 'clewn -d' and the commands:
                                  > @ bufId netbeansBuffer T
                                  > @ bufId stopDocumentListen
                                  >
                                  > Tests run with the attached patch applied:
                                  >
                                  > killed evt Vim signs status
                                  > removed
                                  > quit foo No No Ok
                                  > quit foo (bh=delete) Yes Yes Ok
                                  > quit foo (bh=wipe) Yes Yes Ok
                                  > bunload foo No No Ok
                                  > bdlete foo Yes Yes Ok
                                  > bwipeout foo Yes Yes Ok
                                  > qall Yes Yes Ok
                                  > stopDocumentListen Yes Yes Ok

                                  Great, thanks. I'll look into it later.

                                  --
                                  TALL KNIGHT OF NI: Ni!
                                  "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

                                  /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                                  /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                                  \\\ download, build and distribute -- http://www.A-A-P.org ///
                                  \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

                                  --~--~---------~--~----~------------~-------~--~----~
                                  You received this message from the "vim_dev" maillist.
                                  For more information, visit http://www.vim.org/maillist.php
                                  -~----------~----~----~----~------~----~------~--~---
                                Your message has been successfully submitted and would be delivered to recipients shortly.