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/cc-langs.el


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

Index: emacs/lisp/progmodes/cc-langs.el
diff -c emacs/lisp/progmodes/cc-langs.el:1.19 
emacs/lisp/progmodes/cc-langs.el:1.20
*** emacs/lisp/progmodes/cc-langs.el:1.19       Sun Apr 21 20:35:36 2002
--- emacs/lisp/progmodes/cc-langs.el    Wed Dec  4 06:47:46 2002
***************
*** 44,51 ****
  (cc-require 'cc-defs)
  (cc-require 'cc-vars)
  
- (require 'cl)
- 
  
  ;; Some support functions that are used when the language specific
  ;; constants are built.  Since the constants are built during compile
--- 44,49 ----
***************
*** 78,83 ****
--- 76,88 ----
            (setq count (1+ count) start (match-end 0)))
          count))))
  
+   (defun c-delete-duplicates (list)
+     (let ((tail list))
+       (while tail
+       (setcdr tail (delete (car tail) (cdr tail)))
+       (setq tail (cdr tail)))
+       list))
+ 
    (defun c-make-keywords-re (adorn &rest lists)
      "Make a regexp that matches all the strings in all the lists.
  Duplicates in the lists are removed.  The regexp may contain zero or
***************
*** 85,102 ****
  one submatch which matches the whole keyword, and the regexp will also
  not match a prefix of any identifier.  Adorned regexps cannot be
  appended."
!     (setq lists (delete-duplicates (apply 'append (nconc lists '(nil)))
!                                  :test 'string-equal))
!     (if lists
!       (let ((re (c-regexp-opt lists)))
!         ;; Add our own grouping parenthesis around re instead of
!         ;; passing adorn to regexp-opt, since it in XEmacs makes the
!         ;; top level grouping "shy".
!         (if adorn
!             (concat "\\(" re "\\)\\>\\([^_]\\|$\\)")
!           re))
!       "\\<\\>"                                ; Matches nothing.
!       ))
    (put 'c-make-keywords-re 'lisp-indent-function 1)
    )
  
--- 90,107 ----
  one submatch which matches the whole keyword, and the regexp will also
  not match a prefix of any identifier.  Adorned regexps cannot be
  appended."
!     (let ((list (copy-sequence (apply 'append lists))))
!       (setq list (c-delete-duplicates list))
!       (if list
!         (let ((re (c-regexp-opt list)))
!           ;; Add our own grouping parenthesis around re instead of
!           ;; passing adorn to regexp-opt, since it in XEmacs makes the
!           ;; top level grouping "shy".
!           (if adorn
!               (concat "\\(" re "\\)\\>\\([^_]\\|$\\)")
!             re))
!       "\\<\\>"                                ; Matches nothing.
!       )))
    (put 'c-make-keywords-re 'lisp-indent-function 1)
    )
  
***************
*** 432,457 ****
  
  ;; All keywords as a list.
  (c-lang-defconst c-keywords
!   all (delete-duplicates (append (c-lang-var c-primitive-type-kwds)
!                                (c-lang-var c-specifier-kwds)
!                                (c-lang-var c-class-kwds)
!                                (c-lang-var c-other-decl-block-kwds)
!                                (c-lang-var c-block-decls-with-vars)
!                                (c-lang-var c-other-decl-kwds)
!                                (c-lang-var c-decl-spec-kwds)
!                                (c-lang-var c-protection-kwds)
!                                (c-lang-var c-block-stmt-1-kwds)
!                                (c-lang-var c-block-stmt-2-kwds)
!                                (c-lang-var c-simple-stmt-kwds)
!                                (c-lang-var c-asm-stmt-kwds)
!                                (c-lang-var c-label-kwds)
!                                (c-lang-var c-expr-kwds)
!                                (c-lang-var c-lambda-kwds)
!                                (c-lang-var c-inexpr-block-kwds)
!                                (c-lang-var c-inexpr-class-kwds)
!                                (c-lang-var c-bitfield-kwds)
!                                nil)
!                        :test 'string-equal))
  (c-lang-defvar c-keywords (c-lang-var c-keywords))
  
  ;; All keywords as an adorned regexp.
--- 437,462 ----
  
  ;; All keywords as a list.
  (c-lang-defconst c-keywords
!   all (c-delete-duplicates
!        (append (c-lang-var c-primitive-type-kwds)
!              (c-lang-var c-specifier-kwds)
!              (c-lang-var c-class-kwds)
!              (c-lang-var c-other-decl-block-kwds)
!              (c-lang-var c-block-decls-with-vars)
!              (c-lang-var c-other-decl-kwds)
!              (c-lang-var c-decl-spec-kwds)
!              (c-lang-var c-protection-kwds)
!              (c-lang-var c-block-stmt-1-kwds)
!              (c-lang-var c-block-stmt-2-kwds)
!              (c-lang-var c-simple-stmt-kwds)
!              (c-lang-var c-asm-stmt-kwds)
!              (c-lang-var c-label-kwds)
!              (c-lang-var c-expr-kwds)
!              (c-lang-var c-lambda-kwds)
!              (c-lang-var c-inexpr-block-kwds)
!              (c-lang-var c-inexpr-class-kwds)
!              (c-lang-var c-bitfield-kwds)
!              nil)))
  (c-lang-defvar c-keywords (c-lang-var c-keywords))
  
  ;; All keywords as an adorned regexp.




reply via email to

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