emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r107020: lisp/progmodes/cwarn.el: Sma


From: Juanma Barranquero
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r107020: lisp/progmodes/cwarn.el: Small fixes.
Date: Tue, 31 Jan 2012 03:57:00 +0100
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 107020
committer: Juanma Barranquero <address@hidden>
branch nick: trunk
timestamp: Tue 2012-01-31 03:57:00 +0100
message:
  lisp/progmodes/cwarn.el: Small fixes.
  (cwarn): Remove dead link.
  (cwarn-configuration, cwarn-verbose, cwarn-mode-text, cwarn-load-hook):
  Remove * from defcustom docstrings.
  (turn-on-cwarn-mode): Make obsolete.
  (c-at-toplevel-p): Remove compatibility code for Emacs 20.3 and older.
  (turn-on-cwarn-mode-if-enabled): Call `cwarn-mode'.
modified:
  lisp/ChangeLog
  lisp/progmodes/cwarn.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-01-31 01:53:20 +0000
+++ b/lisp/ChangeLog    2012-01-31 02:57:00 +0000
@@ -1,3 +1,12 @@
+2012-01-31  Juanma Barranquero  <address@hidden>
+
+       * progmodes/cwarn.el (cwarn): Remove dead link.
+       (cwarn-configuration, cwarn-verbose, cwarn-mode-text, cwarn-load-hook):
+       Remove * from defcustom docstrings.
+       (turn-on-cwarn-mode): Make obsolete.
+       (c-at-toplevel-p): Remove compatibility code for Emacs 20.3 and older.
+       (turn-on-cwarn-mode-if-enabled): Call `cwarn-mode'.
+
 2012-01-31  Glenn Morris  <address@hidden>
 
        * emacs-lisp/easy-mmode.el (define-minor-mode): Fix :variable case.

=== modified file 'lisp/progmodes/cwarn.el'
--- a/lisp/progmodes/cwarn.el   2012-01-19 07:21:25 +0000
+++ b/lisp/progmodes/cwarn.el   2012-01-31 02:57:00 +0000
@@ -117,7 +117,6 @@
 (defgroup cwarn nil
   "Highlight suspicious C and C++ constructions."
   :version "21.1"
-  :link '(url-link "http://www.andersl.com/emacs";)
   :group 'faces)
 
 (defvar cwarn-mode nil
@@ -129,7 +128,7 @@
 (defcustom cwarn-configuration
   '((c-mode (not reference))
     (c++-mode t))
-  "*List of items each describing which features are enable for a mode.
+  "List of items each describing which features are enable for a mode.
 Each item is on the form (mode featurelist), where featurelist can be
 on one of three forms:
 
@@ -158,7 +157,7 @@
   :group 'cwarn)
 
 (defcustom cwarn-verbose t
-  "*When nil, CWarn mode will not generate any messages.
+  "When nil, CWarn mode will not generate any messages.
 
 Currently, messages are generated when the mode is activated and
 deactivated."
@@ -166,7 +165,7 @@
   :type 'boolean)
 
 (defcustom cwarn-mode-text " CWarn"
-  "*String to display in the mode line when CWarn mode is active.
+  "String to display in the mode line when CWarn mode is active.
 
 \(When the string is not empty, make sure that it has a leading space.)"
   :tag "CWarn mode text"                ; To separate it from `global-...'
@@ -174,7 +173,7 @@
   :type 'string)
 
 (defcustom cwarn-load-hook nil
-  "*Functions to run when CWarn mode is first loaded."
+  "Functions to run when CWarn mode is first loaded."
   :tag "Load Hook"
   :group 'cwarn
   :type 'hook)
@@ -204,6 +203,7 @@
 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")
 
 ;;}}}
 ;;{{{ Help functions
@@ -247,29 +247,6 @@
                   nil keywords)))))
 
 ;;}}}
-;;{{{ Backward compatibility
-
-;; This piece of code will be part of CC mode as of Emacs 20.4.
-(if (not (fboundp 'c-at-toplevel-p))
-(defun c-at-toplevel-p ()
-  "Return a determination as to whether point is at the `top-level'.
-Being at the top-level means that point is either outside any
-enclosing block (such function definition), or inside a class
-definition, but outside any method blocks.
-
-If point is not at the top-level (e.g. it is inside a method
-definition), then nil is returned.  Otherwise, if point is at a
-top-level not enclosed within a class definition, t is returned.
-Otherwise, a 2-vector is returned where the zeroth element is the
-buffer position of the start of the class declaration, and the first
-element is the buffer position of the enclosing class' opening
-brace."
-  (let ((state (c-parse-state)))
-    (or (not (c-most-enclosing-brace state))
-       (c-search-uplist-for-classkey state))))
-)
-
-;;}}}
 ;;{{{ Font-lock keywords and match functions
 
 ;; This section contains font-lock keywords.  A font lock keyword can
@@ -368,7 +345,7 @@
   "Turn on CWarn mode in the current buffer if applicable.
 The mode is turned if some feature is enabled for the current
 `major-mode' in `cwarn-configuration'."
-  (if (cwarn-is-enabled major-mode) (turn-on-cwarn-mode)))
+  (when (cwarn-is-enabled major-mode) (cwarn-mode 1)))
 
 ;;;###autoload
 (define-globalized-minor-mode global-cwarn-mode


reply via email to

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