Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add inner mode for latex environments #17

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions poly-org.el
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,13 @@ Used in :switch-buffer-functions slot."
:protect-syntax nil
:protect-font-lock nil)

(define-auto-innermode poly-org-src-innermode
(define-innermode poly-org-root-innermode
:mode nil
:fallback-mode 'host
:head-mode 'host
:tail-mode 'host
:tail-mode 'host)

(define-auto-innermode poly-org-src-innermode poly-org-root-innermode
:head-matcher "^[ \t]*#\\+begin_src .*\n"
:tail-matcher "^[ \t]*#\\+end_src"
:mode-matcher #'poly-org-mode-src-matcher
Expand All @@ -78,10 +81,7 @@ Used in :switch-buffer-functions slot."
:body-indent-offset 'org-edit-src-content-indentation
:indent-offset 'org-edit-src-content-indentation)

(define-innermode poly-org-latex-innermode
:fallback-mode 'host
:head-mode 'host
:tail-mode 'host
(define-innermode poly-org-latex-innermode poly-org-root-innermode
:mode 'latex-mode
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am actually no longer sure about this change. It looks like there is little support from org for latex chunks so most of configuration options cannot be reused. Also, shouldn't head be of body type here?

Copy link
Author

@jethrokuan jethrokuan Jul 8, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the same fashion as src chunks, latex chunks are typically edited by entering the indirect buffer environment with C-c ', so I thought equivalent treatment would make sense.

most of configuration options cannot be reused

what kind of configuration options?

Also, shouldn't head be of body type here?

honestly not sure what each of them entail, but this had worked for me

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so I thought equivalent treatment would make sense.

I see. Ok. If latex is a first class environment in org then yes.

most of configuration options cannot be reused
what kind of configuration options?

Object's slots like head-mode, regexp etc. So it doesn't make much sense to inherit the latex from org src.

I will play with this as soon as I can. I am having limited computer access these weeks.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it doesn't make much sense to inherit the latex from org src.

I don't think I had made it inherit from the org-src ones.

I will play with this as soon as I can. I am having limited computer access these weeks.

np, take your time.

:head-matcher "^[ \t]*\\\\begin{.*}\n"
:tail-matcher "^[ \t]*\\\\end{.*}\n")
Expand Down