emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/progmodes/delphi.el


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/progmodes/delphi.el
Date: Fri, 04 Apr 2003 01:22:50 -0500

Index: emacs/lisp/progmodes/delphi.el
diff -c emacs/lisp/progmodes/delphi.el:3.8 emacs/lisp/progmodes/delphi.el:3.9
*** emacs/lisp/progmodes/delphi.el:3.8  Mon Dec  3 20:16:39 2001
--- emacs/lisp/progmodes/delphi.el      Tue Feb  4 08:24:34 2003
***************
*** 38,44 ****
  ;; (add-hook 'delphi-mode-hook 'turn-on-font-lock)
  
  ;; If font-lock is not loaded by default, you might have to do:
! ;; 
  ;; (autoload 'font-lock-mode "font-lock")
  ;; (autoload 'turn-on-font-lock "font-lock")
  ;; (setq font-lock-support-mode 'lazy-lock-mode)
--- 38,44 ----
  ;; (add-hook 'delphi-mode-hook 'turn-on-font-lock)
  
  ;; If font-lock is not loaded by default, you might have to do:
! ;;
  ;; (autoload 'font-lock-mode "font-lock")
  ;; (autoload 'turn-on-font-lock "font-lock")
  ;; (setq font-lock-support-mode 'lazy-lock-mode)
***************
*** 65,71 ****
  (provide 'delphi)
  
  (defconst delphi-version
!   (let ((revision "$Revision: 3.8 $"))
      (string-match ": \\([^ ]+\\)" revision)
      (match-string 1 revision))
    "Version of this delphi mode.")
--- 65,71 ----
  (provide 'delphi)
  
  (defconst delphi-version
!   (let ((revision "$Revision: 3.9 $"))
      (string-match ": \\([^ ]+\\)" revision)
      (match-string 1 revision))
    "Version of this delphi mode.")
***************
*** 187,193 ****
  (defconst delphi-directives
    '(absolute abstract assembler automated cdecl default dispid dynamic
      export external far forward index inline message name near nodefault
!     overload override pascal private protected public published read readonly 
      register reintroduce resident resourcestring safecall stdcall stored
      virtual write writeonly)
    "Delphi4 directives.")
--- 187,193 ----
  (defconst delphi-directives
    '(absolute abstract assembler automated cdecl default dispid dynamic
      export external far forward index inline message name near nodefault
!     overload override pascal private protected public published read readonly
      register reintroduce resident resourcestring safecall stdcall stored
      virtual write writeonly)
    "Delphi4 directives.")
***************
*** 198,206 ****
       and array as asm at begin case class const constructor contains
       destructor dispinterface div do downto else end except exports
       file finalization finally for function goto if implementation implements
!      in inherited initialization interface is label library mod nil not 
       of object on or out package packed procedure program property
!      raise record repeat requires result self set shl shr then threadvar 
       to try type unit uses until var while with xor
  
       ;; These routines should be keywords, if Borland had the balls.
--- 198,206 ----
       and array as asm at begin case class const constructor contains
       destructor dispinterface div do downto else end except exports
       file finalization finally for function goto if implementation implements
!      in inherited initialization interface is label library mod nil not
       of object on or out package packed procedure program property
!      raise record repeat requires result self set shl shr then threadvar
       to try type unit uses until var while with xor
  
       ;; These routines should be keywords, if Borland had the balls.
***************
*** 248,254 ****
  (defconst delphi-visibilities '(public private protected published automated)
    "Class visibilities.")
  
! (defconst delphi-block-statements 
    '(begin try case repeat initialization finalization asm)
    "Statements that contain multiple substatements.")
  
--- 248,254 ----
  (defconst delphi-visibilities '(public private protected published automated)
    "Class visibilities.")
  
! (defconst delphi-block-statements
    '(begin try case repeat initialization finalization asm)
    "Statements that contain multiple substatements.")
  
***************
*** 526,532 ****
                   ;; We have an end only if there is some string content (at
                   ;; least a starting delimiter).
                   (not (delphi-is-literal-end (1- p)))))
!                  
          ;; Special case: strings cannot span lines.
          (and (delphi-is kind delphi-strings) (eq ?\n (char-after (1- p)))))))
  
--- 526,532 ----
                   ;; We have an end only if there is some string content (at
                   ;; least a starting delimiter).
                   (not (delphi-is-literal-end (1- p)))))
! 
          ;; Special case: strings cannot span lines.
          (and (delphi-is kind delphi-strings) (eq ?\n (char-after (1- p)))))))
  
***************
*** 568,574 ****
             ;; We are completing an incomplete literal.
             (let ((kind (delphi-literal-kind (1- search-start))))
               (delphi-complete-literal kind limit)
!              (delphi-set-text-properties 
                search-start (point) (delphi-literal-text-properties kind))))
  
            ((re-search-forward
--- 568,574 ----
             ;; We are completing an incomplete literal.
             (let ((kind (delphi-literal-kind (1- search-start))))
               (delphi-complete-literal kind limit)
!              (delphi-set-text-properties
                search-start (point) (delphi-literal-text-properties kind))))
  
            ((re-search-forward
***************
*** 583,589 ****
                   (start (match-beginning 0)))
               (delphi-set-text-properties search-start start nil)
               (delphi-complete-literal kind limit)
!              (delphi-set-text-properties 
                start (point) (delphi-literal-text-properties kind))))
  
            ;; Nothing found. Mark it as a non-literal.
--- 583,589 ----
                   (start (match-beginning 0)))
               (delphi-set-text-properties search-start start nil)
               (delphi-complete-literal kind limit)
!              (delphi-set-text-properties
                start (point) (delphi-literal-text-properties kind))))
  
            ;; Nothing found. Mark it as a non-literal.
***************
*** 735,741 ****
        (while (< p to)
          ;; Color the token and move past it.
          (setq token (delphi-token-at p))
!         (add-text-properties 
           (delphi-token-start token) (delphi-token-end token)
           (list 'face (delphi-face-of (delphi-token-kind token)) 'lazy-lock t))
          (setq p (delphi-token-end token))
--- 735,741 ----
        (while (< p to)
          ;; Color the token and move past it.
          (setq token (delphi-token-at p))
!         (add-text-properties
           (delphi-token-start token) (delphi-token-end token)
           (list 'face (delphi-face-of (delphi-token-kind token)) 'lazy-lock t))
          (setq p (delphi-token-end token))
***************
*** 756,762 ****
         (delphi-progress-start)
         ;; Reparse at least from the token previous to the change to the end of
         ;; line after the change.
!        (delphi-parse-region-until-stable 
          (delphi-token-start (delphi-token-at (1- change-start)))
          (progn (goto-char change-end) (end-of-line) (point)))
         (delphi-progress-done)))))
--- 756,762 ----
         (delphi-progress-start)
         ;; Reparse at least from the token previous to the change to the end of
         ;; line after the change.
!        (delphi-parse-region-until-stable
          (delphi-token-start (delphi-token-at (1- change-start)))
          (progn (goto-char change-end) (end-of-line) (point)))
         (delphi-progress-done)))))
***************
*** 814,820 ****
      (catch 'done
        (while token
          (setq kind (delphi-token-kind token))
!         (cond 
           ;; Skip over ()/[] groups.
           ((eq 'close-group kind) (setq token (delphi-group-start token)))
  
--- 814,820 ----
      (catch 'done
        (while token
          (setq kind (delphi-token-kind token))
!         (cond
           ;; Skip over ()/[] groups.
           ((eq 'close-group kind) (setq token (delphi-group-start token)))
  
***************
*** 836,845 ****
      (catch 'done
        (while token
          (setq kind (delphi-token-kind token))
!         (cond 
           ((and (eq 'colon kind)
                 (delphi-is (delphi-token-kind last-token)
!                           `(,@delphi-block-statements 
                              ,@delphi-expr-statements)))
            ;; We hit a label followed by a statement. Indent to the statement.
            (throw 'done nil))
--- 836,845 ----
      (catch 'done
        (while token
          (setq kind (delphi-token-kind token))
!         (cond
           ((and (eq 'colon kind)
                 (delphi-is (delphi-token-kind last-token)
!                           `(,@delphi-block-statements
                              ,@delphi-expr-statements)))
            ;; We hit a label followed by a statement. Indent to the statement.
            (throw 'done nil))
***************
*** 916,922 ****
           ((delphi-composite-type-start token last-token)
            (throw 'done (if stop-on-class last-token token)))
           )
!         (unless (delphi-is token-kind delphi-whitespace) 
            (setq last-token token))
          (setq token (delphi-previous-token token)))
        ;; Start not found.
--- 916,922 ----
           ((delphi-composite-type-start token last-token)
            (throw 'done (if stop-on-class last-token token)))
           )
!         (unless (delphi-is token-kind delphi-whitespace)
            (setq last-token token))
          (setq token (delphi-previous-token token)))
        ;; Start not found.
***************
*** 1037,1043 ****
  
  (defun delphi-is-use-clause-end (at-token last-token last-colon from-kind)
    ;; True if we are after the end of a uses type clause.
!   (when (and last-token 
               (not last-colon)
               (eq 'comma (delphi-token-kind at-token))
               (eq 'semicolon from-kind))
--- 1037,1043 ----
  
  (defun delphi-is-use-clause-end (at-token last-token last-colon from-kind)
    ;; True if we are after the end of a uses type clause.
!   (when (and last-token
               (not last-colon)
               (eq 'comma (delphi-token-kind at-token))
               (eq 'semicolon from-kind))
***************
*** 1148,1154 ****
                     (delphi-line-indent-of token))))
  
           ;; Assembly sections always indent in from the asm keyword.
!          ((eq token-kind 'asm) 
            (throw 'done (delphi-stmt-line-indent-of token 
delphi-indent-level)))
  
           ;; An enclosing statement delimits a previous statement.
--- 1148,1154 ----
                     (delphi-line-indent-of token))))
  
           ;; Assembly sections always indent in from the asm keyword.
!          ((eq token-kind 'asm)
            (throw 'done (delphi-stmt-line-indent-of token 
delphi-indent-level)))
  
           ;; An enclosing statement delimits a previous statement.
***************
*** 1236,1242 ****
  
           ;; An enclosing ":" means a label.
           ((and (eq 'colon token-kind)
!                (delphi-is (delphi-token-kind section-token) 
                            delphi-block-statements)
                 (not last-terminator)
                 (not expr-delimited)
--- 1236,1242 ----
  
           ;; An enclosing ":" means a label.
           ((and (eq 'colon token-kind)
!                (delphi-is (delphi-token-kind section-token)
                            delphi-block-statements)
                 (not last-terminator)
                 (not expr-delimited)
***************
*** 1270,1276 ****
          (from-kind (delphi-token-kind from-token))
          (token-kind nil)
          (stmt-start nil)
!         (last-token nil)        
          (equals-encountered nil)
          (before-equals nil)
          (expr-delimited nil))
--- 1270,1276 ----
          (from-kind (delphi-token-kind from-token))
          (token-kind nil)
          (stmt-start nil)
!         (last-token nil)
          (equals-encountered nil)
          (before-equals nil)
          (expr-delimited nil))
***************
*** 1329,1338 ****
                   (if stmt-start
                       ;; We are not actually indenting to the case statement,
                       ;; but are within a label expression.
!                      (delphi-stmt-line-indent-of 
                        stmt-start delphi-indent-level)
                     ;; Indent from the case keyword.
!                    (delphi-stmt-line-indent-of 
                      token delphi-case-label-indent))))
  
           ;; Body expression statements are enclosing. Indent from the
--- 1329,1338 ----
                   (if stmt-start
                       ;; We are not actually indenting to the case statement,
                       ;; but are within a label expression.
!                      (delphi-stmt-line-indent-of
                        stmt-start delphi-indent-level)
                     ;; Indent from the case keyword.
!                    (delphi-stmt-line-indent-of
                      token delphi-case-label-indent))))
  
           ;; Body expression statements are enclosing. Indent from the
***************
*** 1340,1346 ****
           ;; it.
           ((delphi-is token-kind delphi-body-expr-statements)
            (throw 'done
!                  (delphi-stmt-line-indent-of 
                    (or stmt-start token) delphi-indent-level)))
  
           ;; An else statement is enclosing, but it doesn't have an expression.
--- 1340,1346 ----
           ;; it.
           ((delphi-is token-kind delphi-body-expr-statements)
            (throw 'done
!                  (delphi-stmt-line-indent-of
                    (or stmt-start token) delphi-indent-level)))
  
           ;; An else statement is enclosing, but it doesn't have an expression.
***************
*** 1388,1394 ****
                   ((+ (delphi-section-indent-of token) delphi-indent-level)))))
  
           ;; Assembly sections always indent in from the asm keyword.
!          ((eq token-kind 'asm) 
            (throw 'done (delphi-stmt-line-indent-of token 
delphi-indent-level)))
  
           ;; Stop at an enclosing statement and indent from it.
--- 1388,1394 ----
                   ((+ (delphi-section-indent-of token) delphi-indent-level)))))
  
           ;; Assembly sections always indent in from the asm keyword.
!          ((eq token-kind 'asm)
            (throw 'done (delphi-stmt-line-indent-of token 
delphi-indent-level)))
  
           ;; Stop at an enclosing statement and indent from it.
***************
*** 1426,1443 ****
             ;;          + 2;
             ;; which doesn't look right.
             ;;;; Align binary ops with the before token.
!            ;;((delphi-is from-kind delphi-binary-ops) 
             ;;(throw 'done (delphi-indent-of before-equals 0)))
  
             ;; Assignments (:=) we skip over to get a normal indent.
             ((eq (delphi-token-kind last-token) 'equals))
  
             ;; Otherwise indent in from the equals.
!            ((throw 'done 
                     (delphi-indent-of before-equals delphi-indent-level)))))
  
           ;; Remember any "=" we encounter if it has not already been 
processed.
!          ((eq token-kind 'equals) 
            (setq equals-encountered token
                  before-equals last-token))
           )
--- 1426,1443 ----
             ;;          + 2;
             ;; which doesn't look right.
             ;;;; Align binary ops with the before token.
!            ;;((delphi-is from-kind delphi-binary-ops)
             ;;(throw 'done (delphi-indent-of before-equals 0)))
  
             ;; Assignments (:=) we skip over to get a normal indent.
             ((eq (delphi-token-kind last-token) 'equals))
  
             ;; Otherwise indent in from the equals.
!            ((throw 'done
                     (delphi-indent-of before-equals delphi-indent-level)))))
  
           ;; Remember any "=" we encounter if it has not already been 
processed.
!          ((eq token-kind 'equals)
            (setq equals-encountered token
                  before-equals last-token))
           )
***************
*** 1473,1479 ****
  
                    ((delphi-is token-kind delphi-match-block-statements)
                     ;; Use the block's indentation.
!                    (let ((block-start 
                            (delphi-block-start token 'stop-on-class)))
                       (cond
                        ;; When trailing a body statement, indent to
--- 1473,1479 ----
  
                    ((delphi-is token-kind delphi-match-block-statements)
                     ;; Use the block's indentation.
!                    (let ((block-start
                            (delphi-block-start token 'stop-on-class)))
                       (cond
                        ;; When trailing a body statement, indent to




reply via email to

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