diff --git a/UTILITIES/org-fixup.el b/UTILITIES/org-fixup.el index 9d0dfa28c..a7e64b179 100644 --- a/UTILITIES/org-fixup.el +++ b/UTILITIES/org-fixup.el @@ -68,12 +68,12 @@ (defmacro org-fixup () (let* ((origin default-directory) - (dirlisp (org-find-library-name "org")) + (dirlisp (org-find-library-dir "org")) (dirorg (concat dirlisp "../" )) (dirgit (concat dirorg ".git/" )) (org-version "N/A-fixup") (org-git-version "N/A-fixup !!check installation!!")) - (if (load (concat dirlisp "org-version.el") 'noerror 'nomessage 'nosuffix 'mustsuffix) + (if (load (concat dirlisp "org-version.el") 'noerror 'nomessage 'nosuffix) (setq org-version (org-release) org-git-version (org-git-version)) (when (and (file-exists-p dirgit) @@ -81,23 +81,23 @@ (unwind-protect (progn (cd dirorg) - (when (eql 0 (shell-command "git describe --abbrev=6 HEAD")) - (with-current-buffer "*Shell Command Output*" - (goto-char (point-min)) - (setq git-version (buffer-substring (point) (point-at-eol)))) - (when (string-match "\\S-" - (shell-command-to-string - "git diff-index --name-only HEAD --")) - (setq git-version (concat git-version "-dirty"))) - (setq org-version (and (string-match "_\\([^-]+\\)-" git-version) - (match-string 1 git-version))) - (setq org-git-version git-version))) - (cd origin)))) + (setq org-git-version + (concat (substring + (shell-command-to-string "git describe --abbrev=6 HEAD") + 0 -1) + (when (string-match "\\S-" + (shell-command-to-string + "git status -uno --porcelain")) + ".dirty"))) + (setq org-version + (substring + (shell-command-to-string "git describe --abbrev=0 HEAD") + 0 -1)))) + (cd origin))) `(progn (defun org-release () ,org-version) (defun org-git-version () ,org-git-version) - "org-fixup.el: redefined org version." - ))) + "org-fixup.el: redefined org version."))) (provide 'org-fixup) diff --git a/lisp/org-compat.el b/lisp/org-compat.el index d468942b5..0cdb6afd6 100644 --- a/lisp/org-compat.el +++ b/lisp/org-compat.el @@ -330,12 +330,8 @@ Works on both Emacs and XEmacs." (org-no-properties (substring string (or from 0) to)) (substring-no-properties string from to))) -(defmacro org-find-library-name (library) - (if (fboundp 'find-library-name) - `(file-name-directory (find-library-name ,library)) - ; XEmacs does not have `find-library-name' - `(flet ((flnh (lib ignore) lib)) - (file-name-directory (find-library ,library nil 'flnh))))) +(defmacro org-find-library-dir (library) + `(file-name-directory (locate-library ,library))) (defun org-count-lines (s) "How many lines in string S?" diff --git a/lisp/org-exp-blocks.el b/lisp/org-exp-blocks.el index d6714363c..b0bcc377c 100644 --- a/lisp/org-exp-blocks.el +++ b/lisp/org-exp-blocks.el @@ -240,7 +240,7 @@ which defaults to the value of `org-export-blocks-witheld'." (file-name-as-directory (expand-file-name "../contrib" - (file-name-directory (org-find-library-name "org"))))))) + (file-name-directory (org-find-library-dir "org"))))))) "Path to the ditaa jar executable." :group 'org-babel :type 'string) diff --git a/lisp/org.el b/lisp/org.el index 8825d6c0e..3ed14d723 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -89,7 +89,8 @@ (unless (boundp 'diary-fancy-buffer) (defvaralias 'diary-fancy-buffer 'fancy-diary-buffer))) -(require 'outline) (require 'noutline) +(require 'outline) +(require 'noutline "noutline" 'noerror) ;; stock XEmacs does not have it ;; Other stuff we need. (require 'time-date) (unless (fboundp 'time-subtract) (defalias 'time-subtract 'subtract-time)) @@ -211,16 +212,16 @@ identifier." (eval-when-compile (defun org-release () "N/A") (defun org-git-version () "N/A !!check installation!!") - (and (load (concat (org-find-library-name "org") "../UTILITIES/org-fixup.el") - 'noerror 'nomessage 'nosuffix 'mustsuffix) + (and (load (concat (org-find-library-dir "org") "../UTILITIES/org-fixup.el") + 'noerror 'nomessage 'nosuffix) (org-fixup))) ;;;###autoload (defun org-version (&optional here) "Show the org-mode version in the echo area. With prefix arg HERE, insert it at point." (interactive "P") - (let* ((org-dir (ignore-errors (org-find-library-name "org"))) - (org-install-dir (ignore-errors (org-find-library-name "org-install.el"))) + (let* ((org-dir (ignore-errors (org-find-library-dir "org"))) + (org-install-dir (ignore-errors (org-find-library-dir "org-install.el"))) (org-version (org-release)) (git-version (org-git-version)) (version (format "Org-mode version %s (%s @ %s)" @@ -19581,10 +19582,10 @@ With prefix arg UNCOMPILED, load the uncompiled versions." (interactive "P") (require 'find-func) (let* ((file-re "^\\(org\\|orgtbl\\)\\(\\.el\\|-.*\\.el\\)") - (dir-org (file-name-directory (org-find-library-name "org"))) + (dir-org (file-name-directory (org-find-library-dir "org"))) (dir-org-contrib (ignore-errors (file-name-directory - (org-find-library-name "org-contribdir")))) + (org-find-library-dir "org-contribdir")))) (babel-files (mapcar (lambda (el) (concat "ob" (when el (format "-%s" el)) ".el")) (append (list nil "comint" "eval" "exp" "keys"