summaryrefslogtreecommitdiff
path: root/lisp/whitespace.el
diff options
context:
space:
mode:
authorGerd Moellmann <gerd@gnu.org>1999-10-30 21:10:54 +0000
committerGerd Moellmann <gerd@gnu.org>1999-10-30 21:10:54 +0000
commit07dc417520f8a433fbe32bfb8ec753d8a3302819 (patch)
treefb46fc9d06792cee72c4367ea7da2266745b6e05 /lisp/whitespace.el
parente79ad8a15dc2cfe7ced24730a8ad105e17a1bde1 (diff)
downloademacs-07dc417520f8a433fbe32bfb8ec753d8a3302819.tar.gz
(whitespace-version): Update to 2.8
Take a tip from Noah Friedman <friedman@splode.com> and test for existence of `defcustom' and `defgroup' using fboundp instead of assuming that these are not present in particular flavors of emacs.
Diffstat (limited to 'lisp/whitespace.el')
-rw-r--r--lisp/whitespace.el23
1 files changed, 12 insertions, 11 deletions
diff --git a/lisp/whitespace.el b/lisp/whitespace.el
index 84e67eaeda2..b003798e65a 100644
--- a/lisp/whitespace.el
+++ b/lisp/whitespace.el
@@ -42,7 +42,7 @@
(add-hook 'find-file-hooks 'whitespace-buffer)
(add-hook 'kill-buffer-hook 'whitespace-buffer)
-(defvar whitespace-version "2.6" "Version of the whitespace library.")
+(defvar whitespace-version "2.8" "Version of the whitespace library.")
;; Find out what type of Emacs we are running in.
(defvar whitespace-running-emacs (if (string-match "XEmacs\\|Lucid"
emacs-version) nil t)
@@ -70,17 +70,18 @@ visited by the buffers.")
(make-variable-buffer-local 'whitespace-mode-line)
(put 'whitespace-mode-line 'permanent-local nil)
-;; For users of Emacs 19.x, defgroup and defcustom are not defined.
-
+;; For flavors of Emacs which don't define `defgroup' and `defcustom'.
(eval-when-compile
- (if (< (string-to-int emacs-version) 20)
- (progn
- (defmacro defgroup (sym memb doc &rest args)
- "Null macro for defgroup in all versions of Emacs < 20.x"
- t)
- (defmacro defcustom (sym val doc &rest args)
- "Macro to alias defcustom to defvar in all versions of Emacs < 20.x"
- `(defvar ,sym ,val ,doc)))))
+ (if (not (fboundp 'defgroup))
+ (defmacro defgroup (sym memb doc &rest args)
+ "Null macro for defgroup in all versions of Emacs that don't define
+defgroup"
+ t))
+ (if (not (fboundp 'defcustom))
+ (defmacro defcustom (sym val doc &rest args)
+ "Macro to alias defcustom to defvar in all versions of Emacs that
+don't define defcustom"
+ `(defvar ,sym ,val ,doc))))
(defgroup whitespace nil
"Check for and fix five different types of whitespaces in source code."