From: Achim Gratz <Stromeko@nexgo.de>
To: emacs-orgmode@gnu.org
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 [thread overview]
Message-ID: <87txzcy2rr.fsf_-_@Rainer.invalid> (raw)
In-Reply-To: m1r4uh83b4.fsf@tsdye.com
[-- Attachment #1: Type: text/plain, Size: 240 bytes --]
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.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: fix org-reload --]
[-- Type: text/x-patch, Size: 4348 bytes --]
From 20306fd6a576b06cc5783658feafc9a3335f3277 Mon Sep 17 00:00:00 2001
From: Achim Gratz <Stromeko@Stromeko.DE>
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
[-- Attachment #3: Type: text/plain, Size: 191 bytes --]
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
next prev parent reply other threads:[~2012-05-19 8:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-18 6:45 M-x org-version RET now produces some sensible in all possible install/use-cases Bastien
2012-05-18 19:25 ` Thomas S. Dye
2012-05-18 19:41 ` Achim Gratz
2012-05-18 23:41 ` Thomas S. Dye
2012-05-19 8:48 ` Achim Gratz [this message]
2012-05-19 8:52 ` [PATCH] " Bastien
2012-05-19 17:41 ` Thomas S. Dye
2012-05-19 18:02 ` Achim Gratz
2012-05-18 20:14 ` Achim Gratz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87txzcy2rr.fsf_-_@Rainer.invalid \
--to=stromeko@nexgo.de \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).