Re: [O] [PATCH] org-protocol: Allow key=val=value2-style URLs

2015-12-21 Thread Sacha Chua
Nicolas Goaziou  writes:

Hello, Nicolas!

> Apparently, there is no more feedback, so I think it's good to go. 
> One minor issue, however: could you check that sentences (in comments
> and docstrings) are always separated by two spaces?
> Also, would you mind providing an entry for ORG-NEWS?

Sure! Revised patch attached updates docstrings and adds ORG-NEWS.

I also added more test cases and fixed a few small edge cases (ex:
org-capture with just a template, no links). I reworded the
documentation strings to pass M-x checkdoc as well. =)

>From 6045c5856c9f411ae4c337cef1a30848b8e7975e Mon Sep 17 00:00:00 2001
From: Sacha Chua 
Date: Wed, 2 Dec 2015 10:53:07 -0500
Subject: [PATCH] org-protocol: Allow key=val=val2-style URLs

* lisp/org-protocol.el: Update documentation.
  (org-protocol-store-link, org-protocol-capture,
  org-protocol-open-source): Accept new-style links.
  (org-protocol-check-filename-for-protocol): Update documentation.
  (org-protocol-parse-parameters, org-protocol-assign-parameters):
  New functions.

  This allows the use of org-protocol on KDE 5 and makes org-protocol
  links more URI-like.  New-style links are of the form:
  org-protocol://store-link?title=TITLE=URL

* testing/lisp/test-org-protocol.el: New file.

* etc/NEWS: Add org-protocol new-style links.
---
 etc/ORG-NEWS  |  19 +++
 lisp/org-protocol.el  | 283 +-
 testing/lisp/test-org-protocol.el | 191 +
 3 files changed, 396 insertions(+), 97 deletions(-)
 create mode 100644 testing/lisp/test-org-protocol.el

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 0422ff1..9d7178e 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -11,6 +11,25 @@ Please send Org bug reports to mailto:emacs-orgmode@gnu.org.
 * Version 9.0
 
 ** New features
+*** New org-protocol key=value syntax
+
+Org-protocol can now handle query-style parameters such as:
+
+#+begin_example
+org-protocol://store-link?url=http:%2F%2Flocalhost%2Findex.html=The%20title
+org-protocol://capture?template=x=Hello=World=http:%2F%2Fexample.com
+#+end_example
+
+Old-style links such as
+=org-protocol://store-link:/http:%2F%2Flocalhost%2Findex.html/The%20title=
+continue to be supported.
+
+If you have defined your own handler functions for
+~org-protocol-protocol-alist~, change them to accept either a property
+list (for new-style links) or a string (for old-style links).  Use
+~org-protocol-parse-parameters~ to convert old-style links into
+property lists.
+
 *** Org linter
 ~org-lint~ can check syntax and report common issues in Org documents.
 *** New option ~date-tree-last~ for ~org-agenda-insert-diary-strategy~
diff --git a/lisp/org-protocol.el b/lisp/org-protocol.el
index 339f2b7..6ee9163 100644
--- a/lisp/org-protocol.el
+++ b/lisp/org-protocol.el
@@ -49,7 +49,7 @@
 ;;   4.) Try this from the command line (adjust the URL as needed):
 ;;
 ;;   $ emacsclient \
-;; org-protocol://store-link://http:%2F%2Flocalhost%2Findex.html/The%20title
+;; org-protocol://store-link?url=http:%2F%2Flocalhost%2Findex.html=The%20title
 ;;
 ;;   5.) Optionally add custom sub-protocols and handlers:
 ;;
@@ -60,7 +60,7 @@
 ;;
 ;;   A "sub-protocol" will be found in URLs like this:
 ;;
-;;   org-protocol://sub-protocol://data
+;;   org-protocol://sub-protocol?key=val=val2
 ;;
 ;; If it works, you can now setup other applications for using this feature.
 ;;
@@ -94,20 +94,20 @@
 ;; You may use the same bookmark URL for all those standard handlers and just
 ;; adjust the sub-protocol used:
 ;;
-;; location.href='org-protocol://sub-protocol://'+
-;;   encodeURIComponent(location.href)+'/'+
-;;   encodeURIComponent(document.title)+'/'+
+;; location.href='org-protocol://sub-protocol?url='+
+;;   encodeURIComponent(location.href)+'='+
+;;   encodeURIComponent(document.title)+'='+
 ;;   encodeURIComponent(window.getSelection())
 ;;
 ;; The handler for the sub-protocol \"capture\" detects an optional template
 ;; char that, if present, triggers the use of a special template.
 ;; Example:
 ;;
-;; location.href='org-protocol://sub-protocol://x/'+ ...
+;; location.href='org-protocol://capture?template=x'+ ...
 ;;
-;;  use template ?x.
+;;  uses template ?x.
 ;;
-;; Note, that using double slashes is optional from org-protocol.el's point of
+;; Note that using double slashes is optional from org-protocol.el's point of
 ;; view because emacsclient squashes the slashes to one.
 ;;
 ;;
@@ -225,27 +225,36 @@ Each element of this list must be of the form:
 
   (module-name :protocol protocol :function func :kill-client nil)
 
-protocol - protocol to detect in a filename without trailing colon and slashes.
-   See rfc1738 section 2.1 for more on this.
-   If you define a protocol \"my-protocol\", `org-protocol-check-filename-for-protocol'
-   will search 

Re: [O] [ANN] Export block syntax change

2015-12-21 Thread Nicolas Goaziou
Hello,

Rasmus  writes:

> Will org-lint be able to detect and repair documents automatically?

`org-lint' detects it already, but it doesn't repair anything, hence the
additional function in ORG-NEWS.


Regards,

-- 
Nicolas Goaziou



Re: [O] evaluation issue with ocaml code (due to changes to org-babel-comint-with-output)

2015-12-21 Thread Alan Schmitt
On 2015-12-18 22:38, Nicolas Goaziou  writes:

> Hello,
>
> Alan Schmitt  writes:
>
>> Can I push this?
>
> I have no objection.

Thanks, I pushed it.

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Athmospheric CO₂ (Updated December 13, 2015, Mauna Loa Obs.): 401.31 ppm


signature.asc
Description: PGP signature


[O] OrgMode into Gnus buffers (message-mode included) ?

2015-12-21 Thread Xavier Maillard
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

Hello,

there is an area where I am pretty dumb: orgmode articulation with Gnus
buffers.

What do I need exactly to do to activate orgmode into Gnus both when reading
posts and when writing new ones ?

Regards
- -- Xavier.
-BEGIN PGP SIGNATURE-
Comment: GPGTools - https://gpgtools.org

iQEcBAEBCgAGBQJWeORVAAoJEDy08nibbhJtl9kH/2GvuHLk49/tYKU5HCJMd787
LqnQZoJ3jXffrSq32IabTmE9RAmUZeyuf9kQzODMQO5UHg2GGCIOumqfqImvHS4a
7nxE302uIlzo96032HXaTm1BgP86WxU/SvatwdQ+lh2MwaaiWuexjKeDN9bXHNC/
i74bjDgAPViFz/crd6XTzDx9eI2WiXxYDX7OsxZKslwsd5RBNoay7bfZUNs2UQI5
opJTOQVmzGWCi948DaG4M12pQS9dqcBOE60eoiXzEXCQeya0hAN9uEyXibh9tvti
GvDnFqdolaQP1v4r/yClyXbis4EcZpxydgCrAk0J+dQjqfBk/E0Tqyr+VFDiBJA=
=cV5+
-END PGP SIGNATURE-




Re: [O] Restoring the org-freemind-to-org-mode function

2015-12-21 Thread Vaidheeswaran C
Nicolas Goaziou  writes:

> Hello,
>
> Vaidheeswaran C  writes:
>
>> Note: I would like to ensure that the file moves out of it's current
>> obscure place in contrib/lisp of Orgmode to a more visible place like
>> GNU ELPA before I expend any efforts on improving it.
>
> I have no objection to this.

Thanks.



Re: [O] "Symbol's value as variable is void: org-file-apps"

2015-12-21 Thread Nick Dokos
William Denton  writes:

> After compiling from a fresh pull from Git today, setting
> org-file-apps is causing problems.  I have this so make Org exports to
> PDF open in evince instead of Emacs's built-in docview:
>
> (delete '("\\.pdf\\'" . default) org-file-apps)
> (add-to-list 'org-file-apps '("\\.pdf\\'" . "evince %s"))
>
> This was fine last week, but today, on startup, either line causes this error:
>
> Symbol's value as variable is void: org-file-apps
>
> If I C-x C-e those two lines after startup has halted, there are no 
> complaints.
>
> Did something about this variable change?  I had a bit of a look but
> didn't see what could have caused it.
>

You probably have the initialization of the variable too early in your
initialization file. Make sure that you initialize it *after* org is loaded.
-- 
Nick




Re: [O] [ANN] Export block syntax change

2015-12-21 Thread Ken Mankoff

Does this new syntax support that oft (or occasionally?) requested LaTeX header 
export?

I don't think so out of the box, because while LaTeX is a valid export word, 
LaTeX_preamble is not.

But, can the new syntax be used like this?

\include{preamble}
#+BEGIN_EXPORT LaTeX :file preamble.tex
% preamble commands go here
#+END_EXPORT

Thanks,

  -k.



On 2015-12-20 at 16:06, Nicolas Goaziou  wrote:
> Hello,
>
> I just finalized the syntax change for export blocks. As a reminder, the
> new syntax is:
>
>   #+BEGIN_EXPORT backend
>   ...
>   #+END_EXPORT
>
> instead of
>
>   #+BEGIN_backend
>   ...
>   #+END_backend
>
> So, basically, "export" is a reserved block type, much like "src". As
> a consequence, INCLUDE keywords syntax is modified, e.g.,
>
>   #+INCLUDE: "file.org" HTML
>
> becomes
>
>   #+INCLUDE: "file.org" export html
>
> The following function, included in ORG-NEWS, updates any Org document
> to the new syntax. It is meant to be applied after applying the patch.
>
>   (defun org-repair-export-blocks ()
> "Repair export blocks and INCLUDE keywords in current buffer."
> (when (eq major-mode 'org-mode)
>   (let ((case-fold-search t)
> (back-end-re (regexp-opt
>   '("HTML" "ASCII" "LATEX" "ODT" "MARKDOWN" "MD" "ORG"
> "MAN" "BEAMER" "TEXINFO" "GROFF" "KOMA-LETTER")
>   t)))
> (org-with-wide-buffer
>  (goto-char (point-min))
>  (let ((block-re (concat "^[ \t]*#\\+BEGIN_" back-end-re)))
>(save-excursion
>  (while (re-search-forward block-re nil t)
>(let ((element (save-match-data (org-element-at-point
>  (when (eq (org-element-type element) 'special-block)
>(save-excursion
>  (goto-char (org-element-property :end element))
>  (save-match-data (search-backward "_"))
>  (forward-char)
>  (insert "EXPORT")
>  (delete-region (point) (line-end-position)))
>(replace-match "EXPORT \\1" nil nil nil 1))
>  (let ((include-re
> (format "^[ \t]*#\\+INCLUDE: .*?%s[ \t]*$" back-end-re)))
>(while (re-search-forward include-re nil t)
>  (let ((element (save-match-data (org-element-at-point
>(when (and (eq (org-element-type element) 'keyword)
>   (string= (org-element-property :key element) 
> "INCLUDE"))
>  (replace-match "EXPORT \\1" nil nil nil 1)
>
>
> Regards,




Re: [O] Bug in org-lob: Function call adds space to argument string with parenthesis

2015-12-21 Thread Tobias Zawada
Hello,
I had a look at [org-mode.git]/lisp /ob-lob.el
http://orgmode.org/w/org-mode.git?p=org-mode.git;a=blob;f=lisp/ob-lob.el;h=6b0996b4ce3e8f24b53cb554352566b358da5ceb;hb=5aa12cd122feef79a32459463df5828fe520a7c2
and org-element.el
http://orgmode.org/w/org-mode.git?p=org-mode.git;a=blob;f=lisp/org-element.el;h=1a01e618d79bebaf8cd02f3b4b9213769e056754;hb=5aa12cd122feef79a32459463df5828fe520a7c2

The code has changed considerably. The function org-babel-lob-get-info uses 
org-element-property in the development version.
At the moment I do not have the time to check whether the development version 
can also have problems with parsing string arguments.
In my opinion the only robust way to parse arguments without re-inventing the 
wheel is to use the built in parser (ppss) with a proper defined syntax table 
(e.g., this of emacs-lisp).
Maybe org-element-property does exactly this. But, the function is rather large 
so that it is not so easy to check and I have to do some work here...
Hopefully I find some time over the holidays.

I cannot clone the git-repository as non-developer (permission denied). So, 
trying out the development version is a bit difficult for me.

Best regards
Tobias Zawada

itisim.com


SimulationX 3.7 now available
More information 

Always up to date
Subscribe to the ITI Newsletter!

[cid:Charta-der-Vielfalt-Logo_2ed28c31-dc91-41ff-ad23-4b8bdeebfbf2.png]


ITI GmbH
Schweriner Straße 1
01067 Dresden
Germany

Managing Director/Geschäftsführer
Dr. Andreas Uhlig

Commercial Register/Handelsregister
Amtsgericht Dresden · HRB 2331
USt.-IdNr.: DE140297717

Diese E-Mail ist streng vertraulich und nur für den Empfänger bestimmt.
Sie kann Informationen enthalten, die rechtliche, geschäftliche oder andere 
Vergünstigungen bedeuten.
Sollten Sie nicht der ausdrückliche Empfänger sein, dürfen Sie diese 
Informationen nicht benutzen, veröffentlichen oder vervielfältigen.

The information in this e-mail is strictly confidential, is intended solely for 
the addressee, and may be privileged.
If you are not the intended addressee you must not disclose, print or take 
action based upon this transmission and should delete it from your system.

-Ursprüngliche Nachricht-
Von: Nicolas Goaziou [mailto:m...@nicolasgoaziou.fr]
Gesendet: Sonntag, 20. Dezember 2015 16:50
An: Tobias Zawada
Cc: emacs-orgmode@gnu.org
Betreff: Re: Bug in org-lob: Function call adds space to argument string with 
parenthesis

Hello,

Tobias Zawada  writes:

> * Bug in org-lob: Function call adds space to argument string with
> parenthesis Dear all,
>   Please see the following code. I would expect arg="()" as result of the  
> call-line but the result is arg="() " with an additional space.
>
>   #+NAME: test
>   #+BEGIN_SRC emacs-lisp :var arg=""
> (message "arg=%S" arg) #+END_SRC
>
>   #+RESULTS: : arg=""
>
>   #+call: test(arg="()")
>
>   #+RESULTS:
>   : arg="() "

I cannot reproduce it in development version. Could you update and try again?

Thank you.

Regards,

--
Nicolas Goaziou


Re: [O] Restoring the org-freemind-to-org-mode function

2015-12-21 Thread Vaidheeswaran C

Mark Edgington  writes:

> I have in the past used the org-freemind-to-org-mode function, which
> is no longer included in org-mode.  It used to be part of
> org-freemind.el file (see
> http://orgmode.org/w/org-mode.git?p=org-mode.git;a=blob_plain;f=lisp/org-freemind.el;hb=8f49547aaf0f9396f2a0bcfb25ce2c33be5e91fd
> ).
>
> I have since tried this function, and it does still work, so I am
> wondering if we could add it back into the org-mode source tree.  I am
> attaching a stripped-down version of org-freemind.el in which most of
> the code that is irrelevant to org-freemind-to-org-mode has been
> removed.

I have approached emacs-devel and volunteered to move the file to GNU
ELPA (and maintain the file from there).

Note: I would like to ensure that the file moves out of it's current
obscure place in contrib/lisp of Orgmode to a more visible place like
GNU ELPA before I expend any efforts on improving it.





[O] "Symbol's value as variable is void: org-file-apps"

2015-12-21 Thread William Denton
After compiling from a fresh pull from Git today, setting org-file-apps is 
causing problems.  I have this so make Org exports to PDF open in evince instead 
of Emacs's built-in docview:


(delete '("\\.pdf\\'" . default) org-file-apps)
(add-to-list 'org-file-apps '("\\.pdf\\'" . "evince %s"))

This was fine last week, but today, on startup, either line causes this error:

Symbol's value as variable is void: org-file-apps

If I C-x C-e those two lines after startup has halted, there are no complaints.

Did something about this variable change?  I had a bit of a look but didn't see 
what could have caused it.


Bill
--
William Denton ↔  Toronto, Canada ↔  https://www.miskatonic.org/

[O] blog refurbised: how is it in 2015 ?

2015-12-21 Thread Xavier Maillard
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

Hey,

in the same vein I am refurbishing my Gnus (and love it), I'd like, as a 2k16
resolution (right word in english ?), to restart my long abandoned blog. As
usual, this is something I can't imagine doing outside GNU emacs and thus
orgmode.

My question is simply: what are the tools/technics in 2015 to blog ? Can you
share some good recipes with me ?

Thank you

- -- Xavier.
-BEGIN PGP SIGNATURE-
Comment: GPGTools - https://gpgtools.org

iQEcBAEBCgAGBQJWeOZRAAoJEDy08nibbhJtQ58H/R1OxedEz7fpeEsmMj2kHjxA
eFH1dIiF8LRKAP+9wzv3wn8ZWntqNwznq4Zj4cQQo9t0yc8u2l9Kerj3Lt1zGdB/
Bwqs4MXu2h/vtVZVZta1RHcZ/EIh/f5eWBoIJ8jD7snLGlywBBn3H+biAblAMc9/
i2L1aRvcEMR+Y4UX3GZlI+lhrdNaEhtb3UPld6JHTkTxoyOFzzvxvDDbkja/L6UU
mZNPnFy+UPcmDneHBdTs3EouNicOuukYgIYhSClhzo8/H5W/MhqdpTAqZM3Rg/en
fqrm+q128F8UQqPKVchOPcURWBCFs0LoxPAH1uJkvE0yOeyFihVZwVpNazz8qJ0=
=setP
-END PGP SIGNATURE-




Re: [O] [ANN] Export block syntax change

2015-12-21 Thread Nicolas Goaziou
Hello,

Ken Mankoff  writes:

> Does this new syntax support that oft (or occasionally?) requested
> LaTeX header export?

This syntax doesn't introduce any new feature.

> I don't think so out of the box, because while LaTeX is a valid export word, 
> LaTeX_preamble is not.
>
> But, can the new syntax be used like this?
>
> \include{preamble}
> #+BEGIN_EXPORT LaTeX :file preamble.tex
> % preamble commands go here
> #+END_EXPORT

No, it cannot.


Regards,

-- 
Nicolas Goaziou



Re: [O] Restoring the org-freemind-to-org-mode function

2015-12-21 Thread Rasmus
Mark Edgington  writes:

> On Dec 21, 2015 5:14 AM, "Vaidheeswaran C" <
> vaidheeswaran.chinnar...@gmail.com> wrote:
>>
>> Note: I would like to ensure that the file moves out of it's current
>> obscure place in contrib/lisp of Orgmode to a more visible place like
>> GNU ELPA before I expend any efforts on improving it.
>
> Why is ELPA less obscure than org-contrib?  It would seem that every org
> mode installation (e.g. Ubuntu packages) will include the org-contrib
> source files, though they aren't enabled by default.  Not including then in
> org-contrib will effectively remove them from all debian based Linux
> distributions, and from git based installations..
>
> ELPA is a fine place for it, but does it require for it to not be in
> contrib?

This is a long discussion.

Some people, e.g. Bastien, think that "contrib" should be discontinued (my
interpretation, hopefully faithful) in favor or GELPA or maybe Org-ELPA.
Others, e.g. me, like to have "batteries included".  This means keeping as
much as possible in, preferably, "lisp", or at least "contrib".

As such, the best outcome would be if Vaidheeswaran/Jamuthuan would
maintain it in "lisp".  My understanding is that there is no issues on the
FSF/copyright side.  I don’t know what the opinion of the Org developers
are, though.

In this case, moving ox-freemind to GELPA might be the path of least
resistance.  As such, it seems like a good solution.

Rasmus

-- 
Er du tosset for noge' lårt!



Re: [O] Restoring the org-freemind-to-org-mode function

2015-12-21 Thread Nicolas Goaziou
Hello,

Vaidheeswaran C  writes:

> Note: I would like to ensure that the file moves out of it's current
> obscure place in contrib/lisp of Orgmode to a more visible place like
> GNU ELPA before I expend any efforts on improving it.

I have no objection to this.


Regards,

-- 
Nicolas Goaziou



Re: [O] Restoring the org-freemind-to-org-mode function

2015-12-21 Thread Mark Edgington
On Dec 21, 2015 5:14 AM, "Vaidheeswaran C" <
vaidheeswaran.chinnar...@gmail.com> wrote:
>
> Note: I would like to ensure that the file moves out of it's current
> obscure place in contrib/lisp of Orgmode to a more visible place like
> GNU ELPA before I expend any efforts on improving it.

Why is ELPA less obscure than org-contrib?  It would seem that every org
mode installation (e.g. Ubuntu packages) will include the org-contrib
source files, though they aren't enabled by default.  Not including then in
org-contrib will effectively remove them from all debian based Linux
distributions, and from git based installations..

ELPA is a fine place for it, but does it require for it to not be in
contrib?