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

[PATCH] added TextDeleted and TextYanked events

Expand Messages
  • Philippe Vaucher
    Hello, I added TextDelete and TextYank events. This necessity appeared because of the small delete register getting in our way in order to implement a proper
    Message 1 of 27 , May 23 8:30 AM
    • 0 Attachment
      Hello,

      I added TextDelete and TextYank events.

      This necessity appeared because of the small delete register getting
      in our way in order to implement a proper killring. There exists a
      plugin that tries to address it (YankRing.vim) but then other things
      break down, like macros with counts, not to mention the plugin is
      heavy.

      This issue was raised on irc by the-isz and myself after we realised
      we couldn't have a nice flow about editing some file like this:

      delete a word (dw), remove some trailing spaces (xxx), go to end of
      line ($), paste word (arg, dw didn't put word in registers 1-9, need
      to undo, put word in explicit register, etc)

      With this patch, we can now make a very simple "YankRing" plugin which
      only stores Yanked/Deleted texts by listening on those events, without
      interfering with all the vim commands like the original YankRing
      plugin does.

      You can test it with:

      autocmd TextDeleted * echom 'Deleted: ' . @"
      autocmd TextYanked * echom 'Yanked: ' . @"

      Tell me what you think.

      Philippe


      From f82fa9037bf6bd2013742e9502ffcdea903e8401 Mon Sep 17 00:00:00 2001
      From: Philippe Vaucher <philippe.vaucher@...>
      Date: Mon, 23 May 2011 17:08:51 +0200
      Subject: [PATCH] Added TextDeleted and TextYanked events

      ---
      runtime/doc/autocmd.txt | 13 +++++++++++++
      src/fileio.c | 2 ++
      src/ops.c | 2 ++
      src/vim.h | 2 ++
      4 files changed, 19 insertions(+), 0 deletions(-)

      diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
      index 145ecf6..057db21 100644
      --- a/runtime/doc/autocmd.txt
      +++ b/runtime/doc/autocmd.txt
      @@ -302,6 +302,9 @@ Name triggered by ~
      |InsertCharPre| when a character was typed in Insert mode, before
      inserting it

      +|TextDeleted| when some text is deleted (dw, dd, D)
      +|TextYanked| when some text is yanked (yw, yd, Y)
      +
      |ColorScheme| after loading a color scheme

      |RemoteReply| a reply from a server Vim was received
      @@ -670,6 +673,16 @@ InsertCharPre When a character is typed in
      Insert mode,
      It is not allowed to change the text |textlock|.
      The event is not triggered when 'paste' is
      set.
      + *TextDeleted*
      +TextDeleted Just after a delete (|d|) command is issued.
      + You can inspect the @" variable to
      know
      + about the deleted text.
      +
      + *TextYanked*
      +TextYanked Just after a |yank| (|y|) command is issued.
      + You can inspect the @" variable to
      know
      + about the deleted text.
      +
      *InsertEnter*
      InsertEnter Just before starting Insert mode. Also for
      Replace mode and Virtual Replace mode. The
      diff --git a/src/fileio.c b/src/fileio.c
      index 6355c79..81b09e2 100644
      --- a/src/fileio.c
      +++ b/src/fileio.c
      @@ -7688,6 +7688,8 @@ static struct event_name
      {"WinEnter", EVENT_WINENTER},
      {"WinLeave", EVENT_WINLEAVE},
      {"VimResized", EVENT_VIMRESIZED},
      + {"TextDeleted", EVENT_TEXTDELETED},
      + {"TextYanked", EVENT_TEXTYANKED},
      {NULL, (event_T)0}
      };

      diff --git a/src/ops.c b/src/ops.c
      index c41f844..375e629 100644
      --- a/src/ops.c
      +++ b/src/ops.c
      @@ -3160,6 +3160,8 @@ op_yank(oap, deleting, mess)
      # endif
      #endif

      + apply_autocmds(deleting ? EVENT_TEXTDELETED : EVENT_TEXTYANKED,
      NULL, NULL, FALSE, curbuf);
      +
      return OK;

      fail: /* free the allocated lines */
      diff --git a/src/vim.h b/src/vim.h
      index 1f4f17b..5473a21 100644
      --- a/src/vim.h
      +++ b/src/vim.h
      @@ -1290,6 +1290,8 @@ enum auto_event
      EVENT_TABENTER, /* after entering a tab page */
      EVENT_SHELLCMDPOST, /* after ":!cmd" */
      EVENT_SHELLFILTERPOST, /* after ":1,2!cmd", ":w !cmd", ":r !cmd".
      */
      + EVENT_TEXTDELETED, /* after a delete command was done (dd, dw,
      D) */
      + EVENT_TEXTYANKED, /* after a yank command was done (yy, yw, Y)
      */
      NUM_EVENTS /* MUST be the last one */
      };

      --
      1.7.4.msysgit.0

      --
      You received this message from the "vim_dev" 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
    • Bram Moolenaar
      ... I think they should be called TextDeletePost and TextYankPost to be consistent. Try doing something weird in the autocommand, such as help and then
      Message 2 of 27 , May 23 12:13 PM
      • 0 Attachment
        Philippe Vaucher wrote:

        > I added TextDelete and TextYank events.
        >
        > This necessity appeared because of the small delete register getting
        > in our way in order to implement a proper killring. There exists a
        > plugin that tries to address it (YankRing.vim) but then other things
        > break down, like macros with counts, not to mention the plugin is
        > heavy.
        >
        > This issue was raised on irc by the-isz and myself after we realised
        > we couldn't have a nice flow about editing some file like this:
        >
        > delete a word (dw), remove some trailing spaces (xxx), go to end of
        > line ($), paste word (arg, dw didn't put word in registers 1-9, need
        > to undo, put word in explicit register, etc)
        >
        > With this patch, we can now make a very simple "YankRing" plugin which
        > only stores Yanked/Deleted texts by listening on those events, without
        > interfering with all the vim commands like the original YankRing
        > plugin does.
        >
        > You can test it with:
        >
        > autocmd TextDeleted * echom 'Deleted: ' . @"
        > autocmd TextYanked * echom 'Yanked: ' . @"
        >
        > Tell me what you think.

        I think they should be called TextDeletePost and TextYankPost to be
        consistent.

        Try doing something weird in the autocommand, such as "help" and then
        deleting something.

        You probably need to disallow lots of things to avoid breaking stuff
        (and perhaps even crashing Vim).

        Don't you need to let the commands know what register text was yanked
        into?

        --
        hundred-and-one symptoms of being an internet addict:
        99. The hum of a cooling fan and the click of keys is comforting to you.

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
        \\\ an exciting new programming language -- http://www.Zimbu.org ///
        \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

        --
        You received this message from the "vim_dev" 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
      • Philippe Vaucher
        ... Ok, I can do that. ... I m not sure I want to support the crazy guys, there s probably lots of ways to create problems with other events too if that s your
        Message 3 of 27 , May 23 2:00 PM
        • 0 Attachment
          > I think they should be called TextDeletePost and TextYankPost to be
          > consistent.

          Ok, I can do that.

          > Try doing something weird in the autocommand, such as "help" and then
          > deleting something.
          > You probably need to disallow lots of things to avoid breaking stuff
          > (and perhaps even crashing Vim).

          I'm not sure I want to support the crazy guys, there's probably lots
          of ways to create problems with other events too if that's your goal.
          Anyway, what do you have in mind? The current patch is very simple and
          I kinda like it to be that way, but if there are obvious stuffs I can
          disable/disallow I'll do it.

          > Don't you need to let the commands know what register text was yanked
          > into?

          No because every delete/yank use the " register even if a register was
          explicitely specified. As a matter of completeness maybe it'd be nice
          to know which register was intended yes but it's the first time I
          fiddle with vim's source (with some pain) so I'm not too sure how much
          work is involved in creating one of those v:somevar.

          Philippe

          --
          You received this message from the "vim_dev" 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
        • ZyX
          Reply to message «Re: added TextDeleted and TextYanked events», sent 01:00:50 24 May 2011, Tuesday ... No, you forgot about deleting to black hole register.
          Message 4 of 27 , May 23 7:59 PM
          • 0 Attachment
            Reply to message «Re: added TextDeleted and TextYanked events»,
            sent 01:00:50 24 May 2011, Tuesday
            by Philippe Vaucher:

            > No because every delete/yank use the " register even if a register was
            > explicitely specified. As a matter of completeness maybe it'd be nice
            > to know which register was intended yes but it's the first time I
            > fiddle with vim's source (with some pain) so I'm not too sure how much
            > work is involved in creating one of those v:somevar.
            No, you forgot about deleting to black hole register.

            Original message:
            > > I think they should be called TextDeletePost and TextYankPost to be
            > > consistent.
            >
            > Ok, I can do that.
            >
            > > Try doing something weird in the autocommand, such as "help" and then
            > > deleting something.
            > > You probably need to disallow lots of things to avoid breaking stuff
            > > (and perhaps even crashing Vim).
            >
            > I'm not sure I want to support the crazy guys, there's probably lots
            > of ways to create problems with other events too if that's your goal.
            > Anyway, what do you have in mind? The current patch is very simple and
            > I kinda like it to be that way, but if there are obvious stuffs I can
            > disable/disallow I'll do it.
            >
            > > Don't you need to let the commands know what register text was yanked
            > > into?
            >
            > No because every delete/yank use the " register even if a register was
            > explicitely specified. As a matter of completeness maybe it'd be nice
            > to know which register was intended yes but it's the first time I
            > fiddle with vim's source (with some pain) so I'm not too sure how much
            > work is involved in creating one of those v:somevar.
            >
            > Philippe
          • Philippe Vaucher
            ... Well this was kinda by design, tho it s a marginal decision. I originally thought well if someone really don t want it to go in a register (black hole)
            Message 5 of 27 , May 24 1:01 AM
            • 0 Attachment
              > > No because every delete/yank use the " register even if a register was
              > > explicitely specified. As a matter of completeness maybe it'd be nice
              > > to know which register was intended yes but it's the first time I
              > > fiddle with vim's source (with some pain) so I'm not too sure how much
              > > work is involved in creating one of those v:somevar.
              >
              > No, you forgot about deleting to black hole register.

              Well this was kinda by design, tho it's a marginal decision. I
              originally thought "well if someone really don't want it to go in a
              register (black hole) why should TextDeleted/TextYanked fire for it?".

              Philippe

              --
              You received this message from the "vim_dev" 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
            • Bram Moolenaar
              ... Using textlock probably works. The problem is that there will always be people that install an autocommand (or use a plugin that has this autocommand
              Message 6 of 27 , May 24 4:14 AM
              • 0 Attachment
                Philippe Vaucher wrote:

                > > I think they should be called TextDeletePost and TextYankPost to be
                > > consistent.
                >
                > Ok, I can do that.
                >
                > > Try doing something weird in the autocommand, such as "help" and then
                > > deleting something.
                > > You probably need to disallow lots of things to avoid breaking stuff
                > > (and perhaps even crashing Vim).
                >
                > I'm not sure I want to support the crazy guys, there's probably lots
                > of ways to create problems with other events too if that's your goal.
                > Anyway, what do you have in mind? The current patch is very simple and
                > I kinda like it to be that way, but if there are obvious stuffs I can
                > disable/disallow I'll do it.

                Using textlock probably works.

                The problem is that there will always be people that install an
                autocommand (or use a plugin that has this autocommand without them
                knowning) and then run into trouble because of unexpected things.
                It's better to protect the user from destroying his text.
                Crashing Vim is obviously worse.

                > > Don't you need to let the commands know what register text was yanked
                > > into?
                >
                > No because every delete/yank use the " register even if a register was
                > explicitely specified. As a matter of completeness maybe it'd be nice
                > to know which register was intended yes but it's the first time I
                > fiddle with vim's source (with some pain) so I'm not too sure how much
                > work is involved in creating one of those v:somevar.

                OK, we can add it later when really needed.

                --
                hundred-and-one symptoms of being an internet addict:
                101. U can read htis w/o ny porblm and cant figur eout Y its evn listd.

                /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                \\\ an exciting new programming language -- http://www.Zimbu.org ///
                \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

                --
                You received this message from the "vim_dev" 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
              • Bram Moolenaar
                ... That should be in the documentation then. -- hundred-and-one symptoms of being an internet addict: 100. The most exciting sporting events you noticed
                Message 7 of 27 , May 24 4:14 AM
                • 0 Attachment
                  Philippe Vaucher wrote:

                  > > > No because every delete/yank use the " register even if a register was
                  > > > explicitely specified. As a matter of completeness maybe it'd be nice
                  > > > to know which register was intended yes but it's the first time I
                  > > > fiddle with vim's source (with some pain) so I'm not too sure how much
                  > > > work is involved in creating one of those v:somevar.
                  > >
                  > > No, you forgot about deleting to black hole register.
                  >
                  > Well this was kinda by design, tho it's a marginal decision. I
                  > originally thought "well if someone really don't want it to go in a
                  > register (black hole) why should TextDeleted/TextYanked fire for it?".

                  That should be in the documentation then.

                  --
                  hundred-and-one symptoms of being an internet addict:
                  100. The most exciting sporting events you noticed during summer 1996
                  was Netscape vs. Microsoft.

                  /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                  /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                  \\\ an exciting new programming language -- http://www.Zimbu.org ///
                  \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

                  --
                  You received this message from the "vim_dev" 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
                • Ben Fritz
                  ... Do we get it for free? :help v:register says it contains the name of the register in effect for the current normal mode command . It certainly seems like
                  Message 8 of 27 , May 24 8:15 AM
                  • 0 Attachment
                    On May 24, 6:14 am, Bram Moolenaar <B...@...> wrote:
                    > Philippe Vaucher wrote:
                    > > > Don't you need to let the commands know what register text was yanked
                    > > > into?
                    >
                    > > No because every delete/yank use the " register even if a register was
                    > > explicitely specified. As a matter of completeness maybe it'd be nice
                    > > to know which register was intended yes but it's the first time I
                    > > fiddle with vim's source (with some pain) so I'm not too sure how much
                    > > work is involved in creating one of those v:somevar.
                    >
                    > OK, we can add it later when really needed.
                    >

                    Do we get it for free? :help v:register says it contains "the name of
                    the register in effect for the current normal mode command". It
                    certainly seems like it *could* contain the register used, though I'm
                    not sure whether the contents are lost before the autocmd fires.

                    --
                    You received this message from the "vim_dev" 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
                  • Philippe Vaucher
                    ... Actually we do! Didn t know v:register existed, thanks! Here s what I test it with: autocmd! TextDeletePost * echom DeletePost: Register( . v:register .
                    Message 9 of 27 , May 24 11:59 AM
                    • 0 Attachment
                      > > > No because every delete/yank use the " register even if a register was
                      > > > explicitely specified. As a matter of completeness maybe it'd be nice
                      > > > to know which register was intended yes but it's the first time I
                      > > > fiddle with vim's source (with some pain) so I'm not too sure how much
                      > > > work is involved in creating one of those v:somevar.
                      >
                      > > OK, we can add it later when really needed.
                      >
                      > Do we get it for free? :help v:register says it contains "the name of
                      > the register in effect for the current normal mode command". It
                      > certainly seems like it *could* contain the register used, though I'm
                      > not sure whether the contents are lost before the autocmd fires.

                      Actually we do! Didn't know v:register existed, thanks!

                      Here's what I test it with:

                      autocmd! TextDeletePost * echom 'DeletePost: Register(' . v:register .
                      ') Value(' . eval('@' . v:register) . ')'
                      autocmd! TextYankPost * echom 'YankPost: Register(' . v:register .
                      ') Value(' . eval('@' . v:register) . ')'

                      Here's the (hopefully final) patch:

                      From 15a2f33bd2dd3d10d0f167e249546fcff8f7e9a0 Mon Sep 17 00:00:00 2001
                      From: Philippe Vaucher <philippe.vaucher@...>
                      Date: Tue, 24 May 2011 20:32:48 +0200
                      Subject: [PATCH] Add TextDeletePost and TextYankPost events

                      ---
                      runtime/doc/autocmd.txt | 21 +++++++++++++++++++++
                      src/fileio.c | 2 ++
                      src/ops.c | 4 ++++
                      src/vim.h | 2 ++
                      4 files changed, 29 insertions(+), 0 deletions(-)

                      diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
                      index 145ecf6..93fdefc 100644
                      --- a/runtime/doc/autocmd.txt
                      +++ b/runtime/doc/autocmd.txt
                      @@ -302,6 +302,9 @@ Name triggered by ~
                      |InsertCharPre| when a character was typed in Insert mode, before
                      inserting it

                      +|TextDeletePost| when some text is deleted (dw, dd, D)
                      +|TextYankPost| when some text is yanked (yw, yd, Y)
                      +
                      |ColorScheme| after loading a color scheme

                      |RemoteReply| a reply from a server Vim was received
                      @@ -670,6 +673,24 @@ InsertCharPre When a character is typed in
                      Insert mode,
                      It is not allowed to change the text |textlock|.
                      The event is not triggered when 'paste' is
                      set.
                      + *TextDeletePost*
                      +TextDeletePost Just after a delete (|d|) command is issued.
                      + Not issued if the black hole register
                      + (|quote_|) is used. The affected text
                      can be
                      + accessed by several ways, through @"
                      + (|quotequote| or |v:register|: >
                      + :echo @"
                      + :echo eval('@' . v:register)
                      +<
                      + *TextYankPost*
                      +TextYankPost Just after a |yank| (|y|) command is issued.
                      + Not issued if the black hole register
                      + (|quote_|) is used. The affected text
                      can be
                      + accessed by several ways, through @"
                      + (|quotequote| or |v:register|: >
                      + :echo @"
                      + :echo eval('@' . v:register)
                      +<
                      *InsertEnter*
                      InsertEnter Just before starting Insert mode. Also for
                      Replace mode and Virtual Replace mode. The
                      diff --git a/src/fileio.c b/src/fileio.c
                      index 6355c79..a794a04 100644
                      --- a/src/fileio.c
                      +++ b/src/fileio.c
                      @@ -7688,6 +7688,8 @@ static struct event_name
                      {"WinEnter", EVENT_WINENTER},
                      {"WinLeave", EVENT_WINLEAVE},
                      {"VimResized", EVENT_VIMRESIZED},
                      + {"TextDeletePost", EVENT_TEXTDELETEPOST},
                      + {"TextYankPost", EVENT_TEXTYANKPOST},
                      {NULL, (event_T)0}
                      };

                      diff --git a/src/ops.c b/src/ops.c
                      index c41f844..f5897b7 100644
                      --- a/src/ops.c
                      +++ b/src/ops.c
                      @@ -3160,6 +3160,10 @@ op_yank(oap, deleting, mess)
                      # endif
                      #endif

                      + ++textlock;
                      + apply_autocmds(deleting ? EVENT_TEXTDELETEPOST :
                      EVENT_TEXTYANKPOST, NULL, NULL, FALSE, curbuf);
                      + --textlock;
                      +
                      return OK;

                      fail: /* free the allocated lines */
                      diff --git a/src/vim.h b/src/vim.h
                      index 1f4f17b..dc147cf 100644
                      --- a/src/vim.h
                      +++ b/src/vim.h
                      @@ -1290,6 +1290,8 @@ enum auto_event
                      EVENT_TABENTER, /* after entering a tab page */
                      EVENT_SHELLCMDPOST, /* after ":!cmd" */
                      EVENT_SHELLFILTERPOST, /* after ":1,2!cmd", ":w !cmd", ":r !cmd".
                      */
                      + EVENT_TEXTDELETEPOST, /* after a delete command was done (dd, dw,
                      D) */
                      + EVENT_TEXTYANKPOST, /* after a yank command was done (yy, yw, Y)
                      */
                      NUM_EVENTS /* MUST be the last one */
                      };

                      --
                      1.7.1

                      --
                      You received this message from the "vim_dev" 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
                    • Philippe Vaucher
                      Ah, the_isz found the first bug already :) When yanking/deleting with a visual range, the autocmd is triggered twice. I ll fix it and report. -- You received
                      Message 10 of 27 , May 24 2:49 PM
                      • 0 Attachment
                        Ah, the_isz found the first bug already :)

                        When yanking/deleting with a visual range, the autocmd is triggered
                        twice.

                        I'll fix it and report.

                        --
                        You received this message from the "vim_dev" 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
                      • Philippe Vaucher
                        Ok we did some tests and now everything works as it should. For a better view of the patch, see
                        Message 11 of 27 , May 26 1:49 AM
                        • 0 Attachment
                          Ok we did some tests and now everything works as it should.

                          For a better view of the patch, see
                          https://github.com/Silex/vim/commit/de0dd46e90fd7c6587492d3d7f8878d9f57f42f2

                          We tested with `vim -u NONE -U NONE --noplugin test.vim`, followed
                          by :so % and
                          test.vim being:

                          let s:count = 0

                          function! s:del_or_yank_event(desc)
                          echom s:count . ' ' . a:desc . ': Register(' . v:register . ')
                          Value(' . eval('@' . v:register) . ')'
                          let s:count += 1
                          endfunction

                          autocmd! TextDeletePost * call
                          <SID>del_or_yank_event('TextDeletePost')
                          autocmd! TextYankPost * call
                          <SID>del_or_yank_event('TextYankPost')

                          Tell me if there's an issue I forgot to address.

                          Here's the patch:

                          From de0dd46e90fd7c6587492d3d7f8878d9f57f42f2 Mon Sep 17 00:00:00 2001
                          From: Philippe Vaucher <philippe.vaucher@...>
                          Date: Wed, 25 May 2011 13:02:28 +0200
                          Subject: [PATCH] Add TextDeletePost and TextYankPost events

                          ---
                          runtime/doc/autocmd.txt | 21 +++++++++++++++++++++
                          src/fileio.c | 2 ++
                          src/ops.c | 11 +++++++++++
                          src/vim.h | 2 ++
                          4 files changed, 36 insertions(+), 0 deletions(-)

                          diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
                          index 145ecf6..93fdefc 100644
                          --- a/runtime/doc/autocmd.txt
                          +++ b/runtime/doc/autocmd.txt
                          @@ -302,6 +302,9 @@ Name triggered by ~
                          |InsertCharPre| when a character was typed in Insert mode, before
                          inserting it

                          +|TextDeletePost| when some text is deleted (dw, dd, D)
                          +|TextYankPost| when some text is yanked (yw, yd, Y)
                          +
                          |ColorScheme| after loading a color scheme

                          |RemoteReply| a reply from a server Vim was received
                          @@ -670,6 +673,24 @@ InsertCharPre When a character is typed in
                          Insert mode,
                          It is not allowed to change the text |textlock|.
                          The event is not triggered when 'paste' is
                          set.
                          + *TextDeletePost*
                          +TextDeletePost Just after a delete (|d|) command is issued.
                          + Not issued if the black hole register
                          + (|quote_|) is used. The affected text
                          can be
                          + accessed by several ways, through @"
                          + (|quotequote| or |v:register|: >
                          + :echo @"
                          + :echo eval('@' . v:register)
                          +<
                          + *TextYankPost*
                          +TextYankPost Just after a |yank| (|y|) command is issued.
                          + Not issued if the black hole register
                          + (|quote_|) is used. The affected text
                          can be
                          + accessed by several ways, through @"
                          + (|quotequote| or |v:register|: >
                          + :echo @"
                          + :echo eval('@' . v:register)
                          +<
                          *InsertEnter*
                          InsertEnter Just before starting Insert mode. Also for
                          Replace mode and Virtual Replace mode. The
                          diff --git a/src/fileio.c b/src/fileio.c
                          index 6355c79..a794a04 100644
                          --- a/src/fileio.c
                          +++ b/src/fileio.c
                          @@ -7688,6 +7688,8 @@ static struct event_name
                          {"WinEnter", EVENT_WINENTER},
                          {"WinLeave", EVENT_WINLEAVE},
                          {"VimResized", EVENT_VIMRESIZED},
                          + {"TextDeletePost", EVENT_TEXTDELETEPOST},
                          + {"TextYankPost", EVENT_TEXTYANKPOST},
                          {NULL, (event_T)0}
                          };

                          diff --git a/src/ops.c b/src/ops.c
                          index c41f844..5709aa5 100644
                          --- a/src/ops.c
                          +++ b/src/ops.c
                          @@ -1957,6 +1957,10 @@ op_delete(oap)

                          msgmore(curbuf->b_ml.ml_line_count - old_lcount);

                          + ++textlock;
                          + apply_autocmds(EVENT_TEXTDELETEPOST, NULL, NULL, FALSE, curbuf);
                          + --textlock;
                          +
                          #ifdef FEAT_VIRTUALEDIT
                          setmarks:
                          #endif
                          @@ -3160,6 +3164,13 @@ op_yank(oap, deleting, mess)
                          # endif
                          #endif

                          + if(mess && !deleting)
                          + {
                          + ++textlock;
                          + apply_autocmds(EVENT_TEXTYANKPOST, NULL, NULL, FALSE,
                          curbuf);
                          + --textlock;
                          + }
                          +
                          return OK;

                          fail: /* free the allocated lines */
                          diff --git a/src/vim.h b/src/vim.h
                          index 1f4f17b..dc147cf 100644
                          --- a/src/vim.h
                          +++ b/src/vim.h
                          @@ -1290,6 +1290,8 @@ enum auto_event
                          EVENT_TABENTER, /* after entering a tab page */
                          EVENT_SHELLCMDPOST, /* after ":!cmd" */
                          EVENT_SHELLFILTERPOST, /* after ":1,2!cmd", ":w !cmd", ":r !cmd".
                          */
                          + EVENT_TEXTDELETEPOST, /* after a delete command was done (dd, dw,
                          D) */
                          + EVENT_TEXTYANKPOST, /* after a yank command was done (yy, yw, Y)
                          */
                          NUM_EVENTS /* MUST be the last one */
                          };

                          --
                          1.7.4.msysgit.0

                          --
                          You received this message from the "vim_dev" 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
                        • Philippe Vaucher
                          So, Bram is that ok? Do you want the patch on another medium? Are there issues I didn t address? Thanks, Philippe -- You received this message from the
                          Message 12 of 27 , Jun 2, 2011
                          • 0 Attachment
                            So, Bram is that ok? Do you want the patch on another medium? Are
                            there issues I didn't address?

                            Thanks,
                            Philippe

                            --
                            You received this message from the "vim_dev" 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
                          • Bram Moolenaar
                            ... I need to have a closer look. Bugs usually have a higher priority than new features. -- hundred-and-one symptoms of being an internet addict: 131. You
                            Message 13 of 27 , Jun 2, 2011
                            • 0 Attachment
                              Philippe Vaucher wrote:

                              > So, Bram is that ok? Do you want the patch on another medium? Are
                              > there issues I didn't address?

                              I need to have a closer look. Bugs usually have a higher priority than
                              new features.

                              --
                              hundred-and-one symptoms of being an internet addict:
                              131. You challenge authority and society by portnuking people

                              /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                              /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                              \\\ an exciting new programming language -- http://www.Zimbu.org ///
                              \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

                              --
                              You received this message from the "vim_dev" 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
                            • Philippe Vaucher
                              ... Hum, it s been a while now... should I create a ticket on http://code.google.com/p/vim/issues/list so it s not forgotten? In the meantime, we did some
                              Message 14 of 27 , Jun 16, 2011
                              • 0 Attachment
                                > I need to have a closer look.  Bugs usually have a higher priority than
                                > new features.

                                Hum, it's been a while now... should I create a ticket on
                                http://code.google.com/p/vim/issues/list so it's not forgotten?

                                In the meantime, we did some tests about potential problems with this
                                new feature:

                                test: autocmd! TextDeletePost * help :write
                                result:
                                Error detected while processing TextDeletePost Auto commands for
                                "*":
                                E523: Not allowed here: help :write

                                test: autocmd! TextDeletePost * bd
                                result:
                                Error detected while processing TextDeletePost Auto commands for
                                "*":
                                E523: Not allowed here: bd

                                test: autocmd! TextDeletePost * normal isometext
                                result: No error, but nothing inserted either

                                test: autocmd! TextDeletePost * normal dw
                                result: No error, but nothing deleted either


                                This looks fairly ok to me.
                                Philippe

                                --
                                You received this message from the "vim_dev" 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
                              • Philippe Vaucher
                                Bram: this is just a message to bump this issue, to avoid that you forget about it. Thanks, Philippe -- You received this message from the vim_dev maillist.
                                Message 15 of 27 , Jul 9, 2011
                                • 0 Attachment
                                  Bram: this is just a message to bump this issue, to avoid that you
                                  forget about it.

                                  Thanks,
                                  Philippe

                                  --
                                  You received this message from the "vim_dev" 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
                                • Bram Moolenaar
                                  ... It s in the todo list. That list is very long, and bug fixes have priority. Might take a while. -- hundred-and-one symptoms of being an internet addict:
                                  Message 16 of 27 , Jul 9, 2011
                                  • 0 Attachment
                                    Philippe Vaucher wrote:

                                    > Bram: this is just a message to bump this issue, to avoid that you
                                    > forget about it.

                                    It's in the todo list. That list is very long, and bug fixes have
                                    priority. Might take a while.

                                    --
                                    hundred-and-one symptoms of being an internet addict:
                                    271. You collect hilarious signatures from all 250 mailing lists you
                                    are subscribed to.

                                    /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                                    /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                                    \\\ an exciting new programming language -- http://www.Zimbu.org ///
                                    \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

                                    --
                                    You received this message from the "vim_dev" 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
                                  • Philippe Vaucher
                                    ... How long is that list? It s been more than 6 months now :/ Philippe -- You received this message from the vim_dev maillist. Do not top-post! Type your
                                    Message 17 of 27 , Mar 7, 2012
                                    • 0 Attachment
                                      > It's in the todo list. That list is very long, and bug fixes have
                                      > priority. Might take a while.

                                      How long is that list? It's been more than 6 months now :/

                                      Philippe

                                      --
                                      You received this message from the "vim_dev" 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
                                    • Jürgen Krämer
                                      Hi, ... Regards, Jürgen -- Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact
                                      Message 18 of 27 , Mar 7, 2012
                                      • 0 Attachment
                                        Hi,

                                        Philippe Vaucher wrote:
                                        >> It's in the todo list. That list is very long, and bug fixes have
                                        >> priority. Might take a while.
                                        >
                                        > How long is that list? It's been more than 6 months now :/

                                        :help todo

                                        Regards,
                                        Jürgen

                                        --
                                        Sometimes I think the surest sign that intelligent life exists elsewhere
                                        in the universe is that none of it has tried to contact us. (Calvin)

                                        --
                                        You received this message from the "vim_dev" 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
                                      • Thilo Six
                                        Hello Excerpt from Jürgen Krämer: -- -- ... Which might be out of date. The latest version is always available at:
                                        Message 19 of 27 , Mar 7, 2012
                                        • 0 Attachment
                                          Hello


                                          Excerpt from Jürgen Krämer:

                                          -- <snip> --
                                          >>> It's in the todo list. That list is very long, and bug fixes have
                                          >>> priority. Might take a while.
                                          >>
                                          >> How long is that list? It's been more than 6 months now :/
                                          >
                                          > :help todo

                                          Which might be out of date. The latest version is always available at:
                                          https://vim.googlecode.com/hg/runtime/doc/todo.txt


                                          > Regards,
                                          > Jürgen
                                          >

                                          --
                                          Regards,
                                          Thilo

                                          4096R/0xC70B1A8F
                                          721B 1BA0 095C 1ABA 3FC6 7C18 89A4 A2A0 C70B 1A8F


                                          --
                                          You received this message from the "vim_dev" 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
                                        • Philippe Vaucher
                                          ... Thanks. Philippe -- You received this message from the vim_dev maillist. Do not top-post! Type your reply below the text you are replying to. For more
                                          Message 20 of 27 , Mar 9, 2012
                                          • 0 Attachment
                                            > Which might be out of date. The latest version is always available at:
                                            > https://vim.googlecode.com/hg/runtime/doc/todo.txt

                                            Thanks.
                                            Philippe

                                            --
                                            You received this message from the "vim_dev" 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
                                          • Jan Larres
                                            Hi, Do you maybe have a yankring-like plugin that makes use of the feature? That could help people try it out in real-world scenarios. Jan -- -[ OpenPGP key
                                            Message 21 of 27 , Mar 12, 2012
                                            • 0 Attachment
                                              Hi,

                                              Do you maybe have a yankring-like plugin that makes use of the feature?
                                              That could help people try it out in real-world scenarios.


                                              Jan

                                              --
                                              -[ OpenPGP key ID: 00A0FD5F ]-
                                              Technological progress has merely provided us with more efficient means for
                                              going backwards.
                                              -- Aldous Huxley

                                              --
                                              You received this message from the "vim_dev" 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
                                            • Philippe Vaucher
                                              ... Yes there is, see https://github.com/the-isz/MinYankRing.vim/tree/events Philippe -- You received this message from the vim_dev maillist. Do not
                                              Message 22 of 27 , Mar 15, 2012
                                              • 0 Attachment
                                                > Do you maybe have a yankring-like plugin that makes use of the feature?
                                                > That could help people try it out in real-world scenarios.

                                                Yes there is, see https://github.com/the-isz/MinYankRing.vim/tree/events

                                                Philippe

                                                --
                                                You received this message from the "vim_dev" 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
                                              • David Fishburn
                                                I will also add this to the YankRing plugin (script #1234). I don t se the patch # to put a conditional check in for it. Could someone let me know. Thanks. --
                                                Message 23 of 27 , Mar 18, 2012
                                                • 0 Attachment
                                                  I will also add this to the YankRing plugin (script #1234).

                                                  I don't se the patch # to put a conditional check in for it.

                                                  Could someone let me know.

                                                  Thanks.

                                                  --
                                                  David Fishburn


                                                  On Mar 16, 2012, at 1:28 AM, Philippe Vaucher <philippe.vaucher@...> wrote:

                                                  >> Do you maybe have a yankring-like plugin that makes use of the feature?
                                                  >> That could help people try it out in real-world scenarios.
                                                  >
                                                  > Yes there is, see https://github.com/the-isz/MinYankRing.vim/tree/events
                                                  >
                                                  > Philippe
                                                  >
                                                  > --
                                                  > You received this message from the "vim_dev" 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

                                                  --
                                                  You received this message from the "vim_dev" 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
                                                • Benjamin R. Haskell
                                                  ... It hasn t been applied yet, but you shouldn t check by patch # anyway. exists() can detect whether an autocommand for a particular event is supported.
                                                  Message 24 of 27 , Mar 18, 2012
                                                  • 0 Attachment
                                                    On Sun, 18 Mar 2012, David Fishburn wrote:

                                                    > I will also add this to the YankRing plugin (script #1234).
                                                    >
                                                    > I don't se the patch # to put a conditional check in for it.

                                                    It hasn't been applied yet, but you shouldn't check by patch # anyway.
                                                    exists() can detect whether an autocommand for a particular event is
                                                    supported. Use:

                                                    exists('##TextDeleted')

                                                    and

                                                    exists('##TextYanked')

                                                    --
                                                    Best,
                                                    Ben

                                                    --
                                                    You received this message from the "vim_dev" 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
                                                  • David Fishburn
                                                    ... Perfect thanks Ben. -- David Fishburn -- You received this message from the vim_dev maillist. Do not top-post! Type your reply below the text you are
                                                    Message 25 of 27 , Mar 18, 2012
                                                    • 0 Attachment
                                                      On Mar 18, 2012, at 6:16 PM, "Benjamin R. Haskell" <vim@...> wrote:

                                                      > On Sun, 18 Mar 2012, David Fishburn wrote:
                                                      >
                                                      >> I will also add this to the YankRing plugin (script #1234).
                                                      >>
                                                      >> I don't se the patch # to put a conditional check in for it.
                                                      >
                                                      > It hasn't been applied yet, but you shouldn't check by patch # anyway. exists() can detect whether an autocommand for a particular event is supported. Use:
                                                      >
                                                      > exists('##TextDeleted')
                                                      >
                                                      > and
                                                      >
                                                      > exists('##TextYanked')
                                                      >
                                                      Perfect thanks Ben.

                                                      --
                                                      David Fishburn

                                                      --
                                                      You received this message from the "vim_dev" 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
                                                    • Philippe Vaucher
                                                      ... Bump :) Philippe -- You received this message from the vim_dev maillist. Do not top-post! Type your reply below the text you are replying to. For more
                                                      Message 26 of 27 , Jan 7, 2013
                                                      • 0 Attachment
                                                        > It's in the todo list. That list is very long, and bug fixes have
                                                        > priority. Might take a while.

                                                        Bump :)

                                                        Philippe

                                                        --
                                                        You received this message from the "vim_dev" 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
                                                      • Philippe Vaucher
                                                        Yawn... More than 2 years for a trivial patch like this. https://github.com/Silex/vim/commit/de53ab72c89affa8ba77536ed8920751c037d127 Honestly, I m
                                                        Message 27 of 27 , Nov 23, 2013
                                                        • 0 Attachment
                                                          Yawn... More than 2 years for a trivial patch like this.

                                                          https://github.com/Silex/vim/commit/de53ab72c89affa8ba77536ed8920751c037d127

                                                          Honestly, I'm disapointed. It's been a while I don't use vim anymore but I think vim deserves a more reactive development model than the current one.

                                                          Bram: I think you clearly need to nominate additional people to apply patches.

                                                          --
                                                          --
                                                          You received this message from the "vim_dev" 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

                                                          ---
                                                          You received this message because you are subscribed to the Google Groups "vim_dev" group.
                                                          To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                                                          For more options, visit https://groups.google.com/groups/opt_out.
                                                        Your message has been successfully submitted and would be delivered to recipients shortly.