Live data from Hacker News

Emacs as the Ultimate LaTeX Editor

piotrkazmierczak.com

21–30 of 41 posts

Re: Emacs as the Ultimate LaTeX Editor

#21
post #17
post #15

Earlier quoted context omitted.

Uh, Emacs has asynchronous IO, and it works fine. http://www.gnu.org/software/emacs/manual/html_node/elisp/Asy...

It has support for AIO, as had vim for quite a while, but it's not pervasive in the standard library and the ecosystem. Both editors have way too many plugins that block the UI needlessly while you're typing (autocompletion, syntax checking etc).

It's quite more popular than you think. `M-x term` is an example. It's a full-blown terminal emulator in Emacs that runs entirely in another process. Here is another example of async grep/ack/ag: http://tuhdo.github.io/helm-projectile.html#sec-9 . As you can see, Emacs gets line by line results from grep/ack/ag without blocking and gives you new results and you type.

Or Emacs's fantastic support for communicating with REPLs in many interpreted languages.

You can execute any shell command asynchronously while doing other things inside Emacs. You can even compile with beautiful output, in terminal: http://tuhdo.github.io/static/c-ide/compilation-compile.gif

Or built-in GDB integration, also asynchronous: http://tuhdo.github.io/static/c-ide/gdb-many-windows.gif.

Another GDB screenshot: https://flic.kr/p/6FW7Q7.

And Emacs officially supports asynchronous IO, while in Vim it's a hack from Vim Script.

Re: Emacs as the Ultimate LaTeX Editor

#23

I switched to vim years ago for everything else, but I still use emacs specifically for auctex. I have yet to find a vim equivalent nearly as convenient. In particular, C-c C-c as a do what I mean compiler (checking timestamps to figure out whether to run LaTeX, BibTeX, etc, as well as C-c C-e to insert an environment, and alt-enter to insert a newline and \item.

Have you tried looking at VIM-LaTeX (http://vim-latex.sourceforge.net)? It does exactly what you described and is just as customisable as auctex.

For example: ll will compile your document, multiple times if necessary, and show you warnings/errors in a new window, letting you hit enter on each to jump to the line. Lots of helpers for inserting environments, items, packages, too!

But if you're used Emacs just for auctex, more power to you for harnessing the power of two awesome editors!

Re: Emacs as the Ultimate LaTeX Editor

#25
post #19

Earlier quoted context omitted.

My main gripe with yasnippet is that its feature list is pretty lackluster compared to some advanced vim snippet plugins like xptemplate.[1] xptemplate has a bazillion features, and yasnippet is primitive in comparison. Just a simple example is that in xptemplate (and probably any respectable snippet plugin in vim) you can type a part of a snippet name, hit TAB, and it will expand the snippet whose partial name you t…

> Just a simple example is that in xptemplate (and probably any respectable snippet plugin in vim) you can type a part of a snippet name, hit TAB, and it will expand the snippet whose partial name you typed (assuming there's no exact match). In yasnippet, you have to type out the full snippet name before it can be expanded. This is pretty annoying, especially for long snippet names. Yes, you can do that as well. See…

I was hoping someone would say that was possible. Thanks, I'll play around with the available yas-prompt-functions.

As for SRecode, that looks interesting but its documentation is impenetrable. Someone seriously needs to write a bunch of tutorials for that thing. Otherwise, I can't really tell if it can do what xptemplate is capable of or not.

I found some comments from SRecode's author suggesting that it's intended for different uses from yasnippet:

  "Thus, the audience for yasnippet and SRecode is quite different.
  Of course you could do yasnippet like things with SRecode if someone
  took the time to improve the field-editing feature in SRecode, but
  that has not been my focus."[1]
[1] - http://emacs-fu.blogspot.com/2010/09/interview-with-eric-lud...

Re: Emacs as the Ultimate LaTeX Editor

#26

I switched to vim years ago for everything else, but I still use emacs specifically for auctex. I have yet to find a vim equivalent nearly as convenient. In particular, C-c C-c as a do what I mean compiler (checking timestamps to figure out whether to run LaTeX, BibTeX, etc, as well as C-c C-e to insert an environment, and alt-enter to insert a newline and \item.

I just use snippets (via xptemplate) to do LaTeX editing in vim. For running LaTeX, BibTeX, pdftex, etc, I use LatexMk.[1]

I would be interested to hear what AucTEX provides that the above combination can't.

[1] - http://www.emacswiki.org/emacs/LatexMk

Re: Emacs as the Ultimate LaTeX Editor

#27
post #15
post #14

Earlier quoted context omitted.

Neovim has a good chance to become the best editor. They are taking a really hard stance against all the cruft in Vim and have some really great features already implemented. I'm especially excited about their goal of reimplementing all IO with libuv. The lack of proper asynchronous IO has been a sore point in vim and emacs for a long, long time.

Uh, Emacs has asynchronous IO, and it works fine. http://www.gnu.org/software/emacs/manual/html_node/elisp/Asy...

Perry Metzger talks a bit about the problems of emacs blocking starting at the 34'39" mark in his "The Editor of a Lifetime" talk[1] for the NYC Emacs Meetup. Not that his points are new, but this is just one of the first things that sprang to mind when I heard your "it works fine" claim. Here are some excerpts:

  "Threading.  This has been an irritant for me for years.  Emacs
  blocks all windows when you're doing computation in any window.
  It's an operating system, but not enough of an operating system.
  I myself will run three instances of Emacs to get around this.
  I'm slurping in my email and I can't do something at the same time
  because it's off in space slurping in my email.  It's going off and
  doing some extended computation and I can't go in another window and
  do anything else at the same time. ... If it's doing extended
  computation and a lot of file IO and talking to the network, it
  blocks you.  There's not more than one thread there."
There's also this[2] discussion of lack of threading in Emacs on the Emacs Wiki.

[1] - https://www.youtube.com/watch?v=VADudzQGvU8

[2] - http://www.emacswiki.org/emacs/NoThreading

Re: Emacs as the Ultimate LaTeX Editor

#29

I switched to vim years ago for everything else, but I still use emacs specifically for auctex. I have yet to find a vim equivalent nearly as convenient. In particular, C-c C-c as a do what I mean compiler (checking timestamps to figure out whether to run LaTeX, BibTeX, etc, as well as C-c C-e to insert an environment, and alt-enter to insert a newline and \item.

I just use snippets (via xptemplate) to do LaTeX editing in vim. For running LaTeX, BibTeX, pdftex, etc, I use LatexMk.[1] I would be interested to hear what AucTEX provides that the above combination can't. [1] - http://www.emacswiki.org/emacs/LatexMk

Navigation and label handling. M-j lets you jump to a section, C-( inserts a uniquely numbered \lab and C-) gives a menu for inserting a \ref to an existing label.

(These may not be standard bindings - my .emacs is a horrible mess of legacy code dating back to a pre-git world.)

Re: Emacs as the Ultimate LaTeX Editor

#30
post #19

Earlier quoted context omitted.

> Just a simple example is that in xptemplate (and probably any respectable snippet plugin in vim) you can type a part of a snippet name, hit TAB, and it will expand the snippet whose partial name you typed (assuming there's no exact match). In yasnippet, you have to type out the full snippet name before it can be expanded. This is pretty annoying, especially for long snippet names. Yes, you can do that as well. See…

I was hoping someone would say that was possible. Thanks, I'll play around with the available yas-prompt-functions. As for SRecode, that looks interesting but its documentation is impenetrable. Someone seriously needs to write a bunch of tutorials for that thing. Otherwise, I can't really tell if it can do what xptemplate is capable of or not. I found some comments from SRecode's author suggesting that it's intended…

I agree Srecode needs to improve its documentation. It took me a while to learn to use it by reading the actual templates written that come with CEDET. I may write a tutorial for it at some point. But not now.

You can have a look at a sample template: https://github.com/emacsmirror/cedet/blob/f72ebbc52785013280... . Srt file has syntax highlighting in Emacs.

Post reply on HN