aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2007-08-14 07:45:48 +0000
committerGlenn Morris2007-08-14 07:45:48 +0000
commit0b964e141eeb14f92415e418cb7495cf4be49dbd (patch)
tree0b40e4f2ea695b70bfe7ffa76f3ed8d5c6d46d9c
parent6dbb1e769f5ebeba6291fe21b7c6775a621b7504 (diff)
downloademacs-0b964e141eeb14f92415e418cb7495cf4be49dbd.tar.gz
emacs-0b964e141eeb14f92415e418cb7495cf4be49dbd.zip
(bad-packages-alist): New constant.
(bad-package-check): New function. Together, these two add elements to `after-load-alist' to check for problematic external packages.
-rw-r--r--etc/ChangeLog4
-rw-r--r--lisp/simple.el51
2 files changed, 55 insertions, 0 deletions
diff --git a/etc/ChangeLog b/etc/ChangeLog
index 26ead74bdbd..f1fd377f633 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,7 @@
12007-08-14 Glenn Morris <rgm@gnu.org>
2
3 * NEWS: Mention `bad-packages-alist'.
4
12007-08-08 Glenn Morris <rgm@gnu.org> 52007-08-08 Glenn Morris <rgm@gnu.org>
2 6
3 * TODO: `iff' item is dealt with. 7 * TODO: `iff' item is dealt with.
diff --git a/lisp/simple.el b/lisp/simple.el
index b71dffd3c35..eda86856275 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -5605,6 +5605,57 @@ works by saving the value of `buffer-invisibility-spec' and setting it to nil."
5605; 'insert-in-front-hooks '(minibuffer-prompt-insertion))) 5605; 'insert-in-front-hooks '(minibuffer-prompt-insertion)))
5606; 5606;
5607 5607
5608
5609;;;; Problematic external packages.
5610
5611;; rms says this should be done by specifying symbols that define
5612;; versions together with bad values. This is therefore not as
5613;; flexible as it could be. See the thread:
5614;; http://lists.gnu.org/archive/html/emacs-devel/2007-08/msg00300.html
5615(defconst bad-packages-alist
5616 ;; Not sure exactly which semantic versions have problems.
5617 ;; Definitely 2.0pre3, probably all 2.0pre's before this.
5618 '((semantic semantic-version "2\.0pre[1-3]"
5619 "The version of `semantic' loaded does not work in Emacs 22.
5620It can cause constant high CPU load. Upgrade to at least 2.0pre4.")
5621 ;; CUA-mode does not work with GNU Emacs version 22.1 and newer.
5622 ;; Except for version 1.2, all of the 1.x and 2.x version of cua-mode
5623 ;; provided the `CUA-mode' feature. Since this is no longer true,
5624 ;; we can warn the user if the `CUA-mode' feature is ever provided.
5625 (CUA-mode t nil
5626"CUA-mode is now part of the standard GNU Emacs distribution,
5627so you can now enable CUA via the Options menu or by customizing `cua-mode'.
5628
5629You have loaded an older version of CUA-mode which does not work
5630correctly with this version of Emacs. You should remove the old
5631version and use the one distributed with Emacs."))
5632 "Alist of packages known to cause problems in this version of Emacs.
5633Each element has the form (PACKAGE SYMBOL REGEXP STRING).
5634PACKAGE is either a regular expression to match file names, or a
5635symbol (a feature name); see the documentation of
5636`after-load-alist', to which this variable adds functions.
5637SYMBOL is either the name of a string variable, or `t'. Upon
5638loading PACKAGE, if SYMBOL is t or matches REGEXP, display a
5639warning using STRING as the message.")
5640
5641(defun bad-package-check (package)
5642 "Run a check using the element from `bad-packages-alist' matching PACKAGE."
5643 (condition-case nil
5644 (let* ((list (assoc package bad-packages-alist))
5645 (symbol (nth 1 list)))
5646 (and list
5647 (boundp symbol)
5648 (or (eq symbol t)
5649 (and (stringp (setq symbol (eval symbol)))
5650 (string-match (nth 2 list) symbol)))
5651 (display-warning :warning (nth 3 list))))
5652 (error nil)))
5653
5654(mapc (lambda (elem)
5655 (eval-after-load (car elem) `(bad-package-check ',(car elem))))
5656 bad-packages-alist)
5657
5658
5608(provide 'simple) 5659(provide 'simple)
5609 5660
5610;; arch-tag: 24af67c0-2a49-44f6-b3b1-312d8b570dfd 5661;; arch-tag: 24af67c0-2a49-44f6-b3b1-312d8b570dfd