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

Working ODBEditor installer

Expand Messages
  • Nico Weber
    Hi all, the attached patch (relative to current HEAD) adds a second preference pane that has GUI to install the ODBEditor input manager (you can even select
    Message 1 of 6 , Feb 28, 2008
    • 0 Attachment
      Hi all,

      the attached patch (relative to current HEAD) adds a second preference
      pane that has GUI to install the ODBEditor input manager (you can even
      select editors other than MacVim if you want). The ODBEditor plugin
      source is contained in the patch, thanks to Chris Eidhof for sending
      it to me (note to self: add the Edit in ODBEditor guys and Allan
      Odgaard to the credits). I tweaked it a bit, so that the input manager
      is ignored if the
      org.slashpunt.edit_in_odbeditor.ODBEditorBundleIdentifier pref is not
      set. This way, only people who set this pref (via the guy) get the
      input manager -- other users on the same computer won't get it, even
      if the input manager was installed globally (and it has to be
      installed globally, else it won't work on leopard).

      This is still very much WIP (but what's left is mainly GUI work and
      code cleanups), but since the patch is rather huge by now I'd like to
      have it merged rather sooner than later (especially since this changes
      nib and xcodeproj files, which can't really be merged)

      Nico


      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_mac" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • björn
      ... I ve tried it out a bit now and I can install and uninstall the input manager. I have two problems though: 1. Every time I click Uninstall I get the
      Message 2 of 6 , Feb 28, 2008
      • 0 Attachment
        On 28/02/2008, Nico Weber <nicolasweber@...> wrote:
        >
        > the attached patch (relative to current HEAD) adds a second preference
        > pane that has GUI to install the ODBEditor input manager (you can even
        > select editors other than MacVim if you want). The ODBEditor plugin
        > source is contained in the patch, thanks to Chris Eidhof for sending
        > it to me (note to self: add the Edit in ODBEditor guys and Allan
        > Odgaard to the credits). I tweaked it a bit, so that the input manager
        > is ignored if the
        > org.slashpunt.edit_in_odbeditor.ODBEditorBundleIdentifier pref is not
        > set. This way, only people who set this pref (via the guy) get the
        > input manager -- other users on the same computer won't get it, even
        > if the input manager was installed globally (and it has to be
        > installed globally, else it won't work on leopard).
        >
        > This is still very much WIP (but what's left is mainly GUI work and
        > code cleanups), but since the patch is rather huge by now I'd like to
        > have it merged rather sooner than later (especially since this changes
        > nib and xcodeproj files, which can't really be merged)

        I've tried it out a bit now and I can install and uninstall the input manager.

        I have two problems though:

        1. Every time I click "Uninstall" I get the following error on stderr:

        MacVim[1113] LSCopyItemInfoForURL() returned -43 for path
        /Library/InputManagers/Edit In ODBEditor/Edit In ODBEditor.bundle.


        2. I sometimes see a crash whenever I try to open up the prefs
        (although at this stage I am willing to attribute it to my computer
        acting up...it crashes all the time as I've said before):

        In [MMPreferenceController awakeFromNib], line 137: crashes with
        EXC_BAD_ACCESS when CFRelease(bundleIdentifier) is called (this
        happens whenever I try to open the prefs). This is probably due to my
        computer acting up, but it seems to happen only when no editor has
        been chosen in the drop down menu in the Integration prefs pane (that
        button is empty, it doesn't even show the text "(None)"). If I
        comment out that release and recompile, then I can access the prefs
        again. After setting the editor to "MacVim", quitting, reneabling the
        release statement and recompiling it no longer crashes on that
        release. Can you make any sense out of that?


        /Björn

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_mac" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Nico Weber
        ... I can t see this. Clicking on Uninstall basically does sudo rm -rf /Library/InputManagers/Edit in ODBEditor followed by a call to if ([[NSWorkspace
        Message 3 of 6 , Feb 28, 2008
        • 0 Attachment
          > I have two problems though:
          >
          > 1. Every time I click "Uninstall" I get the following error on stderr:
          >
          > MacVim[1113] LSCopyItemInfoForURL() returned -43 for path
          > /Library/InputManagers/Edit In ODBEditor/Edit In ODBEditor.bundle.

          I can't see this. Clicking on Uninstall basically does

          sudo rm -rf /Library/InputManagers/Edit\ in\ ODBEditor

          followed by a call to

          if ([[NSWorkspace sharedWorkspace] isFilePackageAtPath:@"/
          Library/InputManagers/Edit In ODBEditor/Edit In ODBEditor.bundle"]) {

          Can you put the line above in a separate executable and see if it
          causes the problem?

          > 2. I sometimes see a crash whenever I try to open up the prefs
          > (although at this stage I am willing to attribute it to my computer
          > acting up...it crashes all the time as I've said before):

          That's of course my fault, it happens when you launch the prefs dialog
          when org.slashpunt.edit_in_odbeditor.ODBEditorBundleIdentifier is not
          set. In that case, bundleIndentifier is NULL. Try this patch:

          diff --git a/src/MacVim/MMPreferenceController.m b/src/MacVim/
          MMPreferenceController.m
          index 52a7fbf..2d52dd4 100644
          --- a/src/MacVim/MMPreferenceController.m
          +++ b/src/MacVim/MMPreferenceController.m
          @@ -98,7 +98,7 @@ static NSString *ODBEDITOR_PATH =
          @"", @"(None)",
          nil];

          - NSString *selectedTitle = nil;
          + NSString *selectedTitle = @"(None)";

          NSMenu *editorsMenu = [editors menu];
          NSEnumerator *enumerator = [supportedOdbEditors keyEnumerator];
          @@ -106,7 +106,7 @@ static NSString *ODBEDITOR_PATH =
          while ((key = [enumerator nextObject]) != nil) {
          NSString *identifier = [supportedOdbEditors objectForKey:key];

          - if ([bundleIdentifier isEqualToString:identifier])
          + if (bundleIdentifier && [bundleIdentifier
          isEqualToString:identifier])
          selectedTitle = key;

          NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:key
          @@ -134,7 +134,8 @@ static NSString *ODBEDITOR_PATH =

          [self updateIntegrationPane];

          - CFRelease(bundleIdentifier);
          + if (bundleIdentifier)
          + CFRelease(bundleIdentifier);
          }

          - (void)dealloc

          Thanks,
          Nico


          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_mac" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • björn
          ... The problem was that isFilePackageAtPath: would spew out a warning if the path did not exist. I fixed it by simply checking if the path existed before
          Message 4 of 6 , Feb 28, 2008
          • 0 Attachment
            On 28/02/2008, Nico Weber <nicolasweber@...> wrote:
            >
            > > I have two problems though:
            > >
            > > 1. Every time I click "Uninstall" I get the following error on stderr:
            > >
            > > MacVim[1113] LSCopyItemInfoForURL() returned -43 for path
            > > /Library/InputManagers/Edit In ODBEditor/Edit In ODBEditor.bundle.
            >
            >
            > I can't see this. Clicking on Uninstall basically does
            >
            > sudo rm -rf /Library/InputManagers/Edit\ in\ ODBEditor
            >
            > followed by a call to
            >
            > if ([[NSWorkspace sharedWorkspace] isFilePackageAtPath:@"/
            > Library/InputManagers/Edit In ODBEditor/Edit In ODBEditor.bundle"]) {
            >
            > Can you put the line above in a separate executable and see if it
            > causes the problem?

            The problem was that isFilePackageAtPath: would spew out a warning if
            the path did not exist. I fixed it by simply checking if the path
            existed before calling that method. Also, you had a capitalization
            problem in the path to the input manager: you typed "Edit In ..." when
            it should be "Edit in ...". I fixed that as well.


            > > 2. I sometimes see a crash whenever I try to open up the prefs
            > > (although at this stage I am willing to attribute it to my computer
            > > acting up...it crashes all the time as I've said before):
            >
            >
            > That's of course my fault, it happens when you launch the prefs dialog
            > when org.slashpunt.edit_in_odbeditor.ODBEditorBundleIdentifier is not
            > set. In that case, bundleIndentifier is NULL. Try this patch:

            Works a charm. Thanks.

            I have pushed this patch to the public repo now so you can send me
            patches against it instead. This was a rather big patch, but I still
            "bundled" it up as one big commit...I hope you have no objections
            against that.

            Thanks again for the patch!

            /Björn

            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_mac" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          • wishinet@googlemail.com
            ... Just a small question: how do you install that? I think this could get very interesting for the vim community using the Mac. ;) Greetings, Marius
            Message 5 of 6 , Feb 28, 2008
            • 0 Attachment
              * Nico Weber (nicolasweber@...) wrote:
              > Hi all,
              >
              > the attached patch (relative to current HEAD) adds a second preference
              > pane that has GUI to install the ODBEditor input manager (you can even
              > select editors other than MacVim if you want).

              Just a small question: how do you install that?

              I think this could get very interesting for the vim community using the Mac.
              ;)

              Greetings,
              Marius
            • Nico Weber
              ... Looks like this will make it into the next MacVim release. Just wait a few more days :-) Nico --~--~---------~--~----~------------~-------~--~----~ You
              Message 6 of 6 , Feb 29, 2008
              • 0 Attachment
                >> the attached patch (relative to current HEAD) adds a second
                >> preference
                >> pane that has GUI to install the ODBEditor input manager (you can
                >> even
                >> select editors other than MacVim if you want).
                >
                > Just a small question: how do you install that?

                Looks like this will make it into the next MacVim release. Just wait a
                few more days :-)

                Nico

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