fix org-reload and add parameters to customize output from org-version

* org.el(org-version): Add optional parameters 'full and 'message
  to optionally return the full version string and echo to message
  area in non-interactive calls.

* org.el(org-submit-bug-report): Add optional parameter 'full to
  call of (org-version) so that the bug report has all version
  information.

* org.el(org-reload): Simplify file-re (orgtbl-*.el files do not
  exist anymore).  Keep org-*.el at the end of the files list.
  Explicitely load org-version.el (since it doesn't provide feature
  'org-version) at the very end, but ignore errors when it doesn't
  exist.  Add parameters 'full and 'message to the call
  of (org-version) so that after reload the full version information
  is displayed in the message area again.
This commit is contained in:
Achim Gratz 2012-05-19 10:44:24 +02:00 committed by Bastien Guerry
parent 584b869d38
commit 40a789ecd1
1 changed files with 16 additions and 13 deletions

View File

@ -216,7 +216,7 @@ identifier."
'noerror 'nomessage 'nosuffix) 'noerror 'nomessage 'nosuffix)
(org-no-warnings (org-fixup)))) (org-no-warnings (org-fixup))))
;;;###autoload ;;;###autoload
(defun org-version (&optional here) (defun org-version (&optional here full message)
"Show the org-mode version in the echo area. "Show the org-mode version in the echo area.
With prefix arg HERE, insert it at point." With prefix arg HERE, insert it at point."
(interactive "P") (interactive "P")
@ -231,12 +231,14 @@ With prefix arg HERE, insert it at point."
(if (string= org-dir org-install-dir) (if (string= org-dir org-install-dir)
org-install-dir org-install-dir
(concat "mixed installation! " org-install-dir " and " org-dir)) (concat "mixed installation! " org-install-dir " and " org-dir))
"org-install.el can not be found!")))) "org-install.el can not be found!")))
(_version (if full version org-version)))
(if (org-called-interactively-p 'interactive) (if (org-called-interactively-p 'interactive)
(if here (if here
(insert version) (insert version)
(message version)) (message version))
org-version))) (if message (message _version))
_version)))
;;; Compatibility constants ;;; Compatibility constants
@ -19500,7 +19502,7 @@ information about your Org-mode version and configuration."
(let ((reporter-prompt-for-summary-p "Bug report subject: ")) (let ((reporter-prompt-for-summary-p "Bug report subject: "))
(reporter-submit-bug-report (reporter-submit-bug-report
"emacs-orgmode@gnu.org" "emacs-orgmode@gnu.org"
(org-version) (org-version nil 'full)
(let (list) (let (list)
(save-window-excursion (save-window-excursion
(org-pop-to-buffer-same-window (get-buffer-create "*Warn about privacy*")) (org-pop-to-buffer-same-window (get-buffer-create "*Warn about privacy*"))
@ -19581,13 +19583,13 @@ Your bug report will be posted to the Org-mode mailing list.
With prefix arg UNCOMPILED, load the uncompiled versions." With prefix arg UNCOMPILED, load the uncompiled versions."
(interactive "P") (interactive "P")
(require 'find-func) (require 'find-func)
(let* ((file-re "^\\(org\\|orgtbl\\)\\(\\.el\\|-.*\\.el\\)") (let* ((file-re "^org\\(-.*\\)?\\.el")
(dir-org (file-name-directory (org-find-library-dir "org"))) (dir-org (file-name-directory (org-find-library-dir "org")))
(dir-org-contrib (ignore-errors (dir-org-contrib (ignore-errors
(file-name-directory (file-name-directory
(org-find-library-dir "org-contribdir")))) (org-find-library-dir "org-contribdir"))))
(babel-files (babel-files
(mapcar (lambda (el) (concat "ob" (when el (format "-%s" el)) ".el")) (mapcar (lambda (el) (concat (concat dir-org "ob") (when el (format "-%s" el)) ".el"))
(append (list nil "comint" "eval" "exp" "keys" (append (list nil "comint" "eval" "exp" "keys"
"lob" "ref" "table" "tangle") "lob" "ref" "table" "tangle")
(delq nil (delq nil
@ -19596,10 +19598,10 @@ With prefix arg UNCOMPILED, load the uncompiled versions."
(when (cdr lang) (symbol-name (car lang)))) (when (cdr lang) (symbol-name (car lang))))
org-babel-load-languages))))) org-babel-load-languages)))))
(files (files
(append (directory-files dir-org t file-re) (append babel-files
babel-files
(and dir-org-contrib (and dir-org-contrib
(directory-files dir-org-contrib t file-re)))) (directory-files dir-org-contrib t file-re))
(directory-files dir-org t file-re)))
(remove-re (concat (if (featurep 'xemacs) (remove-re (concat (if (featurep 'xemacs)
"org-colview" "org-colview-xemacs") "org-colview" "org-colview-xemacs")
"\\'"))) "\\'")))
@ -19613,10 +19615,11 @@ With prefix arg UNCOMPILED, load the uncompiled versions."
(when (featurep (intern (file-name-nondirectory f))) (when (featurep (intern (file-name-nondirectory f)))
(if (and (not uncompiled) (if (and (not uncompiled)
(file-exists-p (concat f ".elc"))) (file-exists-p (concat f ".elc")))
(load (concat f ".elc") nil nil t) (load (concat f ".elc") nil nil 'nosuffix)
(load (concat f ".el") nil nil t)))) (load (concat f ".el") nil nil 'nosuffix))))
files)) files)
(org-version)) (load (concat dir-org "org-version.el") 'noerror nil 'nosuffix))
(org-version nil 'full 'message))
;;;###autoload ;;;###autoload
(defun org-customize () (defun org-customize ()