Problems with integrating Emacs

45 views
Skip to first unread message

Mike

unread,
Sep 1, 2012, 1:38:34 PM9/1/12
to vimorg...@googlegroups.com

Dear Mr. Sitz and everyone else.

First off, thanks for a great plugin that nears almost a total conversion, if you will. I never quite realized the potential in this project (have been watching the github repo for some time) until I read the vimdoc that seems to be most update.

But there is something wrong with the Emacs integration here. Whether I run the daemon with `emacs --daemon` or interactively with `M-x server-start`, I can't eval my tables. Consider this minimal example:

| item | Qty | Price | Sum  |
|------+-----+-------+------|
| A    | 10  | 2300  | 4600 |
| B    | 1   | 3500  | 7000 |
| C    | 0   | 1000  | 3000 |
| M    | 0   | 3700  | 7400 |
#+TBLFM: $4=($2*$3)
 

With the (seemingly) correct g:org_command_for_emacsclient == 'emacsclient' trying to re-evaluate that table results in no such thing. The numbers stay the same.

Interestingly, if I launch the Emacs server interactively and watch it working, it will go and ask the user about re-reading the file that's modified. Not fit for a background process! Sometimes the `~/org-tbl-block.org` is left with incorrect information but most of the time, the data remains unmodified.

Now this looks an Emacs error to me. I think I saw some documentation mentioning something about modifying `.emacs` but no instructions found!

Both Emacses 23 and 24 (org 7.8.11) affected. Dot-emacs is empty for all intents and purposes.

Herbert Sitz

unread,
Sep 1, 2012, 8:33:59 PM9/1/12
to vimorg...@googlegroups.com
On Sat, Sep 1, 2012 at 10:38 AM, Mike <mr.p...@gmail.com> wrote:
>
> But there is something wrong with the Emacs integration here. Whether I run
> the daemon with `emacs --daemon` or interactively with `M-x server-start`, I
> can't eval my tables. Consider this minimal example:
>
> | item | Qty | Price | Sum |
> |------+-----+-------+------|
> | A | 10 | 2300 | 4600 |
> | B | 1 | 3500 | 7000 |
> | C | 0 | 1000 | 3000 |
> | M | 0 | 3700 | 7400 |
> #+TBLFM: $4=($2*$3)
>

Mike --

Not sure what problem you're seeing, but in investigating I did
discover a bug. Keep in mind that I have not investigated this on
Linux yet, only on my Windows install. Emacs server works slightly
different on Windows.

The table evaluation works fine if I have an emacsserver and
emacsclient running before issuing the eval command in VimOrganizer.
If I rely on the Vim command to autostart Emacs then it hangs up
somewhere in the process. I then need to quit Emacs to get control
back in Vim.

Not sure whether there are problems with any other VimOrganizer/Emacs
interaction on first invocation where Emacs server is started. I
think it works fine for all the export functions, so I'll have to
check how this table eval stuff is different.

>
> Interestingly, if I launch the Emacs server interactively and watch it
> working, it will go and ask the user about re-reading the file that's
> modified. Not fit for a background process! Sometimes the
> `~/org-tbl-block.org` is left with incorrect information but most of the
> time, the data remains unmodified.

It won't do this if things are set up correctly, at least if the table
eval (or code, for code blocks) is not causing an error within Emacs.
Your table evaluates fine in my setup so long as I make sure to have
the EmacsClient open in Windows (Windows doesn't need explicit command
to start the Emacs Server).

>
> Now this looks an Emacs error to me. I think I saw some documentation
> mentioning something about modifying `.emacs` but no instructions found!

There are some suggested functions to add to .emacs file but I think
they all have to do with minor on-the-fly format conversions, not with
table eval. I don't think those would be the issue. To make sure
this isn't problem you can find the code at :h
vimorg-orgmode-conversion in help docs.

Hope that helps. I will investigate problem I see with table eval
hanging when Emacs is not running prior to invoking the eval command.

Regards,

Herb

Mikael Puhakka

unread,
Sep 2, 2012, 3:39:09 AM9/2/12
to vimorg...@googlegroups.com
I think this might be silently failing. I killed the emacs server and
rerun any evaluation. Vim will happily tell me that calculations are
complete. This setup will not launch an emacs server for me; any
emacsclient runs from the command line result in failing.

The conversion scripts in .emacs didn't improve the situation.

I will be testing the eval routines myself but I'm not too skilled with
emacs. Thank you for helping me out.

Oh, for reminding me! Exporting to HTML works well; exporting to text
does not! When I do a text export, it grabs an old testing of mine (my
initial studies in org-mode some time ago) that is exported. The exports
aren't my primary issue here but perhaps it'll lead us to something.
Reply all
Reply to author
Forward
0 new messages