[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [AUCTeX] emaxima environments ($, language-specific indentation)

From: Tamas Papp
Subject: Re: [AUCTeX] emaxima environments ($, language-specific indentation)
Date: Wed, 12 Mar 2014 13:55:27 +0100
User-agent: mu4e; emacs 24.3.1

On Wed, Mar 12 2014, Tassilo Horn <address@hidden> wrote:

> Tamas Papp <address@hidden> writes:
> Hi Tamas,
>> I have now managed to fix the indentation,
> Could you please share what you've done so that others can benefit from
> it?

This is my setup now, comes rather close to the functionality of
wxmaxima. The hook is for emaxima-mode, but that is a derivative of
latex-mode so I think it is relevant to this list.

--8<---------------cut here---------------start------------->8---
(defun customize-emaxima-buffer ()
  (setq emaxima-use-emaxima-indent t)
  (local-set-key (kbd "<S-return>") 'emaxima-update-single-cell)
  (local-set-key (kbd "<C-return>") 'emaxima-tex-update-single-cell)
  (local-set-key (kbd "C-c C-u C-l") 'maxima-send-line)
  (setq comment-indent-function 'comment-indent-default
        maxima-indent-style 'perhaps-smart)
  (add-to-list 'preview-default-preamble "\\PreviewEnvironment{maxima}" t))

(add-hook 'emaxima-mode-hook 'customize-emaxima-buffer)
--8<---------------cut here---------------end--------------->8---

> I guess the reason is that the value is already needed when initializing
> font-lock.  And the setting of `font-lock-set-defaults' and calling
> `font-latex-set-syntactic-keywords' is also important.

Thanks, this works fine. Out of curiosity, is there a way to
re-initialize font-lock with a mode hook? I can of course copy-paste the
Local variables section to each file I work with, but a more automated
solution would be nice, too.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]