Re: [O] Should i upgrade new emacs?

2017-07-06 Thread Kaushal Modi
On Thu, Jul 6, 2017 at 10:10 PM Byung-Hee HWANG (황병희, 黃炳熙) <
soyeo...@doraji.xyz> wrote:

> Hello, i'm new to orgmode.


Welcome to the fold!


> Today i did buy org mode book [The Org Mode 7 Reference
> Manaual


That's a really old Org version (version 7.3, Nov 2010). I hope you don't
get confused between what's deprecated and what's not since that version.

The latest stable version is 9.0.9.

See here[1] on how to install that via Org Elpa.

What's nice is that each Org or Emacs version comes installed with the
corresponding Info manual. So you do not need to worry about actual
software version vs manual mismatch. Once you install Org 9.0.9, do "C-h i"
and jump to the Org Info manual from there[4].


> So i have to question. Should i upgrade new emacs for test
> orgmode 7? Currently my emacs version is 23.3.
>

It would be worthwhile to upgrade to the latest stable version of emacs
too, version 25.2 [2], [3]. emacs 23.3 was released in 2011.

---

[1]: http://orgmode.org/elpa.html
[2]: https://www.gnu.org/software/emacs/download.html
[3]: http://ftp.gnu.org/gnu/emacs/

[4]: If you haven't ever used the Info mode from within emacs, do "C-h i h"
to learn how to use it; it's pretty awesome.
-- 

Kaushal Modi


Re: [O] org-protocol documentation

2017-07-06 Thread Nicolas Goaziou
Hello,

Mario Martelli  writes:

> I started this whole thing because I wanted to learn elisp. But
> learning texinfo en-passant is nice :)

Thank you for your patch.

I re-worded the documentation based on your work. I also added more
index entries. Since I'm not using Org Protocol, I may fall wide of the
mark.

Anyway, it's now your turn to do some reviewing ;)

WDYT?

Regards,

-- 
Nicolas Goaziou0x80A93738
>From 6caca7a57427efb67d5d1fdaf25232a46c96b2ba Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou 
Date: Tue, 4 Jul 2017 14:48:41 +0200
Subject: [PATCH] org.texi: Document Org Protocol

* doc/org.texi (Protocols): Document feature.
---
 doc/org.texi | 208 ---
 1 file changed, 200 insertions(+), 8 deletions(-)

diff --git a/doc/org.texi b/doc/org.texi
index 176e7c259..e73c9c06a 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -499,6 +499,12 @@ Capture templates
 * Template expansion::  Filling in information about time and context
 * Templates in contexts::   Only show a template in a specific context
 
+Protocols for external access
+
+* @code{store-link} protocol::  Store a link, push URL to kill-ring
+* @code{capture} protocol:: Fill a buffer with external information
+* @code{open-source} protocol::  Edit published contents
+
 Archiving
 
 * Moving subtrees:: Moving a tree to an archive file
@@ -7515,16 +7521,202 @@ For more information, including how to read atom feeds, see
 @node Protocols
 @section Protocols for external access
 @cindex protocols, for external access
-@cindex emacsserver
 
-You can set up Org for handling protocol calls from outside applications that
-are passed to Emacs through the @file{emacsserver}.  For example, you can
+Org protocol in a mean to trigger custom actions in Emacs from external
+applications.  Any application that supports calling external programs with
+an URL as argument may be used with this functionality.  For example, you can
 configure bookmarks in your web browser to send a link to the current page to
-Org and create a note from it using capture (@pxref{Capture}).  Or you
-could create a bookmark that will tell Emacs to open the local source file of
-a remote website you are looking at with the browser.  See
-@uref{http://orgmode.org/worg/org-contrib/org-protocol.php} for detailed
-documentation and setup instructions.
+Org and create a note from it using capture (@pxref{Capture}).  You can also
+create a bookmark that tells Emacs to open the local source file of a remote
+website you are browsing.
+
+@cindex Org protocol, set-up
+@cindex Installing Org protocol
+In order to use Org protocol from an application, you need to register
+@samp{org-protocol://} as a valid scheme-handler.  External calls are passed
+to Emacs through the @code{emacsclient} command, so you also need to ensure
+an Emacs server is running.  More precisely, when the application calls
+
+@example
+emacsclient org-protocol://PROTOCOL?key1=var1=var2
+@end example
+
+@noindent
+Emacs calls the handler associated to @samp{PROTOCOL} with argument
+@samp{(:key1 var1 :key2 var2)}.
+
+@cindex protocol, new protocol
+@cindex defining new protocols
+Org protocol comes with three predefined protocols, detailed in the following
+sections.  Configure @code{org-protocol-protocol-alist} to define your own.
+
+@menu
+* @code{store-link} protocol::  Store a link, push URL to kill-ring
+* @code{capture} protocol:: Fill a buffer with external information
+* @code{open-source} protocol::  Edit published contents
+@end menu
+
+@node @code{store-link} protocol
+@subsection @code{store-link} protocol
+@cindex store-link protocol
+@cindex protocol, store-link
+
+Using @code{store-link} handler, you can copy links, insertable through
+@kbd{M-x org-insert-link} or yanking thereafter.  More precisely, the command
+
+@example
+emacsclient org-protocol://store-link?url=URL=TITLE
+@end example
+
+@noindent
+stores the following link:
+
+@example
+[[URL][TITLE]]
+@end example
+
+In addition, @samp{URL} is pushed on the kill-ring for yanking.  You need to
+encode @samp{URL} and @samp{TITLE} if they contain slashes, and probably
+quote those for the shell.
+
+To use this feature from a browser, add a bookmark with an arbitrary name,
+e.g., @samp{Org: store-link} and enter this as @emph{Location}:
+
+@example
+javascript:location.href='org-protocol://store-link?url='+
+  encodeURIComponent(location.href);
+@end example
+
+@node @code{capture} protocol
+@subsection @code{capture} protocol
+@cindex capture protocol
+@cindex protocol, capture
+
+@cindex capture, %:url placeholder
+@cindex %:url template expansion in capture
+@cindex capture, %:title placeholder
+@cindex %:title template expansion in capture
+Activating @code{capture} handler pops up a @samp{Capture} buffer and fills
+the capture template associated to the @samp{X} key 

Re: [O] [PATCH] org.el: Fix custom timestamps for date ranges

2017-07-06 Thread Nicolas Goaziou
Hello,

Jan Seeger  writes:

> * org.el (org-activate-dates): Change `org-activate-dates' to activate
> custom timestamps for both dates in date ranges. Formerly, only the
> second date would be activated. The reason was a misplaced
> `if'. Replaced it with `when'. Also added doc comments.

Applied. Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] bug in tramp?

2017-07-06 Thread Nicolas Goaziou
Hello,

Michael Albinus  writes:

> I believe it is unfortune in Org to require Tramp while
> loading. Instead, it shall declare used Tramp functions.

I removed the sole (require 'tramp) I could find in the code base.
Hopefully it solves the problem.

Regards,

-- 
Nicolas Goaziou0x80A93738



Re: [O] Parsing property drawers in subtree scope exports

2017-07-06 Thread Nicolas Goaziou
Hello,

Kaushal Modi  writes:

> Thanks. That works. Just curious though.. if one specifies certain keywords
> to be exporter specific keywords in the backend definition in
> :options-alist, it is evident that those keywords are specifically for
> export. Should the requirement to have "EXPORT_" prefix before them be
> relaxed? Do you foresee things not happening right if we started doing
> that?

I do. User may not be aware of keywords defined in export back-ends. As
a consequence user-defined properties could interfere with export
specific ones. E.g., ":TITLE:" and ":EXPORT_TITLE:" could mean different
things.

> - Make use of the inbuilt EXPORT_ prefix and get rid of the "HUGO_" prefix
> I need exactly that. My idea is to have a single Org file with one subtree
> per a blog post. So each subtree will have meta data about that post, like
> data, categories, etc.

I meant that you probably need to expand the buffer in order to get the
properties. Once this is done, you can return to the original narrowing.

Regards,

-- 
Nicolas Goaziou0x80A93738



Re: [O] Parsing property drawers in subtree scope exports

2017-07-06 Thread Kaushal Modi
On Sat, Jul 1, 2017 at 12:08 PM Nicolas Goaziou 
wrote:

> Kaushal Modi  writes:
>
> > I didn't follow that. Do you mean that the "EXPORT_" is a special
> > prefix?
>
> I do. See (info "(org) Export settings").
>

Thanks! Sorry for not reading that earlier. For reference:

> When exporting sub-trees, special node properties in them can override
the above keywords. They are special because they have an ‘EXPORT_’ prefix.
For example, ‘DATE’ and ‘OPTIONS’ keywords become, respectively,
‘EXPORT_DATE’ and ‘EXPORT_OPTIONS’. Except for ‘SETUPFILE’, all other
keywords listed above have an ‘EXPORT_’ equivalent.


> > Should that be added to these?
> >
> > =
> > :options-alist '((:hugo-front-matter-format "HUGO_FRONT_MATTER_FORMAT"
> nil
> > org-hugo-front-matter-format)
> > (:hugo-tags "HUGO_TAGS" nil nil)
> > =
>
> If you set this, you can access to EXPORT_HUgo_TAGS property
> with :hugo-tags.
>

Thanks. That works. Just curious though.. if one specifies certain keywords
to be exporter specific keywords in the backend definition in
:options-alist, it is evident that those keywords are specifically for
export. Should the requirement to have "EXPORT_" prefix before them be
relaxed? Do you foresee things not happening right if we started doing that?


> > I already tried above, but I don't know how to get the ":HUGO_TAGS" value
> > from the property drawer, in subtreep export only, in the body filter
> (with
> > only body and info available).
>
> (plist-get info :hugo-tags)
>

I was already doing that, but I was missing the "EXPORT_" prefix in the
property drawer keys. Thanks!


> > Otherwise, you simply need to retrieve it and store it before calling
> >> `org-export-to-file' or whatever.
> >
> >
> > Hmm, will give this a try.. may be look at the pre export hook?
>
> You can also do that, if you don't use the "EXPORT_" prefix above.
>

Using "EXPORT_" prefix works, but then the keys become too wordy; example:
EXPORT_HUGO_CATEGORIES.

So I have two options:

- Make use of the inbuilt EXPORT_ prefix and get rid of the "HUGO_" prefix
from the exporter backend definition. Then if categories are specified
per-Org-file, it would look like "#+CATEGORIES: foo bar", and if they are
specified per subtree, it would look like ":EXPORT_CATEGORIES: foo bar" in
the property drawer.
- Do not use the "EXPORT_" keyword in the property drawers, but then either
do the pre-export parsing, or.. above suggestion to update Org ox to not
require "EXPORT_" before FOO if FOO is a special keyword defined in the
backend?


> However, you need to expand the buffer first, because it will be
> narrowed to the current subtree.


I need exactly that. My idea is to have a single Org file with one subtree
per a blog post. So each subtree will have meta data about that post, like
data, categories, etc.
-- 

Kaushal Modi


Re: [O] Patch on org-agenda-cmp-user-defined not called

2017-07-06 Thread Nicolas Goaziou
Hello,

Li Zhuo  writes:

> Subject: [PATCH] fix `org-agenda-cmp-user-defined` not called when user has
>  defined it
>
> ---
>  lisp/org-agenda.el | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
> index 652fada..3a0248e 100644
> --- a/lisp/org-agenda.el
> +++ b/lisp/org-agenda.el
> @@ -7007,10 +7007,9 @@ their type."
>(alpha-down  (if alpha-up (- alpha-up) nil))
>(need-user-cmp   (org-em 'user-defined-up 'user-defined-down ss))
>user-defined-up user-defined-down)
> -(if (and need-user-cmp org-agenda-cmp-user-defined
> -  (functionp org-agenda-cmp-user-defined))
> +(if (and need-user-cmp (functionp 'org-agenda-cmp-user-defined))
>   (setq user-defined-up
> -   (funcall org-agenda-cmp-user-defined a b)
> +   (funcall 'org-agenda-cmp-user-defined a b)
> user-defined-down (if user-defined-up (- user-defined-up) nil)))
>  (cdr (assoc
> (eval (cons 'or org-agenda-sorting-strategy-selected))

Thank you.

However, I don't understand what your patch is fixing. Could you exhibit
the problem with a simple recipe?

Regards,

-- 
Nicolas Goaziou



Re: [O] org-plus-contrib, where is library-of-babel.org?

2017-07-06 Thread Thomas S. Dye
Aloha Kaushal Modi,

Kaushal Modi writes:

> Hello Tom,
>
> On Thu, Jul 6, 2017, 12:03 AM Thomas S. Dye  wrote:
>
>>
>> Org-plus-contrib from ELPA doesn't have the doc folder and is likewise
>> missing the library-of-babel.org file.
>>
>
> My response was only to "Where has the Library of Babel gone?" :)
>
> I don't know the reasoning behind why that file is no longer part of
> contrib (Copying Bastien to help with this as he was the commit author).

Thanks for your response.

Org babel used to live in contrib, but was moved into core once it was
relatively mature and stable.

I'm wondering where to find library-of-babel.org in the ELPA
distribution of Org mode, org-plus-contrib.

All the best,
Tom

--
Thomas S. Dye
http://www.tsdye.com



[O] [PATCH] org.el: Fix custom timestamps for date ranges

2017-07-06 Thread Jan Seeger
* org.el (org-activate-dates): Change `org-activate-dates' to activate
custom timestamps for both dates in date ranges. Formerly, only the
second date would be activated. The reason was a misplaced
`if'. Replaced it with `when'. Also added doc comments.

TINYCHANGE
---
 lisp/org.el | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index ab0bde1ef..f000c8f24 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -6105,9 +6105,11 @@ by a #."
   'keymap org-mouse-map))
 (org-rear-nonsticky-at (match-end 0))
 (when org-display-custom-times
-  (if (match-end 3)
- (org-display-custom-time (match-beginning 3) (match-end 3))
-   (org-display-custom-time (match-beginning 1) (match-end 1
+  ;; If it's a date range, activate custom time for second date
+  (when (match-end 3)
+   (org-display-custom-time (match-beginning 3) (match-end 3)))
+  ;; Always  activate custom time for first matched date
+  (org-display-custom-time (match-beginning 1) (match-end 1)))
 t))
 
 (defvar-local org-target-link-regexp nil
-- 
2.13.0




Re: [O] git question

2017-07-06 Thread Kyle Meyer
Rasmus  writes:

> Hi,
>
> Re commit acabacaa5689f0644a47edae7c66bbdd68418194
>
> 
> http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=acabacaa5689f0644a47edae7c66bbdd68418194
>
> This should probably have gone to maint as it is a bugfix.  For some
> reason I pushed the commit to master.
>
> Could I now use git cherry-pick to add it maint?  Or is there a better
> way?  Or is it better to just let it live on master and only be part of
> the next major Org version?

Yep, git cherry-pick should be used in these situations.

-- 
Kyle



Re: [O] [PATCH] Fixed bug in custom timestamps for date ranges.

2017-07-06 Thread Kaushal Modi
Hi Jan,

I haven't reviewed the patch functionality, but I see that it is missing a
commit message. Please review this to learn about the required format for
commit messages:

http://orgmode.org/worg/org-contribute.html#commit-messages

Thanks.

On Thu, Jul 6, 2017, 5:10 AM Jan Seeger  wrote:

> Changed org-activate-dates to activate custom timestamps for both
> dates in date ranges. Formerly, only the second date would be
> activated. The reason was a misplaced "if". Replaced it with "when".
> ---
>  lisp/org.el | 8 +---
>  1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/lisp/org.el b/lisp/org.el
> index ab0bde1ef..f000c8f24 100644
> --- a/lisp/org.el
> +++ b/lisp/org.el
> @@ -6105,9 +6105,11 @@ by a #."
>'keymap org-mouse-map))
>  (org-rear-nonsticky-at (match-end 0))
>  (when org-display-custom-times
> -  (if (match-end 3)
> - (org-display-custom-time (match-beginning 3) (match-end 3))
> -   (org-display-custom-time (match-beginning 1) (match-end 1
> +  ;; If it's a date range, activate custom time for second date
> +  (when (match-end 3)
> +   (org-display-custom-time (match-beginning 3) (match-end 3)))
> +  ;; Always  activate custom time for first matched date
> +  (org-display-custom-time (match-beginning 1) (match-end 1)))
>  t))
>
>  (defvar-local org-target-link-regexp nil
> --
> 2.13.0
>
-- 

Kaushal Modi


Re: [O] org-plus-contrib, where is library-of-babel.org?

2017-07-06 Thread Kaushal Modi
Hello Tom,

On Thu, Jul 6, 2017, 12:03 AM Thomas S. Dye  wrote:

>
> Org-plus-contrib from ELPA doesn't have the doc folder and is likewise
> missing the library-of-babel.org file.
>

My response was only to "Where has the Library of Babel gone?" :)

I don't know the reasoning behind why that file is no longer part of
contrib (Copying Bastien to help with this as he was the commit author).

> --

Kaushal Modi


Re: [O] git question

2017-07-06 Thread Kaushal Modi
On Thu, Jul 6, 2017, 3:37 AM Rasmus  wrote:

> Hi,
>
> Re commit acabacaa5689f0644a47edae7c66bbdd68418194
>
>
> http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=acabacaa5689f0644a47edae7c66bbdd68418194
>
> This should probably have gone to maint as it is a bugfix.  For some
> reason I pushed the commit to master.
>
> Could I now use git cherry-pick to add it maint?  Or is there a better
> way?


I haven't tried this, but wouldn't that work:

- Cherry pick that commit into maint
- Merge maint into master

My guess is that the second step will result in just a Merge commit in
master, with just commit hash updates. But then the merge pointers between
master and maint will also be synced.

 Or

is it better to just let it live on master and only be part of
> the next major Org version?
>
-- 

Kaushal Modi


[O] [PATCH] Fixed bug in custom timestamps for date ranges.

2017-07-06 Thread Jan Seeger
Changed org-activate-dates to activate custom timestamps for both
dates in date ranges. Formerly, only the second date would be
activated. The reason was a misplaced "if". Replaced it with "when".
---
 lisp/org.el | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index ab0bde1ef..f000c8f24 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -6105,9 +6105,11 @@ by a #."
   'keymap org-mouse-map))
 (org-rear-nonsticky-at (match-end 0))
 (when org-display-custom-times
-  (if (match-end 3)
- (org-display-custom-time (match-beginning 3) (match-end 3))
-   (org-display-custom-time (match-beginning 1) (match-end 1
+  ;; If it's a date range, activate custom time for second date
+  (when (match-end 3)
+   (org-display-custom-time (match-beginning 3) (match-end 3)))
+  ;; Always  activate custom time for first matched date
+  (org-display-custom-time (match-beginning 1) (match-end 1)))
 t))
 
 (defvar-local org-target-link-regexp nil
-- 
2.13.0




Re: [O] Emacs-orgmode Digest, Vol 137, Issue 4

2017-07-06 Thread Eric S Fraga
Philosophically, #+call: or call_ are very different to noweb.

The latter is really only about insertion of code as is somewhere else
and it can be nested (see contrived example attached).  The former is
about invoking a babel src block with particular arguments and so is
much more flexible.  That block could of course include noweb elements:
again see example.

Export the org file to an ascii buffer (C-c C-e t A) and you'll see the
code expansions due to noweb and the result of calling a src block.

-- 
: Eric S Fraga via Emacs 26.0.50, Org release_9.0.9-551-g92e8c8
#+name: one
#+begin_src octave :noweb yes
a = 1
#+end_src
#+name: two
#+begin_src octave :noweb yes
<>
b = 2
#+end_src
#+name: three
#+begin_src octave :noweb yes
<>
a+b
#+end_src

#+results: three
: 3

The results of calling three are call_three().


signature.asc
Description: PGP signature


Re: [O] bug in tramp?

2017-07-06 Thread Michael Albinus
Thomas Holst  writes:

> Hi Michael,

Hi Thomas,

> The culprit was that I use org-mode and tramp from git. Now I set the
> load-path for org at the very beginning of my .emacs file but for
> tramp further down. As I understand org requires tramp at some point.
> So it loaded tramp from emacs but not from git repo.

I believe it is unfortune in Org to require Tramp while
loading. Instead, it shall declare used Tramp functions.

> Now I set load-path for tramp and require tramp before org and
> everything works fine.
>
> Thanks again.
>   Thomas

Best regards, Michael.



[O] git question

2017-07-06 Thread Rasmus
Hi,

Re commit acabacaa5689f0644a47edae7c66bbdd68418194


http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=acabacaa5689f0644a47edae7c66bbdd68418194

This should probably have gone to maint as it is a bugfix.  For some
reason I pushed the commit to master.

Could I now use git cherry-pick to add it maint?  Or is there a better
way?  Or is it better to just let it live on master and only be part of
the next major Org version?

Thanks,
Rasmus

-- 
Evidence suggests Snowden used a powerful tool called monospaced fonts




Re: [O] Enhancement: Changing default setting of source block header line switches [9.0.5 (9.0.5-elpa @ /home/naehring/.emacs.d/elpa/org-20170210/)]

2017-07-06 Thread Tobias Zawada
Dear Rasmus,

thanks for the fast reply.
> Rasmus  wrote on July, 6th 2017, 09:03:
> 
> Tobias Zawada  writes:
> 
> > At first I would like to ask whether it is already possible to change
> > the default settings of the source block header line switches.
> 
> Couldn't you use #+property headers?
> E.g.
> 
> #+PROPERTY: header-args:R :session *R*
> 
> See:
> 
> http://orgmode.org/org.html#Using-header-arguments

No, switches and header arguments are (pityingly) two different concepts.

Currently, switches cannot be modified via header arguments.

But, you are partially right, It could be one solution of this enhancement 
request to introduce header-arguments for all switches, e.g., :sw-n, :sw+n. The 
values of those header arguments could be t and nil or, e.g., :sw+n 10.
Then the full mechanism for header arguments would work for switches.

See the description of switches at 
http://orgmode.org/manual/Literal-examples.html.

Best regards,
Tobias



Re: [O] Enhancement: Changing default setting of source block header line switches [9.0.5 (9.0.5-elpa @ /home/naehring/.emacs.d/elpa/org-20170210/)]

2017-07-06 Thread Rasmus
Tobias Zawada  writes:

> At first I would like to ask whether it is already possible to change
> the default settings of the source block header line switches.

Couldn't you use #+property headers?
E.g.

#+PROPERTY: header-args:R  :session *R*

See:

http://orgmode.org/org.html#Using-header-arguments

Hope it helps,
Rasmus

-- 
I feel emotional landscapes they puzzle me