unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
To: emacs-devel@gnu.org
Subject: Re: Overlay mechanic improvements
Date: Tue, 30 Sep 2014 18:20:06 +0200	[thread overview]
Message-ID: <871tqtjd1l.fsf@fencepost.gnu.org> (raw)
In-Reply-To: 83sij9kx2r.fsf@gnu.org

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Rasmus <rasmus@gmx.us>
>> Date: Tue, 30 Sep 2014 12:35:08 +0200
>> 
>> > preview-latex does an excellent job, but much of its code is not at all
>> > related to the AUCTeX user interface or the LaTeX input language, and
>> > yet it will work for nothing but the AUCTeX user interface and the LaTeX
>> > input language.
>>  >
>> > And without generally available facilities to do that sort of work, it
>> > will remain a singularly useful application without peers.  Because it's
>> > far too much work to do a peer from scratch for similar needs.  It was
>> > supposed to make it easier for me to work on my PhD thesis, but I ended
>> > up doing it _instead_ of my PhD thesis.
>> >
>> > The main shortcoming of preview-latex in my book is that it stands out.
>> > It should be one of possibly many thin applications on top of rendering
>> > frameworks provided by Emacs proper.
>> 
>> I agree wholeheartedly.  Org has a similar mechanism as well, but it
>> *sucks* compared to preview-latex.  I tried to get
>> preview-latex working with Org (which uses LaTeX-syntax for math), but
>> it was non-trivial.  Thus, I don't interact much with preview-latex
>> these days, but I have very fond memories of using it.
>> 
>> If you ever decide to allocate time to generalize preview-latex and
>> have it shipped with Emacs-core I'd happily support that work!
>
> Feel free to expand on the problem(s) you hint on, because just by
> reading this exchange, I don't really understand what kind of
> facilities are missing in the core.  (I don't use preview-latex and
> probably never will.)

Since preview-latex is trivial to install via ELPA (as it's included in
AUCTeX), I am somewhat at a loss figuring out what point people are
trying to make by stating that they are not going to bother looking at
it, preferring me to type descriptions for hours.

There is a paper
<URL:https://www.tug.org/TUGboat/Articles/tb23-1/kastrup.pdf> sketching
the working mode of preview-latex some more.

But the problem is that static images/screenshots are not really much
help in seeing how the generation of images is actually integrated into
the interactive workflow.  The screenshots would not have looked
significantly different after the first prototype was running, so they
don't really do a lot more than give the information "Emacs can show
images".

I found some conference video Kaveh Bazargan made of me at
<URL:https://www.youtube.com/watch?v=avn7-aVpP9I#t=500>, picture quality
pretty flaky.  While it does not really say a lot about the Emacs parts
of the process, it is pretty obvious that the editing is not at all
disturbed by the images and that any images are regenerated
instantaneously without any obvious delays or interference with the
editing workflow.

That's probably 2007 or 2008, so the processor I use is probably
something like 600MHz.

Emacs does not offer any default support for rendering images on-demand
from source code in a buffer.  The pipelines that preview-latex can be
something like

buffer -> LaTeX -> Dvips -> Ghostscript -> PNG
buffer -> PDFLaTeX -> pdftodsc -> Ghostscript -> PNG
buffer -> LaTeX -> Dvipng -> PNG

It will also run several of those in parallel, like running
LaTeX->Dvipng but falling back to Dvips->Ghostscript for those images
which contain embedded PostScript.  The Ghostscript pipeline will render
the on-screen images first to make for better interactive response.  In
addition to the images, LaTeX produces geometry, baseline, source
location and various other info (for example, default font size in order
to match the rendering scale to the current default screen font) which
is parsed by Emacs and used for integrating the resulting images in the
right place and scale into the originating buffer.

So there are prioritized rendering pipelines and information side paths
that deliver information crucial for tying the image stream back into
the proper buffer locations, with proper scale and baseline.

There is other stuff like being able to paste text plus images into MIME
mails (with the obvious loss of baseline and other formatting
information, but for display math it is somewhat helpful), and desktop
mode saving and restoring the images associated with a buffer.

All of that is not specific to LaTeX, and Emacs does not really provide
anything helpful for creating that kind of facility apart from the
display feature itself and the possibility to run processes and process
filters.

-- 
David Kastrup




  reply	other threads:[~2014-09-30 16:20 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-19 14:59 Overlay mechanic improvements Vladimir Kazanov
2014-09-19 17:22 ` Stefan Monnier
2014-09-20 13:19   ` Richard Stallman
2014-09-20 13:37     ` David Kastrup
2014-09-21 13:35       ` Richard Stallman
2014-09-21 13:52         ` David Kastrup
2014-09-21 21:48           ` Richard Stallman
2014-09-21 22:06             ` David Kastrup
2014-09-22 23:11               ` Richard Stallman
2014-09-22 23:50                 ` David Kastrup
2014-09-23 19:15                   ` Richard Stallman
2014-09-21 16:07         ` Stefan Monnier
2014-09-21 16:14           ` David Kastrup
2014-09-21 21:48             ` Richard Stallman
2014-09-21 22:19               ` David Kastrup
2014-09-23 19:16                 ` Richard Stallman
2014-09-23 19:27                   ` David Kastrup
2014-09-28 23:24                     ` Richard Stallman
2014-09-29  5:45                       ` David Kastrup
2014-09-29 20:48                         ` Richard Stallman
2014-09-30  1:21                           ` Stephen J. Turnbull
2014-09-30  8:43                             ` David Kastrup
2014-09-30 10:35                               ` Rasmus
2014-09-30 14:22                                 ` Eli Zaretskii
2014-09-30 16:20                                   ` David Kastrup [this message]
2014-09-30 16:35                                     ` Eli Zaretskii
2014-09-30 14:32                                 ` Stefan Monnier
2014-10-02 16:12                                 ` Uwe Brauer
2014-09-30 19:23                             ` Richard Stallman
2014-10-01  3:38                               ` Stephen J. Turnbull
2014-10-01 12:53                                 ` Richard Stallman
2014-10-01 13:11                                   ` David Kastrup
2014-10-02  1:26                                   ` Stephen J. Turnbull
2014-09-30  5:52                           ` David Kastrup
2014-10-06 19:14                             ` Richard Stallman
2014-10-06 21:02                               ` David Kastrup
2014-09-21 16:56           ` Eli Zaretskii
2014-09-21 18:42             ` Stefan Monnier
2014-09-21 18:58               ` Eli Zaretskii
2014-09-21 20:12                 ` Stefan Monnier
2014-09-21 21:48           ` Richard Stallman
2014-09-22  0:31             ` Stefan Monnier
2014-09-22 23:11               ` Richard Stallman
2014-09-20 15:56     ` Eli Zaretskii
2014-09-20 19:49     ` Stefan Monnier
2014-09-21 13:36       ` Richard Stallman
2014-09-19 18:03 ` Richard Stallman
2014-09-20  8:08   ` Vladimir Kazanov
2014-09-20 13:21     ` Richard Stallman
2014-09-20 16:28       ` Stephen Leake
2014-09-20 13:21     ` Tokenizing Richard Stallman
2014-09-20 16:24       ` Tokenizing Stephen Leake
2014-09-20 16:40         ` Tokenizing Vladimir Kazanov
2014-09-20 20:16           ` Tokenizing Eric Ludlam
2014-09-20 20:35             ` Tokenizing Vladimir Kazanov
2014-09-21 15:13             ` parsing (was tokenizing) Stephen Leake
2014-09-20 16:36       ` Tokenizing Vladimir Kazanov
2014-09-20 19:55         ` Tokenizing Stefan Monnier
2014-09-21 15:35           ` Tokenizing Stephen Leake
2014-09-21 16:43             ` Tokenizing Stefan Monnier
2014-09-22 14:05               ` Tokenizing Stephen Leake
2014-09-21 13:35         ` Tokenizing Richard Stallman
2014-09-21 14:24           ` Tokenizing Vladimir Kazanov
2014-09-21 15:32         ` Tokenizing Stephen Leake
2014-09-21 16:42           ` Tokenizing Stefan Monnier
2014-09-21 18:55           ` Tokenizing Vladimir Kazanov
2014-09-21 22:01             ` Tokenizing Daniel Colascione
2014-09-22 10:21               ` Tokenizing Vladimir Kazanov
2014-09-22 13:55                 ` Tokenizing Daniel Colascione
2014-09-22 14:02               ` Tokenizing Stephen Leake
2014-09-22 14:14                 ` Tokenizing Daniel Colascione
2014-09-22 13:15             ` Tokenizing Stephen Leake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871tqtjd1l.fsf@fencepost.gnu.org \
    --to=dak@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).