emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [patch] better(?) indention for cdlatex-environment


From: Nicolas Goaziou
Subject: Re: [O] [patch] better(?) indention for cdlatex-environment
Date: Sun, 15 Feb 2015 10:52:58 +0100

Rasmus <address@hidden> writes:

> It's a very good idea!  On the top of my head there's two issues.
>
>  1. cdlatex-environment doesn't work with buffers, only files...¹ I think
>     it doesn't even work with (with-temp-file · ⋯) without saving the file
>     first.  Try:
>
>          (require 'cdlatex)
>          (require 'reftex)
>          (with-temp-buffer (cdlatex-environment "equation"))
>
> 2. if run from a temporary buffer, the refcounter would always be one.
>     Perhaps there would be a way to update it afterwards.

I see. Another idea:

  (let ((beg (point-marker))
        (end (copy-marker (point) t)))
    (cdlatex-environment "equation")
    (prog1 (delete-and-extract-region beg end)
      (set-marker beg nil)
      (set-marker end nil)))

If it is not the empty string, indent it and insert it again...


Regards,



reply via email to

[Prev in Thread] Current Thread [Next in Thread]