From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Zoltan Kemenczy" Newsgroups: gmane.emacs.devel Subject: Re: gud.el - jdb support update to work with updated cc-mode Date: Sat, 13 Sep 2003 20:14:23 -0400 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <001001c37a55$26c15880$0701a8c0@rim.net> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1063498671 28882 80.91.224.253 (14 Sep 2003 00:17:51 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 14 Sep 2003 00:17:51 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sun Sep 14 02:17:49 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19yKaL-00010A-00 for ; Sun, 14 Sep 2003 02:17:49 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 19yKcI-000422-00 for ; Sun, 14 Sep 2003 02:19:50 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.22) id 19yKZc-0007j6-Fv for emacs-devel@quimby.gnus.org; Sat, 13 Sep 2003 20:17:04 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.22) id 19yKYw-0007iL-Vx for emacs-devel@gnu.org; Sat, 13 Sep 2003 20:16:22 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.22) id 19yKYu-0007hi-PB for emacs-devel@gnu.org; Sat, 13 Sep 2003 20:16:21 -0400 Original-Received: from [199.232.41.8] (helo=mx20.gnu.org) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.22) id 19yKYu-0007ZQ-Ii for emacs-devel@gnu.org; Sat, 13 Sep 2003 20:16:20 -0400 Original-Received: from [66.185.86.71] (helo=fep01-mail.bloor.is.net.cable.rogers.com) by mx20.gnu.org with esmtp (Exim 4.22) id 19yKX2-0003XD-Ez for emacs-devel@gnu.org; Sat, 13 Sep 2003 20:14:24 -0400 Original-Received: from zkemenczylt ([24.42.20.42]) by fep01-mail.bloor.is.net.cable.rogers.com (InterMail vM.5.01.05.12 201-253-122-126-112-20020820) with ESMTP id <20030914001413.YMVS83282.fep01-mail.bloor.is.net.cable.rogers.com@zkemenczylt> for ; Sat, 13 Sep 2003 20:14:13 -0400 Original-To: X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Authentication-Info: Submitted using SMTP AUTH LOGIN at fep01-mail.bloor.is.net.cable.rogers.com from [24.42.20.42] using ID at Sat, 13 Sep 2003 20:14:13 -0400 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:16386 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:16386 This is a smaller patch and more correct since it ignores whitespace differences relative to gud.el in CVS My apologies... Regards, Zoltan diff -w -u ~/b/emacs/emacs/lisp/progmodes/gud.el ~/local/lisp-cvs/gud.el --- /zoltan/b/emacs/emacs/lisp/progmodes/gud.el Mon Sep 1 11:45:35 2003 +++ /zoltan/local/lisp-cvs/gud.el Sat Sep 13 19:48:53 2003 @@ -2817,8 +2817,13 @@ (save-match-data (let ((cplist (append gud-jdb-sourcepath gud-jdb-classpath)) (fbuffer (get-file-buffer f)) - class-found) + syntax-symbol syntax-point class-found) (setq f (file-name-sans-extension (file-truename f))) + ;; Syntax-symbol returns the symbol of the *first* element + ;; in the syntactical analysis result list, syntax-point + ;; returns the buffer position of same + (fset 'syntax-symbol (lambda (x) (c-langelem-sym (car x)))) + (fset 'syntax-point (lambda (x) (c-langelem-pos (car x)))) ;; Search through classpath list for an entry that is ;; contained in f (while (and cplist (not class-found)) @@ -2841,17 +2846,17 @@ ;; with the 'topmost-intro symbol, there may be ;; nested classes... (while (not (eq 'topmost-intro - (car (car (c-guess-basic-syntax))))) + (syntax-symbol (c-guess-basic-syntax)))) ;; Check if the current position c-syntactic ;; analysis has 'inclass (setq syntax (c-guess-basic-syntax)) (while - (and (not (eq 'inclass (car (car syntax)))) + (and (not (eq 'inclass (syntax-symbol syntax))) (cdr syntax)) (setq syntax (cdr syntax))) - (if (eq 'inclass (car (car syntax))) + (if (eq 'inclass (syntax-symbol syntax)) (progn - (goto-char (cdr (car syntax))) + (goto-char (syntax-point syntax)) ;; Now we're at the beginning of a class ;; definition. Find class name (looking-at @@ -2860,9 +2865,9 @@ (append (list (match-string-no-properties 1)) nclass))) (setq syntax (c-guess-basic-syntax)) - (while (and (not (cdr (car syntax))) (cdr syntax)) + (while (and (not (syntax-point syntax)) (cdr syntax)) (setq syntax (cdr syntax))) - (goto-char (cdr (car syntax))) + (goto-char (syntax-point syntax)) )) (string-match (concat (car nclass) "$") class-found) (setq class-found