Re: Mac clipboard support

2007-09-27 Fir de Conversatie björn

> >> If you could let us know exactly what the difference is between
> >> GTK/MacVim as regards Hebrew support then I (or anybody else interested,
> >> of course) could look into fixing this.  The problem, for me, with
> >> adding support for other languages (than English) is that I simply do
> >> not know how they are used, and hence I have no idea as to what
> >> works/doesn't work.  I would really appreciate if you could post a list
> >> of test cases (to vim_mac, since this is Mac specific) and say how they
> >> should behave.
> >
> > I will aim to do this for you soon. I would love it if you could fix it!
>
> OK. Well, I've found one reason it doesn't work, which is documented!
>
> One of the main things I need is composing characters which are not yet 
> supported.

Can you provide me with a test case so that I have something to check
when I start working on this feature?  I.e. state which input method
(or language) you use in OSX, and then give some examples of
keystrokes which do not give the desired output (and let me know what
the output should be).

> There are a couple of reasons I didn't find the documentation earlier:
>
> 1. The snapshot archives contain multiple items at the top level. This is 
> fairly
> nonstandard IMHO. I am in the habit of grabbing distribution files and 
> unarchiving
> them in a folder full of other files and then finding the single folder that 
> the
> archive contains. Could I suggest doing the same with MacVim, i.e. rather than
> providing the snapshots containing MacVim.app, README and mvim all at the top
> level, provide them containing a single folder MacVim which contains the 
> other stuff.

Like Nico said, this is "how it is" in Mac OS X.  I don't see any
point in changing it and I hope you can live with it! ;)


> 2. There is no mention of gui_mac.txt at the top of gui.txt in the (patched) 
> help
> files! This should definitely be added, circa line 20 in gui.txt.

Thanks...I will add that.


> Could I also suggest moving the bulk if not all of the content of the README 
> into
> the help files? Even though some of it is snapshot related, it is a much more
> accessible place, given Vim's excellent help facility.

Actually, as of r277, all the README says is "please type :h macvim"
(more or less).  So I have already done this.  (Not verbatim, but most
of the stuff that was in the README is now in the help file.) :)


/Björn

--~--~-~--~~~---~--~~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Mac clipboard support

2007-09-27 Fir de Conversatie Ben Schmidt

>> 1. The snapshot archives contain multiple items at the top level.  
>> This is fairly
>> nonstandard IMHO
> 
> This is the normal way of packaging stuff in OS X because  
> BOMUnarchiver (the program the finder invokes when you double-click a  
> zip) creates a folder with the name of the zip for you.

Ah, right. Will it do so even if there is a single item? 'Cause if it doesn't 
then 
you could have the best of both worlds packaging differently. If it still 
creates 
an extra folder anyway, though, then yeah, it would be a nuisance, understood.

Ben.



Send instant messages to your online friends http://au.messenger.yahoo.com 


--~--~-~--~~~---~--~~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Mac clipboard support

2007-09-27 Fir de Conversatie Nico Weber

> 1. The snapshot archives contain multiple items at the top level.  
> This is fairly
> nonstandard IMHO

This is the normal way of packaging stuff in OS X because  
BOMUnarchiver (the program the finder invokes when you double-click a  
zip) creates a folder with the name of the zip for you.


--~--~-~--~~~---~--~~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Mac clipboard support

2007-09-26 Fir de Conversatie Ben Schmidt

>> If you could let us know exactly what the difference is between 
>> GTK/MacVim as regards Hebrew support then I (or anybody else interested, 
>> of course) could look into fixing this.  The problem, for me, with 
>> adding support for other languages (than English) is that I simply do 
>> not know how they are used, and hence I have no idea as to what 
>> works/doesn't work.  I would really appreciate if you could post a list 
>> of test cases (to vim_mac, since this is Mac specific) and say how they 
>> should behave.
> 
> I will aim to do this for you soon. I would love it if you could fix it!

OK. Well, I've found one reason it doesn't work, which is documented!

One of the main things I need is composing characters which are not yet 
supported.

There are a couple of reasons I didn't find the documentation earlier:

1. The snapshot archives contain multiple items at the top level. This is 
fairly 
nonstandard IMHO. I am in the habit of grabbing distribution files and 
unarchiving 
them in a folder full of other files and then finding the single folder that 
the 
archive contains. Could I suggest doing the same with MacVim, i.e. rather than 
providing the snapshots containing MacVim.app, README and mvim all at the top 
level, provide them containing a single folder MacVim which contains the other 
stuff.

2. There is no mention of gui_mac.txt at the top of gui.txt in the (patched) 
help 
files! This should definitely be added, circa line 20 in gui.txt.

Could I also suggest moving the bulk if not all of the content of the README 
into 
the help files? Even though some of it is snapshot related, it is a much more 
accessible place, given Vim's excellent help facility.

I will get to moving the clipboard support and providing more details on the 
trouble with right-to-left stuff later.

Cheers,

Ben.




Send instant messages to your online friends http://au.messenger.yahoo.com 


--~--~-~--~~~---~--~~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Mac clipboard support

2007-09-10 Fir de Conversatie björn

> > That's fantastic! I've obviously not been paying enough attention
> > to vim_mac. Is there a good way to get it working in xterm? I tried
> > running MacVim.app/Contents/MacOS/Vim, but it didn't recognize the
> > OSX clipboard ("*p).
>
> As far as I understand, MacVim is mainly about the gui version of
> vim. It's a rewrite of the GUI using different technologies. Making
> the clipboard work in an xterm/Terminal.app could probably done with
> the "normal" mac vim version without too much effort.

Nico is almost right.  When I started working on MacVim my intentions
were only to improve the GUI for Mac OS X.  The reason I did not
consider the non-gui version was because I thought it already worked
as it should (I do not use it myself).  Now that I am beginning to see
the shortcomings of the terminal version (clipboard support &
+clientserver springs to mind), I realize that my work on MacVim could
benefit the terminal version as well.  However, due to lack of time on
my part, MacVim will continue to focus on the GUI side of things.

Still, this does present an opportunity for those of you who use
terminal Vim on Mac OS to take the code that I have written for MacVim
and adapt it to the non-GUI version (e.g. +clientserver, let me know
if you are interested).

As for clipboard support...I tried defining FEAT_CLIPBOARD and that
made pasting work ("*p), but copying ("*yy) still did not.  It seems
clip_mch_request_selection() and clip_mch_set_selection() still never
gets called in terminal but they do from the GUI (why?).  Maybe
somebody on this list knows more about FEAT_CLIPBOARD and why it
enables pasting but not copying?


/Björn

--~--~-~--~~~---~--~~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Mac clipboard support

2007-09-09 Fir de Conversatie Nico Weber

> That's fantastic! I've obviously not been paying enough attention  
> to vim_mac. Is there a good way to get it working in xterm? I tried  
> running MacVim.app/Contents/MacOS/Vim, but it didn't recognize the  
> OSX clipboard ("*p).

As far as I understand, MacVim is mainly about the gui version of  
vim. It's a rewrite of the GUI using different technologies. Making  
the clipboard work in an xterm/Terminal.app could probably done with  
the "normal" mac vim version without too much effort.

Nico


--~--~-~--~~~---~--~~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Mac clipboard support

2007-09-09 Fir de Conversatie Kyle Wheeler

On Sunday, September  9 at 02:31 PM, quoth björn:
No, there is no official MacVim.app release yet (only binary 
snapshots)...I am still fixing bugs and implementing missing 
features.  That being said, it works fairly well and supports some 
features that the Carbon port does not. Please try it out and let me 
know why/if it is not suitable for you (I am curious as to why you'd 
prefer the GTK version over MacVim on a Mac). Feature request/bug 
reports can be posted to the vim_mac group.


That's fantastic! I've obviously not been paying enough attention to 
vim_mac. Is there a good way to get it working in xterm? I tried 
running MacVim.app/Contents/MacOS/Vim, but it didn't recognize the OSX 
clipboard ("*p).


~Kyle
--
This is my simple religion. There is no need for temples; no need for 
complicated philosophy. Our own brain, our own heart is our temple; 
the philosophy is kindness.

 -- Dalai Lama


pgpzAheZchSXR.pgp
Description: PGP signature


Re: Mac clipboard support

2007-09-09 Fir de Conversatie björn
>
>
> One issue, though. If we move the clipboard support into os_macosx.c
> will it break MacVim by having those functions doubly defined? Does it
> need some conditional compilation #ifdefs, and if so, what? Or would you
> just remove the MacVim clipboard support if the other worked without the
> GUI?


If you move clipboard support into os_macosx.c and Bram patches the Vim
source then it will break MacVim, but it would take me no time to fix so
don't worry about it.


/Björn

--~--~-~--~~~---~--~~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Mac clipboard support

2007-09-09 Fir de Conversatie Ben Schmidt

> If you could let us know exactly what the difference is between 
> GTK/MacVim as regards Hebrew support then I (or anybody else interested, 
> of course) could look into fixing this.  The problem, for me, with 
> adding support for other languages (than English) is that I simply do 
> not know how they are used, and hence I have no idea as to what 
> works/doesn't work.  I would really appreciate if you could post a list 
> of test cases (to vim_mac, since this is Mac specific) and say how they 
> should behave.

I will aim to do this for you soon. I would love it if you could fix it!

> The code I pointed you to before (in gui_macvim.m) will work even 
> without the GUI, but it is written in objective-c so you would need to 
> enable obj-c compilation.  One way of doing this is to create a new .m 
> file (os_macosx_objc.m?), and copy the two functions I mentioned in 
> there.  It would probably be easier to just take the relevant code from 
> gui_mac.c and put it inside os_macosx.c, but I haven't given this much 
> thought.

Yeah, I tried that, but it didn't work, which is why I think there must 
be some initialisation code or something. Maybe a reference to the 
clipboard is in a global/static variable that is initialised at GUI 
startup. I will look into it. Shouldn't be hard to find.

One issue, though. If we move the clipboard support into os_macosx.c 
will it break MacVim by having those functions doubly defined? Does it 
need some conditional compilation #ifdefs, and if so, what? Or would you 
just remove the MacVim clipboard support if the other worked without the 
GUI?

Ben.



Send instant messages to your online friends http://au.messenger.yahoo.com 


--~--~-~--~~~---~--~~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Mac clipboard support

2007-09-09 Fir de Conversatie björn
>
>
> As I mentioned in my other email on vim-dev, I prefer the terminal
> version for such things as being able to suspend my session. MacVim's
> implementation of :shell isn't bad, though, so a little of that
> functionality is there. Not enough for me to prefer the GUI to the
> terminal, though.


Fair enough.

The preference of GTK over MacVim is due to the struggle I have had
> trying getting Hebrew to work properly in MacVim (and Terminal.app and
> the Carbon GUI). I haven't succeeded in any of those. But I have
> succeeded in the GTK GUI and in xterm. I wonder how it goes in the
> Windows GUI--I will have to have a look when I am at work tomorrow.
>
> If we could get that fixed (Hebrew working properly in MacVim), I would
> definitely prefer it to the GTK GUI or xterm. And indeed, if that were
> fixed, I may well start using MacVim more regularly for editing other
> files, too, as it would be already open.


If you could let us know exactly what the difference is between GTK/MacVim
as regards Hebrew support then I (or anybody else interested, of course)
could look into fixing this.  The problem, for me, with adding support for
other languages (than English) is that I simply do not know how they are
used, and hence I have no idea as to what works/doesn't work.  I would
really appreciate if you could post a list of test cases (to vim_mac, since
this is Mac specific) and say how they should behave.

I still expect I would do most work in terminal Vim, though, as it is
> really my preference, and ideally it would work with the Mac clipboard.


The code I pointed you to before (in gui_macvim.m) will work even without
the GUI, but it is written in objective-c so you would need to enable obj-c
compilation.  One way of doing this is to create a new .m file
(os_macosx_objc.m?), and copy the two functions I mentioned in there.  It
would probably be easier to just take the relevant code from gui_mac.c and
put it inside os_macosx.c, but I haven't given this much thought.


/Björn

--~--~-~--~~~---~--~~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Mac clipboard support

2007-09-09 Fir de Conversatie Ben Schmidt

Hi, Björn,

> No, there is no official MacVim.app release yet (only binary 
> snapshots)...I am still fixing bugs and implementing missing features.  
> That being said, it works fairly well and supports some features that 
> the Carbon port does not.  Please try it out and let me know why/if it 
> is not suitable for you (I am curious as to why you'd prefer the GTK 
> version over MacVim on a Mac).  Feature request/bug reports can be 
> posted to the vim_mac group.

As I mentioned in my other email on vim-dev, I prefer the terminal 
version for such things as being able to suspend my session. MacVim's 
implementation of :shell isn't bad, though, so a little of that 
functionality is there. Not enough for me to prefer the GUI to the 
terminal, though.

The preference of GTK over MacVim is due to the struggle I have had 
trying getting Hebrew to work properly in MacVim (and Terminal.app and 
the Carbon GUI). I haven't succeeded in any of those. But I have 
succeeded in the GTK GUI and in xterm. I wonder how it goes in the 
Windows GUI--I will have to have a look when I am at work tomorrow.

If we could get that fixed (Hebrew working properly in MacVim), I would 
definitely prefer it to the GTK GUI or xterm. And indeed, if that were 
fixed, I may well start using MacVim more regularly for editing other 
files, too, as it would be already open.

I still expect I would do most work in terminal Vim, though, as it is 
really my preference, and ideally it would work with the Mac clipboard.

Cheers,

Ben.



Send instant messages to your online friends http://au.messenger.yahoo.com 


--~--~-~--~~~---~--~~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Mac clipboard support

2007-09-09 Fir de Conversatie Ben Schmidt

 > It does compile for me out of the box (where I mean svn with box).

OK. I see what my problem was. I never downloaded the vim-extras 
package, only the Unix sources, so I didn't get the Carbon UI or any 
other Mac-specific stuff.

> It works in the official Carbon vim as well. And it also works if you  
> use that version in Terminal.app (Cmd-c and Cmd-v, that is. But  
> that's probably because Terminal.app supports it ;-) The clipboard  
> register doesn't seem to work in the terminal, that's true).

Yes. OK. So this is actually my problem.

The clipboard register does not work in the terminal or other GUIs on 
the Mac (e.g. GTK). This is because the support is included in the GUI, 
gui_mac.c, and cannot be enabled without it, rather than somewhere I 
would consider more logical, such as os_macosx.c.

The Mac GUIs don't work for me reliably/consistently (e.g. with Hebrew 
text), and I generally prefer to work in the terminal anyway (I like 
such things as suspending my Vim session).

So I guess the question now is: could the sources be rearranged such 
that Mac clipboard support can be enabled without the GUI being enabled? 
I can't see any reason why not. But it must rely more on just having the 
GUI compiled in, as even running Vim in a terminal without the GUI but 
with the GUI compiled in, the clipboard doesn't work. So some 
initialisation must be happening with the GUI or something to make it 
work only then.

Anyone got any ideas? Or is this not worth pursuing?

Ben.


Send instant messages to your online friends http://au.messenger.yahoo.com 


--~--~-~--~~~---~--~~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Mac clipboard support

2007-09-09 Fir de Conversatie björn
>
>
> I use a Vim that I compiled myself; I use it in the Mac Terminal.app and
> using the GTK GUI. The clipboard register doesn't work. Whenever I have
> investigated, which agreeably hasn't been for a while, none of the
> specific 'Mac' versions of Vim has been suitable for me.
>
> > Like Nico says, clipboard support is in all versions of Vim on the Mac.
> > For instance, in MacVim.app check out the following functions in
> > gui_macvim.m:
>
> So this isn't in the official Vim distribution, correct?


No, there is no official MacVim.app release yet (only binary snapshots)...I
am still fixing bugs and implementing missing features.  That being said, it
works fairly well and supports some features that the Carbon port does not.
Please try it out and let me know why/if it is not suitable for you (I am
curious as to why you'd prefer the GTK version over MacVim on a Mac).
Feature request/bug reports can be posted to the vim_mac group.


> Is there a particular reason that Vim doesn't compile for Mac out of the
> box rather than having these different distributions?


Last time I tried I had no problems compiling Carbon Vim from the svn
repository.  As for MacVim; since it is not the official port I have it set
up on a separate repository.  If it ever reaches a stage where people prefer
MacVim over Carbon Vim then I guess we could start thinking about adding it
to the Vim repository instead.  Building MacVim should not be difficult; the
instructions on the project page.


/Björn

--~--~-~--~~~---~--~~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Mac clipboard support

2007-09-09 Fir de Conversatie Nico Weber

>> Like Nico says, clipboard support is in all versions of Vim on the  
>> Mac.
>> For instance, in MacVim.app check out the following functions in
>> gui_macvim.m:
>
> So this isn't in the official Vim distribution, correct?

It works in the official Carbon vim as well. And it also works if you  
use that version in Terminal.app (Cmd-c and Cmd-v, that is. But  
that's probably because Terminal.app supports it ;-) The clipboard  
register doesn't seem to work in the terminal, that's true).

> I guess it may be worth my while investigating this other  
> distribution.
>
> Is there a particular reason that Vim doesn't compile for Mac out  
> of the
> box rather than having these different distributions?

It does compile for me out of the box (where I mean svn with box).

Nico


--~--~-~--~~~---~--~~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Mac clipboard support

2007-09-09 Fir de Conversatie Ben Schmidt

I have mixed up quotes from multiple people.

> I don't understand. Can you elaborate? Copying to and pasting from  
> the mac clipboard works fine. The normal `p` and `y` commands in vim  
> don't use the system clipboard, you have to use the "system  
> clipboard" register *: "*p to paste, "*y to copy to it. All vims on  
> the mac I use have "*p mapped to  (that's command-v, the usual  
> paste shortcut) and "*y to  (the usual copy). I always use the  
> gui versions, though.

I use a Vim that I compiled myself; I use it in the Mac Terminal.app and 
using the GTK GUI. The clipboard register doesn't work. Whenever I have 
investigated, which agreeably hasn't been for a while, none of the 
specific 'Mac' versions of Vim has been suitable for me.

> Like Nico says, clipboard support is in all versions of Vim on the Mac.
> For instance, in MacVim.app check out the following functions in
> gui_macvim.m:

So this isn't in the official Vim distribution, correct?

I guess it may be worth my while investigating this other distribution.

Is there a particular reason that Vim doesn't compile for Mac out of the 
box rather than having these different distributions?

> Well, if I understand you correctly, this already does work. I didn't  
> test with a different encoding, I don't see a reason for not using  
> enc=utf-8 ;-)

Yeah, me neither.

Ben.



Send instant messages to your online friends http://au.messenger.yahoo.com 


--~--~-~--~~~---~--~~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Mac clipboard support

2007-09-09 Fir de Conversatie björn
Hi Ben,

>
>
> Correct me if I'm wrong, but my belief is that Vim does not support the
> clipboard on the Mac.


Like Nico says, clipboard support is in all versions of Vim on the Mac.  For
instance, in MacVim.app check out the following functions in gui_macvim.m:

void clip_mch_request_selection(VimClipboard *cbd)
void clip_mch_request_selection(VimClipboard *cbd)

You can find the source code for MacVim at http://code.google.com/p/macvim/.


/Björn

--~--~-~--~~~---~--~~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Mac clipboard support

2007-09-09 Fir de Conversatie Nico Weber

Hi,

> Correct me if I'm wrong, but my belief is that Vim does not support  
> the
> clipboard on the Mac.
>
> I'm wondering what would be involved in adding this capability to Vim.

I don't understand. Can you elaborate? Copying to and pasting from  
the mac clipboard works fine. The normal `p` and `y` commands in vim  
don't use the system clipboard, you have to use the "system  
clipboard" register *: "*p to paste, "*y to copy to it. All vims on  
the mac I use have "*p mapped to  (that's command-v, the usual  
paste shortcut) and "*y to  (the usual copy). I always use the  
gui versions, though.

It also works with unicode characters -- I just copied some  
international characters from Mail.app to MacVim, worked without  
problems.

> Since I now have some kind of understanding of the concepts  
> involved, I
> wondered whether it would be easy for me to contribute by adding the
> functionality to Vim--perhaps even to be available only when
> 'encoding=utf8', which would be better than nothing!

Well, if I understand you correctly, this already does work. I didn't  
test with a different encoding, I don't see a reason for not using  
enc=utf-8 ;-)

Bye,
Nico

--~--~-~--~~~---~--~~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Mac clipboard support

2007-09-09 Fir de Conversatie Ben Schmidt

Hi,

Correct me if I'm wrong, but my belief is that Vim does not support the
clipboard on the Mac.

I'm wondering what would be involved in adding this capability to Vim.

I recently adapted some example code of Apple's to create 'pbcopy_utf8'
and 'pbpaste_utf8', which, you guessed it, basically perform the
functions of 'pbcopy' and 'pbpaste' but with UTF8 rather than Macroman
encoding. (If anybody knows a website where it would be useful to post
these, I would be very happy to provide them and their source--the
reason I wrote them is that a quick Google didn't seem to turn up
anything that people found all that reliable or that I liked all that
much for these purposes.)

Since I now have some kind of understanding of the concepts involved, I
wondered whether it would be easy for me to contribute by adding the
functionality to Vim--perhaps even to be available only when
'encoding=utf8', which would be better than nothing!

Could someone with a bit of experience with the Vim codebase and
development process give me some pointers/advice?

Ben.




Send instant messages to your online friends http://au.messenger.yahoo.com 

--~--~-~--~~~---~--~~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---