]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/cwarn.el
Merge from emacs-24; up to 2014-06-02T14:17:07Z!michael.albinus@gmx.de
[gnu-emacs] / lisp / progmodes / cwarn.el
index 74ca5a6d76f6654ba7a285df0dee7c6bac6e7a0e..1aa5170591a57a2d64d0bcb675e34c886f33f152 100644 (file)
@@ -1,6 +1,6 @@
 ;;; cwarn.el --- highlight suspicious C and C++ constructions
 
-;; Copyright (C) 1999-2012 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2014 Free Software Foundation, Inc.
 
 ;; Author: Anders Lindgren <andersl@andersl.com>
 ;; Keywords: c, languages, faces
 
 ;;{{{ Dependencies
 
-(eval-when-compile (require 'cl))
-
 (require 'custom)
 (require 'font-lock)
 (require 'cc-mode)
   :version "21.1"
   :group 'faces)
 
-(defvar cwarn-mode nil
-  "*Non-nil when Cwarn mode is active.
-
-Never set this variable directly, use the command `cwarn-mode'
-instead.")
-
 (defcustom cwarn-configuration
   '((c-mode (not reference))
     (c++-mode t))
@@ -196,16 +188,10 @@ and disable it otherwise.  If called from Lisp, enable the mode
 if ARG is omitted or nil."
   :group 'cwarn :lighter cwarn-mode-text
   (cwarn-font-lock-keywords cwarn-mode)
-  (if font-lock-mode (font-lock-fontify-buffer)))
+  (font-lock-flush))
 
 ;;;###autoload
-(defun turn-on-cwarn-mode ()
-  "Turn on CWarn mode.
-
-This function is designed to be added to hooks, for example:
-  (add-hook 'c-mode-hook 'turn-on-cwarn-mode)"
-  (cwarn-mode 1))
-(make-obsolete 'turn-on-cwarn-mode 'cwarn-mode "24.1")
+(define-obsolete-function-alias 'turn-on-cwarn-mode 'cwarn-mode "24.1")
 
 ;;}}}
 ;;{{{ Help functions