From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Newsgroups: gmane.emacs.help Subject: Re: is there a human readable way to display syntax table? Date: Thu, 16 Oct 2008 14:21:38 -0700 (PDT) Organization: http://groups.google.com Message-ID: <5e70cb60-bbe9-4e9f-8d37-5e8f2786d81b@42g2000pry.googlegroups.com> References: <483eaf97-fc85-423c-8f05-ecd42a0c1507@t18g2000prt.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1224193246 29942 80.91.229.12 (16 Oct 2008 21:40:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 16 Oct 2008 21:40:46 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Oct 16 23:41:46 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KqabJ-0001cj-Qu for geh-help-gnu-emacs@m.gmane.org; Thu, 16 Oct 2008 23:41:46 +0200 Original-Received: from localhost ([127.0.0.1]:43095 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KqaaE-0000Bj-OR for geh-help-gnu-emacs@m.gmane.org; Thu, 16 Oct 2008 17:40:38 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!42g2000pry.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 55 Original-NNTP-Posting-Host: 24.6.185.159 Original-X-Trace: posting.google.com 1224192099 27779 127.0.0.1 (16 Oct 2008 21:21:39 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 16 Oct 2008 21:21:39 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 42g2000pry.googlegroups.com; posting-host=24.6.185.159; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.22, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:163511 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:58853 Archived-At: Xah wrote: =C2=ABI'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.=C2=BB 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: =C2=AB`C-h s', which is `describe-syntax', shows the current syntax table in human-readable form.=C2=BB 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 =E2=88=91 http://xahlee.org/ =E2=98=84