tm 7.72.
[elisp/tm.git] / TM-CFG
diff --git a/TM-CFG b/TM-CFG
index 658eb56..5cb2d4f 100644 (file)
--- a/TM-CFG
+++ b/TM-CFG
          "site-lisp"
        "local.lisp"))
 
+(setq PATTERN-TO-INSTALL
+      (expand-file-name (concat ".*/" LISP_PREFIX) PREFIX))
+(setq PATTERN-TO-AVOID
+      (format "%d\\.%s" emacs-major-version emacs-minor-version))
+
 (defvar LISPDIR
   (or
    (catch 'tag
      (let ((rest default-load-path)
           dir)
        (while (setq dir (car rest))
-        (if (string-match
-             (expand-file-name (concat ".*/" LISP_PREFIX) PREFIX) dir)
-            (throw 'tag (substring dir 0 (match-end 0)))
-          )
+        (or (string-match PATTERN-TO-AVOID dir)
+            (if (string-match PATTERN-TO-INSTALL dir)
+                (throw 'tag (substring dir 0 (match-end 0)))
+              ))
         (setq rest (cdr rest))
         )))
    (expand-file-name (concat