bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#260: marked as done (delphi-mode does not properly format interface


From: Emacs bug Tracking System
Subject: bug#260: marked as done (delphi-mode does not properly format interface definitions)
Date: Sat, 17 May 2008 21:20:04 -0700

Your message dated Sun, 18 May 2008 00:11:07 -0400
with message-id <jwvprrkl0am.fsf-monnier+emacsbugreports@gnu.org>
and subject line Close
has caused the Emacs bug report #260,
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.)


-- 
260: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=260
Emacs Bug Tracking System
Contact don@donarmstrong.com with problems
--- Begin Message --- Subject: Re: delphi-mode does not properly format interface definitions Date: Fri, 16 May 2008 12:33:23 -0400 User-agent: Thunderbird 2.0.0.14 (Windows/20080421) A bug snuck through in my original patch. I've pasted a fixed version below.

What the patch does is make delphi-mode indent by default after the "interface" keyword. This works fine for interface definitions and actually works fairly well overall, since the keywords that typically follow "interface" used in the other sense (like "uses" and "type") cancel the indentation and give the intended formatting. However, it fails when "interface" is used as a unit separator and followed by "function" or "procedure", for instance.


*** delphi.el.orig      Thu May 15 17:57:29 2008
--- delphi.el   Fri May 16 12:19:25 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,1474 ----
                     ;; 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)))
!                    0)

                    ((delphi-is token-kind delphi-comments)
                     ;; In a comment.




--- End Message ---
--- Begin Message --- Subject: Close Date: Sun, 18 May 2008 00:11:07 -0400 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)
Duplicate of 259


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]