all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Rasmus <rasmus@gmx.us>
Cc: emacs-orgmode@gnu.org
Subject: Re: [patch] better(?) indention for cdlatex-environment
Date: Tue, 10 Feb 2015 23:35:26 +0100	[thread overview]
Message-ID: <87wq3pwg29.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <87386e0zuy.fsf@gmx.us> (rasmus@gmx.us's message of "Tue, 10 Feb 2015 12:28:53 +0100")

Hello,

Rasmus <rasmus@gmx.us> writes:

> Cdlatex environment inserted via org-cdlatex-environment-indent are pretty
> bad at getting the right indention.  Consider:
>
>     - concept :: a long description of concept |
>
> Where | is cursor.  When I call org-cdlatex-environment-indent, I expect 
>
>     - concept :: a long description of concept
>           \begin{equation}
>           |
>           \end{equation}
>
> But I get 
>
>     - concept :: a long description of concept
>     \begin{equation}
>     |
>     \end{equation}
>
> This is because it determines the indention after the element is inserted
> at column zero.  So the correct indention /is/ column zero but I wanted it
> to be part of the description.  IOW I want Org to use the correct
> indention of when the time when I call the command.
>
> Note that I can still get an environment at column zero by issuing the
> command here:
>
>     - concept :: a long description of concept
>     |
>
> This patch just fixes this for org-cdlatex-indent-environment only, but
> maybe it's more correct to fix it in org-indent-region?

`org-indent-region' is right here, so I don't see what should be fixed
there.

You can get real indentation by indenting a new line first. What about
the following?

  (defun org-cdlatex-environment-indent (&optional environment item)
    (org-return-indent)
    (beginning-of-line)
    (let ((ind (org-get-indentation)))
      (cdlatex-environment environment item)
      (save-excursion (forward-line -1) (org-indent-to-column ind))
      (save-excursion (forward-line 1) (org-indent-to-column ind))
      (org-indent-to-column ind)))


Regards,

-- 
Nicolas Goaziou

  parent reply	other threads:[~2015-02-10 22:34 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-10 11:28 [patch] better(?) indention for cdlatex-environment Rasmus
2015-02-10 12:27 ` Rasmus
2015-02-10 22:35 ` Nicolas Goaziou [this message]
2015-02-11 11:26   ` Rasmus
2015-02-11 21:39     ` Nicolas Goaziou
2015-02-11 23:40       ` Rasmus
2015-02-13 22:10         ` Nicolas Goaziou
2015-02-13 23:13           ` Rasmus
2015-02-14  0:29             ` Rasmus
2015-02-14 21:20               ` Nicolas Goaziou
2015-02-15  0:08                 ` Rasmus
2015-02-15  9:52                   ` Nicolas Goaziou
2015-02-17  0:41                     ` Rasmus
2015-02-17  8:51                       ` Nicolas Goaziou
2015-02-17 21:19                         ` Rasmus
2015-02-18  0:39                           ` Nicolas Goaziou
2015-02-18  1:06                             ` Rasmus
2015-02-19  0:22                             ` Rasmus
2015-02-19 23:11                               ` Rasmus
2015-02-19 23:23                                 ` Nicolas Goaziou
2015-02-19 23:32                                   ` Rasmus
2015-02-20  0:13                                     ` Nicolas Goaziou
2015-02-20  0:38                                       ` Rasmus
2015-02-20 10:16                                         ` Nicolas Goaziou
2015-02-20 10:35                                           ` Rasmus
2015-02-20 10:40                                             ` Nicolas Goaziou
2015-02-20 10:43                                               ` Rasmus
2015-02-20 10:49                                                 ` Nicolas Goaziou
2015-02-20 10:54                                                   ` Rasmus
2015-02-20 11:17                                                     ` Nicolas Goaziou
2015-02-20 10:50                                                 ` Rasmus
2015-02-14  1:10             ` Nicolas Goaziou

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

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

  git send-email \
    --in-reply-to=87wq3pwg29.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=rasmus@gmx.us \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.