hsitz / VimOrganizer

VimOrganizer is partly a clone of Emacs' Org-mode, and partly a front end to Org-mode itself. Do Org in Vim.
http://vimeo.com/31531308
518 stars 67 forks source link

Error with emacs server export function. #26

Closed punassuming closed 9 years ago

punassuming commented 12 years ago

I am having an issue when trying to export a file to html using the emacs server. The server is set up fine, and emacs opens without a hitch, but it doesn't seem to find the file. If I look at the buffer listing in emacs using , I just see this line item.

thesis.org))) (progn :   0  Fundamental   f:/Documents/projects/_milestones/2012-thesis/(let ((org-export-babel-evaluate t)(org-confirm-babel-evaluate nil)(buf (find-file F:/Documents/projects/_milestones/2012-thesis/thesis.org))) (progn  ( org-export-as-html-and-open nil ) (set-buffer buf) (not-modified) (kill-this-buffer) )

One issue I can see, is that org-export-babel-evaluate doesn't exist, thought if I just run org-export-as-html, the conversion happens correcly

hsitz commented 12 years ago

On Wed, Feb 1, 2012 at 9:54 PM, Rich Alesi reply@reply.github.com wrote:

I am having an issue when trying to export a file to html using the emacs server.  The server is set up fine, and emacs opens without a hitch, but it doesn't seem to find the file.  If I look at the buffer listing in emacs using , I just see this line item.

   thesis.org))) (progn :   0  Fundamental       f:/Documents/projects/_milestones/2012-thesis/(let ((org-export-babel-evaluate t)(org-confirm-babel-evaluate nil)(buf (find-file F:/Documents/projects/_milestones/2012-thesis/thesis.org))) (progn  ( org-export-as-html-and-open nil ) (set-buffer buf) (not-modified) (kill-this-buffer) )

One issue I can see, is that org-export-babel-evaluate doesn't exist, thought if I just run org-export-as-html, the conversion happens correcly

Rich -- I'm not clear about some things.

  1. Does export to html work properly for you from VimOrganizer with other files? I.e., does it work at all? Looks like you're on Windows, have you tried with file in different locations, (e.g., c:)?
  2. Check the 'messages' buffer in emacs to see what it says after an attempted export. That output might be helpful.
  3. In last paragraph you say, ". . . if I just run org-export-as-html the conversion runs correctly". What do you mean here? Is it that if you load the file into emacs and do the export it works? Or something else?

-- Herb

hsitz commented 12 years ago

On Wed, Feb 1, 2012 at 9:54 PM, Rich Alesi <reply+i-3063706-

One issue I can see, is that org-export-babel-evaluate doesn't exist, thought if I just run org-export-as-html, the conversion happens correcly

Rich -- What do you mean when you say "org-export-babel-evaluate doesn't exist"? What version of Org is running on Emacs? You can check by opening org document and then on top menu choose 'Org', 'Documentation', 'Show Version'.

-- Herb

punassuming commented 12 years ago

Version 6.33x, from most recent windows release.

When I try to run 'org-export-babel-evaluate' in the M-x command prompt in emacs, I don't have that option.

hsitz commented 12 years ago

On Thu, Feb 2, 2012 at 10:12 AM, Rich Alesi reply@reply.github.com wrote:

Version 6.33x, from most recent windows release.

When I try to run 'org-export-babel-evaluate' in the M-x command prompt in emacs, I don't have that option.

org-export-babel-evaluate is a variable, not a function, so it wouldn't be available at M-x. You should be able to get a description of it using c-H v.

6.33 is, I think, over two years old (they're on 7.7 now), but I don't think that should be an issue.

You should get help viewing bad command by looking at the history in Emacs 'Messages' buffer after an attempted export.

Also, did you see my previous response asking if export from VimOrganizer work for any of your files at all, or whether this one in particular has a problem?

-- Herb

punassuming commented 12 years ago

Export works now.

My emacs is set up with :

let g:org_command_for_emacsclient = 'F:\Documents\utilities\emacs\bin\emacsclientw -a F:\Documents\utilities\emacs\bin\emacs'

As it gives me a server name not found error otherwise. Doing some debugging, I found that server mode couldn't start due to the unsafe server error. Once I fixed that and started a server prior to running the command, it exported. I cannot however get emacs to export without emacs already open and a server started. ( I don't even know if I should be able to).

hsitz commented 12 years ago

On Fri, Feb 3, 2012 at 1:29 PM, Rich Alesi reply@reply.github.com wrote:

Export works now.

My emacs is set up with :

   let g:org_command_for_emacsclient = 'F:\Documents\utilities\emacs\bin\emacsclientw -a F:\Documents\utilities\emacs\bin\emacs'

Rich --

Glad you got it running. So your only change to get things working was altering the variable above?

As it gives me a server name not found error otherwise.  Doing some debugging, I found that server mode couldn't start due to the unsafe server error.  Once I fixed that and started a server prior to running the command, it exported.  I cannot however get emacs to export without emacs already open and a server started. ( I don't even know if I should be able to).

Yes, it should automatically open an emacs server if one is not open already. That is the default for emacsclientw, so no '-a' switch should be required.

You should be able to test all this out at a Windows command prompt, does simple 'emacsclientw' command not open a new Emacs when no Emacs is running?

-- Herb

hsitz commented 12 years ago

On Fri, Feb 3, 2012 at 1:29 PM, Rich Alesi reply@reply.github.com wrote:

As it gives me a server name not found error otherwise.  Doing some debugging, I found that server mode couldn't start due to the unsafe server error.  Once I fixed that and started a server prior to running the command, it exported.  I cannot however get emacs to export without emacs already open and a server started. ( I don't even know if I should be able to).

A quick google check of that error makes me think it might be related to the directory where your emacsclientw and/or emacs.exe are located. A fix might be to reassign ownership of the directory to the user that is calling emacsclientw. . .

See http://stackoverflow.com/questions/885793/emacs-error-when-calling-server-start

punassuming commented 12 years ago

Thanks for that, emacs is really picky about ownership, isn't it? I have been trying to compile gvim on windows for an hour now just to use your patch. Is there anyway you can send me the binary, as long as its with python and rupy support.

Thanks, Rich On Feb 3, 2012 5:35 PM, "hsitz" < reply@reply.github.com> wrote:

On Fri, Feb 3, 2012 at 1:29 PM, Rich Alesi reply@reply.github.com wrote:

As it gives me a server name not found error otherwise. Doing some debugging, I found that server mode couldn't start due to the unsafe server error. Once I fixed that and started a server prior to running the command, it exported. I cannot however get emacs to export without emacs already open and a server started. ( I don't even know if I should be able to).

A quick google check of that error makes me think it might be related to the directory where your emacsclientw and/or emacs.exe are located. A fix might be to reassign ownership of the directory to the user that is calling emacsclientw. . .

See http://stackoverflow.com/questions/885793/emacs-error-when-calling-server-start


Reply to this email directly or view it on GitHub: https://github.com/hsitz/VimOrganizer/issues/26#issuecomment-3805754

hsitz commented 12 years ago

On Fri, Feb 3, 2012 at 2:51 PM, Rich Alesi reply@reply.github.com wrote:

Thanks for that, emacs is really picky about ownership, isn't it?

Not sure, I haven't run into any problems on Windows 7. I wonder whether your problem is related to having Emacs and/or your emacsclientw on an F: drive. You could try making a soft link to emacsclientw and putting it in your home directory, which is what I did with no problems. . . ( On Windows7 or Vista, the link can be created with Windows' MKLINK command line utility, e.g.,: mklink c:\users\george\emacsclientw c:\program files(x86)\Emacs\emacs\bin\emacsclientw.exe )

I have been trying to compile  gvim on windows for an hour now just to use your patch. Is there anyway you can send me the binary, as long as its with python and rupy support.

My exe does have python, ruby, perl, and lua support, but I don't think they'll work for you unless you have same language versions in same locations as I have on my machine. I can send you my exe to test out, just email me at my hesitz gmail account and I'll reply with the exe.

I found that compiling with MingW was relatively straightforward; I think the pre-prepared make file for Windows (in src directory) had ample instructions to follow. Also: http://vim.wikia.com/wiki/Build_Python-enabled_Vim_on_Windows_with_MinGW

-- Herb