[Top][All Lists]

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

Re: Wrapping code in a try/except

From: Andrea Crotti
Subject: Re: Wrapping code in a try/except
Date: Fri, 19 Nov 2010 21:50:46 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (darwin)

Andreas Röhler <address@hidden> writes:

>  it's not automatically
>> indented in the rest of the C++ code...
> Write a function based on `indent-region' with reasonable defaults -- 
> function-beginnning-pos, point.
> Make it run with an idle-timer like fontifying does.
> Could be a feature request if not existing already.

Well in theory something like that would be perfect reading what those
things should do:

--8<---------------cut here---------------start------------->8---
(defun re-indent-buffer ()
  "reindent the whole buffer"
  (indent-region yas/snippet-beg yas/snippet-end))

(add-hook 'yas/after-exit-snippet-hook 're-indent-buffer)
--8<---------------cut here---------------end--------------->8---

in practice I guess there are some problems since now I have to force
the exit of the snippet instead, so it doens't work at all...

reply via email to

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