[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] org-element-context doesn't parse consistently link with spaces
From: |
Nicolas Richard |
Subject: |
Re: [O] org-element-context doesn't parse consistently link with spaces |
Date: |
Wed, 05 Mar 2014 17:27:50 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
Bastien <address@hidden> writes:
> Hi Nicolas,
>
> Nicolas Richard <address@hidden> writes:
>
>> OTOH, I find it a bad idea that some arguments are ignored in
>> non-interactive uses, it'd be better to have a function which fully
>> obeys its arguments, and has an interactive spec which sets the
>> argument. If you're interested I can do that.
>
> Of course I'm interested, thanks in advance!
Could you review this ? thanks.
From: Nicolas Richard <address@hidden>
Date: Wed, 5 Mar 2014 17:25:45 +0100
Subject: [PATCH] lisp/org.el (org-version): obey all arguments in
non-interactive uses.
---
lisp/org.el | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/lisp/org.el b/lisp/org.el
index 5c1b61e..11184cc 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -297,12 +297,11 @@ identifier."
;;;###autoload
(defun org-version (&optional here full message)
- "Show the org-mode version in the echo area.
-With prefix argument HERE (this is ignored in non-interactive
-uses), insert it at point.
-When FULL is non-nil, use a verbose version string.
-When MESSAGE is non-nil, display a message with the version."
- (interactive "P")
+ "Show the org-mode version.
+Interactively, or when MESSAGE is non-nil, show it in echo area.
+With prefix argument, or when HERE is non-nil, insert it at point.
+In non-interactive uses, a reduced version string is output unless FULL is
given."
+ (interactive (list current-prefix-arg t (not current-prefix-arg)))
(let* ((org-dir (ignore-errors (org-find-library-dir "org")))
(save-load-suffixes (when (boundp 'load-suffixes) load-suffixes))
(load-suffixes (list ".el"))
@@ -322,12 +321,12 @@ When MESSAGE is non-nil, display a message with the
version."
(concat "mixed installation! " org-install-dir
" and " org-dir))
"org-loaddefs.el can not be found!")))
(version1 (if full version org-version)))
- (if (org-called-interactively-p 'interactive)
- (if here
- (insert version)
- (message version))
- (if message (message version1))
- version1)))
+ (when here (insert version1))
+ (when message (message "%s" version1))
+ version1))
+
+
+
(defconst org-version (org-version))
--
1.8.3.2
- Re: [O] org-element-context doesn't parse consistently link with spaces, (continued)
- Re: [O] org-element-context doesn't parse consistently link with spaces, Daimrod, 2014/03/05
- Re: [O] org-element-context doesn't parse consistently link with spaces, Nicolas Goaziou, 2014/03/05
- Re: [O] org-element-context doesn't parse consistently link with spaces, Daimrod, 2014/03/05
- Re: [O] org-element-context doesn't parse consistently link with spaces, Nicolas Goaziou, 2014/03/05
- Re: [O] org-element-context doesn't parse consistently link with spaces, Bastien, 2014/03/05
- Re: [O] org-element-context doesn't parse consistently link with spaces, Daimrod, 2014/03/05
- Re: [O] org-element-context doesn't parse consistently link with spaces, Bastien, 2014/03/05
- Re: [O] org-element-context doesn't parse consistently link with spaces, Thorsten Jolitz, 2014/03/05
- Re: [O] org-element-context doesn't parse consistently link with spaces, Nicolas Richard, 2014/03/05
- Re: [O] org-element-context doesn't parse consistently link with spaces, Bastien, 2014/03/05
- Re: [O] org-element-context doesn't parse consistently link with spaces,
Nicolas Richard <=
- Re: [O] org-element-context doesn't parse consistently link with spaces, Bastien, 2014/03/13
- Re: [O] org-element-context doesn't parse consistently link with spaces, Nicolas Goaziou, 2014/03/05
- Re: [O] org-element-context doesn't parse consistently link with spaces, Bastien, 2014/03/05
- Re: [O] org-element-context doesn't parse consistently link with spaces, Nicolas Goaziou, 2014/03/05
- Re: [O] org-element-context doesn't parse consistently link with spaces, Bastien, 2014/03/05
- Re: [O] org-element-context doesn't parse consistently link with spaces, Nicolas Goaziou, 2014/03/10
- Re: [O] org-element-context doesn't parse consistently link with spaces, Achim Gratz, 2014/03/08
- Re: [O] org-element-context doesn't parse consistently link with spaces, Jonathan Leech-Pepin, 2014/03/05
- Re: [O] org-element-context doesn't parse consistently link with spaces, Daimrod, 2014/03/05
- Re: [O] org-element-context doesn't parse consistently link with spaces, Daimrod, 2014/03/05