From mboxrd@z Thu Jan 1 00:00:00 1970 From: Achim Gratz Subject: Re: [PATCH] M-x org-version RET now produces some sensible in all possible install/use-cases Date: Sat, 19 May 2012 10:48:56 +0200 Message-ID: <87txzcy2rr.fsf_-_@Rainer.invalid> References: <87k40axa0a.fsf@gnu.org> <878vgpcm5r.fsf@Rainer.invalid> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:32794) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SVfLe-0005Tw-Qh for emacs-orgmode@gnu.org; Sat, 19 May 2012 04:49:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SVfLc-0003UI-DM for emacs-orgmode@gnu.org; Sat, 19 May 2012 04:49:14 -0400 Received: from plane.gmane.org ([80.91.229.3]:41663) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SVfLc-0003U9-2V for emacs-orgmode@gnu.org; Sat, 19 May 2012 04:49:12 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SVfLa-0006Cj-5E for emacs-orgmode@gnu.org; Sat, 19 May 2012 10:49:10 +0200 Received: from pd9eb3173.dip.t-dialin.net ([217.235.49.115]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 19 May 2012 10:49:10 +0200 Received: from Stromeko by pd9eb3173.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 19 May 2012 10:49:10 +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: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Thomas S. Dye writes: > Thanks for your response. No, thank you — because it turns out that org-reload didn't do the 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. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-fix-org-reload-and-add-parameters-to-customize-outpu.patch Content-Description: fix org-reload >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 from 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= 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))) ;;; Compatibility constants @@ -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)) ;;;###autoload (defun org-customize () -- 1.7.9.2 --=-=-= Content-Type: text/plain Regards, Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ Wavetables for the Waldorf Blofeld: http://Synth.Stromeko.net/Downloads.html#BlofeldUserWavetables --=-=-=--