diff options
| -rw-r--r-- | lisp/whitespace.el | 23 |
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 @@ | |||
| 42 | (add-hook 'find-file-hooks 'whitespace-buffer) | 42 | (add-hook 'find-file-hooks 'whitespace-buffer) |
| 43 | (add-hook 'kill-buffer-hook 'whitespace-buffer) | 43 | (add-hook 'kill-buffer-hook 'whitespace-buffer) |
| 44 | 44 | ||
| 45 | (defvar whitespace-version "2.6" "Version of the whitespace library.") | 45 | (defvar whitespace-version "2.8" "Version of the whitespace library.") |
| 46 | ;; Find out what type of Emacs we are running in. | 46 | ;; Find out what type of Emacs we are running in. |
| 47 | (defvar whitespace-running-emacs (if (string-match "XEmacs\\|Lucid" | 47 | (defvar whitespace-running-emacs (if (string-match "XEmacs\\|Lucid" |
| 48 | emacs-version) nil t) | 48 | emacs-version) nil t) |
| @@ -70,17 +70,18 @@ visited by the buffers.") | |||
| 70 | (make-variable-buffer-local 'whitespace-mode-line) | 70 | (make-variable-buffer-local 'whitespace-mode-line) |
| 71 | (put 'whitespace-mode-line 'permanent-local nil) | 71 | (put 'whitespace-mode-line 'permanent-local nil) |
| 72 | 72 | ||
| 73 | ;; For users of Emacs 19.x, defgroup and defcustom are not defined. | 73 | ;; For flavors of Emacs which don't define `defgroup' and `defcustom'. |
| 74 | |||
| 75 | (eval-when-compile | 74 | (eval-when-compile |
| 76 | (if (< (string-to-int emacs-version) 20) | 75 | (if (not (fboundp 'defgroup)) |
| 77 | (progn | 76 | (defmacro defgroup (sym memb doc &rest args) |
| 78 | (defmacro defgroup (sym memb doc &rest args) | 77 | "Null macro for defgroup in all versions of Emacs that don't define |
| 79 | "Null macro for defgroup in all versions of Emacs < 20.x" | 78 | defgroup" |
| 80 | t) | 79 | t)) |
| 81 | (defmacro defcustom (sym val doc &rest args) | 80 | (if (not (fboundp 'defcustom)) |
| 82 | "Macro to alias defcustom to defvar in all versions of Emacs < 20.x" | 81 | (defmacro defcustom (sym val doc &rest args) |
| 83 | `(defvar ,sym ,val ,doc))))) | 82 | "Macro to alias defcustom to defvar in all versions of Emacs that |
| 83 | don't define defcustom" | ||
| 84 | `(defvar ,sym ,val ,doc)))) | ||
| 84 | 85 | ||
| 85 | (defgroup whitespace nil | 86 | (defgroup whitespace nil |
| 86 | "Check for and fix five different types of whitespaces in source code." | 87 | "Check for and fix five different types of whitespaces in source code." |