help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Insert appropriate line-end character (like ';' for C*)


From: David Hansen
Subject: Re: Insert appropriate line-end character (like ';' for C*)
Date: Thu, 12 Jun 2008 21:21:19 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux)

On Thu, 12 Jun 2008 11:30:05 -0700 (PDT) Josh <josh@dydxtech.com> wrote:

> So the various modes don' t include that information? It seems like
> they must, otherwise how would Emacs be able to indent things
> appropriately? In python-mode it's aware that a line ending in ':' is
> special, and so it automatically indents the following line(s),
> similarly it un-indents the lines following a 'return' statement. It's
> not doing this solely based on the presence of key terms such as 'if'
> and 'def' either (I tested); it's aware of ':' as an important
> character in python-mode at least.
>
> All I'm trying to figure out is if there's an easy way to determine,
> even if it's just for python-mode, what that special character is.

Of course every major-mode implementation somewhere has this information
stored but there is no standard way of doing this.  Emacs builtin
support for parsing languages is pretty low level and focused on lisp
(read about syntax tables in the manual).

All major modes come with additions to this low level parser (mostly a
bunch of regexps and good guess work, no real parser).  If python is
your only concern read the source.

David





reply via email to

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