From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: don@donarmstrong.com (Emacs bug Tracking System) Newsgroups: gmane.emacs.bugs Subject: bug#259: marked as done (delphi-mode does not properly format interface definitions) Date: Mon, 1 Sep 2008 10:35:07 -0700 Message-ID: References: <8763pf6ajf.fsf@cyd.mit.edu> <482DB340.3050405@slowcomputing.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----------=_1220290507-7045-0" X-Trace: ger.gmane.org 1220291300 6836 80.91.229.12 (1 Sep 2008 17:48:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 1 Sep 2008 17:48:20 +0000 (UTC) To: Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 01 19:49:14 2008 Return-path: Envelope-to: geb-bug-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 1KaDW5-0000md-0x for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Sep 2008 19:48:41 +0200 Original-Received: from localhost ([127.0.0.1]:60753 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KaDV5-00006n-Ny for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Sep 2008 13:47:39 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KaDV1-00006B-3E for bug-gnu-emacs@gnu.org; Mon, 01 Sep 2008 13:47:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KaDV0-00005y-Go for bug-gnu-emacs@gnu.org; Mon, 01 Sep 2008 13:47:34 -0400 Original-Received: from [199.232.76.173] (port=60425 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KaDV0-00005v-CJ for bug-gnu-emacs@gnu.org; Mon, 01 Sep 2008 13:47:34 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:53255) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KaDUz-0002ga-HO for bug-gnu-emacs@gnu.org; Mon, 01 Sep 2008 13:47:34 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m81HlUHB011542; Mon, 1 Sep 2008 10:47:31 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m81HZ7MS007106; Mon, 1 Sep 2008 10:35:07 -0700 X-Mailer: MIME-tools 5.420 (Entity 5.420) X-Loop: don@donarmstrong.com X-Emacs-PR-Message: closed 259 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: patch X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:19971 Archived-At: This is a multi-part message in MIME format... ------------=_1220290507-7045-0 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Your message dated Mon, 01 Sep 2008 13:28:04 -0400 with message-id <8763pf6ajf.fsf@cyd.mit.edu> and subject line Re: Delphi mode has caused the Emacs bug report #259, regarding delphi-mode does not properly format interface definitions to be marked as done. This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what this message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact don@donarmstrong.com immediately.) --=20 259: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=3D259 Emacs Bug Tracking System Contact don@donarmstrong.com with problems ------------=_1220290507-7045-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-5.0 required=4.0 tests=BAYES_00,MURPHY_DRUGS_REL8, RCVD_IN_DNSWL_LOW autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 16 May 2008 16:16:19 +0000 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m4GGGBn3025406 for ; Fri, 16 May 2008 09:16:13 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jx2bL-0008B3-AE for bug-gnu-emacs@gnu.org; Fri, 16 May 2008 12:16:11 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jx2bJ-00088f-Gs for bug-gnu-emacs@gnu.org; Fri, 16 May 2008 12:16:10 -0400 Received: from [199.232.76.173] (port=50484 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jx2bJ-00088X-6J for bug-gnu-emacs@gnu.org; Fri, 16 May 2008 12:16:09 -0400 Received: from sd-green-bigip-81.dreamhost.com ([208.97.132.81]:59400 helo=postalmail-a5.g.dreamhost.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Jx2bH-0000jW-Td for bug-gnu-emacs@gnu.org; Fri, 16 May 2008 12:16:08 -0400 Received: from [192.168.30.235] (unknown [24.244.216.58]) by postalmail-a5.g.dreamhost.com (Postfix) with ESMTP id 56036BF2A9 for ; Fri, 16 May 2008 09:16:02 -0700 (PDT) Message-ID: <482DB340.3050405@slowcomputing.org> Date: Fri, 16 May 2008 12:16:00 -0400 From: Simon South User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: bug-gnu-emacs@gnu.org Subject: delphi-mode does not properly format interface definitions Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 delphi-mode doesn't properly indent interface definition, things like this: type IHelloWorld = interface(IInvokable) ['{D613A992-AB12-0978-80D1-02B40DF72551}'] function HelloWorld: String; stdcall; end; This is because it doesn't distinguish between the "interface" keyword used as a unit separator (i.e., as opposed to "implementation") and used like a class declaration, as above. As a result, delphi-mode will incorrectly indent the above code this way: type IHelloWorld = interface(IInvokable) ['{D613A992-AB12-0978-80D1-02B40DF72551}'] function HelloWorld: String; stdcall; end; I've taken a stab at updating delphi.el to distinguish between these cases and support "dispinterface" properly as well (patch below) but I don't understand the existing code well enough yet to finish it. (I suspect more changes need to be made to the delphi-enclosing-indent-of function.) Perhaps someone more familiar with this sort of thing could help me complete it? In GNU Emacs 22.1.1 (i386-mingw-nt5.1.2600) of 2007-06-02 on RELEASE Windowing system distributor `Microsoft Corp.', version 5.1.2600 configured using `configure --with-gcc (3.4) --cflags -Ic:/gnuwin32/include' *** delphi.el.orig Thu May 15 17:57:29 2008 --- delphi.el Fri May 16 12:07:37 2008 *************** *** 262,271 **** (defconst delphi-decl-sections '(type const var label resourcestring) "Denotes the start of a declaration section.") (defconst delphi-class-types '(class object) "Class types.") ! (defconst delphi-composite-types `(,@delphi-class-types record) "Types that contain declarations within them.") (defconst delphi-unit-sections --- 262,275 ---- (defconst delphi-decl-sections '(type const var label resourcestring) "Denotes the start of a declaration section.") + (defconst delphi-interface-types '(dispinterface interface) + "Interface types.") + (defconst delphi-class-types '(class object) "Class types.") ! (defconst delphi-composite-types ! `(,@delphi-class-types ,@delphi-interface-types record) "Types that contain declarations within them.") (defconst delphi-unit-sections *************** *** 859,866 **** (delphi-stmt-line-indent-of token delphi-indent-level)))) (defun delphi-composite-type-start (token last-token) ! ;; Returns true (actually the last-token) if the pair equals (= class) or (= ! ;; record), and nil otherwise. (if (and (eq 'equals (delphi-token-kind token)) (delphi-is (delphi-token-kind last-token) delphi-composite-types)) last-token)) --- 863,870 ---- (delphi-stmt-line-indent-of token delphi-indent-level)))) (defun delphi-composite-type-start (token last-token) ! ;; Returns true (actually the last-token) if the pair equals (= class), (= ! ;; interface), or (= record), and nil otherwise. (if (and (eq 'equals (delphi-token-kind token)) (delphi-is (delphi-token-kind last-token) delphi-composite-types)) last-token)) *************** *** 1252,1258 **** (throw 'done (delphi-line-indent-of token 0))) ;; Unit statements mean we indent right to the left. ! ((delphi-is token-kind delphi-unit-statements) (throw 'done 0)) ) (unless (delphi-is token-kind delphi-whitespace) (setq last-token token)) --- 1256,1264 ---- (throw 'done (delphi-line-indent-of token 0))) ;; Unit statements mean we indent right to the left. ! ((and (delphi-is token-kind delphi-unit-statements) ! (not (delphi-composite-type-start token last-token))) ! (throw 'done 0)) ) (unless (delphi-is token-kind delphi-whitespace) (setq last-token token)) *************** *** 1351,1357 **** delphi-indent-level))) ;; In unit sections we indent right to the left. ! ((delphi-is token-kind delphi-unit-sections) (throw 'done 0)) ;; A previous terminator means we can stop. ((delphi-is token-kind delphi-previous-terminators) --- 1357,1365 ---- delphi-indent-level))) ;; In unit sections we indent right to the left. ! ((and (delphi-is token-kind delphi-unit-sections) ! (not (delphi-is token-kind delphi-interface-types))) ! (throw 'done 0)) ;; A previous terminator means we can stop. ((delphi-is token-kind delphi-previous-terminators) *************** *** 1457,1463 **** ;; Indent to the matching start ( or [. (delphi-indent-of (delphi-group-start token))) ! ((delphi-is token-kind delphi-unit-statements) 0) ((delphi-is token-kind delphi-comments) ;; In a comment. --- 1465,1475 ---- ;; Indent to the matching start ( or [. (delphi-indent-of (delphi-group-start token))) ! ((and (delphi-is token-kind delphi-unit-statements) ! (not ! (delphi-is token-kind delphi-interface-types))) ! 1) ! 0) ((delphi-is token-kind delphi-comments) ;; In a comment. ------------=_1220290507-7045-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-3.7 required=4.0 tests=AWL,BAYES_00, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 259-done) by emacsbugs.donarmstrong.com; 1 Sep 2008 17:25:51 +0000 Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m81HPmBA004732 for <259-done@emacsbugs.donarmstrong.com>; Mon, 1 Sep 2008 10:25:49 -0700 Received: by cyd.mit.edu (Postfix, from userid 1000) id 76F5F57E337; Mon, 1 Sep 2008 13:28:04 -0400 (EDT) To: Simon South Cc: 259-done@emacsbugs.donarmstrong.com Subject: Re: Delphi mode References: <87hc91jni1.fsf@cyd.mit.edu> <48BC1118.9030300@slowcomputing.org> From: Chong Yidong Date: Mon, 01 Sep 2008 13:28:04 -0400 In-Reply-To: <48BC1118.9030300@slowcomputing.org> (Simon South's message of "Mon\, 01 Sep 2008 11\:58\:16 -0400") Message-ID: <8763pf6ajf.fsf@cyd.mit.edu> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Simon South writes: > Chong Yidong wrote: >> I didn't receive a reply from you previously, so maybe it got lost. >> Your copyright assignment for Emacs changes has arrived; could you send >> me the updated patch to delphi mode, so that I can check it into CVS? > > Very sorry Chong, this slipped off my radar the first time > around. Here's the patch, against the source in CVS this morning. Checked in. Thanks. ------------=_1220290507-7045-0--