- (or
- (catch 'tag
- (let ((rest default-load-path)
- (pat (concat "^"
- (expand-file-name (concat ".*/" elisp-prefix) prefix)
- "/?$")))
- (while rest
- (if (string-match pat (car rest))
- (if (or allow-version-specific
- (not (string-match (format "/%d\\.%d"
- emacs-major-version
- emacs-minor-version)
- (car rest))))
- (throw 'tag dir)))
- (setq rest (cdr rest)))))
- (expand-file-name (concat
- (if (and ; running-emacs-19_29-or-later
- (not (featurep 'xemacs))
- (or (>= emacs-major-version 20)
- (and (= emacs-major-version 19)
- (>= emacs-minor-version 29))))
- "share/"
- "lib/")
- (cond ((boundp 'NEMACS) "nemacs/")
- ((boundp 'MULE) "mule/")
- ((featurep 'xemacs) ; running-xemacs
- (if (featurep 'mule)
- "xmule/"
- "xemacs/"))
- (t "emacs/"))
- elisp-prefix)
- prefix)))
+ (or (catch 'tag
+ (let ((rest default-load-path)
+ (regexp (concat "^"
+ (expand-file-name (concat ".*/" elisp-prefix)
+ prefix)
+ "/?$")))
+ (while rest
+ (if (string-match regexp (car rest))
+ (if (or allow-version-specific
+ (not (string-match (format "/%d\\.%d"
+ emacs-major-version
+ emacs-minor-version)
+ (car rest))))
+ (throw 'tag (car rest))))
+ (setq rest (cdr rest)))))
+ (expand-file-name (concat (if (and (not (featurep 'xemacs))
+ (or (>= emacs-major-version 20)
+ (and (= emacs-major-version 19)
+ (> emacs-minor-version 28))))
+ "share/"
+ "lib/")
+ (cond
+ ((featurep 'xemacs)
+ (if (featurep 'mule)
+ "xmule/"
+ "xemacs/"))
+ ;; unfortunately, unofficial mule based on
+ ;; 19.29 and later use "emacs/" by default.
+ ((boundp 'MULE) "mule/")
+ ((boundp 'NEMACS) "nemacs/")
+ (t "emacs/"))
+ elisp-prefix)
+ prefix)))