emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Maik Beckmann <beckmann.maik@googlemail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Bug: cdlatex-tab in math-env isn't considered when inside of a list item. [7.7 (release_7.7.513.g2a5877)]
Date: Thu, 10 Nov 2011 12:09:23 +0100	[thread overview]
Message-ID: <CAL7baBxvABPDFvKLcfATFBhq0EK4MwxpZFUDJ7JsZn4FWyW_5Q@mail.gmail.com> (raw)
In-Reply-To: <CAL7baBwyQKOGzu70VYoAYySdwK=AjbDw+B0BtOVfuC3h_BWikg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 624 bytes --]

The attached patch what works for me.  It is however the result
of a short trail'n'error session, since I'm by no means an
experienced lisp/elisp programmer.

With the patch the behavior is slightly different than usual with
lists.  Before TAB cycles the list, the cursor jumps out of the
Latex fragment:

action:
 - $y = a_0 + a_{1[TAB]}$
  + foo

result:
 - $y = a_0 + a_1[CURSOR]$
  + foo

action:
 - $y = a_0 + a_1[TAB]$
  + foo

result:
 - $y = a_0 + a_1$[CURSOR]
  + foo

action:
 - $y = a_0 + a_1$[TAB]
  + foo

result: emacs mumbles "SUBTREE".

action:
 - $y = a_0 + a_1$[TAB]
  + foo

result:
 - $y = a_0 + a_1$...

[-- Attachment #2: 0001-When-in-a-Latex-fragment-try-cdlatex-tab-before-the-.patch --]
[-- Type: text/x-patch, Size: 1064 bytes --]

From 43ae3ff0393d8a43c02938ae621ae7a1c1d67b61 Mon Sep 17 00:00:00 2001
From: Maik Beckmann <beckmann.maik@googlemail.com>
Date: Thu, 10 Nov 2011 11:51:07 +0100
Subject: [PATCH] When in a Latex fragment, try cdlatex-tab before the trying
 to cyle the list.

---
 lisp/org.el |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 92ced78..6f81981 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -6143,6 +6143,8 @@ in special contexts.
 	     (or (bolp) (not (eq org-cycle-emulate-tab 'exc-hl-bol))))
 	(org-inlinetask-toggle-visibility))
 
+       ((and (org-inside-LaTeX-fragment-p) (org-try-cdlatex-tab)))
+
        ;; At an item/headline: delegate to `org-cycle-internal-local'.
        ((and (or (and org-cycle-include-plain-lists (org-at-item-p))
 		 (save-excursion (beginning-of-line 1)
@@ -6158,8 +6160,6 @@ in special contexts.
 
        ((org-try-structure-completion))
 
-       ((org-try-cdlatex-tab))
-
        ((run-hook-with-args-until-success
 	 'org-tab-before-tab-emulation-hook))
 
-- 
1.7.7.3


  reply	other threads:[~2011-11-10 11:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-10 10:36 Bug: cdlatex-tab in math-env isn't considered when inside of a list item. [7.7 (release_7.7.513.g2a5877)] Maik Beckmann
2011-11-10 11:09 ` Maik Beckmann [this message]
2011-11-12 14:08   ` Nicolas Goaziou
2011-11-13  7:20     ` Maik Beckmann
2011-11-13  9:40       ` Nicolas Goaziou
2011-11-13 10:45         ` Maik Beckmann
2011-11-13 11:34           ` Maik Beckmann

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.orgmode.org/

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

  git send-email \
    --in-reply-to=CAL7baBxvABPDFvKLcfATFBhq0EK4MwxpZFUDJ7JsZn4FWyW_5Q@mail.gmail.com \
    --to=beckmann.maik@googlemail.com \
    --cc=emacs-orgmode@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/org-mode.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).