Emacs client integration failure,

78 views
Skip to first unread message

rakesh uv

unread,
Dec 5, 2011, 3:11:07 PM12/5/11
to VimOrganizer
herbs,
I am kind of stuck with emacsclient, i try to create a
table and get the sum of the values in the table
i got a error from emacs clients describing the absense of server file
and name of alternate editor(EMACS_SERVERFILE and ALTERNATE_EDITOR
variable missing)
please help !!, i doubt if you have missing something in the
installation instructions

Herbert Sitz

unread,
Dec 5, 2011, 4:18:48 PM12/5/11
to vimorg...@googlegroups.com
What operating system are you on?

So you're starting emacs manually and issuing the <alt-x>server-start command?

If emacs is started and you've issued server-start command, then you should be able to go to terminal command line and open a new emacs window with:  emacsclient.  Does that work for you?

With error you're getting from VimOrganizer it sounds like the emacs server is not running or some error on emacs side.  So to troubleshoot just take VimOrganizer out of equation and get it so that you can start up your emacs server, then open a new file directly from command line using emacsclient.  Here is the emacswiki page for that:
http://www.gnu.org/software/emacs/manual/html_node/emacs/Invoking-emacsclient.html

Regards,

Herb



rakesh uv

unread,
Dec 6, 2011, 12:22:37 AM12/6/11
to VimOrganizer
herbs,
I am working on windows operating system,
i tried to start emacs(i added (server-start) to .emacs) and run it as
server and was also able to succesfully open the emacsclient
Later i tried with VI and i was able to feel the communication between
the emacs server and client(Though dont have enough evidence to
confirm it)
But i cant see the change in result
my table looks like this
| 1 | 2 | 3 | 4 | =$4/2 |
| 3 | 4 | 5 | 6 | =$4/2 |
| | | | | |

I am just playing around , i might be wrong in syntax.
Thanks for the help


On Dec 6, 2:18 am, Herbert Sitz <hes...@gmail.com> wrote:

> Here is the emacswiki page for that:http://www.gnu.org/software/emacs/manual/html_node/emacs/Invoking-ema...
>
> Regards,
>
> Herb

Herbert Sitz

unread,
Dec 6, 2011, 12:35:13 AM12/6/11
to vimorg...@googlegroups.com
On Mon, Dec 5, 2011 at 9:22 PM, rakesh uv <uvra...@gmail.com> wrote:
herbs,
           I am working on windows operating system,
i tried to start emacs(i added (server-start) to .emacs) and run it as
server and was also able to succesfully open the emacsclient
Later i tried with VI and i was able to feel the communication between
the emacs server and client(Though dont have enough evidence to
confirm it)
But i cant see the change in result
my table looks like this
| 1 | 2 | 3 | 4 | =$4/2 |
| 3 | 4 | 5 | 6 | =$4/2 |
|   |   |   |   |       |

I am just playing around , i might be wrong in syntax.
Thanks for the help


Rakesh -- If you're on Windows there is no need to start emacs manually.  The tricky part is setting things up so emacsclientw can be called on the command line from any directory without including a space in a path leading to emacsclientw. 

What version of Windows are you using?

I described the fixes for this in the help at :h vimorg-emacs-setup (and I've included relevant portion below).  You must do one of these two things:  (1) Use mklink utility to create a softlink to emacsclientw executable, or (2) alter the path variable so it searches the appropriate directory to find emacsclientw.exe that is part of the emacs installation.  Have you done one of those two things?  If you have you should be able to start emacs (from scratch, with no previously existing emacs running) using the command (1) c:\users\your_name\emacsclientw.exe  or (2) just emacsclientw.exe .

-- Herb

Relevant portion from help is below:
-------------------------------------------------
a.  On WINDOWS.  The variable, g:org_command_for_emacsclient, must be
assigned in your vimrc file with a command that will open an emacs client
on your system.  On Windows the associated exe file is emacsclientw.exe
in Emacs' bin directory.  By default Emacs is installed with
a path that includes spaces in a directory name (viz., '/program files/). 
The complex command that VimOrganizer constructs to call
Emacs won't work if the command invoking Emacs itself
includes a space.  There are two ways to work around this: 1. Create a
"symbolic link" to the Emacs client executable that doesn't have a space and
include that link as value of g:org_command_for_emacs, e.g.,

     let g:org_command_for_emacsclient = c:\users\george\emacsclientw

On Windows7 or Vista, the link can be created with Windows' MKLINK command line utility:

     mklink c:\users\george\emacsclientw c:\program files(x86)\Emacs\emacs\bin\emacsclientw.exe

Alternatively, rather than create a symbolic link having a path with no
spaces, a user can add the directory to the environment's path variable, so
that the emacsclient can be invoked simply by issuing the command
'emacsclientw', without including any element of its path.  In that case you
would include this assignment in your vimrc:

     let g:org_command_for_emacsclient = emacsclientw.exe


rakesh uv

unread,
Dec 7, 2011, 1:41:21 PM12/7/11
to VimOrganizer
herbs!!, I looked into the org.vim and i found a suspicious statement
at line num 6637
exe start . ',' . end . w! ~/org-tbl-block.org'


the meaning of ~ shall be differnt for emacs and for vim(in linux it
shall not be a problem but in vim it might be)

by looking into the code i guess you are making a temperory buffer
which containing the table and then passing it to emacs
and then reading the updated buffer.

i have doubt at two situation
->weather emacs saves the buffer and kill it
->if the buffer is modified saved and killed, does vim able to
read it back correctly.

I strongly doubt the "~", i was able to see the result on emacs
simulataneouly by modify the "~", but still there is some problem
which
fails reading the result into vim, i suppose you can fix it in seconds

On Dec 6, 10:35 am, Herbert Sitz <hes...@gmail.com> wrote:

Herbert Sitz

unread,
Dec 7, 2011, 2:15:14 PM12/7/11
to vimorg...@googlegroups.com
On Wed, Dec 7, 2011 at 10:41 AM, rakesh uv <uvra...@gmail.com> wrote:

i have doubt at two situation
      ->weather emacs saves the buffer and kill it
      ->if the buffer is modified saved and killed, does vim able to
read it back correctly.

I strongly doubt the "~", i was able to see the result on emacs
simulataneouly by modify the "~", but still there is some problem
which
fails reading the result into vim, i suppose you can fix it in seconds


Rakesh --

I'm pretty sure your problem is with the Emacs connection.  Easiest way as I described before is to just work at Windows command line to confirm that you can issue an emacsclientw command that opens Emacs and which has no space in the command.  To do that you have to use one of the two methods I described.

Once you have the emacs end set up, and put the command into g:org_command_for_emacs_client, then you can test in VimOrganizer. Best way to test is not with tables, but with exporting to html.  If you can get a good export to html then you know Emacs integration is working.

All of the filename stuff and temporary file stuff is designed to work on both Windows and Linux, the '~' is used internally by VimOrganizer.

Also, the reformatting of tables that you see has nothing to do with Emacs; VimOrganizer does some of that itself.  That's why I say best way to test is with exporting to html.

What is the value you are setting in your vimrc for g:org_command_for_emacs_client?

First thing to test is whether issuing that command from Windows command line will open an Emacs window.  Does it?

-- Herb

Herbert Sitz

unread,
Dec 7, 2011, 2:17:29 PM12/7/11
to vimorg...@googlegroups.com
On Wed, Dec 7, 2011 at 11:15 AM, Herbert Sitz <hes...@gmail.com> wrote:
What is the value you are setting in your vimrc for g:org_command_for_emacs_client?

First thing to test is whether issuing that command from Windows command line will open an Emacs window.  Does it?

-- Herb

Sorry, that should have been:

"What is the value you are setting in your vimrc for g:org_command_for_emacsclient ?

-- Herb

rakesh uv

unread,
Dec 8, 2011, 1:42:11 AM12/8/11
to VimOrganizer
herbs
IT WORKS GOOD :-), there was two mistakes

1)I was not setting the ALTERNATE_EDITOR env variable, so starting the
emacs server and then cleint.
2)When i work in my company the $HOME is different its h:\ and at my
home its C:\doccument and settings\rakuv.
I dont know what was the exact problem, but i copied the plugin
again , and set the environment variable and things are working
I would be comming back soon asking for more help

Herbert Sitz

unread,
Dec 8, 2011, 2:20:41 AM12/8/11
to vimorg...@googlegroups.com
On Wed, Dec 7, 2011 at 10:42 PM, rakesh uv <uvra...@gmail.com> wrote:
herbs
              IT WORKS GOOD :-), there was two mistakes

Good to hear.
 
1)I was not setting the ALTERNATE_EDITOR env variable, so starting the
emacs server and then cleint.
2)When i work in my company the $HOME is different its h:\  and at my
home its C:\doccument and settings\rakuv.
  I dont know what was the exact problem, but i copied the plugin
again , and set the environment variable and things are working
  I would be comming back soon asking for more help

I'm not sure why either of those environment variables would be causing a problem.  What value(s) are you using for g:org_command_for_emacsclient?

A couple other things:

1.  The emacs server setup works pretty well, but if there is an error on the emacs side you obviously won't get the right thing to happen in VimOrganizer.  Also, if there's an error in Emacs it will usually leave the document open in Emacs, which creates problems when you try to re-run things.  For me this happened especially often when I was evaluating tables and sending a table to Emacs that had bad formulas in it.  So just be aware if things seem to be not working that you should open up Emacs to see if it has a document open.  If there is a document open in Emacs, then quit that buffer in Emacs without saving it before you go back and resend more commands from VimOrganizer.

2.  I have patched Vim executables for Windows that make highlighting of folded levels much better.  If you haven't already patched yours let me know what version of Vim you're using and I'll send you the executable to substitute in for your current one.

Regards,

Herb


 

rakesh uv

unread,
Dec 8, 2011, 9:25:49 AM12/8/11
to VimOrganizer
herbs !! this is my org_command_for_emacsclient
and i am using the _vimrc file you provide with your plugin(though i
have my orignal _vimrc which sources it )
let g:org_command_for_emacsclient = 'D:\ruv\bin\emacs\bin
\emacsclientw.exe'
ya sure you can send me the patched one for now, but if you have any
links or information
which would help me to do the patching stuff myself in future, would
be more nice.

though i tried finding the patch specific to the mentioned problem,
but i was not able to figure the right patch


On Dec 8, 12:20 pm, Herbert Sitz <hes...@gmail.com> wrote:

Reply all
Reply to author
Forward
0 new messages