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

Is there a way to check whether a specific autocmd group is empty?

Expand Messages
  • winterTTr
    I just want to check whether a autocmd group is empty and i want to remove it when it is empty. But I don t find the method or a way to do this. Is there a way
    Message 1 of 2 , Mar 4 1:08 AM
    • 0 Attachment
      I just want to check whether a autocmd group is empty and i want to remove it when it is empty.
      But I don't find the method or a way to do this.

      Is there a way to check whether a specific autocmd group is empty?
      Any suggestion is OK. Thanks.


      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Tony Mechelynck
      ... I m surprised that there has been no reply yet to this post. To check if auto commands exist for a given group, I can imagine two possibilities; you will
      Message 2 of 2 , May 1, 2010
      • 0 Attachment
        On 04/03/10 10:08, winterTTr wrote:
        > I just want to check whether a autocmd group is empty and i want to
        > remove it when it is empty.
        > But I don't find the method or a way to do this.
        >
        > Is there a way to check whether a specific autocmd group is empty?
        > Any suggestion is OK. Thanks.
        >

        I'm surprised that there has been no reply yet to this post.

        To check if auto commands exist for a given group, I can imagine two
        possibilities; you will have to experiment to see what works:

        a) see ":help exists()" [near the end of the list]. I'm not sure this
        allows you to test if autocommands are defined for a given group if you
        don't know which patterns or events are possible in that group.

        b) see ":help autocmd-list" and ":help :redir". Finding out that you got
        an empty list may be tedious. Also the title may depend on your messages
        language (see :help v:lang and what it resends to).


        Best regards,
        Tony.
        --
        GUARD #2: It could be carried by an African swallow!
        GUARD #1: Oh, yeah, an African swallow maybe, but not a European swallow,
        that's my point.
        GUARD #2: Oh, yeah, I agree with that...
        The Quest for the Holy Grail (Monty
        Python)

        --
        You received this message from the "vim_use" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      Your message has been successfully submitted and would be delivered to recipients shortly.