From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Martin Stjernholm Newsgroups: gmane.emacs.devel Subject: Re: [kemenczy@rogers.com: cc-engine:c-guess-basic-syntax related problem in latest CVS] Date: Wed, 16 Jul 2003 23:13:23 +0200 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <5b4r1mp43w.fsf@lister.roxen.com> References: <5b1xx0tx2l.fsf@lister.roxen.com> <000501c34688$20902500$0701a8c0@rim.net> Reply-To: bug-cc-mode@gnu.org NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1058390024 21578 80.91.224.249 (16 Jul 2003 21:13:44 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 16 Jul 2003 21:13:44 +0000 (UTC) Cc: bug-cc-mode@gnu.org, rms@gnu.org, monnier@cs.yale.edu, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Wed Jul 16 23:13:42 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19ctao-0005bt-00 for ; Wed, 16 Jul 2003 23:13:42 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 19ctpC-0007A8-00 for ; Wed, 16 Jul 2003 23:28:34 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19ctbX-0008Oc-Uf for emacs-devel@quimby.gnus.org; Wed, 16 Jul 2003 17:14:27 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19ctbH-0007oj-HK for emacs-devel@gnu.org; Wed, 16 Jul 2003 17:14:11 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19ctav-0006Ys-VN for emacs-devel@gnu.org; Wed, 16 Jul 2003 17:13:50 -0400 Original-Received: from godzilla.roxen.com ([194.52.182.190] helo=mail.roxen.com) by monty-python.gnu.org with esmtp (Exim 4.20) id 19ctaf-0005LY-Ea; Wed, 16 Jul 2003 17:13:33 -0400 Original-Received: by mail.roxen.com (Postfix, from userid 52) id 395F299CF; Wed, 16 Jul 2003 23:13:29 +0200 (MEST) Original-Received: from lister.roxen.com (lister.roxen.com [194.52.182.147]) by mail.roxen.com (Postfix) with ESMTP id 030FB99CC; Wed, 16 Jul 2003 23:13:24 +0200 (MEST) Original-Received: from mast by lister.roxen.com with local (Exim 3.36 #1 (Debian)) id 19ctaV-0004Td-00; Wed, 16 Jul 2003 23:13:23 +0200 Original-To: "Zoltan Kemenczy" In-Reply-To: <000501c34688$20902500$0701a8c0@rim.net> ("Zoltan Kemenczy"'s message of "Wed, 9 Jul 2003 22:08:16 -0400") User-Agent: Gnus/5.090016 (Oort Gnus v0.16) Emacs/20.7 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:15640 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:15640 "Zoltan Kemenczy" wrote: > Getting syntax information on write-protected C++ buffers does work now... > (however, visiting a .java file now doesn't load java-mode?? :-( . Perhaps you haven't updated your loaddefs.el file lately? > Two "predicates" (there must be a better term for "getAttribute" > type methods?) I call them accessor functions. > I found useful to define (inside gud-find-class as local symbols) > are: > > (fset 'syntax-symbol (lambda (x) (car (car x)))) ; symbol of first > syntactic element > (fset 'syntax-point (lambda (x) (car (cdr (car x))))) ; point (integer) of > first syntactic element I find it more generic to make accessor functions for a single syntactic element and then treat the syntactic context as a normal list of them (i.e. no use defining accessors for the list itself). There are many cases where single elements are handled. /.../ > It's just common sense to have such predicates with the "objects", > so if you agree, redesign/name them for cc-engine, and I'll patch > gud-jdb accordingly... I've now added c-langelem-sym, c-langelem-pos, and c-langelem-2nd-pos (which makes use of the new extended information in some syntactic elements). (The naming scheme stems from the already existing c-langelem-col.)