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-mode.el


From: Martin Stjernholm
Subject: [Emacs-diffs] Changes to emacs/lisp/progmodes/cc-mode.el
Date: Sun, 22 May 2005 20:04:02 -0400

Index: emacs/lisp/progmodes/cc-mode.el
diff -c emacs/lisp/progmodes/cc-mode.el:1.40 
emacs/lisp/progmodes/cc-mode.el:1.41
*** emacs/lisp/progmodes/cc-mode.el:1.40        Tue May  3 06:45:08 2005
--- emacs/lisp/progmodes/cc-mode.el     Mon May 23 00:03:59 2005
***************
*** 24,32 ****
  ;; GNU General Public License for more details.
  
  ;; You should have received a copy of the GNU General Public License
! ;; along with GNU Emacs; see the file COPYING.  If not, write to
! ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
! ;; Boston, MA 02111-1307, USA.
  
  ;;; Commentary:
  
--- 24,32 ----
  ;; GNU General Public License for more details.
  
  ;; You should have received a copy of the GNU General Public License
! ;; along with this program; see the file COPYING.  If not, write to
! ;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
! ;; Boston, MA 02110-1301, USA.
  
  ;;; Commentary:
  
***************
*** 91,100 ****
  (cc-require 'cc-align)
  (cc-require 'cc-menus)
  
! ;; SILENCE the compiler.
  (cc-bytecomp-defvar comment-line-break-function) ; (X)Emacs 20+
  (cc-bytecomp-defvar adaptive-fill-first-line-regexp) ; Emacs 20+
  (cc-bytecomp-defun set-keymap-parents)        ; XEmacs
  
  ;; We set these variables during mode init, yet we don't require
  ;; font-lock.
--- 91,102 ----
  (cc-require 'cc-align)
  (cc-require 'cc-menus)
  
! ;; Silence the compiler.
  (cc-bytecomp-defvar comment-line-break-function) ; (X)Emacs 20+
  (cc-bytecomp-defvar adaptive-fill-first-line-regexp) ; Emacs 20+
  (cc-bytecomp-defun set-keymap-parents)        ; XEmacs
+ (cc-bytecomp-defun run-mode-hooks)    ; Emacs 21.1+
+ (cc-bytecomp-obsolete-fun make-local-hook) ; Marked obsolete in Emacs 21.1.
  
  ;; We set these variables during mode init, yet we don't require
  ;; font-lock.
***************
*** 201,212 ****
  
  (defun c-make-inherited-keymap ()
    (let ((map (make-sparse-keymap)))
      (cond
       ;; XEmacs
!      ((fboundp 'set-keymap-parents)
        (set-keymap-parents map c-mode-base-map))
       ;; Emacs
!      ((fboundp 'set-keymap-parent)
        (set-keymap-parent map c-mode-base-map))
       ;; incompatible
       (t (error "CC Mode is incompatible with this version of Emacs")))
--- 203,217 ----
  
  (defun c-make-inherited-keymap ()
    (let ((map (make-sparse-keymap)))
+     ;; Necessary to use `cc-bytecomp-fboundp' below since this
+     ;; function is called from top-level forms that are evaluated
+     ;; while cc-bytecomp is active when one does M-x eval-buffer.
      (cond
       ;; XEmacs
!      ((cc-bytecomp-fboundp 'set-keymap-parents)
        (set-keymap-parents map c-mode-base-map))
       ;; Emacs
!      ((cc-bytecomp-fboundp 'set-keymap-parent)
        (set-keymap-parent map c-mode-base-map))
       ;; incompatible
       (t (error "CC Mode is incompatible with this version of Emacs")))
***************
*** 587,592 ****
--- 592,604 ----
  
  (add-hook 'hack-local-variables-hook 'c-postprocess-file-styles)
  
+ (defmacro c-run-mode-hooks (&rest hooks)
+   ;; Emacs 21.1 has introduced a system with delayed mode hooks that
+   ;; require the use of the new function `run-mode-hooks'.
+   (if (cc-bytecomp-fboundp 'run-mode-hooks)
+       `(run-mode-hooks ,@hooks)
+     `(progn ,@(mapcar (lambda (hook) `(run-hooks ,hook)) hooks))))
+ 
  
  ;; Support for C
  
***************
*** 667,673 ****
    (c-common-init 'c-mode)
    (easy-menu-add c-c-menu)
    (cc-imenu-init cc-imenu-c-generic-expression)
!   (run-mode-hooks 'c-mode-common-hook 'c-mode-hook)
    (c-update-modeline))
  
  
--- 679,685 ----
    (c-common-init 'c-mode)
    (easy-menu-add c-c-menu)
    (cc-imenu-init cc-imenu-c-generic-expression)
!   (c-run-mode-hooks 'c-mode-common-hook 'c-mode-hook)
    (c-update-modeline))
  
  
***************
*** 730,736 ****
    (c-common-init 'c++-mode)
    (easy-menu-add c-c++-menu)
    (cc-imenu-init cc-imenu-c++-generic-expression)
!   (run-mode-hooks 'c-mode-common-hook 'c++-mode-hook)
    (c-update-modeline))
  
  
--- 742,748 ----
    (c-common-init 'c++-mode)
    (easy-menu-add c-c++-menu)
    (cc-imenu-init cc-imenu-c++-generic-expression)
!   (c-run-mode-hooks 'c-mode-common-hook 'c++-mode-hook)
    (c-update-modeline))
  
  
***************
*** 794,800 ****
    (c-common-init 'objc-mode)
    (easy-menu-add c-objc-menu)
    (cc-imenu-init nil 'cc-imenu-objc-function)
!   (run-mode-hooks 'c-mode-common-hook 'objc-mode-hook)
    (c-update-modeline))
  
  
--- 806,812 ----
    (c-common-init 'objc-mode)
    (easy-menu-add c-objc-menu)
    (cc-imenu-init nil 'cc-imenu-objc-function)
!   (c-run-mode-hooks 'c-mode-common-hook 'objc-mode-hook)
    (c-update-modeline))
  
  
***************
*** 864,870 ****
    (c-common-init 'java-mode)
    (easy-menu-add c-java-menu)
    (cc-imenu-init cc-imenu-java-generic-expression)
!   (run-mode-hooks 'c-mode-common-hook 'java-mode-hook)
    (c-update-modeline))
  
  
--- 876,882 ----
    (c-common-init 'java-mode)
    (easy-menu-add c-java-menu)
    (cc-imenu-init cc-imenu-java-generic-expression)
!   (c-run-mode-hooks 'c-mode-common-hook 'java-mode-hook)
    (c-update-modeline))
  
  
***************
*** 922,928 ****
    (c-common-init 'idl-mode)
    (easy-menu-add c-idl-menu)
    ;;(cc-imenu-init cc-imenu-idl-generic-expression) ;TODO
!   (run-mode-hooks 'c-mode-common-hook 'idl-mode-hook)
    (c-update-modeline))
  
  
--- 934,940 ----
    (c-common-init 'idl-mode)
    (easy-menu-add c-idl-menu)
    ;;(cc-imenu-init cc-imenu-idl-generic-expression) ;TODO
!   (c-run-mode-hooks 'c-mode-common-hook 'idl-mode-hook)
    (c-update-modeline))
  
  
***************
*** 984,990 ****
    (c-common-init 'pike-mode)
    (easy-menu-add c-pike-menu)
    ;;(cc-imenu-init cc-imenu-pike-generic-expression) ;TODO
!   (run-mode-hooks 'c-mode-common-hook 'pike-mode-hook)
    (c-update-modeline))
  
  
--- 996,1002 ----
    (c-common-init 'pike-mode)
    (easy-menu-add c-pike-menu)
    ;;(cc-imenu-init cc-imenu-pike-generic-expression) ;TODO
!   (c-run-mode-hooks 'c-mode-common-hook 'pike-mode-hook)
    (c-update-modeline))
  
  
***************
*** 1076,1082 ****
      ;; in cc-engine.el, just before (defun c-fast-in-literal ...
      (defalias 'c-in-literal 'c-slow-in-literal)
  
!     (run-mode-hooks 'c-mode-common-hook 'awk-mode-hook)
      (c-update-modeline))
  ) ;; closes the (if (not (memq 'syntax-properties c-emacs-features))
  
--- 1088,1094 ----
      ;; in cc-engine.el, just before (defun c-fast-in-literal ...
      (defalias 'c-in-literal 'c-slow-in-literal)
  
!     (c-run-mode-hooks 'c-mode-common-hook 'awk-mode-hook)
      (c-update-modeline))
  ) ;; closes the (if (not (memq 'syntax-properties c-emacs-features))
  




reply via email to

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