From mboxrd@z Thu Jan 1 00:00:00 1970 From: tsd@tsdye.com (Thomas S. Dye) Subject: Re: [PATCH] M-x org-version RET now produces some sensible in all possible install/use-cases Date: Sat, 19 May 2012 07:41:22 -1000 Message-ID: References: <87k40axa0a.fsf@gnu.org> <878vgpcm5r.fsf@Rainer.invalid> <87txzcy2rr.fsf_-_@Rainer.invalid> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:35610) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SVnep-0003GM-1F for emacs-orgmode@gnu.org; Sat, 19 May 2012 13:41:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SVnek-0003B4-P6 for emacs-orgmode@gnu.org; Sat, 19 May 2012 13:41:34 -0400 Received: from oproxy9.bluehost.com ([69.89.24.6]:36672) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1SVnek-0003Ag-Fi for emacs-orgmode@gnu.org; Sat, 19 May 2012 13:41:30 -0400 In-Reply-To: <87txzcy2rr.fsf_-_@Rainer.invalid> (Achim Gratz's message of "Sat, 19 May 2012 10:48:56 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Achim Gratz Cc: emacs-orgmode@gnu.org Achim Gratz writes: > Thomas S. Dye writes: >> Thanks for your response.=20=20 > > No, thank you =E2=80=94 because it turns out that org-reload didn't do th= e right > thing in your case (i.e. after an org-reload, you'll see that pesky > "N/A" again). Here's a patch to fix that. > I pulled from git and reloaded. Org-version now gives this: Org-mode version 7.8.10 (release_7.8.10-568-gc84cda @ /Users/dk/.emacs.d/src/org/lisp/)=20 I think all is well. All the best, Tom > From 20306fd6a576b06cc5783658feafc9a3335f3277 Mon Sep 17 00:00:00 2001 > From: Achim Gratz > Date: Sat, 19 May 2012 10:44:24 +0200 > Subject: [PATCH] fix org-reload and add parameters to customize output fr= om > org-version > > * lisp/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. > > * lisp/org.el(org-submit-bug-report): Add optional parameter 'full to > call of (org-version) so that the bug report has all version > information. > > * lisp/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. > --- > lisp/org.el | 29 ++++++++++++++++------------- > 1 file changed, 16 insertions(+), 13 deletions(-) > > diff --git a/lisp/org.el b/lisp/org.el > index 7b34576..6f7aebb 100644 > --- a/lisp/org.el > +++ b/lisp/org.el > @@ -216,7 +216,7 @@ (defcustom org-clone-delete-id nil > 'noerror 'nomessage 'nosuffix) > (org-no-warnings (org-fixup)))) > ;;;###autoload > -(defun org-version (&optional here) > +(defun org-version (&optional here full message) > "Show the org-mode version in the echo area. > With prefix arg HERE, insert it at point." > (interactive "P") > @@ -231,12 +231,14 @@ (defun org-version (&optional here) > (if (string=3D org-dir org-install-dir) > org-install-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 here > (insert version) > (message version)) > - org-version))) > + (if message (message _version)) > + _version))) >=20=20 > ;;; Compatibility constants >=20=20 > @@ -19514,7 +19516,7 @@ (defun org-submit-bug-report () > (let ((reporter-prompt-for-summary-p "Bug report subject: ")) > (reporter-submit-bug-report > "emacs-orgmode@gnu.org" > - (org-version) > + (org-version nil 'full) > (let (list) > (save-window-excursion > (org-pop-to-buffer-same-window (get-buffer-create "*Warn about privacy= *")) > @@ -19595,13 +19597,13 @@ (defun org-reload (&optional uncompiled) > With prefix arg UNCOMPILED, load the uncompiled versions." > (interactive "P") > (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-contrib (ignore-errors > (file-name-directory > (org-find-library-dir "org-contribdir")))) > (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" > "lob" "ref" "table" "tangle") > (delq nil > @@ -19610,10 +19612,10 @@ (defun org-reload (&optional uncompiled) > (when (cdr lang) (symbol-name (car lang)))) > org-babel-load-languages))))) > (files > - (append (directory-files dir-org t file-re) > - babel-files > + (append babel-files > (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) > "org-colview" "org-colview-xemacs") > "\\'"))) > @@ -19627,10 +19629,11 @@ (defun org-reload (&optional uncompiled) > (when (featurep (intern (file-name-nondirectory f))) > (if (and (not uncompiled) > (file-exists-p (concat f ".elc"))) > - (load (concat f ".elc") nil nil t) > - (load (concat f ".el") nil nil t)))) > - files)) > - (org-version)) > + (load (concat f ".elc") nil nil 'nosuffix) > + (load (concat f ".el") nil nil 'nosuffix)))) > + files) > + (load (concat dir-org "org-version.el") 'noerror nil 'nosuffix)) > + (org-version nil 'full 'message)) >=20=20 > ;;;###autoload > (defun org-customize () > --=20 > 1.7.9.2 > > > > Regards, > Achim. --=20 Thomas S. Dye http://www.tsdye.com