From: Xah <xahlee@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: is there a human readable way to display syntax table?
Date: Thu, 16 Oct 2008 14:21:38 -0700 (PDT) [thread overview]
Message-ID: <5e70cb60-bbe9-4e9f-8d37-5e8f2786d81b@42g2000pry.googlegroups.com> (raw)
In-Reply-To: mailman.885.1223828028.25473.help-gnu-emacs@gnu.org
Xah wrote:
«I'm mostly interested in seeing which of the ascii chars's classes,
in the standard-syntax-table, text-mode- syntaxt-table, or c-mode-
syntax-table.»
Nikolaj Schumacher wrote:
> (with-syntax-tablec-mode-syntax-table
> (let ((c 0))
> (while (< c ?~)
> (insert (format "%c: %c\n" c (char-syntaxc)))
> (incf c))))
Drew Adams wrote:
«`C-h s', which is `describe-syntax', shows the current syntax table
in human-readable form.»
Thanks guys.
When i write a new mode from the ground up (not using derived-mode or
generic mode), how do i go about defining the syntax table?
For example, i'm writing a mode for the LSL language, which uses a
sytax like C/Java.
So, i start by copying example from text-mode:
(defvar text-mode-syntax-table
(let ((st (make-syntax-table)))
(modify-syntax-entry ?\" ". " st)
(modify-syntax-entry ?\\ ". " st)
;; We add `p' so that M-c on 'hello' leads to 'Hello' rather than
'hello'.
(modify-syntax-entry ?' "w p" st)
st)
"Syntax table used while in `text-mode'.")
In my case, the LSL is basically ascii based lang. So, do i go thru
each printable ascii char, and add a modify-syntax-entry for it using
the above template?
Another question... i tried to study syntax table, which is a char
table, which is a specialized vector with extra things ... not so easy
to understand... but looking at the syntax table for text mode, it has
some 800 entries. Is a syntax table meant to cover all unicode char?
(am avoiding copying from c mode's syntax table for the moment so i
get more understanding by doing more from the basics... the cc-mode
source seems much complex to dig ...)
Xah
∑ http://xahlee.org/
☄
next prev parent reply other threads:[~2008-10-16 21:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-12 14:52 is there a human readable way to display syntax table? Xah
2008-10-12 16:13 ` Nikolaj Schumacher
2008-10-12 16:18 ` Drew Adams
[not found] ` <mailman.885.1223828028.25473.help-gnu-emacs@gnu.org>
2008-10-16 21:21 ` Xah [this message]
2008-10-17 13:50 ` Kevin Rodgers
[not found] ` <mailman.1336.1224251466.25473.help-gnu-emacs@gnu.org>
2008-10-17 18:36 ` Xah
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=5e70cb60-bbe9-4e9f-8d37-5e8f2786d81b@42g2000pry.googlegroups.com \
--to=xahlee@gmail.com \
--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.