When using Carbon Emacs (v22) from an external application (ex. Unity 3D) files sent to Carbon Emacs would jump to the line number requested by the external application (ie. double click on an 开发者_运维技巧error message editor selected in preferences is started with file at error line number). For some reason the new Cocoa Emacs (v23) no longer does this. Instead it simply opens the file, but does not jump to the line number requested by the external application.
Not sure what command line Unity 3D was using to fire up Carbon Emacs correctly for you, but it looks like you can open a file at a given position in Emacs 23 using the following:
emacsclient -c +4:3 FILE1
where 4 is the line number, and 3 is the column number. Note that the emacsclient you execute should be the one matching your emacs; under OS X, you'll find a /usr/bin/emacsclient
, but you should really be executing /Applications/Emacs.app/Contents/MacOS/bin/emacsclient
instead.
You can also use a small helper application to make Emacs respond to emacs:// URLs containing line and column args. I wrote about it here.
精彩评论