diff options
| author | Juanma Barranquero | 2012-01-31 03:57:00 +0100 |
|---|---|---|
| committer | Juanma Barranquero | 2012-01-31 03:57:00 +0100 |
| commit | 4789358111435e41a6389a439066b2b7eb6df40f (patch) | |
| tree | 19e3a4101ac3bf1dd639520e4c82add58e2cb9a8 /lisp | |
| parent | 8d8939e85800f1f8957190d27f6a308d5d2d8c53 (diff) | |
| download | emacs-4789358111435e41a6389a439066b2b7eb6df40f.tar.gz emacs-4789358111435e41a6389a439066b2b7eb6df40f.zip | |
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'.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/progmodes/cwarn.el | 35 |
2 files changed, 15 insertions, 29 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 258e9497e02..e67f90c24b8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2012-01-31 Juanma Barranquero <lekktu@gmail.com> | ||
| 2 | |||
| 3 | * progmodes/cwarn.el (cwarn): Remove dead link. | ||
| 4 | (cwarn-configuration, cwarn-verbose, cwarn-mode-text, cwarn-load-hook): | ||
| 5 | Remove * from defcustom docstrings. | ||
| 6 | (turn-on-cwarn-mode): Make obsolete. | ||
| 7 | (c-at-toplevel-p): Remove compatibility code for Emacs 20.3 and older. | ||
| 8 | (turn-on-cwarn-mode-if-enabled): Call `cwarn-mode'. | ||
| 9 | |||
| 1 | 2012-01-31 Glenn Morris <rgm@gnu.org> | 10 | 2012-01-31 Glenn Morris <rgm@gnu.org> |
| 2 | 11 | ||
| 3 | * emacs-lisp/easy-mmode.el (define-minor-mode): Fix :variable case. | 12 | * emacs-lisp/easy-mmode.el (define-minor-mode): Fix :variable case. |
diff --git a/lisp/progmodes/cwarn.el b/lisp/progmodes/cwarn.el index 90147700d77..70c5b45ca44 100644 --- a/lisp/progmodes/cwarn.el +++ b/lisp/progmodes/cwarn.el | |||
| @@ -117,7 +117,6 @@ | |||
| 117 | (defgroup cwarn nil | 117 | (defgroup cwarn nil |
| 118 | "Highlight suspicious C and C++ constructions." | 118 | "Highlight suspicious C and C++ constructions." |
| 119 | :version "21.1" | 119 | :version "21.1" |
| 120 | :link '(url-link "http://www.andersl.com/emacs") | ||
| 121 | :group 'faces) | 120 | :group 'faces) |
| 122 | 121 | ||
| 123 | (defvar cwarn-mode nil | 122 | (defvar cwarn-mode nil |
| @@ -129,7 +128,7 @@ instead.") | |||
| 129 | (defcustom cwarn-configuration | 128 | (defcustom cwarn-configuration |
| 130 | '((c-mode (not reference)) | 129 | '((c-mode (not reference)) |
| 131 | (c++-mode t)) | 130 | (c++-mode t)) |
| 132 | "*List of items each describing which features are enable for a mode. | 131 | "List of items each describing which features are enable for a mode. |
| 133 | Each item is on the form (mode featurelist), where featurelist can be | 132 | Each item is on the form (mode featurelist), where featurelist can be |
| 134 | on one of three forms: | 133 | on one of three forms: |
| 135 | 134 | ||
| @@ -158,7 +157,7 @@ keyword list." | |||
| 158 | :group 'cwarn) | 157 | :group 'cwarn) |
| 159 | 158 | ||
| 160 | (defcustom cwarn-verbose t | 159 | (defcustom cwarn-verbose t |
| 161 | "*When nil, CWarn mode will not generate any messages. | 160 | "When nil, CWarn mode will not generate any messages. |
| 162 | 161 | ||
| 163 | Currently, messages are generated when the mode is activated and | 162 | Currently, messages are generated when the mode is activated and |
| 164 | deactivated." | 163 | deactivated." |
| @@ -166,7 +165,7 @@ deactivated." | |||
| 166 | :type 'boolean) | 165 | :type 'boolean) |
| 167 | 166 | ||
| 168 | (defcustom cwarn-mode-text " CWarn" | 167 | (defcustom cwarn-mode-text " CWarn" |
| 169 | "*String to display in the mode line when CWarn mode is active. | 168 | "String to display in the mode line when CWarn mode is active. |
| 170 | 169 | ||
| 171 | \(When the string is not empty, make sure that it has a leading space.)" | 170 | \(When the string is not empty, make sure that it has a leading space.)" |
| 172 | :tag "CWarn mode text" ; To separate it from `global-...' | 171 | :tag "CWarn mode text" ; To separate it from `global-...' |
| @@ -174,7 +173,7 @@ deactivated." | |||
| 174 | :type 'string) | 173 | :type 'string) |
| 175 | 174 | ||
| 176 | (defcustom cwarn-load-hook nil | 175 | (defcustom cwarn-load-hook nil |
| 177 | "*Functions to run when CWarn mode is first loaded." | 176 | "Functions to run when CWarn mode is first loaded." |
| 178 | :tag "Load Hook" | 177 | :tag "Load Hook" |
| 179 | :group 'cwarn | 178 | :group 'cwarn |
| 180 | :type 'hook) | 179 | :type 'hook) |
| @@ -204,6 +203,7 @@ With ARG, turn CWarn mode on if and only if arg is positive." | |||
| 204 | This function is designed to be added to hooks, for example: | 203 | This function is designed to be added to hooks, for example: |
| 205 | (add-hook 'c-mode-hook 'turn-on-cwarn-mode)" | 204 | (add-hook 'c-mode-hook 'turn-on-cwarn-mode)" |
| 206 | (cwarn-mode 1)) | 205 | (cwarn-mode 1)) |
| 206 | (make-obsolete 'turn-on-cwarn-mode 'cwarn-mode "24.1") | ||
| 207 | 207 | ||
| 208 | ;;}}} | 208 | ;;}}} |
| 209 | ;;{{{ Help functions | 209 | ;;{{{ Help functions |
| @@ -247,29 +247,6 @@ If ADDP is non-nil, install else remove." | |||
| 247 | nil keywords))))) | 247 | nil keywords))))) |
| 248 | 248 | ||
| 249 | ;;}}} | 249 | ;;}}} |
| 250 | ;;{{{ Backward compatibility | ||
| 251 | |||
| 252 | ;; This piece of code will be part of CC mode as of Emacs 20.4. | ||
| 253 | (if (not (fboundp 'c-at-toplevel-p)) | ||
| 254 | (defun c-at-toplevel-p () | ||
| 255 | "Return a determination as to whether point is at the `top-level'. | ||
| 256 | Being at the top-level means that point is either outside any | ||
| 257 | enclosing block (such function definition), or inside a class | ||
| 258 | definition, but outside any method blocks. | ||
| 259 | |||
| 260 | If point is not at the top-level (e.g. it is inside a method | ||
| 261 | definition), then nil is returned. Otherwise, if point is at a | ||
| 262 | top-level not enclosed within a class definition, t is returned. | ||
| 263 | Otherwise, a 2-vector is returned where the zeroth element is the | ||
| 264 | buffer position of the start of the class declaration, and the first | ||
| 265 | element is the buffer position of the enclosing class' opening | ||
| 266 | brace." | ||
| 267 | (let ((state (c-parse-state))) | ||
| 268 | (or (not (c-most-enclosing-brace state)) | ||
| 269 | (c-search-uplist-for-classkey state)))) | ||
| 270 | ) | ||
| 271 | |||
| 272 | ;;}}} | ||
| 273 | ;;{{{ Font-lock keywords and match functions | 250 | ;;{{{ Font-lock keywords and match functions |
| 274 | 251 | ||
| 275 | ;; This section contains font-lock keywords. A font lock keyword can | 252 | ;; This section contains font-lock keywords. A font lock keyword can |
| @@ -368,7 +345,7 @@ The semicolon after a `do { ... } while (x);' construction is not matched." | |||
| 368 | "Turn on CWarn mode in the current buffer if applicable. | 345 | "Turn on CWarn mode in the current buffer if applicable. |
| 369 | The mode is turned if some feature is enabled for the current | 346 | The mode is turned if some feature is enabled for the current |
| 370 | `major-mode' in `cwarn-configuration'." | 347 | `major-mode' in `cwarn-configuration'." |
| 371 | (if (cwarn-is-enabled major-mode) (turn-on-cwarn-mode))) | 348 | (when (cwarn-is-enabled major-mode) (cwarn-mode 1))) |
| 372 | 349 | ||
| 373 | ;;;###autoload | 350 | ;;;###autoload |
| 374 | (define-globalized-minor-mode global-cwarn-mode | 351 | (define-globalized-minor-mode global-cwarn-mode |