From: David Hansen <david.hansen@gmx.net>
To: help-gnu-emacs@gnu.org
Subject: Re: Insert appropriate line-end character (like ';' for C*)
Date: Thu, 12 Jun 2008 21:21:19 +0200 [thread overview]
Message-ID: <877icuqx1s.fsf@localhorst.mine.nu> (raw)
In-Reply-To: 83af0c69-4c59-4b9f-96c2-b59fe6b0c048@2g2000hsn.googlegroups.com
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
next prev parent reply other threads:[~2008-06-12 19:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-10 22:11 Insert appropriate line-end character (like ';' for C*) Josh
2008-06-11 4:17 ` David Hansen
[not found] ` <mailman.13053.1213158202.18990.help-gnu-emacs@gnu.org>
2008-06-11 19:09 ` Josh
2008-06-11 20:20 ` Thien-Thi Nguyen
2008-06-11 20:58 ` David Hansen
2008-06-11 22:03 ` Jason Rumney
2008-06-12 18:30 ` Josh
2008-06-12 19:21 ` David Hansen [this message]
[not found] ` <mailman.13154.1213298609.18990.help-gnu-emacs@gnu.org>
2008-06-13 18:37 ` Josh
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877icuqx1s.fsf@localhorst.mine.nu \
--to=david.hansen@gmx.net \
--cc=help-gnu-emacs@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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.