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

Re: [PATCH] Add clipboard support for running without GUI in Mac OS X

Expand Messages
  • Jjgod Jiang
    Hi, ... Because that code was included in vim-cocoa long time ago, you are right, I should have checked the recent MacVim code before send out this patch. ...
    Message 1 of 21 , Aug 1, 2009
    • 0 Attachment
      Hi,

      On Sat, Aug 1, 2009 at 10:45 PM, björn<bjorn.winckler@...> wrote:
      > A few comments on this patch:
      >
      > 1. Why have you not included the code that handles block-wise copy in
      > clip_mch_request_selection() from the MacVim sources?  This is a bad
      > idea since it means that every time you copy from Vim the pasteboard
      > will only keep a "line-wise" copy.  E.g. if you enter visual block
      > mode, copy, then paste, the text will be pasted line-wise even though
      > it should be pasted block-wise.  Why did you "derive" the clipboard
      > code from MacVim instead of just copying it?

      Because that code was included in vim-cocoa long time ago, you are right,
      I should have checked the recent MacVim code before send out this patch.

      > 2. I'm not decided on this myself, but maybe it would be cleaner to
      > implement this using the Carbon Pasteboard Manager instead of using
      > Cocoa (so that you don't have to use the Objective-C compiler, fiddle
      > around with autorelease pools, link against Cocoa etc.):
      >
      > http://developer.apple.com/documentation/Carbon/Reference/Pasteboard_Reference/Reference/reference.html

      I think Pasteboard Manager belongs to the part of Carbon that won't
      have 64-bit version. So it will prevent vim to be built as a 64-bit
      binary in future Mac OS X releases.

      > At any rate, I would not merge this patch until #1 is resolved.  The
      > second issue is more delicate but I have myself implemented copy/paste
      > using Pasteboard Manager once and I know that it is not that much of
      > an effort, but then again the current MacVim clipboard code works and
      > has been in use for quite some time so it is maybe a better idea to
      > just include it verbatim.

      I agree. Would you like me to update this patch or maybe you prefer to
      separate that part of the code in MacVim as one patch yourself?

      - Jiang

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_dev" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • björn
      ... Ok. ... Can you back that statement up? Looking at the docs I cannot see any warning about it not being available for 64 bit. Also, have you checked how
      Message 2 of 21 , Aug 1, 2009
      • 0 Attachment
        2009/8/1 Jjgod Jiang:
        >
        > On Sat, Aug 1, 2009 at 10:45 PM, björn<bjorn.winckler@...> wrote:
        >> A few comments on this patch:
        >>
        >> 1. Why have you not included the code that handles block-wise copy in
        >> clip_mch_request_selection() from the MacVim sources?  This is a bad
        >> idea since it means that every time you copy from Vim the pasteboard
        >> will only keep a "line-wise" copy.  E.g. if you enter visual block
        >> mode, copy, then paste, the text will be pasted line-wise even though
        >> it should be pasted block-wise.  Why did you "derive" the clipboard
        >> code from MacVim instead of just copying it?
        >
        > Because that code was included in vim-cocoa long time ago, you are right,
        > I should have checked the recent MacVim code before send out this patch.

        Ok.

        >> 2. I'm not decided on this myself, but maybe it would be cleaner to
        >> implement this using the Carbon Pasteboard Manager instead of using
        >> Cocoa (so that you don't have to use the Objective-C compiler, fiddle
        >> around with autorelease pools, link against Cocoa etc.):
        >>
        >> http://developer.apple.com/documentation/Carbon/Reference/Pasteboard_Reference/Reference/reference.html
        >
        > I think Pasteboard Manager belongs to the part of Carbon that won't
        > have 64-bit version. So it will prevent vim to be built as a 64-bit
        > binary in future Mac OS X releases.

        Can you back that statement up? Looking at the docs I cannot see any
        warning about it not being available for 64 bit.

        Also, have you checked how much of an overhead in binary sizes it is
        building with obj-c and linking against Cocoa? (I assume it should
        not make much of a difference but it would be nice to know for sure.
        If the binary size increases significantly then I definitely think it
        would be advisable to use Pasteboard Manager.)

        Also, have you made sure that all the APIs used are present in OS X
        10.0? For MacVim I only check 10.4 compatibility but since this patch
        is to os_macosx.c it should work on 10.0 and upwards.

        >> At any rate, I would not merge this patch until #1 is resolved.  The
        >> second issue is more delicate but I have myself implemented copy/paste
        >> using Pasteboard Manager once and I know that it is not that much of
        >> an effort, but then again the current MacVim clipboard code works and
        >> has been in use for quite some time so it is maybe a better idea to
        >> just include it verbatim.
        >
        > I agree. Would you like me to update this patch or maybe you prefer to
        > separate that part of the code in MacVim as one patch yourself?

        Maybe the best idea would be if you submit this patch against both the
        MacVim sources and the Vim sources. I can merge the patch immediately
        and then Bram can merge the corresponding patch into the Vim sources
        after we've tested it out for a while and checked that everything is
        ok.

        I think its good that you're taking the time to fix this...I was
        hoping that somebody would.

        Thanks,
        Björn

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_dev" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Bram Moolenaar
        ... A few remarks were made after this patch was submitted, but I don t think I ever saw an updated patch. Is it still coming? -- FATHER: Make sure the
        Message 3 of 21 , Jul 11, 2010
        • 0 Attachment
          Jjgod Jiang wrote (a long time ago):

          > Running vim under Mac OS X terminal do not support copy to/from
          > system clipboard currently, this patch add this feature. To have
          > this feature in mainstream, we receive the following benifits:
          >
          > 1. We can copy from/to system clipboard without running GUI.
          > (Default vim builds shipped with Mac OS X do not have GUI
          > enabled, so it can share this feature.)
          > 2. We don't need to duplicate code in GUI implementations like
          > MacVim or vim-cocoa.
          >
          > The clipboard handling code is derived from MacVim.
          >
          > To use Cocoa APIs, we need to convert os_macosx.c into an Obj-C
          > file. Other changes are trivial.

          A few remarks were made after this patch was submitted, but I don't
          think I ever saw an updated patch. Is it still coming?

          --
          FATHER: Make sure the Prince doesn't leave this room until I come and
          get him.
          FIRST GUARD: Not ... to leave the room ... even if you come and get him.
          FATHER: No. Until I come and get him.
          SECOND GUARD: Hic.
          "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.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php
        • björn
          ... I made the remark that it would be nicer to use the C-API (Core Foundation) to implement Copy/Paste instead of converting os_macosx.c to an Objective-C
          Message 4 of 21 , Jul 11, 2010
          • 0 Attachment
            On 11 July 2010 16:45, Bram Moolenaar wrote:
            >
            > Jjgod Jiang wrote (a long time ago):
            >
            >> Running vim under Mac OS X terminal do not support copy to/from
            >> system clipboard currently, this patch add this feature. To have
            >> this feature in mainstream, we receive the following benifits:
            >>
            >> 1. We can copy from/to system clipboard without running GUI.
            >>    (Default vim builds shipped with Mac OS X do not have GUI
            >>     enabled, so it can share this feature.)
            >> 2. We don't need to duplicate code in GUI implementations like
            >>    MacVim or vim-cocoa.
            >>
            >> The clipboard handling code is derived from MacVim.
            >>
            >> To use Cocoa APIs, we need to convert os_macosx.c into an Obj-C
            >> file. Other changes are trivial.
            >
            > A few remarks were made after this patch was submitted, but I don't
            > think I ever saw an updated patch.  Is it still coming?

            I made the remark that it would be "nicer" to use the C-API (Core
            Foundation) to implement Copy/Paste instead of converting os_macosx.c
            to an Objective-C file and then using the MacVim Copy/Paste code which
            uses the Objective-C API (Foundation).

            It would not be very difficult to write such a patch but I don't think
            anybody ever volunteered to do it. The advantages of rewriting the
            patch are mostly aesthetic -- the functionality would be identical.
            If you Bram can live with that then I think it is safe to merge this
            patch (here is one of the problems though: since the patch renames a
            whole file it is a bit tricky to review -- I believe it is fine but
            have not checked it myself). If you would prefer not to use
            Objective-C then it is possible to rewrite it using only C.

            What would you prefer Bram?

            Björn

            --
            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 don t know enough about the advantages and disadvantages. I think at least the issues with block mode should be fixed. Otherwise one can just as well
            Message 5 of 21 , Jul 11, 2010
            • 0 Attachment
              Jjgod Jiang wrote (a long time ago):

              > >> Running vim under Mac OS X terminal do not support copy to/from
              > >> system clipboard currently, this patch add this feature. To have
              > >> this feature in mainstream, we receive the following benifits:
              > >>
              > >> 1. We can copy from/to system clipboard without running GUI.
              > >> =A0 =A0(Default vim builds shipped with Mac OS X do not have GUI
              > >> =A0 =A0 enabled, so it can share this feature.)
              > >> 2. We don't need to duplicate code in GUI implementations like
              > >> =A0 =A0MacVim or vim-cocoa.
              > >>
              > >> The clipboard handling code is derived from MacVim.
              > >>
              > >> To use Cocoa APIs, we need to convert os_macosx.c into an Obj-C
              > >> file. Other changes are trivial.
              > >
              > > A few remarks were made after this patch was submitted, but I don't
              > > think I ever saw an updated patch. =A0Is it still coming?
              >
              > I made the remark that it would be "nicer" to use the C-API (Core
              > Foundation) to implement Copy/Paste instead of converting os_macosx.c
              > to an Objective-C file and then using the MacVim Copy/Paste code which
              > uses the Objective-C API (Foundation).
              >
              > It would not be very difficult to write such a patch but I don't think
              > anybody ever volunteered to do it. The advantages of rewriting the
              > patch are mostly aesthetic -- the functionality would be identical.
              > If you Bram can live with that then I think it is safe to merge this
              > patch (here is one of the problems though: since the patch renames a
              > whole file it is a bit tricky to review -- I believe it is fine but
              > have not checked it myself). If you would prefer not to use
              > Objective-C then it is possible to rewrite it using only C.
              >
              > What would you prefer Bram?

              I don't know enough about the advantages and disadvantages. I think at
              least the issues with block mode should be fixed. Otherwise one can
              just as well use the clipboard throught the terminal, right?

              When going with Objective-C, would there be disadvantages? Some people
              who can't build the binary? Does the executable become bigger? More
              dependencies on libraries?

              --
              You got to work at a mill? Lucky! I got sent back to work in the
              acid-mines for my daily crust of stale bread... which not even the
              birds would eat.

              /// 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.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php
            • Bee
              ... What would be the advantage over using: vmap ,y y:call system( pbcopy , getreg( )) nmap ,p :call setreg( ,system( pbpaste )) p And some
              Message 6 of 21 , Jul 11, 2010
              • 0 Attachment
                On Jul 11, 2:20 pm, Bram Moolenaar <B...@...> wrote:
                > Jjgod Jiang wrote (a long time ago):
                > > >> Running vim under Mac OS X terminal do not support copy to/from
                > > >> system clipboard currently, this patch add this feature. To have
                > > >> this feature in mainstream, we receive the following benifits:
                >
                > > >> 1. We can copy from/to system clipboard without running GUI.
                > > >> =A0 =A0(Default vim builds shipped with Mac OS X do not have GUI
                > > >> =A0 =A0 enabled, so it can share this feature.)
                > > >> 2. We don't need to duplicate code in GUI implementations like
                > > >> =A0 =A0MacVim or vim-cocoa.
                >
                > > >> The clipboard handling code is derived from MacVim.
                >
                > > >> To use Cocoa APIs, we need to convert os_macosx.c into an Obj-C
                > > >> file. Other changes are trivial.
                >
                > > > A few remarks were made after this patch was submitted, but I don't
                > > > think I ever saw an updated patch. =A0Is it still coming?
                >
                > > I made the remark that it would be "nicer" to use the C-API (Core
                > > Foundation) to implement Copy/Paste instead of converting os_macosx.c
                > > to an Objective-C file and then using the MacVim Copy/Paste code which
                > > uses the Objective-C API (Foundation).
                >
                > > It would not be very difficult to write such a patch but I don't think
                > > anybody ever volunteered to do it.  The advantages of rewriting the
                > > patch are mostly aesthetic -- the functionality would be identical.
                > > If you Bram can live with that then I think it is safe to merge this
                > > patch (here is one of the problems though: since the patch renames a
                > > whole file it is a bit tricky to review -- I believe it is fine but
                > > have not checked it myself).  If you would prefer not to use
                > > Objective-C then it is possible to rewrite it using only C.
                >
                > > What would you prefer Bram?
                >
                > I don't know enough about the advantages and disadvantages.  I think at
                > least the issues with block mode should be fixed.  Otherwise one can
                > just as well use the clipboard throught the terminal, right?
                >
                > When going with Objective-C, would there be disadvantages?  Some people
                > who can't build the binary?  Does the executable become bigger?  More
                > dependencies on libraries?

                What would be the advantage over using:

                vmap ,y y:call system("pbcopy", getreg("\""))<CR>
                nmap ,p :call setreg("\"",system("pbpaste"))<CR>p

                And some syntactic sugar for mapping?

                -Bill

                --
                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
                ... Not being able to pass block-wise selection. -- Q: Why do ducks have flat feet? A: To stamp out forest fires. Q: Why do elephants have flat feet? A: To
                Message 7 of 21 , Jul 12, 2010
                • 0 Attachment
                  > On Jul 11, 2:20 pm, Bram Moolenaar <B...@...> wrote:
                  > > Jjgod Jiang wrote (a long time ago):
                  > > > >> Running vim under Mac OS X terminal do not support copy to/from
                  > > > >> system clipboard currently, this patch add this feature. To have
                  > > > >> this feature in mainstream, we receive the following benifits:
                  > >
                  > > > >> 1. We can copy from/to system clipboard without running GUI.
                  > > > >> =A0 =A0(Default vim builds shipped with Mac OS X do not have GUI
                  > > > >> =A0 =A0 enabled, so it can share this feature.)
                  > > > >> 2. We don't need to duplicate code in GUI implementations like
                  > > > >> =A0 =A0MacVim or vim-cocoa.
                  > >
                  > > > >> The clipboard handling code is derived from MacVim.
                  > >
                  > > > >> To use Cocoa APIs, we need to convert os_macosx.c into an Obj-C
                  > > > >> file. Other changes are trivial.
                  > >
                  > > > > A few remarks were made after this patch was submitted, but I don't
                  > > > > think I ever saw an updated patch. =A0Is it still coming?
                  > >
                  > > > I made the remark that it would be "nicer" to use the C-API (Core
                  > > > Foundation) to implement Copy/Paste instead of converting os_macosx.c
                  > > > to an Objective-C file and then using the MacVim Copy/Paste code which
                  > > > uses the Objective-C API (Foundation).
                  > >
                  > > > It would not be very difficult to write such a patch but I don't think
                  > > > anybody ever volunteered to do it. The advantages of rewriting the
                  > > > patch are mostly aesthetic -- the functionality would be identical.
                  > > > If you Bram can live with that then I think it is safe to merge this
                  > > > patch (here is one of the problems though: since the patch renames a
                  > > > whole file it is a bit tricky to review -- I believe it is fine but
                  > > > have not checked it myself). If you would prefer not to use
                  > > > Objective-C then it is possible to rewrite it using only C.
                  > >
                  > > > What would you prefer Bram?
                  > >
                  > > I don't know enough about the advantages and disadvantages. I think at
                  > > least the issues with block mode should be fixed. Otherwise one can
                  > > just as well use the clipboard throught the terminal, right?
                  > >
                  > > When going with Objective-C, would there be disadvantages? Some people
                  > > who can't build the binary? Does the executable become bigger? More
                  > > dependencies on libraries?
                  >
                  > What would be the advantage over using:
                  >
                  > vmap ,y y:call system("pbcopy", getreg("\""))<CR>
                  > nmap ,p :call setreg("\"",system("pbpaste"))<CR>p
                  >
                  > And some syntactic sugar for mapping?

                  Not being able to pass block-wise selection.

                  --
                  Q: Why do ducks have flat feet?
                  A: To stamp out forest fires.

                  Q: Why do elephants have flat feet?
                  A: To stamp out flaming ducks.

                  /// 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.
                  Do not top-post! Type your reply below the text you are replying to.
                  For more information, visit http://www.vim.org/maillist.php
                • björn
                  ... ...and I just had a more careful look: this patch does not include the block-wise selection code for copy/paste that is in MacVim. Bram: do not merge this
                  Message 8 of 21 , Jul 12, 2010
                  • 0 Attachment
                    On 12 July 2010 17:10, Bram Moolenaar wrote:
                    >
                    >> On Jul 11, 2:20 pm, Bram Moolenaar <B...@...> wrote:
                    >> > Jjgod Jiang wrote (a long time ago):
                    >> > > >> Running vim under Mac OS X terminal do not support copy to/from
                    >> > > >> system clipboard currently, this patch add this feature. To have
                    >> > > >> this feature in mainstream, we receive the following benifits:
                    >> >
                    >> > > >> 1. We can copy from/to system clipboard without running GUI.
                    >> > > >> =A0 =A0(Default vim builds shipped with Mac OS X do not have GUI
                    >> > > >> =A0 =A0 enabled, so it can share this feature.)
                    >> > > >> 2. We don't need to duplicate code in GUI implementations like
                    >> > > >> =A0 =A0MacVim or vim-cocoa.
                    >> >
                    >> > > >> The clipboard handling code is derived from MacVim.
                    >> >
                    >> > > >> To use Cocoa APIs, we need to convert os_macosx.c into an Obj-C
                    >> > > >> file. Other changes are trivial.
                    >> >
                    >> > > > A few remarks were made after this patch was submitted, but I don't
                    >> > > > think I ever saw an updated patch. =A0Is it still coming?
                    >> >
                    >> > > I made the remark that it would be "nicer" to use the C-API (Core
                    >> > > Foundation) to implement Copy/Paste instead of converting os_macosx.c
                    >> > > to an Objective-C file and then using the MacVim Copy/Paste code which
                    >> > > uses the Objective-C API (Foundation).
                    >> >
                    >> > > It would not be very difficult to write such a patch but I don't think
                    >> > > anybody ever volunteered to do it.  The advantages of rewriting the
                    >> > > patch are mostly aesthetic -- the functionality would be identical.
                    >> > > If you Bram can live with that then I think it is safe to merge this
                    >> > > patch (here is one of the problems though: since the patch renames a
                    >> > > whole file it is a bit tricky to review -- I believe it is fine but
                    >> > > have not checked it myself).  If you would prefer not to use
                    >> > > Objective-C then it is possible to rewrite it using only C.
                    >> >
                    >> > > What would you prefer Bram?
                    >> >
                    >> > I don't know enough about the advantages and disadvantages.  I think at
                    >> > least the issues with block mode should be fixed.  Otherwise one can
                    >> > just as well use the clipboard throught the terminal, right?
                    >> >
                    >> > When going with Objective-C, would there be disadvantages?  Some people
                    >> > who can't build the binary?  Does the executable become bigger?  More
                    >> > dependencies on libraries?
                    >>
                    >> What would be the advantage over using:
                    >>
                    >> vmap ,y y:call system("pbcopy", getreg("\""))<CR>
                    >> nmap ,p :call setreg("\"",system("pbpaste"))<CR>p
                    >>
                    >> And some syntactic sugar for mapping?
                    >
                    > Not being able to pass block-wise selection.

                    ...and I just had a more careful look: this patch does not include the
                    block-wise
                    selection code for copy/paste that is in MacVim.

                    Bram: do not merge this patch. It will have to be either rewritten or
                    updated to include the latest MacVim copy/paste code. I'll see if
                    have some time to spare to take a look at it, otherwise I guess we'll
                    have to wait until Vim 7.4.

                    Björn

                    --
                    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
                  • björn
                    ... I looked into this issue carefully now and decided it is best to convert os_macosx.c to Obj-C and have attached an updated patch which includes block-wise
                    Message 9 of 21 , Jul 12, 2010
                    • 0 Attachment
                      On 12 July 2010 17:48, björn wrote:
                      >
                      > Bram: do not merge this patch.  It will have to be either rewritten or
                      > updated to include the latest MacVim copy/paste code.  I'll see if
                      > have some time to spare to take a look at it, otherwise I guess we'll
                      > have to wait until Vim 7.4.

                      I looked into this issue carefully now and decided it is best to
                      convert os_macosx.c to Obj-C and have attached an updated patch which
                      includes block-wise copy/paste (the old patch had issues with linking
                      as well).

                      The only cons to using Obj-C are insignificant:

                      - executable size is not significantly increased (Carbon=2350496 vs.
                      Cocoa=2373944)
                      - there are more dependencies but only on dynamic libraries that come
                      with all Mac OS X versions

                      ...but there are pros:

                      - Should work on _all_ Mac OS X versions, whereas the C API is only
                      supported on 10.3+
                      - Future proof (Apple has made it quite clear that Cocoa is the way forward)

                      The copy/paste code is taken directly from MacVim and has been used by
                      many people for years now so it should be considered stable -- I would
                      say the patch is ready for merging.

                      There is one issue: the Carbon GUI no longer compiles (Mac OS X 10.6)
                      so I cannot confirm that it still builds (I had to do some
                      modifications to configure.in). Since this is likely to give a bad
                      impression to anybody building from source I have made NO GUI default
                      (i.e. you have to explicitly enable the GUI in configure). The Carbon
                      GUI is dead anyway so I do not think this is a major issue but I
                      thought I should mention it.

                      I have made sure the copy/paste build with tiny builds, with/without
                      multibyte etc.

                      Björn

                      --
                      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
                    • björn
                      ... I accidentally included auto/config.mk in the patch...attaching a new one. Sorry about that. Björn -- You received this message from the vim_dev
                      Message 10 of 21 , Jul 12, 2010
                      • 0 Attachment
                        On 12 July 2010 21:04, björn wrote:
                        >
                        > I looked into this issue carefully now and decided it is best to
                        > convert os_macosx.c to Obj-C and have attached an updated patch which
                        > includes block-wise copy/paste (the old patch had issues with linking
                        > as well).
                        >

                        I accidentally included auto/config.mk in the patch...attaching a new
                        one. Sorry about that.

                        Björn

                        --
                        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
                        ... Great, thanks. I ll try it out, hopefully this week. -- Why doesn t Tarzan have a beard? /// Bram Moolenaar -- Bram@Moolenaar.net --
                        Message 11 of 21 , Jul 12, 2010
                        • 0 Attachment
                          Björn Winckler wrote:

                          > On 12 July 2010 17:48, björn wrote:
                          > >
                          > > Bram: do not merge this patch. It will have to be either rewritten or
                          > > updated to include the latest MacVim copy/paste code. I'll see if
                          > > have some time to spare to take a look at it, otherwise I guess we'll
                          > > have to wait until Vim 7.4.
                          >
                          > I looked into this issue carefully now and decided it is best to
                          > convert os_macosx.c to Obj-C and have attached an updated patch which
                          > includes block-wise copy/paste (the old patch had issues with linking
                          > as well).
                          >
                          > The only cons to using Obj-C are insignificant:
                          >
                          > - executable size is not significantly increased (Carbon=2350496 vs.
                          > Cocoa=2373944)
                          > - there are more dependencies but only on dynamic libraries that come
                          > with all Mac OS X versions
                          >
                          > ...but there are pros:
                          >
                          > - Should work on _all_ Mac OS X versions, whereas the C API is only
                          > supported on 10.3+
                          > - Future proof (Apple has made it quite clear that Cocoa is the way forward)
                          >
                          > The copy/paste code is taken directly from MacVim and has been used by
                          > many people for years now so it should be considered stable -- I would
                          > say the patch is ready for merging.
                          >
                          > There is one issue: the Carbon GUI no longer compiles (Mac OS X 10.6)
                          > so I cannot confirm that it still builds (I had to do some
                          > modifications to configure.in). Since this is likely to give a bad
                          > impression to anybody building from source I have made NO GUI default
                          > (i.e. you have to explicitly enable the GUI in configure). The Carbon
                          > GUI is dead anyway so I do not think this is a major issue but I
                          > thought I should mention it.
                          >
                          > I have made sure the copy/paste build with tiny builds, with/without
                          > multibyte etc.

                          Great, thanks. I'll try it out, hopefully this week.

                          --
                          Why doesn't Tarzan have a beard?

                          /// 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.
                          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 included this, and generated the configure script. Looking at os_macosx.m, it appears these functions are not used: mch_gettext() mch_bindtextdomain()
                          Message 12 of 21 , Jul 14, 2010
                          • 0 Attachment
                            Björn Winckler wrote:

                            > On 12 July 2010 21:04, björn wrote:
                            > >
                            > > I looked into this issue carefully now and decided it is best to
                            > > convert os_macosx.c to Obj-C and have attached an updated patch which
                            > > includes block-wise copy/paste (the old patch had issues with linking
                            > > as well).
                            > >
                            >
                            > I accidentally included auto/config.mk in the patch...attaching a new
                            > one. Sorry about that.

                            I included this, and generated the configure script.

                            Looking at os_macosx.m, it appears these functions are not used:
                            mch_gettext()
                            mch_bindtextdomain()
                            mch_textdomain()

                            The whole section with #ifdef USE_MCH_GETTEXT appears to be unused.


                            --
                            Futility Factor: No experiment is ever a complete failure - it can always
                            serve as a negative example.

                            /// 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.
                            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
                            ... The clipboard does not appear to work. Looks like a call to clip_init() is missing. Was the patch incomplete? -- ARTHUR: Well, it doesn t matter.
                            Message 13 of 21 , Jul 14, 2010
                            • 0 Attachment
                              I wrote:

                              > Björn Winckler wrote:
                              >
                              > > On 12 July 2010 21:04, björn wrote:
                              > > >
                              > > > I looked into this issue carefully now and decided it is best to
                              > > > convert os_macosx.c to Obj-C and have attached an updated patch which
                              > > > includes block-wise copy/paste (the old patch had issues with linking
                              > > > as well).
                              > > >
                              > >
                              > > I accidentally included auto/config.mk in the patch...attaching a new
                              > > one. Sorry about that.
                              >
                              > I included this, and generated the configure script.
                              >
                              > Looking at os_macosx.m, it appears these functions are not used:
                              > mch_gettext()
                              > mch_bindtextdomain()
                              > mch_textdomain()
                              >
                              > The whole section with #ifdef USE_MCH_GETTEXT appears to be unused.

                              The clipboard does not appear to work. Looks like a call to clip_init()
                              is missing. Was the patch incomplete?

                              --
                              ARTHUR: Well, it doesn't matter. Will you go and tell your master that
                              Arthur from the Court of Camelot is here.
                              GUARD #1: Listen, in order to maintain air-speed velocity, a swallow
                              needs to beat its wings 43 times every second, right?
                              ARTHUR: Please!
                              The Quest for the Holy Grail (Monty Python)

                              /// 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.
                              Do not top-post! Type your reply below the text you are replying to.
                              For more information, visit http://www.vim.org/maillist.php
                            • björn
                              ... You are right about the missing call to clip_init(). The patch below is the missing hunk from main.c. Sorry about that. Thanks for including this patch.
                              Message 14 of 21 , Jul 14, 2010
                              • 0 Attachment
                                On 14 July 2010 14:52, Bram Moolenaar wrote:
                                >
                                > I wrote:
                                >
                                >> Björn Winckler wrote:
                                >>
                                >> > On 12 July 2010 21:04, björn wrote:
                                >> > >
                                >> > > I looked into this issue carefully now and decided it is best to
                                >> > > convert os_macosx.c to Obj-C and have attached an updated patch which
                                >> > > includes block-wise copy/paste (the old patch had issues with linking
                                >> > > as well).
                                >> > >
                                >> >
                                >> > I accidentally included auto/config.mk in the patch...attaching a new
                                >> > one.  Sorry about that.
                                >>
                                >> I included this, and generated the configure script.
                                >>
                                >> Looking at os_macosx.m, it appears these functions are not used:
                                >>       mch_gettext()
                                >>       mch_bindtextdomain()
                                >>       mch_textdomain()
                                >>
                                >> The whole section with #ifdef USE_MCH_GETTEXT  appears to be unused.
                                >
                                > The clipboard does not appear to work.  Looks like a call to clip_init()
                                > is missing.  Was the patch incomplete?

                                You are right about the missing call to clip_init(). The patch below
                                is the missing hunk from main.c. Sorry about that.

                                Thanks for including this patch.

                                Björn


                                diff --git a/src/main.c b/src/main.c
                                index 964bdd5..e19084e 100644
                                --- a/src/main.c
                                +++ b/src/main.c
                                @@ -711,6 +711,10 @@ main
                                qnx_clip_init();
                                #endif

                                +#if defined(MACOS_X) && defined(FEAT_CLIPBOARD)
                                + clip_init(TRUE);
                                +#endif
                                +
                                #ifdef FEAT_XCLIPBOARD
                                /* Start using the X clipboard, unless the GUI was started. */
                                # ifdef FEAT_GUI

                                --
                                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
                              • björn
                                ... I have no idea what this has been used for (if anything). I d say it is safe to delete (I started working on localizing MacVim a while ago and for that
                                Message 15 of 21 , Jul 14, 2010
                                • 0 Attachment
                                  On 14 July 2010 14:27, Bram Moolenaar wrote:
                                  >
                                  > Looking at os_macosx.m, it appears these functions are not used:
                                  >        mch_gettext()
                                  >        mch_bindtextdomain()
                                  >        mch_textdomain()
                                  >
                                  > The whole section with #ifdef USE_MCH_GETTEXT  appears to be unused.

                                  I have no idea what this has been used for (if anything). I'd say it
                                  is safe to delete (I started working on localizing MacVim a while ago
                                  and for that patch I would not have any use for these functions).

                                  Björn

                                  --
                                  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
                                  ... OK. And how about the section inside #ifdef MACOS_X_ICONVEMU ? I don t see it defined anywhere. -- ARTHUR: Will you ask your master if he wants to join
                                  Message 16 of 21 , Jul 14, 2010
                                  • 0 Attachment
                                    Björn Winckler wrote:

                                    > On 14 July 2010 14:27, Bram Moolenaar wrote:
                                    > >
                                    > > Looking at os_macosx.m, it appears these functions are not used:
                                    > > mch_gettext()
                                    > > mch_bindtextdomain()
                                    > > mch_textdomain()
                                    > >
                                    > > The whole section with #ifdef USE_MCH_GETTEXT appears to be unused.
                                    >
                                    > I have no idea what this has been used for (if anything). I'd say it
                                    > is safe to delete (I started working on localizing MacVim a while ago
                                    > and for that patch I would not have any use for these functions).

                                    OK. And how about the section inside #ifdef MACOS_X_ICONVEMU ?
                                    I don't see it defined anywhere.

                                    --
                                    ARTHUR: Will you ask your master if he wants to join my court at Camelot?!
                                    GUARD #1: But then of course African swallows are not migratory.
                                    GUARD #2: Oh, yeah...
                                    GUARD #1: So they couldn't bring a coconut back anyway...
                                    The Quest for the Holy Grail (Monty Python)

                                    /// 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.
                                    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 works now, thanks. -- GUARD #2: It could be carried by an African swallow! GUARD #1: Oh, yeah, an African swallow maybe, but not a European swallow,
                                    Message 17 of 21 , Jul 14, 2010
                                    • 0 Attachment
                                      Björn Winckler wrote:

                                      > > The clipboard does not appear to work. Looks like a call to clip_init()
                                      > > is missing. Was the patch incomplete?
                                      >
                                      > You are right about the missing call to clip_init(). The patch below
                                      > is the missing hunk from main.c. Sorry about that.
                                      >
                                      > Thanks for including this patch.

                                      It works now, thanks.

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

                                      /// 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.
                                      Do not top-post! Type your reply below the text you are replying to.
                                      For more information, visit http://www.vim.org/maillist.php
                                    • björn
                                      ... I can t see what it s used for either. Is iconv not present on all versions of Mac OS X perhaps? That sounds unlikely -- my guess is that this is a
                                      Message 18 of 21 , Jul 14, 2010
                                      • 0 Attachment
                                        On 14 July 2010 17:08, Bram Moolenaar wrote:
                                        >
                                        > Björn Winckler wrote:
                                        >
                                        >> On 14 July 2010 14:27, Bram Moolenaar wrote:
                                        >> >
                                        >> > Looking at os_macosx.m, it appears these functions are not used:
                                        >> >        mch_gettext()
                                        >> >        mch_bindtextdomain()
                                        >> >        mch_textdomain()
                                        >> >
                                        >> > The whole section with #ifdef USE_MCH_GETTEXT  appears to be unused.
                                        >>
                                        >> I have no idea what this has been used for (if anything).  I'd say it
                                        >> is safe to delete (I started working on localizing MacVim a while ago
                                        >> and for that patch I would not have any use for these functions).
                                        >
                                        > OK.  And how about the section inside #ifdef MACOS_X_ICONVEMU ?
                                        > I don't see it defined anywhere.

                                        I can't see what it's used for either. Is iconv not present on all
                                        versions of Mac OS X perhaps? That sounds unlikely -- my guess is
                                        that this is a leftover from pre-OS X. (A quick search did not reveal
                                        anything on this...I could find a man page for iconv from OS X 10.3
                                        but that was it.)

                                        I deleted all the leftovers (as well as a TRACE macro from os_mac.h
                                        that nobody should use anyway) and tried compiling with different
                                        versions and (as expected) there were no problems. I've attached a
                                        patch that also moves the "VimPboardType" variable inside #ifdef
                                        FEAT_CLIPBOARD, since it is only used there. I for one would be happy
                                        to see this dead code removed.

                                        Björn

                                        --
                                        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
                                        ... Thanks. I ll include this. -- GUARD #2: Wait a minute -- supposing two swallows carried it together? GUARD #1: No, they d have to have it on a line.
                                        Message 19 of 21 , Jul 14, 2010
                                        • 0 Attachment
                                          Björn Winckler wrote:

                                          > >> On 14 July 2010 14:27, Bram Moolenaar wrote:
                                          > >> >
                                          > >> > Looking at os_macosx.m, it appears these functions are not used:
                                          > >> > mch_gettext()
                                          > >> > mch_bindtextdomain()
                                          > >> > mch_textdomain()
                                          > >> >
                                          > >> > The whole section with #ifdef USE_MCH_GETTEXT appears to be unused.
                                          > >>
                                          > >> I have no idea what this has been used for (if anything). I'd say it
                                          > >> is safe to delete (I started working on localizing MacVim a while ago
                                          > >> and for that patch I would not have any use for these functions).
                                          > >
                                          > > OK. And how about the section inside #ifdef MACOS_X_ICONVEMU ?
                                          > > I don't see it defined anywhere.
                                          >
                                          > I can't see what it's used for either. Is iconv not present on all
                                          > versions of Mac OS X perhaps? That sounds unlikely -- my guess is
                                          > that this is a leftover from pre-OS X. (A quick search did not reveal
                                          > anything on this...I could find a man page for iconv from OS X 10.3
                                          > but that was it.)
                                          >
                                          > I deleted all the leftovers (as well as a TRACE macro from os_mac.h
                                          > that nobody should use anyway) and tried compiling with different
                                          > versions and (as expected) there were no problems. I've attached a
                                          > patch that also moves the "VimPboardType" variable inside #ifdef
                                          > FEAT_CLIPBOARD, since it is only used there. I for one would be happy
                                          > to see this dead code removed.

                                          Thanks. I'll include this.

                                          --
                                          GUARD #2: Wait a minute -- supposing two swallows carried it together?
                                          GUARD #1: No, they'd have to have it on a line.
                                          GUARD #2: Well, simple! They'd just use a standard creeper!
                                          GUARD #1: What, held under the dorsal guiding feathers?
                                          GUARD #2: Well, why not?
                                          The Quest for the Holy Grail (Monty Python)

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