[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: |
Sat, 14 Feb 2015 22:20:59 +0100 |
Rasmus <address@hidden> writes:
> This patch applies indentation unless at BOL in which case it stays at
> BOL. The rest is basically just to work with cdlatex and not insert too
> many blank lines. It's still quicky, but these quirks seem to be cdlatex
> quirks.
>
> I wonder, are there any commands to merge two elements buffer-undo-list
> into one? 'Cause ATM it takes two undo-presses to undo an environment
> insert via this command.
Another idea: insert the environment in a temp buffer. Check for buffer
emptiness. If there is something, insert it with appropriate
indentation.
> + (let ((non-blank-eolp
> + (save-excursion
> + (and (not (save-excursion
> + (skip-chars-backward " \t")
> + (bolp)))
> + (progn (skip-chars-forward " \t") (eolp)))))
> + (ind (if (bolp) 0
> + (save-excursion
> + (unless (and (bolp)
> + (save-excursion
> + (skip-chars-forward " \t")
> + (eolp)))
(bolp) is always nil, and so it (and (bolp) ...) so you can skip the
unless test and write (org-return-indent)
> + (org-return-indent))
> + (org-get-indentation)))))
> + ;; Skip forward to next bol to avoid extra newline from
> + ;; cdlatex-environment.
> + (when non-blank-eolp (forward-line 1) (beginning-of-line))
(forward-line 1), which is (forward-line) always put point at the
beginning of line, excepted at eob. As a consequence,
(beginning-of-line) should be removed here.
Regards,
- [O] [patch] better(?) indention for cdlatex-environment, Rasmus, 2015/02/10
- Re: [O] [patch] better(?) indention for cdlatex-environment, Rasmus, 2015/02/10
- Re: [O] [patch] better(?) indention for cdlatex-environment, Nicolas Goaziou, 2015/02/10
- Re: [O] [patch] better(?) indention for cdlatex-environment, Rasmus, 2015/02/11
- Re: [O] [patch] better(?) indention for cdlatex-environment, Nicolas Goaziou, 2015/02/11
- Re: [O] [patch] better(?) indention for cdlatex-environment, Rasmus, 2015/02/11
- Re: [O] [patch] better(?) indention for cdlatex-environment, Nicolas Goaziou, 2015/02/13
- Re: [O] [patch] better(?) indention for cdlatex-environment, Rasmus, 2015/02/13
- Re: [O] [patch] better(?) indention for cdlatex-environment, Rasmus, 2015/02/13
- Re: [O] [patch] better(?) indention for cdlatex-environment,
Nicolas Goaziou <=
- Re: [O] [patch] better(?) indention for cdlatex-environment, Rasmus, 2015/02/14
- Re: [O] [patch] better(?) indention for cdlatex-environment, Nicolas Goaziou, 2015/02/15
- Re: [O] [patch] better(?) indention for cdlatex-environment, Rasmus, 2015/02/16
- Re: [O] [patch] better(?) indention for cdlatex-environment, Nicolas Goaziou, 2015/02/17
- Re: [O] [patch] better(?) indention for cdlatex-environment, Rasmus, 2015/02/17
- Re: [O] [patch] better(?) indention for cdlatex-environment, Nicolas Goaziou, 2015/02/17
- Re: [O] [patch] better(?) indention for cdlatex-environment, Rasmus, 2015/02/17
- Re: [O] [patch] better(?) indention for cdlatex-environment, Rasmus, 2015/02/18
- Re: [O] [patch] better(?) indention for cdlatex-environment, Rasmus, 2015/02/19
- Re: [O] [patch] better(?) indention for cdlatex-environment, Nicolas Goaziou, 2015/02/19