From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [patch] better(?) indention for cdlatex-environment Date: Sun, 15 Feb 2015 10:52:58 +0100 Message-ID: <87lhjzo611.fsf@nicolasgoaziou.fr> References: <87386e0zuy.fsf@gmx.us> <87wq3pwg29.fsf@nicolasgoaziou.fr> <87lhk48z9x.fsf@gmx.us> <87fvacw2jv.fsf@nicolasgoaziou.fr> <87mw4kyq2e.fsf@gmx.us> <87fva9tqdj.fsf@nicolasgoaziou.fr> <873869h0cd.fsf@gmx.us> <87twypgwt5.fsf@gmx.us> <87pp9cnq9w.fsf@nicolasgoaziou.fr> <874mqoc9zf.fsf@gmx.us> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56269) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YMvrr-00037v-DM for emacs-orgmode@gnu.org; Sun, 15 Feb 2015 04:52:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YMvrm-0000n9-HL for emacs-orgmode@gnu.org; Sun, 15 Feb 2015 04:51:59 -0500 Received: from relay3-d.mail.gandi.net ([2001:4b98:c:538::195]:57808) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YMvrm-0000mc-CA for emacs-orgmode@gnu.org; Sun, 15 Feb 2015 04:51:54 -0500 In-Reply-To: <874mqoc9zf.fsf@gmx.us> (rasmus@gmx.us's message of "Sun, 15 Feb 2015 01:08:20 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Rasmus Cc: emacs-orgmode@gnu.org Rasmus 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...=EF=BB=BF= =C2=B9 I think > it doesn't even work with (with-temp-file =C2=B7 =E2=8B=AF) without s= aving 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,